lavc/libtheoraenc: handle frame durations and AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This commit is contained in:
parent
b7f0c8889e
commit
2bb20e98ba
@ -347,6 +347,12 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
|
|||||||
// HACK: assumes no encoder delay, this is true until libtheora becomes
|
// HACK: assumes no encoder delay, this is true until libtheora becomes
|
||||||
// multithreaded (which will be disabled unless explicitly requested)
|
// multithreaded (which will be disabled unless explicitly requested)
|
||||||
pkt->pts = pkt->dts = frame->pts;
|
pkt->pts = pkt->dts = frame->pts;
|
||||||
|
pkt->duration = frame->duration;
|
||||||
|
|
||||||
|
ret = ff_encode_reordered_opaque(avc_context, pkt, frame);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
if (!(o_packet.granulepos & h->keyframe_mask))
|
if (!(o_packet.granulepos & h->keyframe_mask))
|
||||||
pkt->flags |= AV_PKT_FLAG_KEY;
|
pkt->flags |= AV_PKT_FLAG_KEY;
|
||||||
*got_packet = 1;
|
*got_packet = 1;
|
||||||
@ -373,7 +379,9 @@ const FFCodec ff_libtheora_encoder = {
|
|||||||
.p.type = AVMEDIA_TYPE_VIDEO,
|
.p.type = AVMEDIA_TYPE_VIDEO,
|
||||||
.p.id = AV_CODEC_ID_THEORA,
|
.p.id = AV_CODEC_ID_THEORA,
|
||||||
.p.capabilities = AV_CODEC_CAP_DR1 |
|
.p.capabilities = AV_CODEC_CAP_DR1 |
|
||||||
AV_CODEC_CAP_DELAY /* for statsfile summary */,
|
/* for statsfile summary */
|
||||||
|
AV_CODEC_CAP_DELAY |
|
||||||
|
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
|
||||||
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE,
|
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE,
|
||||||
.priv_data_size = sizeof(TheoraContext),
|
.priv_data_size = sizeof(TheoraContext),
|
||||||
.init = encode_init,
|
.init = encode_init,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user