From 70a48e09624b8fb5d1c6f7e539f6150f13eeec20 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 30 Jun 2014 18:46:45 +0200 Subject: [PATCH] decoder: propagate "one-field" flags. Allow decoders to set the "one-field" attribute when the decoded frame genuinely has a single field, or if the second field was mis-decoded but we still want to display the first field. --- gst-libs/gst/vaapi/gstvaapidecoder_objects.c | 2 ++ gst-libs/gst/vaapi/gstvaapidecoder_objects.h | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c index edd9a62..76bc79d 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c @@ -336,6 +336,8 @@ do_output (GstVaapiPicture * picture) flags |= GST_VAAPI_SURFACE_PROXY_FLAG_INTERLACED; if (GST_VAAPI_PICTURE_IS_TFF (picture)) flags |= GST_VAAPI_SURFACE_PROXY_FLAG_TFF; + if (GST_VAAPI_PICTURE_IS_ONEFIELD (picture)) + flags |= GST_VAAPI_SURFACE_PROXY_FLAG_ONEFIELD; } GST_VAAPI_SURFACE_PROXY_FLAG_SET (proxy, flags); diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_objects.h b/gst-libs/gst/vaapi/gstvaapidecoder_objects.h index e2790cb..6499574 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_objects.h +++ b/gst-libs/gst/vaapi/gstvaapidecoder_objects.h @@ -65,6 +65,7 @@ typedef enum * @GST_VAAPI_PICTURE_FLAG_INTERLACED: interlaced frame * @GST_VAAPI_PICTURE_FLAG_FF: first-field * @GST_VAAPI_PICTURE_FLAG_TFF: top-field-first + * @GST_VAAPI_PICTURE_FLAG_ONEFIELD: only one field is valid * @GST_VAAPI_PICTURE_FLAG_MVC: multiview component * @GST_VAAPI_PICTURE_FLAG_LAST: first flag that can be used by subclasses * @@ -78,8 +79,9 @@ typedef enum GST_VAAPI_PICTURE_FLAG_INTERLACED = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 3), GST_VAAPI_PICTURE_FLAG_FF = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 4), GST_VAAPI_PICTURE_FLAG_TFF = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 5), - GST_VAAPI_PICTURE_FLAG_MVC = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 6), - GST_VAAPI_PICTURE_FLAG_LAST = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 7), + GST_VAAPI_PICTURE_FLAG_ONEFIELD = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 6), + GST_VAAPI_PICTURE_FLAG_MVC = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 7), + GST_VAAPI_PICTURE_FLAG_LAST = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 8), } GstVaapiPictureFlags; #define GST_VAAPI_PICTURE_FLAGS GST_VAAPI_MINI_OBJECT_FLAGS @@ -105,12 +107,16 @@ typedef enum #define GST_VAAPI_PICTURE_IS_TFF(picture) \ GST_VAAPI_PICTURE_FLAG_IS_SET (picture, GST_VAAPI_PICTURE_FLAG_TFF) +#define GST_VAAPI_PICTURE_IS_ONEFIELD(picture) \ + GST_VAAPI_PICTURE_FLAG_IS_SET (picture, GST_VAAPI_PICTURE_FLAG_ONEFIELD) + #define GST_VAAPI_PICTURE_IS_FRAME(picture) \ (GST_VAAPI_PICTURE (picture)->structure == GST_VAAPI_PICTURE_STRUCTURE_FRAME) #define GST_VAAPI_PICTURE_IS_COMPLETE(picture) \ (GST_VAAPI_PICTURE_IS_FRAME (picture) || \ - !GST_VAAPI_PICTURE_IS_FIRST_FIELD (picture)) + GST_VAAPI_PICTURE_IS_ONEFIELD (picture) || \ + !GST_VAAPI_PICTURE_IS_FIRST_FIELD (picture)) #define GST_VAAPI_PICTURE_IS_MVC(picture) \ (GST_VAAPI_PICTURE_FLAG_IS_SET (picture, GST_VAAPI_PICTURE_FLAG_MVC)) -- 2.7.4