mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
v4l2object: Add parsed=1 field for encoded output
https://bugzilla.gnome.org/show_bug.cgi?id=720568
This commit is contained in:
parent
5be7d39a3f
commit
b39c838ece
1 changed files with 25 additions and 4 deletions
|
@ -2126,6 +2126,27 @@ sort_by_frame_size (GstStructure * s1, GstStructure * s2)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
gst_v4l2_object_update_and_append (GstV4l2Object * v4l2object,
|
||||
guint32 format, GstCaps * caps, GstStructure * s)
|
||||
{
|
||||
/* Encoded stream on output buffer need to be parsed */
|
||||
if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_OUTPUT ||
|
||||
v4l2object->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
||||
gint i = 0;
|
||||
|
||||
for (; i < GST_V4L2_FORMAT_COUNT; i++) {
|
||||
if (format == gst_v4l2_formats[i].format &&
|
||||
gst_v4l2_formats[i].flags == GST_V4L2_CODEC) {
|
||||
gst_structure_set (s, "parsed", G_TYPE_BOOLEAN, TRUE, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gst_caps_append_structure (caps, s);
|
||||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_v4l2_object_probe_caps_for_format (GstV4l2Object * v4l2object,
|
||||
guint32 pixelformat, const GstStructure * template)
|
||||
|
@ -2233,7 +2254,7 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object * v4l2object,
|
|||
NULL);
|
||||
|
||||
/* no point using the results list here, since there's only one struct */
|
||||
gst_caps_append_structure (ret, tmp);
|
||||
gst_v4l2_object_update_and_append (v4l2object, pixelformat, ret, tmp);
|
||||
}
|
||||
} else {
|
||||
goto unknown_type;
|
||||
|
@ -2246,7 +2267,8 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object * v4l2object,
|
|||
* resolution last, since order in caps matters for things like fixation. */
|
||||
results = g_list_sort (results, (GCompareFunc) sort_by_frame_size);
|
||||
while (results != NULL) {
|
||||
gst_caps_append_structure (ret, GST_STRUCTURE (results->data));
|
||||
gst_v4l2_object_update_and_append (v4l2object, pixelformat, ret,
|
||||
results->data);
|
||||
results = g_list_delete_link (results, results);
|
||||
}
|
||||
|
||||
|
@ -2348,8 +2370,7 @@ default_frame_sizes:
|
|||
(interlaced ? "mixed" : "progressive"), NULL);
|
||||
gst_v4l2_object_add_aspect_ratio (v4l2object, tmp);
|
||||
|
||||
gst_caps_append_structure (ret, tmp);
|
||||
|
||||
gst_v4l2_object_update_and_append (v4l2object, pixelformat, ret, tmp);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue