35 #define MAX_PAGE_SIZE 65025
73 #define OFFSET(x) offsetof(OGGContext, x)
74 #define PARAM AV_OPT_FLAG_ENCODING_PARAM
77 {
"oggpagesize",
"Set preferred Ogg page size.",
79 {
"pagesize",
"preferred page size in bytes",
147 return (granule>>oggstream->
kfgshift) +
148 (granule & ((1<<oggstream->
kfgshift)-1));
157 int64_t next_granule, cur_granule;
166 return next_granule > cur_granule;
208 int total_segments = size / 255 + 1;
226 for (i = 0; i < total_segments; ) {
237 len =
FFMIN(size, segments*255);
239 memcpy(page->
data+page->
size, p, len);
245 if (i == total_segments)
279 bytestream_put_byte(&p, 1);
302 bytestream_put_byte(&p, 0x7F);
304 bytestream_put_byte(&p, 1);
305 bytestream_put_byte(&p, 0);
306 bytestream_put_be16(&p, 1);
308 bytestream_put_byte(&p, 0x00);
309 bytestream_put_be24(&p, 34);
317 bytestream_put_byte(&p, 0x84);
318 bytestream_put_be24(&p, oggstream->
header_len[1] - 4);
323 #define SPEEX_HEADER_SIZE 80
352 #define OPUS_HEADER_SIZE 19
388 unsigned serial_num = i;
417 for (j = 0; j < i; j++) {
474 bytestream_put_byte(&p, header_type);
498 for (i = 1; i < 3; i++) {
544 if (pframe_count >= (1<<oggstream->
kfgshift)) {
560 oggstream->last_granule = granule;
592 .mime_type =
"application/ogg",
593 .extensions =
"ogg,ogv,spx,opus",
600 .priv_class = &ogg_muxer_class,