[Pkg-gstreamer-commits] [gstreamer-vaapi] 77/176: download: use GstVideoInfo facilities to build output caps.

Vincent Cheng vcheng at moszumanska.debian.org
Tue Jun 3 08:09:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

vcheng pushed a commit to branch upstream
in repository gstreamer-vaapi.

commit 7f88fdcc03294ddf2785f5dac0c27c2f66f789f9
Author: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
Date:   Sat Dec 21 08:27:30 2013 +0100

    download: use GstVideoInfo facilities to build output caps.
    
    Use standard GstVideoInfo related functions to build the output caps,
    thus directly preserving additional fields as needed, instead of
    manually copying them over through gst_vaapi_append_surface_caps().
    
    Also ensure that the input caps are fixated first.
---
 gst/vaapi/gstvaapidownload.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/gst/vaapi/gstvaapidownload.c b/gst/vaapi/gstvaapidownload.c
index 9a9a3ca..045a6de 100644
--- a/gst/vaapi/gstvaapidownload.c
+++ b/gst/vaapi/gstvaapidownload.c
@@ -282,6 +282,7 @@ gst_vaapidownload_update_src_caps(GstVaapiDownload *download, GstBuffer *buffer)
     GstVaapiVideoMeta *meta;
     GstVaapiSurface *surface;
     GstVideoFormat format;
+    GstVideoInfo vi;
     GstPad *srcpad;
     GstCaps *in_caps, *out_caps;
 
@@ -297,20 +298,22 @@ gst_vaapidownload_update_src_caps(GstVaapiDownload *download, GstBuffer *buffer)
         return TRUE;
 
     in_caps = GST_BUFFER_CAPS(buffer);
-    if (!in_caps) {
+    if (!in_caps || !gst_caps_is_fixed(in_caps)) {
         GST_WARNING("failed to retrieve caps from buffer");
         return FALSE;
     }
 
-    out_caps = gst_vaapi_video_format_to_caps(download->image_format);
-    if (!out_caps) {
-        GST_WARNING("failed to create caps from format %s",
-                    gst_video_format_to_string(download->image_format));
+    if (!gst_video_info_from_caps(&vi, in_caps)) {
+        GST_WARNING("failed to parse caps %" GST_PTR_FORMAT, in_caps);
         return FALSE;
     }
 
-    if (!gst_vaapi_append_surface_caps(out_caps, in_caps)) {
-        gst_caps_unref(out_caps);
+    gst_video_info_set_format(&vi, download->image_format,
+        GST_VIDEO_INFO_WIDTH(&vi), GST_VIDEO_INFO_HEIGHT(&vi));
+    out_caps = gst_video_info_to_caps(&vi);
+    if (!out_caps) {
+        GST_WARNING("failed to create caps from format %s",
+                    gst_video_format_to_string(download->image_format));
         return FALSE;
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git



More information about the Pkg-gstreamer-commits mailing list