35 #define MAX_PAGE_SIZE 65025
75 #define OFFSET(x) offsetof(OGGContext, x)
76 #define PARAM AV_OPT_FLAG_ENCODING_PARAM
79 {
"oggpagesize",
"Set preferred Ogg page size.",
81 {
"pagesize",
"preferred page size in bytes (deprecated)",
83 {
"page_duration",
"preferred page duration, in microseconds",
151 return (granule>>oggstream->
kfgshift) +
152 (granule & ((1<<oggstream->
kfgshift)-1));
161 int64_t next_granule, cur_granule;
170 return next_granule > cur_granule;
213 int total_segments = size / 255 + 1;
232 if (!header && oggstream->
page.
size > 0 &&
237 for (i = 0; i < total_segments; ) {
248 len =
FFMIN(size, segments*255);
250 memcpy(page->
data+page->
size, p, len);
256 if (i == total_segments)
300 bytestream_put_byte(&p, 1);
323 bytestream_put_byte(&p, 0x7F);
325 bytestream_put_byte(&p, 1);
326 bytestream_put_byte(&p, 0);
327 bytestream_put_be16(&p, 1);
329 bytestream_put_byte(&p, 0x00);
330 bytestream_put_be24(&p, 34);
338 bytestream_put_byte(&p, 0x84);
339 bytestream_put_be24(&p, oggstream->
header_len[1] - 4);
344 #define SPEEX_HEADER_SIZE 80
373 #define OPUS_HEADER_SIZE 19
413 unsigned serial_num = i;
442 for (j = 0; j < i; j++) {
499 bytestream_put_byte(&p, header_type);
523 for (i = 1; i < 3; i++) {
572 if (pframe_count >= (1<<oggstream->
kfgshift)) {
583 oggstream->page.start_granule =
pkt->
pts;
591 oggstream->last_granule = granule;
627 .mime_type =
"application/ogg",
628 .extensions =
"ogg,ogv,spx,opus",
636 .priv_class = &ogg_muxer_class,