@@ -131,6 +131,17 @@ static void browser_source_get_defaults(obs_data_t *settings)
131
131
obs_data_set_default_bool (settings, " reroute_audio" , false );
132
132
}
133
133
134
+ static void browser_source_get_defaults_v2 (obs_data_t *settings)
135
+ {
136
+ browser_source_get_defaults (settings);
137
+
138
+ struct obs_video_info ovi;
139
+ obs_get_video_info (&ovi);
140
+
141
+ obs_data_set_default_int (settings, " width" , ovi.base_width );
142
+ obs_data_set_default_int (settings, " height" , ovi.base_height );
143
+ }
144
+
134
145
static bool is_local_file_modified (obs_properties_t *props, obs_property_t *,
135
146
obs_data_t *settings)
136
147
{
@@ -408,7 +419,7 @@ extern "C" EXPORT void obs_browser_initialize(void)
408
419
void RegisterBrowserSource ()
409
420
{
410
421
struct obs_source_info info = {};
411
- info.id = " browser_source " ;
422
+ info.id = " browser_source_v2 " ;
412
423
info.type = OBS_SOURCE_TYPE_INPUT;
413
424
info.output_flags = OBS_SOURCE_VIDEO |
414
425
#if CHROME_VERSION_BUILD >= 3683
@@ -417,7 +428,7 @@ void RegisterBrowserSource()
417
428
OBS_SOURCE_CUSTOM_DRAW | OBS_SOURCE_INTERACTION |
418
429
OBS_SOURCE_DO_NOT_DUPLICATE | OBS_SOURCE_SRGB;
419
430
info.get_properties = browser_source_get_properties;
420
- info.get_defaults = browser_source_get_defaults ;
431
+ info.get_defaults = browser_source_get_defaults_v2 ;
421
432
info.icon_type = OBS_ICON_TYPE_BROWSER;
422
433
423
434
info.get_name = [](void *) { return obs_module_text (" BrowserSource" ); };
@@ -496,6 +507,11 @@ void RegisterBrowserSource()
496
507
};
497
508
498
509
obs_register_source (&info);
510
+
511
+ info.id = " browser_source" ;
512
+ info.output_flags |= OBS_SOURCE_CAP_OBSOLETE;
513
+ info.get_defaults = browser_source_get_defaults;
514
+ obs_register_source (&info);
499
515
}
500
516
501
517
/* ========================================================================= */
0 commit comments