diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-11 10:59:33 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-11 17:08:47 +0200 |
commit | 6c19849cd2d273fdc67b6e8f6befd17e1fbb68fc (patch) | |
tree | 5c8d4e774751c21286ed7bc343770f444fb190c1 | |
parent | e4d27fba6b9f6accadb7a428bf8423a41c5392f7 (diff) |
decoder: propagate buffer duration downstream.
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder.c | 6 | ||||
-rw-r--r-- | gst/vaapi/gstvaapidecode.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c index 148a6a2..c63bb14 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder.c @@ -129,10 +129,16 @@ static inline void push_surface(GstVaapiDecoder *decoder, GstVaapiSurfaceProxy *proxy) { GstVaapiDecoderPrivate * const priv = decoder->priv; + GstClockTime duration; GST_DEBUG("queue decoded surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(gst_vaapi_surface_proxy_get_surface_id(proxy))); + if (priv->fps_n && priv->fps_d) { + /* Actual field duration is computed in vaapipostproc */ + duration = gst_util_uint64_scale(GST_SECOND, priv->fps_d, priv->fps_n); + gst_vaapi_surface_proxy_set_duration(proxy, duration); + } g_queue_push_tail(priv->surfaces, proxy); } diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 7b85636..0b9643f 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -229,6 +229,7 @@ gst_vaapidecode_step(GstVaapiDecode *decode) goto error_create_buffer; GST_BUFFER_TIMESTAMP(buffer) = GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy); + GST_BUFFER_DURATION(buffer) = GST_VAAPI_SURFACE_PROXY_DURATION(proxy); gst_buffer_set_caps(buffer, GST_PAD_CAPS(decode->srcpad)); if (GST_VAAPI_SURFACE_PROXY_TFF(proxy)) |