From a7ec623279b6f63633df8f6f54581d85fc5deb35 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 28 Mar 2012 14:24:40 +0200 Subject: [PATCH] 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. --- gst-libs/gst/vaapi/gstvaapidecoder_objects.c | 8 +++++--- gst-libs/gst/vaapi/gstvaapidecoder_objects.h | 3 +++ 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 f089aa2ff8..adad9c6abe 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 6566fec047..c53492dfa4 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 d7d68121c2..63fbc7307b 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);