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:
fryshorts
2014-09-16 21:45:23 +02:00
parent 91fc59faca
commit 0132453d23

View File

@@ -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);