aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2019-08-22 15:04:48 -0700
committerAman Gupta <aman@tmm1.net>2019-09-10 18:52:37 -0700
commitab4835f41885c0f2e2f75101d72b888557c0e284 (patch)
treecedf8287aa5765c9f4631920c8ca607fa5bdff0f
parent0f0f5188acc67a35a8f045505ccf6e2178e5f858 (diff)
downloadffmpeg-ab4835f41885c0f2e2f75101d72b888557c0e284.tar.gz
avcodec/v4l2_m2m_enc: add support for -force_key_frames
Signed-off-by: Aman Gupta <aman@tmm1.net>
-rw-r--r--libavcodec/v4l2_m2m_enc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 27bb254fc1..a0d5bcf760 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -245,6 +245,9 @@ static int v4l2_send_frame(AVCodecContext *avctx, const AVFrame *frame)
V4L2m2mContext *s = ((V4L2m2mPriv*)avctx->priv_data)->context;
V4L2Context *const output = &s->output;
+ if (frame && frame->pict_type == AV_PICTURE_TYPE_I)
+ v4l2_set_ext_ctrl(s, MPEG_CID(FORCE_KEY_FRAME), 0, "force key frame");
+
return ff_v4l2_context_enqueue_frame(output, frame);
}