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.
This commit is contained in:
Gwenole Beauchesne 2014-06-30 18:46:45 +02:00
parent f040f4f8b4
commit 70a48e0962
2 changed files with 11 additions and 3 deletions

View file

@ -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);

View file

@ -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))