[aravis] gst: correctly determine buffer element caps.



commit 1c8edd3674cc70b7f75d20bcd39cbbed279fa01d
Author: Edgar Thier <edgarthier gmail com>
Date:   Mon Jul 22 15:45:07 2013 +0200

    gst: correctly determine buffer element caps.

 gst/gstaravis.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gst/gstaravis.c b/gst/gstaravis.c
index 1131065..8919ea3 100644
--- a/gst/gstaravis.c
+++ b/gst/gstaravis.c
@@ -151,10 +151,17 @@ gst_aravis_set_caps (GstBaseSrc *src, GstCaps *caps)
        gst_structure_get_int (structure, "width", &width);
        gst_structure_get_int (structure, "height", &height);
        frame_rate = gst_structure_get_value (structure, "framerate");
-       gst_structure_get_fourcc (structure, "format", &fourcc);
        gst_structure_get_int (structure, "bpp", &bpp);
        gst_structure_get_int (structure, "depth", &depth);
 
+       if (gst_structure_get_field_type (structure, "format") == G_TYPE_STRING) {
+               char* s = gst_structure_get_string (structure, "format");
+               fourcc = GST_STR_FOURCC (s);
+       } else if (gst_structure_get_field_type (structure, "format") == GST_TYPE_FOURCC) {
+               gst_structure_get_fourcc (structure, "format", &fourcc);
+       } else
+               fourcc = 0;
+
        pixel_format = arv_pixel_format_from_gst_caps (gst_structure_get_name (structure), bpp, depth, 
fourcc);
 
        arv_camera_set_region (gst_aravis->camera, gst_aravis->offset_x, gst_aravis->offset_y, width, height);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]