Merge pull request #1648 from DougTy/master
linux-v4l2: Add setting to change color range
This commit is contained in:
commit
c4f4b6602b
@ -8,3 +8,6 @@ Resolution="Resolution"
|
|||||||
FrameRate="Frame Rate"
|
FrameRate="Frame Rate"
|
||||||
LeaveUnchanged="Leave Unchanged"
|
LeaveUnchanged="Leave Unchanged"
|
||||||
UseBuffering="Use Buffering"
|
UseBuffering="Use Buffering"
|
||||||
|
ColorRange="Color Range"
|
||||||
|
ColorRange.Partial="Partial"
|
||||||
|
ColorRange.Full="Full"
|
||||||
|
@ -75,6 +75,7 @@ struct v4l2_data {
|
|||||||
int dv_timing;
|
int dv_timing;
|
||||||
int resolution;
|
int resolution;
|
||||||
int framerate;
|
int framerate;
|
||||||
|
int color_range;
|
||||||
|
|
||||||
/* internal data */
|
/* internal data */
|
||||||
obs_source_t *source;
|
obs_source_t *source;
|
||||||
@ -112,7 +113,7 @@ static void v4l2_prep_obs_frame(struct v4l2_data *data,
|
|||||||
frame->width = data->width;
|
frame->width = data->width;
|
||||||
frame->height = data->height;
|
frame->height = data->height;
|
||||||
frame->format = v4l2_to_obs_video_format(data->pixfmt);
|
frame->format = v4l2_to_obs_video_format(data->pixfmt);
|
||||||
video_format_get_parameters(VIDEO_CS_DEFAULT, VIDEO_RANGE_PARTIAL,
|
video_format_get_parameters(VIDEO_CS_DEFAULT, data->color_range,
|
||||||
frame->color_matrix, frame->color_range_min,
|
frame->color_matrix, frame->color_range_min,
|
||||||
frame->color_range_max);
|
frame->color_range_max);
|
||||||
|
|
||||||
@ -231,6 +232,7 @@ static void v4l2_defaults(obs_data_t *settings)
|
|||||||
obs_data_set_default_int(settings, "dv_timing", -1);
|
obs_data_set_default_int(settings, "dv_timing", -1);
|
||||||
obs_data_set_default_int(settings, "resolution", -1);
|
obs_data_set_default_int(settings, "resolution", -1);
|
||||||
obs_data_set_default_int(settings, "framerate", -1);
|
obs_data_set_default_int(settings, "framerate", -1);
|
||||||
|
obs_data_set_default_int(settings, "color_range", VIDEO_RANGE_PARTIAL);
|
||||||
obs_data_set_default_bool(settings, "buffering", true);
|
obs_data_set_default_bool(settings, "buffering", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,6 +765,12 @@ static obs_properties_t *v4l2_properties(void *vptr)
|
|||||||
"framerate", obs_module_text("FrameRate"),
|
"framerate", obs_module_text("FrameRate"),
|
||||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||||
|
|
||||||
|
obs_property_t *color_range_list = obs_properties_add_list(props,
|
||||||
|
"color_range", obs_module_text("ColorRange"),
|
||||||
|
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||||
|
obs_property_list_add_int(color_range_list, obs_module_text("ColorRange.Partial"), VIDEO_RANGE_PARTIAL);
|
||||||
|
obs_property_list_add_int(color_range_list, obs_module_text("ColorRange.Full"), VIDEO_RANGE_FULL);
|
||||||
|
|
||||||
obs_properties_add_bool(props,
|
obs_properties_add_bool(props,
|
||||||
"buffering", obs_module_text("UseBuffering"));
|
"buffering", obs_module_text("UseBuffering"));
|
||||||
|
|
||||||
@ -944,6 +952,7 @@ static void v4l2_update(void *vptr, obs_data_t *settings)
|
|||||||
data->dv_timing = obs_data_get_int(settings, "dv_timing");
|
data->dv_timing = obs_data_get_int(settings, "dv_timing");
|
||||||
data->resolution = obs_data_get_int(settings, "resolution");
|
data->resolution = obs_data_get_int(settings, "resolution");
|
||||||
data->framerate = obs_data_get_int(settings, "framerate");
|
data->framerate = obs_data_get_int(settings, "framerate");
|
||||||
|
data->color_range = obs_data_get_int(settings, "color_range");
|
||||||
|
|
||||||
v4l2_update_source_flags(data, settings);
|
v4l2_update_source_flags(data, settings);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user