1 /*
2  * GStreamer
3  * Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
4  *
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.
9  *
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.
14  *
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.
19  */
20 
21 /**
22  * SECTION:element-vdpaumpegdec
23  *
24  * FIXME:Describe vdpaumpegdec here.
25  *
26  * <refsect2>
27  * <title>Example launch line</title>
28  * |[
29  * gst-launch-1.0 -v -m fakesrc ! vdpaumpegdec ! fakesink silent=TRUE
30  * ]|
31  * </refsect2>
32  */
33 
34 #ifdef HAVE_CONFIG_H
35 #include <config.h>
36 #endif
37 
38 #include <gst/gst.h>
39 #include <gst/base/gstbytereader.h>
40 #include <gst/base/gstbitreader.h>
41 #include <gst/codecparsers/gstmpegvideoparser.h>
42 #include <gst/codecparsers/gstmpegvideometa.h>
43 #include <string.h>
44 
45 #include "gstvdpmpegdec.h"
46 #include "gstvdpvideomemory.h"
47 
48 GST_DEBUG_CATEGORY_STATIC (gst_vdp_mpeg_dec_debug);
49 #define GST_CAT_DEFAULT gst_vdp_mpeg_dec_debug
50 
51 /* the capabilities of the inputs and outputs.
52  *
53  * describe the real formats here.
54  */
55 static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
56     GST_PAD_SINK,
57     GST_PAD_ALWAYS,
58     GST_STATIC_CAPS ("video/mpeg, mpegversion = (int) [ 1, 2 ], "
59         "systemstream = (boolean) false")
60     );
61 
62 #define DEBUG_INIT \
63     GST_DEBUG_CATEGORY_INIT (gst_vdp_mpeg_dec_debug, "vdpaumpegdec", 0, \
64     "VDPAU mpeg decoder");
65 #define gst_vdp_mpeg_dec_parent_class parent_class
66 G_DEFINE_TYPE_WITH_CODE (GstVdpMpegDec, gst_vdp_mpeg_dec, GST_TYPE_VDP_DECODER,
67     DEBUG_INIT);
68 
69 static void gst_vdp_mpeg_dec_init_info (VdpPictureInfoMPEG1Or2 * vdp_info);
70 
71 #define SYNC_CODE_SIZE 3
72 
73 static VdpDecoderProfile
gst_vdp_mpeg_dec_get_profile(GstMpegVideoSequenceExt * hdr)74 gst_vdp_mpeg_dec_get_profile (GstMpegVideoSequenceExt * hdr)
75 {
76   VdpDecoderProfile profile;
77 
78   switch (hdr->profile) {
79     case GST_MPEG_VIDEO_PROFILE_SIMPLE:
80       profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE;
81       break;
82     default:
83       profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
84       break;
85   }
86 
87   return profile;
88 }
89 
90 static gboolean
gst_vdp_mpeg_dec_handle_picture_coding(GstVdpMpegDec * mpeg_dec,GstMpegVideoPictureExt * pic_ext,GstVideoCodecFrame * frame)91 gst_vdp_mpeg_dec_handle_picture_coding (GstVdpMpegDec * mpeg_dec,
92     GstMpegVideoPictureExt * pic_ext, GstVideoCodecFrame * frame)
93 {
94   VdpPictureInfoMPEG1Or2 *info;
95 #if 0
96   gint fields;
97 #endif
98 
99   GST_DEBUG_OBJECT (mpeg_dec, "Handling GstMpegVideoPictureExt");
100 
101   info = &mpeg_dec->vdp_info;
102 
103   /* FIXME : Set defaults when pic_ext isn't present */
104 
105   memcpy (&mpeg_dec->vdp_info.f_code, &pic_ext->f_code, 4);
106 
107   info->intra_dc_precision = pic_ext->intra_dc_precision;
108   info->picture_structure = pic_ext->picture_structure;
109   info->top_field_first = pic_ext->top_field_first;
110   info->frame_pred_frame_dct = pic_ext->frame_pred_frame_dct;
111   info->concealment_motion_vectors = pic_ext->concealment_motion_vectors;
112   info->q_scale_type = pic_ext->q_scale_type;
113   info->intra_vlc_format = pic_ext->intra_vlc_format;
114   info->alternate_scan = pic_ext->alternate_scan;
115 
116 #if 0
117   fields = 2;
118   if (pic_ext->picture_structure == 3) {
119     if (mpeg_dec->stream_info.interlaced) {
120       if (pic_ext->progressive_frame == 0)
121         fields = 2;
122       if (pic_ext->progressive_frame == 0 && pic_ext->repeat_first_field == 0)
123         fields = 2;
124       if (pic_ext->progressive_frame == 1 && pic_ext->repeat_first_field == 1)
125         fields = 3;
126     } else {
127       if (pic_ext->repeat_first_field == 0)
128         fields = 2;
129       if (pic_ext->repeat_first_field == 1 && pic_ext->top_field_first == 0)
130         fields = 4;
131       if (pic_ext->repeat_first_field == 1 && pic_ext->top_field_first == 1)
132         fields = 6;
133     }
134   } else
135     fields = 1;
136 #endif
137 
138   if (pic_ext->top_field_first)
139     GST_FIXME ("Set TFF on outgoing buffer");
140 #if 0
141   GST_VIDEO_FRAME_FLAG_SET (frame, GST_VIDEO_FRAME_FLAG_TFF);
142 #endif
143 
144   return TRUE;
145 }
146 
147 static gboolean
gst_vdp_mpeg_dec_handle_picture(GstVdpMpegDec * mpeg_dec,GstMpegVideoPictureHdr * pic_hdr)148 gst_vdp_mpeg_dec_handle_picture (GstVdpMpegDec * mpeg_dec,
149     GstMpegVideoPictureHdr * pic_hdr)
150 {
151   GST_DEBUG_OBJECT (mpeg_dec, "Handling GstMpegVideoPictureHdr");
152 
153   mpeg_dec->vdp_info.picture_coding_type = pic_hdr->pic_type;
154 
155   if (mpeg_dec->stream_info.version == 1) {
156     mpeg_dec->vdp_info.full_pel_forward_vector =
157         pic_hdr->full_pel_forward_vector;
158     mpeg_dec->vdp_info.full_pel_backward_vector =
159         pic_hdr->full_pel_backward_vector;
160     memcpy (&mpeg_dec->vdp_info.f_code, &pic_hdr->f_code, 4);
161   }
162 
163   mpeg_dec->frame_nr = mpeg_dec->gop_frame + pic_hdr->tsn;
164 
165   return TRUE;
166 }
167 
168 static gboolean
gst_vdp_mpeg_dec_set_format(GstVideoDecoder * decoder,GstVideoCodecState * state)169 gst_vdp_mpeg_dec_set_format (GstVideoDecoder * decoder,
170     GstVideoCodecState * state)
171 {
172   GstVdpMpegDec *mpeg_dec = (GstVdpMpegDec *) decoder;
173 
174   /* FIXME : Check the hardware can handle the level/profile */
175   if (mpeg_dec->input_state)
176     gst_video_codec_state_unref (mpeg_dec->input_state);
177   mpeg_dec->input_state = gst_video_codec_state_ref (state);
178 
179   return TRUE;
180 }
181 
182 #if 0
183 static gboolean
184 gst_vdp_mpeg_dec_handle_gop (GstVdpMpegDec * mpeg_dec, const guint8 * data,
185     gsize size, guint offset)
186 {
187   GstMpegVideoGop gop;
188   GstClockTime time;
189 
190   if (!gst_mpeg_video_parse_gop (&gop, data, size, offset))
191     return FALSE;
192 
193   time = GST_SECOND * (gop.hour * 3600 + gop.minute * 60 + gop.second);
194 
195   GST_DEBUG ("gop timestamp: %" GST_TIME_FORMAT, GST_TIME_ARGS (time));
196 
197   mpeg_dec->gop_frame =
198       gst_util_uint64_scale (time, mpeg_dec->stream_info.fps_n,
199       mpeg_dec->stream_info.fps_d * GST_SECOND) + gop.frame;
200 
201   if (mpeg_dec->state == GST_VDP_MPEG_DEC_STATE_NEED_GOP)
202     mpeg_dec->state = GST_VDP_MPEG_DEC_STATE_NEED_DATA;
203 
204   return TRUE;
205 }
206 #endif
207 
208 static gboolean
gst_vdp_mpeg_dec_handle_quant_matrix(GstVdpMpegDec * mpeg_dec,GstMpegVideoQuantMatrixExt * qm)209 gst_vdp_mpeg_dec_handle_quant_matrix (GstVdpMpegDec * mpeg_dec,
210     GstMpegVideoQuantMatrixExt * qm)
211 {
212   GST_DEBUG_OBJECT (mpeg_dec, "Handling GstMpegVideoQuantMatrixExt");
213 
214   memcpy (&mpeg_dec->vdp_info.intra_quantizer_matrix,
215       &qm->intra_quantiser_matrix, 64);
216   memcpy (&mpeg_dec->vdp_info.non_intra_quantizer_matrix,
217       &qm->non_intra_quantiser_matrix, 64);
218 
219   return TRUE;
220 }
221 
222 static GstFlowReturn
gst_vdp_mpeg_dec_handle_sequence(GstVdpMpegDec * mpeg_dec,GstMpegVideoSequenceHdr * hdr,GstMpegVideoSequenceExt * ext)223 gst_vdp_mpeg_dec_handle_sequence (GstVdpMpegDec * mpeg_dec,
224     GstMpegVideoSequenceHdr * hdr, GstMpegVideoSequenceExt * ext)
225 {
226   GstFlowReturn ret;
227   GstVideoDecoder *video_decoder = GST_VIDEO_DECODER (mpeg_dec);
228   GstVdpMpegStreamInfo stream_info;
229 
230   GST_DEBUG_OBJECT (mpeg_dec, "Handling GstMpegVideoSequenceHdr");
231 
232   memcpy (&mpeg_dec->vdp_info.intra_quantizer_matrix,
233       &hdr->intra_quantizer_matrix, 64);
234   memcpy (&mpeg_dec->vdp_info.non_intra_quantizer_matrix,
235       &hdr->non_intra_quantizer_matrix, 64);
236 
237   stream_info.width = hdr->width;
238   stream_info.height = hdr->height;
239 
240   stream_info.fps_n = hdr->fps_n;
241   stream_info.fps_d = hdr->fps_d;
242 
243   stream_info.par_n = hdr->par_w;
244   stream_info.par_d = hdr->par_h;
245 
246   stream_info.interlaced = FALSE;
247   stream_info.version = 1;
248   stream_info.profile = VDP_DECODER_PROFILE_MPEG1;
249 
250   if (ext) {
251     GST_DEBUG_OBJECT (mpeg_dec, "Handling GstMpegVideoSequenceExt");
252 
253     /* FIXME : isn't this already processed by mpegvideoparse ? */
254     stream_info.fps_n *= (ext->fps_n_ext + 1);
255     stream_info.fps_d *= (ext->fps_d_ext + 1);
256 
257     stream_info.width += (ext->horiz_size_ext << 12);
258     stream_info.height += (ext->vert_size_ext << 12);
259 
260     stream_info.interlaced = !ext->progressive;
261     stream_info.version = 2;
262     stream_info.profile = gst_vdp_mpeg_dec_get_profile (ext);
263   }
264 
265   GST_DEBUG_OBJECT (mpeg_dec, "Setting output state to %dx%d",
266       stream_info.width, stream_info.height);
267   mpeg_dec->output_state =
268       gst_video_decoder_set_output_state (video_decoder, GST_VIDEO_FORMAT_YV12,
269       stream_info.width, stream_info.height, mpeg_dec->input_state);
270   if (stream_info.interlaced)
271     mpeg_dec->output_state->info.interlace_mode =
272         GST_VIDEO_INTERLACE_MODE_INTERLEAVED;
273   gst_video_decoder_negotiate (video_decoder);
274 
275   ret = gst_vdp_decoder_init_decoder (GST_VDP_DECODER (mpeg_dec),
276       stream_info.profile, 2, mpeg_dec->output_state);
277   mpeg_dec->state = GST_VDP_MPEG_DEC_STATE_NEED_DATA;
278 
279   return ret;
280 }
281 
282 static GstFlowReturn
gst_vdp_mpeg_dec_handle_frame(GstVideoDecoder * video_decoder,GstVideoCodecFrame * frame)283 gst_vdp_mpeg_dec_handle_frame (GstVideoDecoder * video_decoder,
284     GstVideoCodecFrame * frame)
285 {
286   GstVdpMpegDec *mpeg_dec = GST_VDP_MPEG_DEC (video_decoder);
287 
288   VdpPictureInfoMPEG1Or2 *info;
289   GstMpegVideoMeta *mpeg_meta;
290   GstVdpVideoMemory *vmem;
291 
292   GstFlowReturn ret = GST_FLOW_OK;
293   VdpBitstreamBuffer vbit[1];
294   GstMapInfo mapinfo;
295 
296   /* FIXME : Specify in sink query that we need the mpeg video meta */
297 
298   /* Parse all incoming data from the frame */
299   mpeg_meta = gst_buffer_get_mpeg_video_meta (frame->input_buffer);
300   if (!mpeg_meta)
301     goto no_meta;
302 
303   /* GST_MPEG_VIDEO_PACKET_SEQUENCE */
304   if (mpeg_meta->sequencehdr) {
305     ret =
306         gst_vdp_mpeg_dec_handle_sequence (mpeg_dec, mpeg_meta->sequencehdr,
307         mpeg_meta->sequenceext);
308     if (ret != GST_FLOW_OK)
309       goto sequence_parse_fail;
310   }
311 
312   if (mpeg_dec->state == GST_VDP_MPEG_DEC_STATE_NEED_SEQUENCE)
313     goto need_sequence;
314 
315   /* GST_MPEG_VIDEO_PACKET_PICTURE */
316   if (mpeg_meta->pichdr)
317     gst_vdp_mpeg_dec_handle_picture (mpeg_dec, mpeg_meta->pichdr);
318 
319   /* GST_MPEG_VIDEO_PACKET_EXT_PICTURE_CODING */
320   if (mpeg_meta->picext)
321     gst_vdp_mpeg_dec_handle_picture_coding (mpeg_dec, mpeg_meta->picext, frame);
322 
323   /* GST_MPEG_VIDEO_PACKET_GOP */
324   /* if (mpeg_meta->gop) */
325   /*   GST_FIXME_OBJECT (mpeg_dec, "Handle GOP !"); */
326   /*   gst_vdp_mpeg_dec_handle_gop (mpeg_dec, mpeg_frame.gop); */
327 
328   /* GST_MPEG_VIDEO_PACKET_EXT_QUANT_MATRIX */
329   if (mpeg_meta->quantext)
330     gst_vdp_mpeg_dec_handle_quant_matrix (mpeg_dec, mpeg_meta->quantext);
331 
332   info = &mpeg_dec->vdp_info;
333 
334   info->slice_count = mpeg_meta->num_slices;
335 
336   GST_DEBUG_OBJECT (mpeg_dec, "picture coding type %d",
337       info->picture_coding_type);
338 
339   /* check if we can decode the frame */
340   if (info->picture_coding_type != GST_MPEG_VIDEO_PICTURE_TYPE_I
341       && info->backward_reference == VDP_INVALID_HANDLE)
342     goto need_i_frame;
343 
344   if (info->picture_coding_type == GST_MPEG_VIDEO_PICTURE_TYPE_B
345       && info->forward_reference == VDP_INVALID_HANDLE)
346     goto need_non_b_frame;
347 
348   if (info->picture_coding_type != GST_MPEG_VIDEO_PICTURE_TYPE_B) {
349     if (info->backward_reference != VDP_INVALID_HANDLE) {
350       GST_DEBUG_OBJECT (mpeg_dec, "Pushing B frame");
351       ret = gst_video_decoder_finish_frame (video_decoder, mpeg_dec->b_frame);
352     }
353 
354     if (info->forward_reference != VDP_INVALID_HANDLE) {
355       GST_DEBUG_OBJECT (mpeg_dec, "Releasing no-longer needed forward frame");
356       gst_video_codec_frame_unref (mpeg_dec->f_frame);
357       info->forward_reference = VDP_INVALID_HANDLE;
358     }
359 
360     info->forward_reference = info->backward_reference;
361     mpeg_dec->f_frame = mpeg_dec->b_frame;
362 
363     info->backward_reference = VDP_INVALID_HANDLE;
364   }
365 
366   if (ret != GST_FLOW_OK)
367     goto exit_after_b_frame;
368 
369   /* decode */
370   if (!gst_buffer_map (frame->input_buffer, &mapinfo, GST_MAP_READ))
371     goto map_fail;
372 
373   vbit[0].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
374   vbit[0].bitstream = mapinfo.data + mpeg_meta->slice_offset;
375   vbit[0].bitstream_bytes = mapinfo.size - mpeg_meta->slice_offset;
376 
377   ret = gst_vdp_decoder_render (GST_VDP_DECODER (mpeg_dec),
378       (VdpPictureInfo *) info, 1, vbit, frame);
379 
380   gst_buffer_unmap (frame->input_buffer, &mapinfo);
381 
382   if (ret != GST_FLOW_OK)
383     goto render_fail;
384 
385   vmem = (GstVdpVideoMemory *) gst_buffer_get_memory (frame->output_buffer, 0);
386 
387   if (info->picture_coding_type == GST_MPEG_VIDEO_PICTURE_TYPE_B) {
388     ret = gst_video_decoder_finish_frame (video_decoder, frame);
389   } else {
390     info->backward_reference = vmem->surface;
391     mpeg_dec->b_frame = gst_video_codec_frame_ref (frame);
392   }
393 
394   return ret;
395 
396   /* EARLY EXIT */
397 need_sequence:
398   {
399     GST_DEBUG_OBJECT (mpeg_dec, "Drop frame since we haven't found a "
400         "GST_MPEG_VIDEO_PACKET_SEQUENCE yet");
401 
402     gst_video_decoder_finish_frame (video_decoder, frame);
403     return GST_FLOW_OK;
404   }
405 
406 need_i_frame:
407   {
408     GST_DEBUG_OBJECT (mpeg_dec,
409         "Drop frame since we haven't got an I_FRAME yet");
410 
411     gst_video_decoder_finish_frame (video_decoder, frame);
412     return GST_FLOW_OK;
413   }
414 
415 need_non_b_frame:
416   {
417     GST_DEBUG_OBJECT (mpeg_dec,
418         "Drop frame since we haven't got two non B_FRAME yet");
419 
420     gst_video_decoder_finish_frame (video_decoder, frame);
421     return GST_FLOW_OK;
422   }
423 
424 
425   /* ERRORS */
426 no_meta:
427   {
428     GST_ERROR_OBJECT (video_decoder,
429         "Input buffer does not have MpegVideo GstMeta");
430     gst_video_decoder_drop_frame (video_decoder, frame);
431     return GST_FLOW_ERROR;
432   }
433 
434 sequence_parse_fail:
435   {
436     GST_ERROR_OBJECT (video_decoder, "Failed to handle sequence header");
437     gst_video_decoder_finish_frame (video_decoder, frame);
438     return ret;
439   }
440 
441 exit_after_b_frame:
442   {
443     GST_WARNING_OBJECT (video_decoder, "Leaving after pushing B frame");
444     gst_video_decoder_finish_frame (video_decoder, frame);
445     return ret;
446   }
447 
448 map_fail:
449   {
450     GST_ERROR_OBJECT (video_decoder, "Failed to map input buffer");
451     gst_video_decoder_drop_frame (video_decoder, frame);
452     return GST_FLOW_ERROR;
453   }
454 
455 render_fail:
456   {
457     GST_ERROR_OBJECT (video_decoder, "Error when rendering the frame");
458     gst_video_decoder_drop_frame (video_decoder, frame);
459     return ret;
460   }
461 }
462 
463 static gboolean
gst_vdp_mpeg_dec_flush(GstVideoDecoder * video_decoder)464 gst_vdp_mpeg_dec_flush (GstVideoDecoder * video_decoder)
465 {
466   GstVdpMpegDec *mpeg_dec = GST_VDP_MPEG_DEC (video_decoder);
467 
468   if (mpeg_dec->vdp_info.forward_reference != VDP_INVALID_HANDLE)
469     gst_video_codec_frame_unref (mpeg_dec->f_frame);
470   if (mpeg_dec->vdp_info.backward_reference != VDP_INVALID_HANDLE)
471     gst_video_codec_frame_unref (mpeg_dec->b_frame);
472 
473   gst_vdp_mpeg_dec_init_info (&mpeg_dec->vdp_info);
474 
475   mpeg_dec->prev_packet = -1;
476 
477   return TRUE;
478 }
479 
480 static gboolean
gst_vdp_mpeg_dec_start(GstVideoDecoder * video_decoder)481 gst_vdp_mpeg_dec_start (GstVideoDecoder * video_decoder)
482 {
483   GstVdpMpegDec *mpeg_dec = GST_VDP_MPEG_DEC (video_decoder);
484 
485   GST_DEBUG_OBJECT (video_decoder, "Starting");
486 
487   gst_vdp_mpeg_dec_init_info (&mpeg_dec->vdp_info);
488 
489   mpeg_dec->decoder = VDP_INVALID_HANDLE;
490   mpeg_dec->state = GST_VDP_MPEG_DEC_STATE_NEED_SEQUENCE;
491 
492   memset (&mpeg_dec->stream_info, 0, sizeof (GstVdpMpegStreamInfo));
493 
494   return GST_VIDEO_DECODER_CLASS (parent_class)->start (video_decoder);
495 }
496 
497 static gboolean
gst_vdp_mpeg_dec_stop(GstVideoDecoder * video_decoder)498 gst_vdp_mpeg_dec_stop (GstVideoDecoder * video_decoder)
499 {
500   GstVdpMpegDec *mpeg_dec = GST_VDP_MPEG_DEC (video_decoder);
501 
502   if (mpeg_dec->vdp_info.forward_reference != VDP_INVALID_HANDLE)
503     mpeg_dec->vdp_info.forward_reference = VDP_INVALID_HANDLE;
504   if (mpeg_dec->vdp_info.backward_reference != VDP_INVALID_HANDLE)
505     mpeg_dec->vdp_info.backward_reference = VDP_INVALID_HANDLE;
506 
507   mpeg_dec->state = GST_VDP_MPEG_DEC_STATE_NEED_SEQUENCE;
508 
509   return GST_VIDEO_DECODER_CLASS (parent_class)->stop (video_decoder);
510 }
511 
512 /* initialize the vdpaumpegdecoder's class */
513 static void
gst_vdp_mpeg_dec_class_init(GstVdpMpegDecClass * klass)514 gst_vdp_mpeg_dec_class_init (GstVdpMpegDecClass * klass)
515 {
516   GstElementClass *element_class;
517   GstVideoDecoderClass *video_decoder_class;
518 
519   element_class = GST_ELEMENT_CLASS (klass);
520   video_decoder_class = GST_VIDEO_DECODER_CLASS (klass);
521 
522   gst_element_class_set_static_metadata (element_class,
523       "VDPAU Mpeg Decoder",
524       "Decoder",
525       "Decode mpeg stream with vdpau",
526       "Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>");
527 
528   gst_element_class_add_static_pad_template (element_class, &sink_template);
529 
530   video_decoder_class->start = gst_vdp_mpeg_dec_start;
531   video_decoder_class->stop = gst_vdp_mpeg_dec_stop;
532   video_decoder_class->flush = gst_vdp_mpeg_dec_flush;
533 
534   video_decoder_class->handle_frame = gst_vdp_mpeg_dec_handle_frame;
535   video_decoder_class->set_format = gst_vdp_mpeg_dec_set_format;
536 }
537 
538 static void
gst_vdp_mpeg_dec_init_info(VdpPictureInfoMPEG1Or2 * vdp_info)539 gst_vdp_mpeg_dec_init_info (VdpPictureInfoMPEG1Or2 * vdp_info)
540 {
541   vdp_info->forward_reference = VDP_INVALID_HANDLE;
542   vdp_info->backward_reference = VDP_INVALID_HANDLE;
543   vdp_info->slice_count = 0;
544   vdp_info->picture_structure = 3;
545   vdp_info->picture_coding_type = 0;
546   vdp_info->intra_dc_precision = 0;
547   vdp_info->frame_pred_frame_dct = 1;
548   vdp_info->concealment_motion_vectors = 0;
549   vdp_info->intra_vlc_format = 0;
550   vdp_info->alternate_scan = 0;
551   vdp_info->q_scale_type = 0;
552   vdp_info->top_field_first = 1;
553 }
554 
555 static void
gst_vdp_mpeg_dec_init(GstVdpMpegDec * mpeg_dec)556 gst_vdp_mpeg_dec_init (GstVdpMpegDec * mpeg_dec)
557 {
558 }
559