gst_structure_set (props, "v4l2.device.device_caps", G_TYPE_UINT,
v4l2obj->vcap.device_caps, NULL);
- if (v4l2obj->device_caps & V4L2_CAP_VIDEO_CAPTURE)
+ if (v4l2obj->device_caps &
+ (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE_MPLANE))
type = GST_V4L2_DEVICE_TYPE_SOURCE;
- if (v4l2obj->device_caps & V4L2_CAP_VIDEO_OUTPUT) {
- /* Morph it in case our initial guess was wrong */
- v4l2obj->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ if (v4l2obj->device_caps &
+ (V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_MPLANE)) {
+ /* We ignore M2M devices that are both capture and output for now
+ * The provider is not for them */
+ if (type != GST_V4L2_DEVICE_TYPE_INVALID)
+ goto close;
+
+ type = GST_V4L2_DEVICE_TYPE_SINK;
- if (type == GST_V4L2_DEVICE_TYPE_INVALID)
- type = GST_V4L2_DEVICE_TYPE_SINK;
+ /* We have opened as a capture as we didn't know, now that know,
+ * let's fixed it */
+ if (v4l2obj->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE)
+ v4l2obj->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
else
- /* We ignore M2M devices that are both capture and output for now
- * The provider is not for them
- */
- goto close;
+ v4l2obj->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
}
+ if (type == GST_V4L2_DEVICE_TYPE_INVALID)
+ goto close;
+
caps = gst_v4l2_object_get_caps (v4l2obj, NULL);
if (caps == NULL)