34 #define MAX_PAGE_SIZE 65025
74 #define OFFSET(x) offsetof(OGGContext, x)
75 #define PARAM AV_OPT_FLAG_ENCODING_PARAM
78 {
"oggpagesize",
"Set preferred Ogg page size.",
80 {
"pagesize",
"preferred page size in bytes (deprecated)",
82 {
"page_duration",
"preferred page duration, in microseconds",
150 return (granule>>oggstream->
kfgshift) +
151 (granule & ((1<<oggstream->
kfgshift)-1));
160 int64_t next_granule, cur_granule;
169 return next_granule > cur_granule;
212 int total_segments = size / 255 + 1;
231 if (!header && oggstream->
page.
size > 0 &&
236 for (i = 0; i < total_segments; ) {
247 len =
FFMIN(size, segments*255);
249 memcpy(page->
data+page->
size, p, len);
255 if (i == total_segments)
299 bytestream_put_byte(&p, 1);
322 bytestream_put_byte(&p, 0x7F);
324 bytestream_put_byte(&p, 1);
325 bytestream_put_byte(&p, 0);
326 bytestream_put_be16(&p, 1);
328 bytestream_put_byte(&p, 0x00);
329 bytestream_put_be24(&p, 34);
337 bytestream_put_byte(&p, 0x84);
338 bytestream_put_be24(&p, oggstream->
header_len[1] - 4);
343 #define SPEEX_HEADER_SIZE 80
372 #define OPUS_HEADER_SIZE 19
412 unsigned serial_num = i;
441 for (j = 0; j < i; j++) {
500 bytestream_put_byte(&p, header_type);
524 for (i = 1; i < 3; i++) {
573 if (pframe_count >= (1<<oggstream->
kfgshift)) {
584 oggstream->page.start_granule =
pkt->
pts;
592 oggstream->last_granule = granule;
628 .mime_type =
"application/ogg",
629 .extensions =
"ogg,ogv,spx,opus",
637 .priv_class = &ogg_muxer_class,