Add video format check in v4l2 input.
This adds a check whether the video format from the device is compatible with obs. This could either happen if the "Leave unchanged" option is selected for the video format, or if the driver simply overwrites the requested video format.
This commit is contained in:
@@ -602,6 +602,10 @@ static void v4l2_init(struct v4l2_data *data)
|
||||
blog(LOG_ERROR, "Unable to set format");
|
||||
goto fail;
|
||||
}
|
||||
if (v4l2_to_obs_video_format(data->pixfmt) == VIDEO_FORMAT_NONE) {
|
||||
blog(LOG_ERROR, "Selected video format not supported");
|
||||
goto fail;
|
||||
}
|
||||
v4l2_unpack_tuple(&data->width, &data->height, data->resolution);
|
||||
blog(LOG_INFO, "Resolution: %dx%d", data->width, data->height);
|
||||
blog(LOG_INFO, "Pixelformat: %d", data->pixfmt);
|
||||
|
Reference in New Issue
Block a user