diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2013-07-01 16:55:01 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2013-09-13 16:29:48 +0200 |
commit | 4c27613d2d1370342950045a38de7ed934f2f7be (patch) | |
tree | 62f9b8d45fb2aa724fd39c812a18eb7d0e02891a | |
parent | 90320f1fd91aa6c33e78d57644ca487e3e3c77a9 (diff) | |
download | gst-plugins-good-4c27613d2d1370342950045a38de7ed934f2f7be.tar.gz gst-plugins-good-4c27613d2d1370342950045a38de7ed934f2f7be.tar.xz |
v4l2: don't extract data from caps twice
gst_video_info_from_caps() always extract width, height, interlace mode and
framerate now. It is no longer necessary to do it again for encoded
formats.
https://bugzilla.gnome.org/show_bug.cgi?id=703399
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 49654de59..f3985d40c 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -1567,11 +1567,8 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps, break; } } else { - gboolean dimensions = TRUE; - if (g_str_equal (mimetype, "video/mpegts")) { fourcc = V4L2_PIX_FMT_MPEG; - dimensions = FALSE; } else if (g_str_equal (mimetype, "video/x-dv")) { fourcc = V4L2_PIX_FMT_DV; } else if (g_str_equal (mimetype, "image/jpeg")) { @@ -1605,26 +1602,6 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps, fourcc = V4L2_PIX_FMT_PWC2; } #endif - - if (dimensions) { - const gchar *interlace_mode; - - if (!gst_structure_get_int (structure, "width", &info->width)) - goto no_width; - - if (!gst_structure_get_int (structure, "height", &info->height)) - goto no_height; - - interlace_mode = gst_structure_get_string (structure, "interlace-mode"); - if (g_str_equal (interlace_mode, "progressive")) { - info->interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE; - } else { - info->interlace_mode = GST_VIDEO_INTERLACE_MODE_MIXED; - } - if (!gst_structure_get_fraction (structure, "framerate", &info->fps_n, - &info->fps_d)) - goto no_framerate; - } } if (fourcc == 0) @@ -1639,21 +1616,6 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps, return TRUE; /* ERRORS */ -no_width: - { - GST_DEBUG_OBJECT (v4l2object, "no width"); - return FALSE; - } -no_height: - { - GST_DEBUG_OBJECT (v4l2object, "no height"); - return FALSE; - } -no_framerate: - { - GST_DEBUG_OBJECT (v4l2object, "no framerate"); - return FALSE; - } invalid_format: { GST_DEBUG_OBJECT (v4l2object, "invalid format"); |