- Define a new function that identify if the v4l2object is raw based
on pixel format
- Only consider setting delta flag on buffer if the video is not raw.
Sponsored by Living Optics Ltd.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4867>
break;
}
- if (GST_VIDEO_INFO_FORMAT (&obj->info) == GST_VIDEO_FORMAT_ENCODED) {
+ if (!gst_v4l2_object_is_raw (obj)) {
if ((group->buffer.flags & V4L2_BUF_FLAG_KEYFRAME) ||
GST_V4L2_PIXELFORMAT (obj) == V4L2_PIX_FMT_MJPEG ||
GST_V4L2_PIXELFORMAT (obj) == V4L2_PIX_FMT_JPEG ||
return template;
}
+gboolean
+gst_v4l2_object_is_raw (GstV4l2Object * v4l2object)
+{
+ gint i;
+
+ if (GST_VIDEO_INFO_FORMAT (&v4l2object->info) != GST_VIDEO_FORMAT_ENCODED)
+ return TRUE;
+
+ for (i = 0; i < GST_V4L2_FORMAT_COUNT; i++) {
+ if (gst_v4l2_formats[i].format == GST_V4L2_PIXELFORMAT (v4l2object)) {
+ return ! !(gst_v4l2_formats[i].flags & GST_V4L2_RAW);
+ }
+ }
+ return FALSE;
+}
+
/* Add an 'alternate' variant of the caps with the feature */
static void
add_alternate_variant (GstV4l2Object * v4l2object, GstCaps * caps,
GstFlowReturn gst_v4l2_object_poll (GstV4l2Object * v4l2object, GstClockTime timeout);
gboolean gst_v4l2_object_subscribe_event (GstV4l2Object * v4l2object, guint32 event);
+gboolean gst_v4l2_object_is_raw (GstV4l2Object * obj);
+
/* crop / compose */
gboolean gst_v4l2_object_set_crop (GstV4l2Object * obj, struct v4l2_rect *result);
gboolean gst_v4l2_object_get_crop_bounds (GstV4l2Object * obj, struct v4l2_rect *bounds);