@@ -133,6 +133,17 @@ static void browser_source_get_defaults(obs_data_t *settings)
133
133
obs_data_set_default_bool (settings, " reroute_audio" , false );
134
134
}
135
135
136
+ static void browser_source_get_defaults_v2 (obs_data_t *settings)
137
+ {
138
+ browser_source_get_defaults (settings);
139
+
140
+ struct obs_video_info ovi;
141
+ obs_get_video_info (&ovi);
142
+
143
+ obs_data_set_default_int (settings, " width" , ovi.base_width );
144
+ obs_data_set_default_int (settings, " height" , ovi.base_height );
145
+ }
146
+
136
147
static bool is_local_file_modified (obs_properties_t *props, obs_property_t *,
137
148
obs_data_t *settings)
138
149
{
@@ -434,7 +445,7 @@ extern "C" EXPORT void obs_browser_initialize(void)
434
445
void RegisterBrowserSource ()
435
446
{
436
447
struct obs_source_info info = {};
437
- info.id = " browser_source " ;
448
+ info.id = " browser_source_v2 " ;
438
449
info.type = OBS_SOURCE_TYPE_INPUT;
439
450
info.output_flags = OBS_SOURCE_VIDEO |
440
451
#if CHROME_VERSION_BUILD >= 3683
@@ -443,7 +454,7 @@ void RegisterBrowserSource()
443
454
OBS_SOURCE_CUSTOM_DRAW | OBS_SOURCE_INTERACTION |
444
455
OBS_SOURCE_DO_NOT_DUPLICATE | OBS_SOURCE_SRGB;
445
456
info.get_properties = browser_source_get_properties;
446
- info.get_defaults = browser_source_get_defaults ;
457
+ info.get_defaults = browser_source_get_defaults_v2 ;
447
458
info.icon_type = OBS_ICON_TYPE_BROWSER;
448
459
449
460
info.get_name = [](void *) { return obs_module_text (" BrowserSource" ); };
@@ -522,6 +533,11 @@ void RegisterBrowserSource()
522
533
};
523
534
524
535
obs_register_source (&info);
536
+
537
+ info.id = " browser_source" ;
538
+ info.output_flags |= OBS_SOURCE_CAP_OBSOLETE;
539
+ info.get_defaults = browser_source_get_defaults;
540
+ obs_register_source (&info);
525
541
}
526
542
527
543
/* ========================================================================= */
0 commit comments