2 * Copyright (C) 2014 Collabora Ltd.
3 * Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
26 #include "gstv4l2videodec.h"
27 #include "v4l2_calls.h"
30 #include <gst/gst-i18n-plugin.h>
32 #define DEFAULT_PROP_DEVICE "/dev/video8"
34 GST_DEBUG_CATEGORY_STATIC (gst_v4l2_video_dec_debug);
35 #define GST_CAT_DEFAULT gst_v4l2_video_dec_debug
37 #define parent_class gst_v4l2_video_dec_parent_class
38 G_DEFINE_TYPE (GstV4l2VideoDec, gst_v4l2_video_dec, GST_TYPE_VIDEO_DECODER);
40 static gboolean gst_v4l2_video_dec_flush (GstVideoDecoder * decoder);
45 V4L2_STD_OBJECT_PROPS,
50 gst_v4l2_video_dec_set_property (GObject * object,
51 guint prop_id, const GValue * value, GParamSpec * pspec)
53 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (object);
56 /* Split IO mode so output is configure through 'io-mode' and capture
57 * through 'capture-io-mode' */
59 gst_v4l2_object_set_property_helper (self->v4l2output, prop_id, value,
62 case PROP_CAPTURE_IO_MODE:
63 gst_v4l2_object_set_property_helper (self->v4l2capture, prop_id, value,
68 gst_v4l2_object_set_property_helper (self->v4l2output, prop_id, value,
70 gst_v4l2_object_set_property_helper (self->v4l2capture, prop_id, value,
74 /* By default, only set on output */
76 if (!gst_v4l2_object_set_property_helper (self->v4l2output,
77 prop_id, value, pspec)) {
78 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
85 gst_v4l2_video_dec_get_property (GObject * object,
86 guint prop_id, GValue * value, GParamSpec * pspec)
88 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (object);
92 gst_v4l2_object_get_property_helper (self->v4l2output, prop_id, value,
95 case PROP_CAPTURE_IO_MODE:
96 gst_v4l2_object_get_property_helper (self->v4l2output, PROP_IO_MODE,
100 /* By default read from output */
102 if (!gst_v4l2_object_get_property_helper (self->v4l2output,
103 prop_id, value, pspec)) {
104 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
111 gst_v4l2_video_dec_open (GstVideoDecoder * decoder)
113 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
115 GST_DEBUG_OBJECT (self, "Opening");
117 if (!gst_v4l2_object_open (self->v4l2output))
120 if (!gst_v4l2_object_open_shared (self->v4l2capture, self->v4l2output))
123 self->probed_sinkcaps = gst_v4l2_object_get_caps (self->v4l2output,
124 gst_v4l2_object_get_codec_caps ());
126 if (gst_caps_is_empty (self->probed_sinkcaps))
127 goto no_encoded_format;
129 self->probed_srccaps = gst_v4l2_object_get_caps (self->v4l2capture,
130 gst_v4l2_object_get_raw_caps ());
132 if (gst_caps_is_empty (self->probed_srccaps))
138 GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,
139 (_("Encoder on device %s has no supported input format"),
140 self->v4l2output->videodev), (NULL));
145 GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,
146 (_("Encoder on device %s has no supported output format"),
147 self->v4l2output->videodev), (NULL));
151 if (GST_V4L2_IS_OPEN (self->v4l2output))
152 gst_v4l2_object_close (self->v4l2output);
154 if (GST_V4L2_IS_OPEN (self->v4l2capture))
155 gst_v4l2_object_close (self->v4l2capture);
157 gst_caps_replace (&self->probed_srccaps, NULL);
158 gst_caps_replace (&self->probed_sinkcaps, NULL);
164 gst_v4l2_video_dec_close (GstVideoDecoder * decoder)
166 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
168 GST_DEBUG_OBJECT (self, "Closing");
170 gst_v4l2_object_close (self->v4l2output);
171 gst_v4l2_object_close (self->v4l2capture);
172 gst_caps_replace (&self->probed_srccaps, NULL);
173 gst_caps_replace (&self->probed_sinkcaps, NULL);
179 gst_v4l2_video_dec_start (GstVideoDecoder * decoder)
181 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
183 GST_DEBUG_OBJECT (self, "Starting");
185 gst_v4l2_object_unlock (self->v4l2output);
186 g_atomic_int_set (&self->active, TRUE);
187 self->output_flow = GST_FLOW_OK;
193 gst_v4l2_video_dec_stop (GstVideoDecoder * decoder)
195 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
197 GST_DEBUG_OBJECT (self, "Stopping");
199 /* Should have been flushed already */
200 g_assert (g_atomic_int_get (&self->active) == FALSE);
201 g_assert (g_atomic_int_get (&self->processing) == FALSE);
203 gst_v4l2_object_stop (self->v4l2output);
204 gst_v4l2_object_stop (self->v4l2capture);
206 if (self->input_state) {
207 gst_video_codec_state_unref (self->input_state);
208 self->input_state = NULL;
211 GST_DEBUG_OBJECT (self, "Stopped");
217 gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
218 GstVideoCodecState * state)
221 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
223 GST_DEBUG_OBJECT (self, "Setting format: %" GST_PTR_FORMAT, state->caps);
225 if (self->input_state) {
226 if (gst_v4l2_object_caps_equal (self->v4l2output, state->caps)) {
227 GST_DEBUG_OBJECT (self, "Compatible caps");
230 gst_video_codec_state_unref (self->input_state);
232 /* FIXME we probably need to do more work if pools are active */
235 ret = gst_v4l2_object_set_format (self->v4l2output, state->caps);
238 self->input_state = gst_video_codec_state_ref (state);
245 gst_v4l2_video_dec_flush (GstVideoDecoder * decoder)
247 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
249 GST_DEBUG_OBJECT (self, "Flushing");
251 /* Wait for capture thread to stop */
252 gst_pad_stop_task (decoder->srcpad);
253 self->output_flow = GST_FLOW_OK;
255 gst_v4l2_buffer_pool_flush (GST_V4L2_BUFFER_POOL (self->v4l2output->pool));
256 gst_v4l2_buffer_pool_flush (GST_V4L2_BUFFER_POOL (self->v4l2capture->pool));
258 /* Output will remain flushing until new frame comes in */
259 gst_v4l2_object_unlock_stop (self->v4l2capture);
265 gst_v4l2_video_dec_negotiate (GstVideoDecoder * decoder)
267 return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder);
271 gst_v4l2_video_dec_finish (GstVideoDecoder * decoder)
273 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
274 GstFlowReturn ret = GST_FLOW_OK;
277 if (!self->input_state)
280 GST_DEBUG_OBJECT (self, "Finishing decoding");
282 /* Keep queuing empty buffers until the processing thread has stopped,
283 * _pool_process() will return FLUSHING when that happened */
284 GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
285 while (ret == GST_FLOW_OK) {
286 buffer = gst_buffer_new ();
288 gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->
289 v4l2output->pool), buffer);
290 gst_buffer_unref (buffer);
292 GST_VIDEO_DECODER_STREAM_LOCK (decoder);
294 g_assert (g_atomic_int_get (&self->processing) == FALSE);
296 if (ret == GST_FLOW_FLUSHING)
297 ret = self->output_flow;
299 GST_DEBUG_OBJECT (decoder, "Done draining buffers");
305 static GstVideoCodecFrame *
306 gst_v4l2_video_dec_get_oldest_frame (GstVideoDecoder * decoder)
308 GstVideoCodecFrame *frame = NULL;
312 frames = gst_video_decoder_get_frames (decoder);
314 for (l = frames; l != NULL; l = l->next) {
315 GstVideoCodecFrame *f = l->data;
317 if (!frame || frame->pts > f->pts)
324 GST_LOG_OBJECT (decoder,
325 "Oldest frame is %d %" GST_TIME_FORMAT " and %d frames left",
326 frame->system_frame_number, GST_TIME_ARGS (frame->pts), count - 1);
327 gst_video_codec_frame_ref (frame);
330 g_list_free_full (frames, (GDestroyNotify) gst_video_codec_frame_unref);
336 gst_v4l2_video_dec_loop (GstVideoDecoder * decoder)
338 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
340 GstVideoCodecFrame *frame;
341 GstBuffer *buffer = NULL;
344 GST_LOG_OBJECT (decoder, "Allocate output buffer");
346 /* We cannot use the base class allotate helper since it taking the internal
347 * stream lock. we know that the acquire may need to poll until more frames
348 * comes in and holding this lock would prevent that.
350 pool = gst_video_decoder_get_buffer_pool (decoder);
351 ret = gst_buffer_pool_acquire_buffer (pool, &buffer, NULL);
352 g_object_unref (pool);
354 if (ret != GST_FLOW_OK)
357 /* Check if buffer isn't the last one */
358 if (gst_buffer_get_size (buffer) == 0)
361 GST_LOG_OBJECT (decoder, "Process output buffer");
363 gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->
364 v4l2capture->pool), buffer);
366 if (ret != GST_FLOW_OK)
369 frame = gst_v4l2_video_dec_get_oldest_frame (decoder);
372 frame->output_buffer = buffer;
374 ret = gst_video_decoder_finish_frame (decoder, frame);
376 if (ret != GST_FLOW_OK)
379 GST_WARNING_OBJECT (decoder, "Decoder is producing too many buffers");
380 gst_buffer_unref (buffer);
386 GST_DEBUG_OBJECT (decoder, "Leaving output thread");
388 gst_buffer_replace (&buffer, NULL);
389 self->output_flow = ret;
390 g_atomic_int_set (&self->processing, FALSE);
391 gst_v4l2_object_unlock (self->v4l2output);
392 gst_pad_pause_task (decoder->srcpad);
396 gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
397 GstVideoCodecFrame * frame)
399 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
400 GstFlowReturn ret = GST_FLOW_OK;
402 GST_DEBUG_OBJECT (self, "Handling frame %d", frame->system_frame_number);
404 if (G_UNLIKELY (!g_atomic_int_get (&self->active)))
407 if (G_UNLIKELY (!GST_V4L2_IS_ACTIVE (self->v4l2output))) {
408 if (!gst_v4l2_object_set_format (self->v4l2output, self->input_state->caps))
412 if (G_UNLIKELY (!GST_V4L2_IS_ACTIVE (self->v4l2capture))) {
414 GstVideoCodecState *output_state;
415 GstBuffer *codec_data;
417 GST_DEBUG_OBJECT (self, "Sending header");
419 codec_data = self->input_state->codec_data;
421 /* We are running in byte-stream mode, so we don't know the headers, but
422 * we need to send something, otherwise the decoder will refuse to
426 gst_buffer_ref (codec_data);
428 codec_data = frame->input_buffer;
429 frame->input_buffer = NULL;
432 GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
433 gst_v4l2_object_unlock_stop (self->v4l2output);
435 gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->v4l2output->
437 gst_v4l2_object_unlock (self->v4l2output);
438 GST_VIDEO_DECODER_STREAM_LOCK (decoder);
440 gst_buffer_unref (codec_data);
442 if (!gst_v4l2_object_setup_format (self->v4l2capture, &info, &self->align))
445 output_state = gst_video_decoder_set_output_state (decoder,
446 info.finfo->format, info.width, info.height, self->input_state);
448 /* Copy the rest of the information, there might be more in the future */
449 output_state->info.interlace_mode = info.interlace_mode;
450 gst_video_codec_state_unref (output_state);
452 if (!gst_video_decoder_negotiate (decoder)) {
453 if (GST_PAD_IS_FLUSHING (decoder->srcpad))
460 if (g_atomic_int_get (&self->processing) == FALSE) {
461 /* It possible that the processing thread stopped due to an error */
462 if (self->output_flow != GST_FLOW_OK) {
463 GST_DEBUG_OBJECT (self, "Processing loop stopped with error, leaving");
464 ret = self->output_flow;
468 GST_DEBUG_OBJECT (self, "Starting decoding thread");
470 /* Enable processing input */
471 gst_v4l2_object_unlock_stop (self->v4l2output);
473 /* Start the processing task, when it quits, the task will disable input
474 * processing to unlock input if draining, or prevent potential block */
475 g_atomic_int_set (&self->processing, TRUE);
476 gst_pad_start_task (decoder->srcpad,
477 (GstTaskFunction) gst_v4l2_video_dec_loop, self, NULL);
480 if (frame->input_buffer) {
481 GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
483 gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->v4l2output->
484 pool), frame->input_buffer);
485 GST_VIDEO_DECODER_STREAM_LOCK (decoder);
487 if (ret == GST_FLOW_FLUSHING) {
488 if (g_atomic_int_get (&self->processing) == FALSE)
489 ret = self->output_flow;
492 /* No need to keep input arround */
493 gst_buffer_replace (&frame->input_buffer, NULL);
496 gst_video_codec_frame_unref (frame);
502 GST_ERROR_OBJECT (self, "not negotiated");
503 ret = GST_FLOW_NOT_NEGOTIATED;
508 ret = GST_FLOW_FLUSHING;
513 gst_video_decoder_drop_frame (decoder, frame);
519 gst_v4l2_video_dec_decide_allocation (GstVideoDecoder * decoder,
522 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
523 GstClockTime latency;
524 gboolean ret = FALSE;
526 if (gst_v4l2_object_decide_allocation (self->v4l2capture, query))
527 ret = GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder,
530 latency = self->v4l2capture->min_buffers_for_capture *
531 self->v4l2capture->duration;
532 gst_video_decoder_set_latency (decoder, latency, latency);
538 gst_v4l2_video_dec_src_query (GstVideoDecoder * decoder, GstQuery * query)
541 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
543 switch (GST_QUERY_TYPE (query)) {
544 case GST_QUERY_CAPS:{
545 GstCaps *filter, *result = NULL;
546 gst_query_parse_caps (query, &filter);
548 if (self->probed_srccaps)
549 result = gst_caps_ref (self->probed_srccaps);
551 result = gst_v4l2_object_get_raw_caps ();
554 GstCaps *tmp = result;
556 gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);
557 gst_caps_unref (tmp);
560 GST_DEBUG_OBJECT (self, "Returning src caps %" GST_PTR_FORMAT, result);
562 gst_query_set_caps_result (query, result);
563 gst_caps_unref (result);
568 ret = GST_VIDEO_DECODER_CLASS (parent_class)->src_query (decoder, query);
576 gst_v4l2_video_dec_sink_query (GstVideoDecoder * decoder, GstQuery * query)
579 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
581 switch (GST_QUERY_TYPE (query)) {
582 case GST_QUERY_CAPS:{
583 GstCaps *filter, *result = NULL;
584 gst_query_parse_caps (query, &filter);
586 if (self->probed_sinkcaps)
587 result = gst_caps_ref (self->probed_sinkcaps);
589 result = gst_v4l2_object_get_codec_caps ();
592 GstCaps *tmp = result;
594 gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);
595 gst_caps_unref (tmp);
598 GST_DEBUG_OBJECT (self, "Returning sink caps %" GST_PTR_FORMAT, result);
600 gst_query_set_caps_result (query, result);
601 gst_caps_unref (result);
606 ret = GST_VIDEO_DECODER_CLASS (parent_class)->sink_query (decoder, query);
614 gst_v4l2_video_dec_sink_event (GstVideoDecoder * decoder, GstEvent * event)
616 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
618 switch (GST_EVENT_TYPE (event)) {
619 case GST_EVENT_FLUSH_START:
620 gst_v4l2_object_unlock (self->v4l2output);
621 gst_v4l2_object_unlock (self->v4l2capture);
626 return GST_VIDEO_DECODER_CLASS (parent_class)->sink_event (decoder, event);
629 static GstStateChangeReturn
630 gst_v4l2_video_dec_change_state (GstElement * element,
631 GstStateChange transition)
633 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (element);
635 if (transition == GST_STATE_CHANGE_PAUSED_TO_READY) {
636 g_atomic_int_set (&self->active, FALSE);
637 gst_v4l2_object_unlock (self->v4l2output);
638 gst_v4l2_object_unlock (self->v4l2capture);
641 return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
645 gst_v4l2_video_dec_dispose (GObject * object)
647 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (object);
649 gst_caps_replace (&self->probed_sinkcaps, NULL);
650 gst_caps_replace (&self->probed_srccaps, NULL);
652 G_OBJECT_CLASS (parent_class)->dispose (object);
656 gst_v4l2_video_dec_finalize (GObject * object)
658 GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (object);
660 gst_v4l2_object_destroy (self->v4l2capture);
661 gst_v4l2_object_destroy (self->v4l2output);
663 G_OBJECT_CLASS (parent_class)->finalize (object);
667 gst_v4l2_video_dec_init (GstV4l2VideoDec * self)
669 GstVideoDecoder *decoder = (GstVideoDecoder *) self;
671 gst_video_decoder_set_packetized (decoder, TRUE);
673 self->v4l2output = gst_v4l2_object_new (GST_ELEMENT (self),
674 V4L2_BUF_TYPE_VIDEO_OUTPUT, DEFAULT_PROP_DEVICE,
675 gst_v4l2_get_output, gst_v4l2_set_output, NULL);
676 self->v4l2output->no_initial_format = TRUE;
677 self->v4l2output->keep_aspect = FALSE;
679 self->v4l2capture = gst_v4l2_object_new (GST_ELEMENT (self),
680 V4L2_BUF_TYPE_VIDEO_CAPTURE, DEFAULT_PROP_DEVICE,
681 gst_v4l2_get_input, gst_v4l2_set_input, NULL);
682 self->v4l2capture->no_initial_format = TRUE;
683 self->v4l2output->keep_aspect = FALSE;
685 g_object_set (self, "device", DEFAULT_PROP_DEVICE, NULL);
689 gst_v4l2_video_dec_class_init (GstV4l2VideoDecClass * klass)
691 GstElementClass *element_class;
692 GObjectClass *gobject_class;
693 GstVideoDecoderClass *video_decoder_class;
695 element_class = (GstElementClass *) klass;
696 gobject_class = (GObjectClass *) klass;
697 video_decoder_class = (GstVideoDecoderClass *) klass;
699 gst_element_class_add_pad_template (element_class,
700 gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
701 gst_v4l2_object_get_codec_caps ()));
703 gst_element_class_add_pad_template (element_class,
704 gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
705 gst_v4l2_object_get_raw_caps ()));
707 gst_element_class_set_static_metadata (element_class,
708 "V4L2 Video Decoder",
709 "Codec/Decoder/Video",
710 "Decode video streams via V4L2 API",
711 "Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>");
713 gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_dispose);
714 gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_finalize);
715 gobject_class->set_property =
716 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_set_property);
717 gobject_class->get_property =
718 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_get_property);
720 video_decoder_class->open = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_open);
721 video_decoder_class->close = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_close);
722 video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_start);
723 video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_stop);
724 video_decoder_class->finish = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_finish);
725 video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_flush);
726 video_decoder_class->set_format =
727 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_set_format);
728 video_decoder_class->negotiate =
729 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_negotiate);
730 video_decoder_class->decide_allocation =
731 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_decide_allocation);
732 /* FIXME propose_allocation or not ? */
733 video_decoder_class->handle_frame =
734 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_handle_frame);
735 video_decoder_class->sink_query =
736 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_sink_query);
737 video_decoder_class->src_query =
738 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_src_query);
739 video_decoder_class->sink_event =
740 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_sink_event);
742 element_class->change_state =
743 GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_change_state);
746 gst_v4l2_object_install_properties_helper (gobject_class,
747 DEFAULT_PROP_DEVICE);
750 * GstV4l2VideoDec:capture-io-mode
754 g_object_class_install_property (gobject_class, PROP_IO_MODE,
755 g_param_spec_enum ("capture-io-mode", "Capture IO mode",
757 GST_TYPE_V4L2_IO_MODE, GST_V4L2_IO_AUTO,
758 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
760 GST_DEBUG_CATEGORY_INIT (gst_v4l2_video_dec_debug, "v4l2videodec", 0,
761 "V4L2 Video Decoder");