Asterisk - The Open Source Telephony Project  18.5.0
ex_codec2.h
Go to the documentation of this file.
1 /*! \file
2  * \brief 8-bit raw data
3  *
4  * Copyright (C) 2016, Alexander Traud
5  *
6  * Distributed under the terms of the GNU General Public License
7  *
8  */
9 
10 #include "asterisk/format_cache.h" /* for ast_format_codec2 */
11 #include "asterisk/frame.h" /* for ast_frame, etc */
12 
13 static uint8_t ex_codec2[] = {
14  0xea, 0xca, 0x14, 0x85, 0x91, 0x78,
15 };
16 
17 static struct ast_frame *codec2_sample(void)
18 {
19  static struct ast_frame f = {
21  .datalen = sizeof(ex_codec2),
23  .mallocd = 0,
24  .offset = 0,
25  .src = __PRETTY_FUNCTION__,
26  .data.ptr = ex_codec2,
27  };
28 
30 
31  return &f;
32 }
struct ast_frame_subclass subclass
const char * src
Asterisk internal frame definitions.
struct ast_format * ast_format_codec2
Built-in cached Codec 2 format.
Definition: format_cache.c:231
static struct ast_frame * codec2_sample(void)
Definition: ex_codec2.h:17
#define CODEC2_SAMPLES
Definition: codec_codec2.c:48
static uint8_t ex_codec2[]
Definition: ex_codec2.h:13
Data structure associated with a single frame of data.
union ast_frame::@263 data
enum ast_frame_type frametype
struct ast_format * format
Media Format Cache API.