diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-12-21 22:29:06 -0500 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2018-01-08 17:20:52 -0500 |
commit | 4aa5298f56dbbb87abc3a5d86a93ac84296c9bf1 (patch) | |
tree | 989e7df35f8fcb46dce4174263ada9d97f4478fd | |
parent | 97985a335c787f76ebdbb0702dc7b0b5ee6c93b6 (diff) |
v4l2videoenc: Delay capture pool activation
This is support CODA driver which prevents setting the output format if
the capture is streaming.
https://bugzilla.gnome.org/show_bug.cgi?id=791338
-rw-r--r-- | sys/v4l2/gstv4l2videoenc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c index 8e914f6fd..6be1bed38 100644 --- a/sys/v4l2/gstv4l2videoenc.c +++ b/sys/v4l2/gstv4l2videoenc.c @@ -343,6 +343,14 @@ gst_v4l2_video_enc_set_format (GstVideoEncoder * encoder, return FALSE; } + /* activating a capture pool will also call STREAMON. CODA driver will + * refuse to configure the output if the capture is stremaing. */ + if (!gst_buffer_pool_set_active (GST_BUFFER_POOL (self->v4l2capture->pool), + TRUE)) { + GST_WARNING_OBJECT (self, "Could not activate capture buffer pool."); + return FALSE; + } + self->input_state = gst_video_codec_state_ref (state); GST_DEBUG_OBJECT (self, "output caps: %" GST_PTR_FORMAT, state->caps); @@ -581,12 +589,6 @@ gst_v4l2_video_enc_negotiate (GstVideoEncoder * encoder) if (!GST_VIDEO_ENCODER_CLASS (parent_class)->negotiate (encoder)) return FALSE; - if (!gst_buffer_pool_set_active (GST_BUFFER_POOL (self->v4l2capture->pool), - TRUE)) { - GST_WARNING_OBJECT (self, "Could not activate capture buffer pool."); - return FALSE; - } - return TRUE; g_ctrl_failed: |