|
@@ -43,6 +43,7 @@ struct ffmpeg_source {
|
|
|
uint8_t *sws_data;
|
|
uint8_t *sws_data;
|
|
|
int sws_linesize;
|
|
int sws_linesize;
|
|
|
enum video_range_type range;
|
|
enum video_range_type range;
|
|
|
|
|
+ bool is_linear_alpha;
|
|
|
obs_source_t *source;
|
|
obs_source_t *source;
|
|
|
obs_hotkey_id hotkey;
|
|
obs_hotkey_id hotkey;
|
|
|
|
|
|
|
@@ -109,6 +110,7 @@ static void ffmpeg_source_defaults(obs_data_t *settings)
|
|
|
obs_data_set_default_bool(settings, "looping", false);
|
|
obs_data_set_default_bool(settings, "looping", false);
|
|
|
obs_data_set_default_bool(settings, "clear_on_media_end", true);
|
|
obs_data_set_default_bool(settings, "clear_on_media_end", true);
|
|
|
obs_data_set_default_bool(settings, "restart_on_activate", true);
|
|
obs_data_set_default_bool(settings, "restart_on_activate", true);
|
|
|
|
|
+ obs_data_set_default_bool(settings, "linear_alpha", false);
|
|
|
obs_data_set_default_int(settings, "reconnect_delay_sec", 10);
|
|
obs_data_set_default_int(settings, "reconnect_delay_sec", 10);
|
|
|
obs_data_set_default_int(settings, "buffering_mb", 2);
|
|
obs_data_set_default_int(settings, "buffering_mb", 2);
|
|
|
obs_data_set_default_int(settings, "speed_percent", 100);
|
|
obs_data_set_default_int(settings, "speed_percent", 100);
|
|
@@ -163,8 +165,7 @@ static obs_properties_t *ffmpeg_source_getproperties(void *data)
|
|
|
dstr_free(&filter);
|
|
dstr_free(&filter);
|
|
|
dstr_free(&path);
|
|
dstr_free(&path);
|
|
|
|
|
|
|
|
- prop = obs_properties_add_bool(props, "looping",
|
|
|
|
|
- obs_module_text("Looping"));
|
|
|
|
|
|
|
+ obs_properties_add_bool(props, "looping", obs_module_text("Looping"));
|
|
|
|
|
|
|
|
obs_properties_add_bool(props, "restart_on_activate",
|
|
obs_properties_add_bool(props, "restart_on_activate",
|
|
|
obs_module_text("RestartWhenActivated"));
|
|
obs_module_text("RestartWhenActivated"));
|
|
@@ -215,6 +216,9 @@ static obs_properties_t *ffmpeg_source_getproperties(void *data)
|
|
|
obs_property_list_add_int(prop, obs_module_text("ColorRange.Full"),
|
|
obs_property_list_add_int(prop, obs_module_text("ColorRange.Full"),
|
|
|
VIDEO_RANGE_FULL);
|
|
VIDEO_RANGE_FULL);
|
|
|
|
|
|
|
|
|
|
+ obs_properties_add_bool(props, "linear_alpha",
|
|
|
|
|
+ obs_module_text("LinearAlpha"));
|
|
|
|
|
+
|
|
|
obs_properties_add_bool(props, "seekable", obs_module_text("Seekable"));
|
|
obs_properties_add_bool(props, "seekable", obs_module_text("Seekable"));
|
|
|
|
|
|
|
|
return props;
|
|
return props;
|
|
@@ -229,13 +233,15 @@ static void dump_source_info(struct ffmpeg_source *s, const char *input,
|
|
|
"\tinput_format: %s\n"
|
|
"\tinput_format: %s\n"
|
|
|
"\tspeed: %d\n"
|
|
"\tspeed: %d\n"
|
|
|
"\tis_looping: %s\n"
|
|
"\tis_looping: %s\n"
|
|
|
|
|
+ "\tis_linear_alpha: %s\n"
|
|
|
"\tis_hw_decoding: %s\n"
|
|
"\tis_hw_decoding: %s\n"
|
|
|
"\tis_clear_on_media_end: %s\n"
|
|
"\tis_clear_on_media_end: %s\n"
|
|
|
"\trestart_on_activate: %s\n"
|
|
"\trestart_on_activate: %s\n"
|
|
|
"\tclose_when_inactive: %s",
|
|
"\tclose_when_inactive: %s",
|
|
|
input ? input : "(null)",
|
|
input ? input : "(null)",
|
|
|
input_format ? input_format : "(null)", s->speed_percent,
|
|
input_format ? input_format : "(null)", s->speed_percent,
|
|
|
- s->is_looping ? "yes" : "no", s->is_hw_decoding ? "yes" : "no",
|
|
|
|
|
|
|
+ s->is_looping ? "yes" : "no", s->is_linear_alpha ? "yes" : "no",
|
|
|
|
|
+ s->is_hw_decoding ? "yes" : "no",
|
|
|
s->is_clear_on_media_end ? "yes" : "no",
|
|
s->is_clear_on_media_end ? "yes" : "no",
|
|
|
s->restart_on_activate ? "yes" : "no",
|
|
s->restart_on_activate ? "yes" : "no",
|
|
|
s->close_when_inactive ? "yes" : "no");
|
|
s->close_when_inactive ? "yes" : "no");
|
|
@@ -304,6 +310,7 @@ static void ffmpeg_source_open(struct ffmpeg_source *s)
|
|
|
.buffering = s->buffering_mb * 1024 * 1024,
|
|
.buffering = s->buffering_mb * 1024 * 1024,
|
|
|
.speed = s->speed_percent,
|
|
.speed = s->speed_percent,
|
|
|
.force_range = s->range,
|
|
.force_range = s->range,
|
|
|
|
|
+ .is_linear_alpha = s->is_linear_alpha,
|
|
|
.hardware_decoding = s->is_hw_decoding,
|
|
.hardware_decoding = s->is_hw_decoding,
|
|
|
.is_local_file = s->is_local_file || s->seekable,
|
|
.is_local_file = s->is_local_file || s->seekable,
|
|
|
.reconnecting = s->reconnecting,
|
|
.reconnecting = s->reconnecting,
|
|
@@ -425,6 +432,7 @@ static void ffmpeg_source_update(void *data, obs_data_t *settings)
|
|
|
obs_data_get_bool(settings, "restart_on_activate");
|
|
obs_data_get_bool(settings, "restart_on_activate");
|
|
|
s->range = (enum video_range_type)obs_data_get_int(settings,
|
|
s->range = (enum video_range_type)obs_data_get_int(settings,
|
|
|
"color_range");
|
|
"color_range");
|
|
|
|
|
+ s->is_linear_alpha = obs_data_get_bool(settings, "linear_alpha");
|
|
|
s->buffering_mb = (int)obs_data_get_int(settings, "buffering_mb");
|
|
s->buffering_mb = (int)obs_data_get_int(settings, "buffering_mb");
|
|
|
s->speed_percent = (int)obs_data_get_int(settings, "speed_percent");
|
|
s->speed_percent = (int)obs_data_get_int(settings, "speed_percent");
|
|
|
s->is_local_file = is_local_file;
|
|
s->is_local_file = is_local_file;
|