pspec);
break;
case PROP_CAPTURE_IO_MODE:
- gst_v4l2_object_set_property_helper (self->v4l2capture, prop_id, value,
- pspec);
+ gst_v4l2_object_set_property_helper (self->v4l2capture, PROP_IO_MODE,
+ value, pspec);
break;
case PROP_DEVICE:
gst_v4l2_object_unlock (self->v4l2output);
gst_v4l2_object_unlock (self->v4l2capture);
- GST_VIDEO_DECODER_STREAM_LOCK (decoder);
/* Wait for capture thread to stop */
gst_pad_stop_task (decoder->srcpad);
+
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
self->output_flow = GST_FLOW_OK;
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
GST_DEBUG_OBJECT (self, "Flushing");
/* Wait for capture thread to stop */
+ GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
gst_pad_stop_task (decoder->srcpad);
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
self->output_flow = GST_FLOW_OK;
if (self->v4l2output->pool)
- gst_v4l2_buffer_pool_flush (GST_V4L2_BUFFER_POOL (self->v4l2output->pool));
+ gst_v4l2_buffer_pool_stop_streaming (GST_V4L2_BUFFER_POOL
+ (self->v4l2output->pool));
if (self->v4l2capture->pool)
- gst_v4l2_buffer_pool_flush (GST_V4L2_BUFFER_POOL (self->v4l2capture->pool));
-
- /* Output will remain flushing until new frame comes in */
- gst_v4l2_object_unlock_stop (self->v4l2capture);
+ gst_v4l2_buffer_pool_stop_streaming (GST_V4L2_BUFFER_POOL
+ (self->v4l2capture->pool));
return TRUE;
}
buffer = gst_buffer_new ();
ret =
gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->
- v4l2output->pool), buffer);
+ v4l2output->pool), &buffer);
gst_buffer_unref (buffer);
}
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
if (ret != GST_FLOW_OK)
goto beach;
- /* Check if buffer isn't the last one */
- if (gst_buffer_get_size (buffer) == 0)
- goto beach;
-
GST_LOG_OBJECT (decoder, "Process output buffer");
ret =
gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->
- v4l2capture->pool), buffer);
+ v4l2capture->pool), &buffer);
if (ret != GST_FLOW_OK)
goto beach;
goto flushing;
if (G_UNLIKELY (!GST_V4L2_IS_ACTIVE (self->v4l2output))) {
+ if (!self->input_state)
+ goto not_negotiated;
if (!gst_v4l2_object_set_format (self->v4l2output, self->input_state->caps))
goto not_negotiated;
}
frame->input_buffer = NULL;
}
- if (!gst_buffer_pool_set_active (pool, TRUE))
- goto activate_failed;
+ /* Ensure input internal pool is active */
+ if (!gst_buffer_pool_is_active (pool)) {
+ GstStructure *config = gst_buffer_pool_get_config (pool);
+ gst_buffer_pool_config_set_params (config, self->input_state->caps,
+ self->v4l2output->info.size, 2, 2);
+
+ /* There is no reason to refuse this config */
+ if (!gst_buffer_pool_set_config (pool, config))
+ goto activate_failed;
+
+ if (!gst_buffer_pool_set_active (pool, TRUE))
+ goto activate_failed;
+ }
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
gst_v4l2_object_unlock_stop (self->v4l2output);
ret =
gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->
- v4l2output->pool), codec_data);
+ v4l2output->pool), &codec_data);
gst_v4l2_object_unlock (self->v4l2output);
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
GST_DEBUG_OBJECT (self, "Starting decoding thread");
/* Enable processing input */
+ gst_v4l2_buffer_pool_start_streaming (GST_V4L2_BUFFER_POOL
+ (self->v4l2capture->pool));
gst_v4l2_object_unlock_stop (self->v4l2output);
+ gst_v4l2_object_unlock_stop (self->v4l2capture);
/* Start the processing task, when it quits, the task will disable input
* processing to unlock input if draining, or prevent potential block */
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
ret =
gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->v4l2output->
- pool), frame->input_buffer);
+ pool), &frame->input_buffer);
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
if (ret == GST_FLOW_FLUSHING) {
activate_failed:
{
GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,
- (_("Failed to allocated required memory.")),
+ (_("Failed to allocate required memory.")),
("Buffer pool activation failed"));
return GST_FLOW_ERROR;
}
*
* Capture IO Mode
*/
- g_object_class_install_property (gobject_class, PROP_IO_MODE,
+ g_object_class_install_property (gobject_class, PROP_CAPTURE_IO_MODE,
g_param_spec_enum ("capture-io-mode", "Capture IO mode",
"Capture I/O mode",
GST_TYPE_V4L2_IO_MODE, GST_V4L2_IO_AUTO,