diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-03-28 14:24:40 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-03-28 17:59:19 +0200 |
commit | a7ec623279b6f63633df8f6f54581d85fc5deb35 (patch) | |
tree | ae4991a98cbe69d9a2d98b2a870dd99e64ec2bbc | |
parent | b98d334dce30746df20787dfc8d0d7c4324ccaea (diff) |
decoder: fix semantics of SKIPPED pictures.
If GstVaapiPicture has flag SKIPPED set, this means gst_vaapi_picture_output()
will not push the underlying surface for rendering. Besides, VC-1 skipped P-frame
has nothing to do with rendering. This only means that the currently decoded
picture is just a copy of its reference picture.
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_objects.c | 8 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_objects.h | 3 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_vc1.c | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c index f089aa2f..adad9c6a 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c @@ -250,9 +250,11 @@ gst_vaapi_picture_output(GstVaapiPicture *picture) if (!picture->proxy) return FALSE; - proxy = g_object_ref(picture->proxy); - gst_vaapi_surface_proxy_set_timestamp(proxy, picture->pts); - gst_vaapi_decoder_push_surface_proxy(GET_DECODER(picture), proxy); + if (!GST_VAAPI_PICTURE_IS_SKIPPED(picture)) { + proxy = g_object_ref(picture->proxy); + gst_vaapi_surface_proxy_set_timestamp(proxy, picture->pts); + gst_vaapi_decoder_push_surface_proxy(GET_DECODER(picture), proxy); + } return TRUE; } diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_objects.h b/gst-libs/gst/vaapi/gstvaapidecoder_objects.h index 6566fec0..c53492df 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_objects.h +++ b/gst-libs/gst/vaapi/gstvaapidecoder_objects.h @@ -101,6 +101,9 @@ enum { #define GST_VAAPI_PICTURE_FLAG_SET GST_MINI_OBJECT_FLAG_SET #define GST_VAAPI_PICTURE_FLAG_UNSET GST_MINI_OBJECT_FLAG_UNSET +#define GST_VAAPI_PICTURE_IS_SKIPPED(picture) \ + GST_VAAPI_PICTURE_FLAG_IS_SET(picture, GST_VAAPI_PICTURE_FLAG_SKIPPED) + #define GST_VAAPI_PICTURE_IS_REFERENCE(picture) \ GST_VAAPI_PICTURE_FLAG_IS_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c index d7d68121..63fbc730 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c @@ -933,8 +933,6 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu) GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); break; case GST_VC1_PICTURE_TYPE_SKIPPED: - GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_SKIPPED); - // fall-through case GST_VC1_PICTURE_TYPE_P: picture->type = GST_VAAPI_PICTURE_TYPE_P; GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE); |