Save to raw, headerless h264 data.
More...
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Raw H.264 data" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct ast_format_def | h264_f |
|
Save to raw, headerless h264 data.
- File name extension: h264
Definition in file format_h264.c.
◆ BUF_SIZE
#define BUF_SIZE 4096 /* Two Real h264 Frames */ |
◆ FRAME_ENDED
#define FRAME_ENDED 0x8000 |
- Todo:
- Check this buf size estimate, it may be totally wrong for large frame video
Definition at line 43 of file format_h264.c.
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ h264_open()
◆ h264_read()
Definition at line 60 of file format_h264.c.
61{
62 size_t res;
63 int mark = 0;
65 unsigned int ts;
67
68
69 if ((res = fread(&
len, 1,
sizeof(
len), s->
f)) !=
sizeof(
len))
77 }
80 if (res) {
84 }
86 }
90 if ((res = fread(&ts, 1,
sizeof(ts), s->
f)) ==
sizeof(ts)) {
92 *whennext = fs->
lastts * 4/45;
93 } else
94 *whennext = 0;
96}
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#define AST_FRAME_SET_BUFFER(fr, _base, _ofs, _datalen)
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
struct ast_frame fr
frame produced by read, typically
unsigned int frame_ending
struct ast_format * format
struct ast_frame_subclass subclass
union ast_frame::@226 data
References ast_filestream::_private, ast_format_get_name(), AST_FRAME_SET_BUFFER, AST_FRIENDLY_OFFSET, ast_log, ast_filestream::buf, BUF_SIZE, ast_frame::data, ast_frame::datalen, errno, ast_filestream::f, ast_frame_subclass::format, ast_filestream::fr, FRAME_ENDED, ast_frame_subclass::frame_ending, if(), h264_desc::lastts, len(), LOG_WARNING, NULL, ast_frame::ptr, ast_frame::samples, ast_frame::subclass, and ast_frame::ts.
◆ h264_seek()
static int h264_seek |
( |
struct ast_filestream * |
fs, |
|
|
off_t |
sample_offset, |
|
|
int |
whence |
|
) |
| |
|
static |
◆ h264_tell()
◆ h264_trunc()
◆ h264_write()
Definition at line 98 of file format_h264.c.
99{
100 int res;
101 unsigned int ts;
103 int mark;
104
107 if ((res = fwrite(&ts, 1,
sizeof(ts), s->
f)) !=
sizeof(ts)) {
109 return -1;
110 }
112 if ((res = fwrite(&
len, 1,
sizeof(
len), s->
f)) !=
sizeof(
len)) {
114 return -1;
115 }
118 return -1;
119 }
120 return 0;
121}
References ast_log, ast_frame::data, ast_frame::datalen, errno, ast_filestream::f, FRAME_ENDED, ast_frame_subclass::frame_ending, len(), LOG_WARNING, ast_frame::ptr, ast_frame::samples, and ast_frame::subclass.
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Raw H.264 data" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND } |
|
static |
◆ ast_module_info
◆ h264_f