Asterisk - The Open Source Telephony Project  21.4.1
codecs/ex_opus.h
Go to the documentation of this file.
1 /*! \file
2  * \brief 8-bit data
3  *
4  * Copyright (C) 2014, Lorenzo Miniero
5  *
6  * Distributed under the terms of the GNU General Public License
7  *
8  */
9 
10 #include "asterisk/format_cache.h" /* for ast_format_opus */
11 #include "asterisk/frame.h" /* for ast_frame, etc */
12 
13 /* Opus, a 20ms sample */
14 static uint8_t ex_opus[] = {
15  0x4b, 0x41, 0x25, 0x0b, 0xe4, 0x55, 0xc6, 0x74,
16  0xda, 0xbb, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
17  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
18  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
19  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 };
22 
23 static struct ast_frame *opus_sample(void)
24 {
25  static struct ast_frame f = {
27  .datalen = sizeof(ex_opus),
28  .samples = OPUS_SAMPLES,
29  .mallocd = 0,
30  .offset = 0,
31  .src = __PRETTY_FUNCTION__,
32  .data.ptr = ex_opus,
33  };
34 
36 
37  return &f;
38 }
struct ast_frame_subclass subclass
struct ast_format * ast_format_opus
Built-in cached opus format.
Definition: format_cache.c:221
const char * src
Asterisk internal frame definitions.
union ast_frame::@224 data
Data structure associated with a single frame of data.
enum ast_frame_type frametype
struct ast_format * format
Media Format Cache API.