From 74b4743bce754a607b20121ba5d764f5db303c35 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 24 Jun 2014 23:54:10 -0700 Subject: [PATCH] Remove 'locale' from properties Having the value stored here is somewhat pointless, so this is one step in fixing the locale handling. Locale should be handled by the modules themselves with their own loaded locale lookup information. --- libobs/obs-properties.c | 17 +++++------------ libobs/obs-properties.h | 8 +++----- plugins/linux-pulseaudio/pulse-input.c | 2 +- plugins/linux-v4l2/v4l2-input.c | 2 +- plugins/linux-xcomposite/xcompcap-main.cpp | 2 +- plugins/linux-xshm/xshm-input.c | 2 +- plugins/mac-avcapture/av-capture.m | 2 +- plugins/mac-capture/mac-audio.c | 2 +- plugins/obs-ffmpeg/obs-ffmpeg-aac.c | 2 +- plugins/obs-libfdk/obs-libfdk.c | 2 +- plugins/obs-outputs/flv-output.c | 2 +- plugins/obs-outputs/rtmp-stream.c | 2 +- plugins/obs-x264/obs-x264.c | 2 +- plugins/rtmp-services/rtmp-common.c | 2 +- plugins/rtmp-services/rtmp-custom.c | 2 +- plugins/win-capture/window-capture.c | 2 +- plugins/win-dshow/win-dshow.cpp | 2 +- plugins/win-wasapi/win-wasapi.cpp | 2 +- 18 files changed, 24 insertions(+), 33 deletions(-) diff --git a/libobs/obs-properties.c b/libobs/obs-properties.c index ff7ab514b..43c5f68ee 100644 --- a/libobs/obs-properties.c +++ b/libobs/obs-properties.c @@ -90,7 +90,6 @@ struct obs_property { }; struct obs_properties { - const char *locale; void *param; void (*destroy)(void *param); @@ -98,12 +97,11 @@ struct obs_properties { struct obs_property **last; }; -obs_properties_t obs_properties_create(const char *locale) +obs_properties_t obs_properties_create(void) { struct obs_properties *props; props = bzalloc(sizeof(struct obs_properties)); - props->locale = locale; - props->last = &props->first_property; + props->last = &props->first_property; return props; } @@ -125,10 +123,10 @@ void *obs_properties_get_param(obs_properties_t props) return props ? props->param : NULL; } -obs_properties_t obs_properties_create_param(const char *locale, - void *param, void (*destroy)(void *param)) +obs_properties_t obs_properties_create_param(void *param, + void (*destroy)(void *param)) { - struct obs_properties *props = obs_properties_create(locale); + struct obs_properties *props = obs_properties_create(); obs_properties_set_param(props, param, destroy); return props; } @@ -161,11 +159,6 @@ void obs_properties_destroy(obs_properties_t props) } } -const char *obs_properties_locale(obs_properties_t props) -{ - return props ? props->locale : NULL; -} - obs_property_t obs_properties_first(obs_properties_t props) { return (props != NULL) ? props->first_property : NULL; diff --git a/libobs/obs-properties.h b/libobs/obs-properties.h index ed956fc49..cd0656d9c 100644 --- a/libobs/obs-properties.h +++ b/libobs/obs-properties.h @@ -61,17 +61,15 @@ typedef struct obs_property *obs_property_t; /* ------------------------------------------------------------------------- */ -EXPORT obs_properties_t obs_properties_create(const char *locale); -EXPORT obs_properties_t obs_properties_create_param(const char *locale, - void *param, void (*destroy)(void *param)); +EXPORT obs_properties_t obs_properties_create(void); +EXPORT obs_properties_t obs_properties_create_param(void *param, + void (*destroy)(void *param)); EXPORT void obs_properties_destroy(obs_properties_t props); EXPORT void obs_properties_set_param(obs_properties_t props, void *param, void (*destroy)(void *param)); EXPORT void *obs_properties_get_param(obs_properties_t props); -EXPORT const char *obs_properties_locale(obs_properties_t props); - EXPORT obs_property_t obs_properties_first(obs_properties_t props); EXPORT obs_property_t obs_properties_get(obs_properties_t props, diff --git a/plugins/linux-pulseaudio/pulse-input.c b/plugins/linux-pulseaudio/pulse-input.c index 415612739..40109a680 100644 --- a/plugins/linux-pulseaudio/pulse-input.c +++ b/plugins/linux-pulseaudio/pulse-input.c @@ -283,7 +283,7 @@ skip: */ static obs_properties_t pulse_properties(const char *locale, bool input) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); obs_property_t devices = obs_properties_add_list(props, "device_id", "Device", OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); diff --git a/plugins/linux-v4l2/v4l2-input.c b/plugins/linux-v4l2/v4l2-input.c index fe14808e0..aeae8a99b 100644 --- a/plugins/linux-v4l2/v4l2-input.c +++ b/plugins/linux-v4l2/v4l2-input.c @@ -454,7 +454,7 @@ static bool resolution_selected(obs_properties_t props, obs_property_t p, static obs_properties_t v4l2_properties(const char *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); obs_property_t device_list = obs_properties_add_list(props, "device_id", "Device", OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); obs_property_t format_list = obs_properties_add_list(props, diff --git a/plugins/linux-xcomposite/xcompcap-main.cpp b/plugins/linux-xcomposite/xcompcap-main.cpp index bd9ec55f4..76b9c9263 100644 --- a/plugins/linux-xcomposite/xcompcap-main.cpp +++ b/plugins/linux-xcomposite/xcompcap-main.cpp @@ -48,7 +48,7 @@ void XCompcapMain::deinit() obs_properties_t XCompcapMain::properties(const char *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); obs_property_t wins = obs_properties_add_list(props, "capture_window", "Captured Window", OBS_COMBO_TYPE_LIST, diff --git a/plugins/linux-xshm/xshm-input.c b/plugins/linux-xshm/xshm-input.c index ea0d07f1b..2fce36614 100644 --- a/plugins/linux-xshm/xshm-input.c +++ b/plugins/linux-xshm/xshm-input.c @@ -156,7 +156,7 @@ static void xshm_defaults(obs_data_t defaults) */ static obs_properties_t xshm_properties(const char *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); int_fast32_t screen_max; Display *dpy = XOpenDisplay(NULL); diff --git a/plugins/mac-avcapture/av-capture.m b/plugins/mac-avcapture/av-capture.m index 44d829be9..183e7c6ea 100644 --- a/plugins/mac-avcapture/av-capture.m +++ b/plugins/mac-avcapture/av-capture.m @@ -571,7 +571,7 @@ static bool properties_device_changed(obs_properties_t props, obs_property_t p, static obs_properties_t av_capture_properties(char const *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); /* TODO: locale */ obs_property_t dev_list = obs_properties_add_list(props, "device", diff --git a/plugins/mac-capture/mac-audio.c b/plugins/mac-capture/mac-audio.c index 50e6fc318..0f1c95362 100644 --- a/plugins/mac-capture/mac-audio.c +++ b/plugins/mac-capture/mac-audio.c @@ -706,7 +706,7 @@ static void *coreaudio_create_output_capture(obs_data_t settings, static obs_properties_t coreaudio_properties(const char *locale, bool input) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); obs_property_t property; struct device_list devices; diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-aac.c b/plugins/obs-ffmpeg/obs-ffmpeg-aac.c index 1ae1f4026..bdd7b7fee 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-aac.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-aac.c @@ -240,7 +240,7 @@ static void aac_defaults(obs_data_t settings) static obs_properties_t aac_properties(const char *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); /* TODO: locale */ obs_properties_add_int(props, "bitrate", "Bitrate", 32, 320, 32); diff --git a/plugins/obs-libfdk/obs-libfdk.c b/plugins/obs-libfdk/obs-libfdk.c index 77369abc6..f5f86999c 100644 --- a/plugins/obs-libfdk/obs-libfdk.c +++ b/plugins/obs-libfdk/obs-libfdk.c @@ -67,7 +67,7 @@ static const char *libfdk_getname(const char *locale) static obs_properties_t libfdk_properties(const char *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); obs_properties_add_int(props, "bitrate", "Bitrate", 32, 256, 32); obs_properties_add_bool(props, "afterburner", "Enable AAC Afterburner"); diff --git a/plugins/obs-outputs/flv-output.c b/plugins/obs-outputs/flv-output.c index 0a7e13452..fe83699bd 100644 --- a/plugins/obs-outputs/flv-output.c +++ b/plugins/obs-outputs/flv-output.c @@ -191,7 +191,7 @@ static void flv_output_data(void *data, struct encoder_packet *packet) static obs_properties_t flv_output_properties(const char *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); /* TODO: locale */ obs_properties_add_text(props, "path", "File Path", OBS_TEXT_DEFAULT); diff --git a/plugins/obs-outputs/rtmp-stream.c b/plugins/obs-outputs/rtmp-stream.c index 154d3905b..8fbcd4d7d 100644 --- a/plugins/obs-outputs/rtmp-stream.c +++ b/plugins/obs-outputs/rtmp-stream.c @@ -569,7 +569,7 @@ static void rtmp_stream_defaults(obs_data_t defaults) static obs_properties_t rtmp_stream_properties(const char *locale) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); /* TODO: locale */ obs_properties_add_text(props, "path", "Stream URL", OBS_TEXT_DEFAULT); diff --git a/plugins/obs-x264/obs-x264.c b/plugins/obs-x264/obs-x264.c index 718bc7fdb..73e0c2131 100644 --- a/plugins/obs-x264/obs-x264.c +++ b/plugins/obs-x264/obs-x264.c @@ -97,7 +97,7 @@ static obs_properties_t obs_x264_props(const char *locale) { /* TODO: locale */ - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); obs_property_t list; obs_properties_add_int(props, "bitrate", "Bitrate", 50, 100000, 1); diff --git a/plugins/rtmp-services/rtmp-common.c b/plugins/rtmp-services/rtmp-common.c index de76fcab4..5e9a9780d 100644 --- a/plugins/rtmp-services/rtmp-common.c +++ b/plugins/rtmp-services/rtmp-common.c @@ -202,7 +202,7 @@ static bool service_selected(obs_properties_t props, obs_property_t p, static obs_properties_t rtmp_common_properties(const char *locale) { - obs_properties_t ppts = obs_properties_create(locale); + obs_properties_t ppts = obs_properties_create(); obs_property_t list; char *file; diff --git a/plugins/rtmp-services/rtmp-custom.c b/plugins/rtmp-services/rtmp-custom.c index bb09a10f8..4e0e51202 100644 --- a/plugins/rtmp-services/rtmp-custom.c +++ b/plugins/rtmp-services/rtmp-custom.c @@ -43,7 +43,7 @@ static void *rtmp_custom_create(obs_data_t settings, obs_service_t service) static obs_properties_t rtmp_custom_properties(const char *locale) { - obs_properties_t ppts = obs_properties_create(locale); + obs_properties_t ppts = obs_properties_create(); /* TODO: locale */ diff --git a/plugins/win-capture/window-capture.c b/plugins/win-capture/window-capture.c index 39e18ec69..e728ddec4 100644 --- a/plugins/win-capture/window-capture.c +++ b/plugins/win-capture/window-capture.c @@ -364,7 +364,7 @@ static void wc_defaults(obs_data_t defaults) static obs_properties_t wc_properties(const char *locale) { - obs_properties_t ppts = obs_properties_create(locale); + obs_properties_t ppts = obs_properties_create(); obs_property_t p; /* TODO: locale */ diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index 463b24fac..8c044379d 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -780,7 +780,7 @@ static bool DeviceIntervalChanged(obs_properties_t props, obs_property_t p, static obs_properties_t GetDShowProperties(const char *locale) { - obs_properties_t ppts = obs_properties_create(locale); + obs_properties_t ppts = obs_properties_create(); PropertiesData *data = new PropertiesData; obs_properties_set_param(ppts, data, PropertiesDataDestroy); diff --git a/plugins/win-wasapi/win-wasapi.cpp b/plugins/win-wasapi/win-wasapi.cpp index 335b6b82b..85d71b631 100644 --- a/plugins/win-wasapi/win-wasapi.cpp +++ b/plugins/win-wasapi/win-wasapi.cpp @@ -468,7 +468,7 @@ static void UpdateWASAPISource(void *obj, obs_data_t settings) static obs_properties_t GetWASAPIProperties(const char *locale, bool input) { - obs_properties_t props = obs_properties_create(locale); + obs_properties_t props = obs_properties_create(); vector devices; /* TODO: translate */ -- GitLab