summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@sharp.fm>2015-08-22 15:54:55 +0000
committerSebastian Dröge <sebastian@centricular.com>2015-08-27 11:15:29 +0300
commit703bab688566c6fe4de934dbb2b93300bc2aa4ff (patch)
treed09089575340becd7ac2c53e55f028bd5a3620a6
parentfb95ce9bfc80167eba843567aa62d62d359a2bf1 (diff)
downloadgst-omx-703bab688566c6fe4de934dbb2b93300bc2aa4ff.tar.gz
omxvideoenc: Add keyframe support for the Rpi, using OMX_IndexConfigBrcmVideoRequestIFrame
https://bugzilla.gnome.org/show_bug.cgi?id=753085
-rw-r--r--omx/gstomxvideoenc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 41ca346..0901b33 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1538,6 +1538,18 @@ gst_omx_video_enc_handle_frame (GstVideoEncoder * encoder,
GST_DEBUG_OBJECT (self, "Handling frame");
if (GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME (frame)) {
+#ifdef USE_OMX_TARGET_RPI
+ OMX_CONFIG_BOOLEANTYPE config;
+
+ GST_OMX_INIT_STRUCT (&config);
+ config.bEnabled = OMX_TRUE;
+
+ GST_DEBUG_OBJECT (self, "Forcing a keyframe (iframe on the RPi)");
+
+ err =
+ gst_omx_component_set_config (self->enc,
+ OMX_IndexConfigBrcmVideoRequestIFrame, &config);
+#else
OMX_CONFIG_INTRAREFRESHVOPTYPE config;
GST_OMX_INIT_STRUCT (&config);
@@ -1548,6 +1560,7 @@ gst_omx_video_enc_handle_frame (GstVideoEncoder * encoder,
err =
gst_omx_component_set_config (self->enc,
OMX_IndexConfigVideoIntraVOPRefresh, &config);
+#endif
if (err != OMX_ErrorNone)
GST_ERROR_OBJECT (self, "Failed to force a keyframe: %s (0x%08x)",
gst_omx_error_to_string (err), err);