commit
4512b9c4f8
|
@ -0,0 +1,2 @@
|
|||
ImageInput="Image"
|
||||
File="Image File"
|
|
@ -0,0 +1,3 @@
|
|||
PulseInput="Audio Input Capture (PulseAudio)"
|
||||
PulseOutput="Audio Output Capture (PulseAudio)"
|
||||
Device="Device"
|
|
@ -0,0 +1,5 @@
|
|||
V4L2Input="Video Capture Device (V4L2)"
|
||||
Device="Device"
|
||||
ImageFormat="Video Format"
|
||||
Resolution="Resolution"
|
||||
FrameRate="Frame Rate"
|
|
@ -0,0 +1,8 @@
|
|||
XCCapture="Xcomposite Capture"
|
||||
Window="Window"
|
||||
CropTop="Crop Top (pixels)"
|
||||
CropLeft="Crop Left (pixels)"
|
||||
CropRight="Crop Right (pixels)"
|
||||
CropBottom="Crop Bottom (pixels)"
|
||||
SwapRedBlue="Swap red and blue"
|
||||
LockX="Lock X server when capturing"
|
|
@ -0,0 +1,3 @@
|
|||
X11SharedMemoryScreenInput="X11 Shared Memory Screen Input"
|
||||
Screen="Screen"
|
||||
CaptureCursor="Capture Cursor"
|
|
@ -0,0 +1,4 @@
|
|||
AVCapture="Video Capture Device"
|
||||
Device="Device"
|
||||
UsePreset="Use Preset"
|
||||
Preset="Preset"
|
|
@ -0,0 +1,7 @@
|
|||
CoreAudio.InputCapture="Audio Input Capture"
|
||||
CoreAudio.OutputCapture="Audio Output Capture"
|
||||
CoreAudio.Device="Device"
|
||||
CoreAudio.Device.Default="Default"
|
||||
DisplayCapture="Display Capture"
|
||||
DisplayCapture.Display="Display"
|
||||
DisplayCapture.ShowCursor="Show Cursor"
|
|
@ -0,0 +1,3 @@
|
|||
FFmpegOutput="FFmpeg Output"
|
||||
FFmpegAAC="FFmpeg Default AAC Encoder"
|
||||
Bitrate="Bitrate"
|
|
@ -0,0 +1,3 @@
|
|||
LibFDK="libfdk AAC Encoder"
|
||||
Bitrate="Bitrate"
|
||||
Afterburner="Enable AAC Afterburner"
|
|
@ -0,0 +1,4 @@
|
|||
RTMPStream="RTMP Stream"
|
||||
RTMPStream.DropThreshold="Drop Threshold (milliseconds)"
|
||||
FLVOutput="FLV File Output"
|
||||
FLVOutput.FilePath="File Path"
|
|
@ -0,0 +1,7 @@
|
|||
Bitrate="Bitrate"
|
||||
BufferSize="Buffer Size"
|
||||
KeyframeIntervalSec="Keyframe Interval (seconds, 0=auto)"
|
||||
CPUPreset="CPU Usage Preset (encoder speed)"
|
||||
Profile="Profile"
|
||||
Tune="Tune"
|
||||
EncoderOptions="x264 Encoder Options (separated by space)"
|
|
@ -0,0 +1,5 @@
|
|||
StreamingServices="Streaming Services"
|
||||
CustomStreamingServer="Custom Streaming Server"
|
||||
Service="Service"
|
||||
Server="Server"
|
||||
StreamKey="Stream key"
|
|
@ -0,0 +1,9 @@
|
|||
MonitorCapture="Monitor Capture"
|
||||
WindowCapture="Window Capture"
|
||||
WindowCapture.Window="Window"
|
||||
WindowCapture.Priority="Window Match Priority"
|
||||
WindowCapture.Priority.Title="Window Title"
|
||||
WindowCapture.Priority.Class="Window Class"
|
||||
WindowCapture.Priority.Exe="Executable Name"
|
||||
CaptureCursor="Capture Cursor"
|
||||
Compatibility="Multi-adapter Compatibility"
|
|
@ -0,0 +1,13 @@
|
|||
VideoCaptureDevice="Video Capture Device"
|
||||
Device="Device"
|
||||
ConfigureVideo="Configure Video"
|
||||
ConfigureCrossbar="Configure Crossbar"
|
||||
ResFPSType="Resolution/FPS Type"
|
||||
ResFPSType.Custom="Custom"
|
||||
ResFPSType.DevPreferred="Device Preferred"
|
||||
FPS.Matching="Match Output FPS"
|
||||
FPS.Highest="Highest FPS"
|
||||
Resolution="Resolution"
|
||||
VideoFormat="Video Format"
|
||||
VideoFormat.Any="Any"
|
||||
VideoFormat.Unknown="Unknown (%1)"
|
|
@ -0,0 +1,5 @@
|
|||
AudioInput="Audio Input Capture"
|
||||
AudioOutput="Audio Output Capture"
|
||||
Device="Device"
|
||||
Default="Default"
|
||||
UseDeviceTiming="Use Device Timestamps"
|
|
@ -101,6 +101,54 @@ void free_module(struct obs_module *mod)
|
|||
bfree(mod->name);
|
||||
}
|
||||
|
||||
lookup_t obs_module_load_locale(const char *module, const char *default_locale,
|
||||
const char *locale)
|
||||
{
|
||||
struct dstr str = {0};
|
||||
lookup_t lookup = NULL;
|
||||
|
||||
if (!module || !default_locale || !locale) {
|
||||
blog(LOG_WARNING, "obs_module_load_locale: Invalid parameters");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dstr_copy(&str, module);
|
||||
dstr_cat(&str, "/locale/");
|
||||
dstr_cat(&str, default_locale);
|
||||
dstr_cat(&str, ".ini");
|
||||
|
||||
char *file = obs_find_plugin_file(str.array);
|
||||
if (file)
|
||||
lookup = text_lookup_create(file);
|
||||
|
||||
bfree(file);
|
||||
|
||||
if (!lookup) {
|
||||
blog(LOG_WARNING, "Failed to load '%s' text for module: '%s'",
|
||||
default_locale, module);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (astrcmpi(locale, default_locale) == 0)
|
||||
goto cleanup;
|
||||
|
||||
dstr_copy(&str, module);
|
||||
dstr_cat(&str, "/locale/");
|
||||
dstr_cat(&str, locale);
|
||||
dstr_cat(&str, ".ini");
|
||||
|
||||
file = obs_find_plugin_file(str.array);
|
||||
|
||||
if (!text_lookup_add(lookup, file))
|
||||
blog(LOG_WARNING, "Failed to load '%s' text for module: '%s'",
|
||||
locale, module);
|
||||
|
||||
bfree(file);
|
||||
cleanup:
|
||||
dstr_free(&str);
|
||||
return lookup;
|
||||
}
|
||||
|
||||
#define REGISTER_OBS_DEF(size_var, structure, dest, info) \
|
||||
do { \
|
||||
struct structure data = {0}; \
|
||||
|
|
|
@ -53,6 +53,32 @@ MODULE_EXPORT void obs_module_unload(void);
|
|||
/** Called to set the current locale data for the module. */
|
||||
MODULE_EXPORT void obs_module_set_locale(const char *locale);
|
||||
|
||||
/**
|
||||
* Optional: Use this macro in a module to use default locale handling. Use
|
||||
* the OBS_MODULE_FREE_DEFAULT_LOCALE macro in obs_module_unload to free the
|
||||
* locale data when the module unloads.
|
||||
*/
|
||||
#define OBS_MODULE_USE_DEFAULT_LOCALE(module_name, default_locale) \
|
||||
lookup_t obs_module_lookup = NULL; \
|
||||
const char *obs_module_text(const char *val) \
|
||||
{ \
|
||||
const char *out = val; \
|
||||
text_lookup_getstr(obs_module_lookup, val, &out); \
|
||||
return out; \
|
||||
} \
|
||||
void obs_module_set_locale(const char *locale) \
|
||||
{ \
|
||||
if (obs_module_lookup) text_lookup_destroy(obs_module_lookup); \
|
||||
obs_module_lookup = obs_module_load_locale(module_name, \
|
||||
default_locale, locale); \
|
||||
}
|
||||
|
||||
#define OBS_MODULE_FREE_DEFAULT_LOCALE() \
|
||||
text_lookup_destroy(obs_module_lookup)
|
||||
|
||||
/** Helper function for looking up locale if default locale handler was used */
|
||||
extern const char *obs_module_text(const char *lookup_string);
|
||||
|
||||
/**
|
||||
* Optional: Declares the author(s) of the module
|
||||
*
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "util/c99defs.h"
|
||||
#include "util/bmem.h"
|
||||
#include "util/text-lookup.h"
|
||||
#include "graphics/graphics.h"
|
||||
#include "graphics/vec2.h"
|
||||
#include "graphics/vec3.h"
|
||||
|
@ -250,6 +251,10 @@ EXPORT bool obs_get_audio_info(struct audio_output_info *ai);
|
|||
*/
|
||||
EXPORT int obs_load_module(const char *path);
|
||||
|
||||
/** Helper function for using default module locale */
|
||||
EXPORT lookup_t obs_module_load_locale(const char *module,
|
||||
const char *default_locale, const char *locale);
|
||||
|
||||
/**
|
||||
* Enumerates all available inputs source types.
|
||||
*
|
||||
|
|
|
@ -9,3 +9,4 @@ target_link_libraries(image-source
|
|||
libobs)
|
||||
|
||||
install_obs_plugin(image-source)
|
||||
install_obs_plugin_data(image-source ../../build/data/obs-plugins/image-source)
|
||||
|
|
|
@ -14,8 +14,7 @@ struct image_source {
|
|||
|
||||
static const char *image_source_get_name(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Image";
|
||||
return obs_module_text("Image");
|
||||
}
|
||||
|
||||
static void image_source_update(void *data, obs_data_t settings)
|
||||
|
@ -99,9 +98,9 @@ static obs_properties_t image_source_properties(void)
|
|||
{
|
||||
obs_properties_t props = obs_properties_create();
|
||||
|
||||
/* TODO: locale */
|
||||
obs_properties_add_path(props, "file", "Image file", OBS_PATH_FILE,
|
||||
image_filter, NULL);
|
||||
obs_properties_add_path(props,
|
||||
"file", obs_module_text("File"),
|
||||
OBS_PATH_FILE, image_filter, NULL);
|
||||
|
||||
return props;
|
||||
}
|
||||
|
@ -121,6 +120,7 @@ static struct obs_source_info image_source_info = {
|
|||
};
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("image-source", "en-US")
|
||||
|
||||
bool obs_module_load(uint32_t libobs_version)
|
||||
{
|
||||
|
@ -129,3 +129,8 @@ bool obs_module_load(uint32_t libobs_version)
|
|||
UNUSED_PARAMETER(libobs_version);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -23,3 +23,4 @@ target_link_libraries(linux-pulseaudio
|
|||
)
|
||||
|
||||
install_obs_plugin(linux-pulseaudio)
|
||||
install_obs_plugin_data(linux-pulseaudio ../../build/data/obs-plugins/linux-pulseaudio)
|
||||
|
|
|
@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("linux-pulseaudio", "en-US")
|
||||
|
||||
extern struct obs_source_info pulse_input_capture;
|
||||
extern struct obs_source_info pulse_output_capture;
|
||||
|
@ -28,3 +29,8 @@ bool obs_module_load(uint32_t obs_version)
|
|||
obs_register_source(&pulse_output_capture);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <util/platform.h>
|
||||
#include <util/bmem.h>
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
#include "pulse-wrapper.h"
|
||||
|
||||
|
@ -285,7 +285,8 @@ static obs_properties_t pulse_properties(bool input)
|
|||
{
|
||||
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);
|
||||
obs_module_text("Device"), OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
pulse_init();
|
||||
pa_source_info_cb_t cb = (input) ? pulse_input_info : pulse_output_info;
|
||||
|
@ -368,14 +369,12 @@ static void pulse_output_defaults(obs_data_t settings)
|
|||
*/
|
||||
static const char *pulse_input_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Pulse Audio Input Capture";
|
||||
return obs_module_text("PulseInput");
|
||||
}
|
||||
|
||||
static const char *pulse_output_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Pulse Audio Output Capture";
|
||||
return obs_module_text("PulseOutput");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,3 +13,4 @@ target_link_libraries(linux-v4l2
|
|||
)
|
||||
|
||||
install_obs_plugin(linux-v4l2)
|
||||
install_obs_plugin_data(linux-v4l2 ../../build/data/obs-plugins/linux-v4l2)
|
||||
|
|
|
@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("linux-v4l2", "en-US")
|
||||
|
||||
extern struct obs_source_info v4l2_input;
|
||||
|
||||
|
@ -26,3 +27,8 @@ bool obs_module_load(uint32_t obs_version)
|
|||
obs_register_source(&v4l2_input);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <util/threading.h>
|
||||
#include <util/bmem.h>
|
||||
#include <util/dstr.h>
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
#define V4L2_DATA(voidptr) struct v4l2_data *data = voidptr;
|
||||
|
||||
|
@ -268,8 +268,7 @@ exit:
|
|||
|
||||
static const char* v4l2_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "V4L2 Capture Input";
|
||||
return obs_module_text("V4L2Input");
|
||||
}
|
||||
|
||||
static void v4l2_defaults(obs_data_t settings)
|
||||
|
@ -465,16 +464,23 @@ static obs_properties_t v4l2_properties(void)
|
|||
{
|
||||
/* TODO: 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 device_list = obs_properties_add_list(props,
|
||||
"device_id", obs_module_text("Device"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_t format_list = obs_properties_add_list(props,
|
||||
"pixelformat", "Image Format", OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_INT);
|
||||
obs_property_t resolution_list = obs_properties_add_list(props,
|
||||
"resolution", "Resolution", OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_INT);
|
||||
obs_properties_add_list(props, "framerate", "Frame Rate",
|
||||
"pixelformat", obs_module_text("VideoFormat"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_property_t resolution_list = obs_properties_add_list(props,
|
||||
"resolution", obs_module_text("Resolution"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_properties_add_list(props,
|
||||
"framerate", obs_module_text("FrameRate"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
v4l2_device_list(device_list, NULL);
|
||||
obs_property_set_modified_callback(device_list, device_selected);
|
||||
obs_property_set_modified_callback(format_list, format_selected);
|
||||
|
|
|
@ -26,3 +26,4 @@ target_link_libraries(linux-xcomposite
|
|||
${X11_Xcomposite_LIB})
|
||||
|
||||
install_obs_plugin(linux-xcomposite)
|
||||
install_obs_plugin_data(linux-xcomposite ../../build/data/obs-plugins/linux-xcomposite)
|
||||
|
|
|
@ -54,11 +54,11 @@ void xcompcap_update(void *data, obs_data_t settings)
|
|||
}
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("linux-xcomposite", "en-US")
|
||||
|
||||
static const char* xcompcap_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Xcomposite capture";
|
||||
return obs_module_text("XCCapture");
|
||||
}
|
||||
|
||||
bool obs_module_load(uint32_t libobs_version)
|
||||
|
@ -96,5 +96,7 @@ void obs_module_unload()
|
|||
{
|
||||
XCompcapMain::deinit();
|
||||
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
|
||||
blog(LOG_INFO, "Xcomposite capture plugin unloaded");
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ obs_properties_t XCompcapMain::properties()
|
|||
obs_properties_t props = obs_properties_create();
|
||||
|
||||
obs_property_t wins = obs_properties_add_list(props, "capture_window",
|
||||
"Captured Window", OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
obs_module_text("Window"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
for (Window win: XCompcap::getTopLevelWindows()) {
|
||||
std::string wname = XCompcap::getWindowName(win);
|
||||
|
@ -66,18 +66,18 @@ obs_properties_t XCompcapMain::properties()
|
|||
desc.c_str());
|
||||
}
|
||||
|
||||
obs_properties_add_int(props, "cut_top", "Cut top pixels",
|
||||
obs_properties_add_int(props, "cut_top", obs_module_text("CropTop"),
|
||||
0, 4096, 1);
|
||||
obs_properties_add_int(props, "cut_left", "Cut left pixels",
|
||||
obs_properties_add_int(props, "cut_left", obs_module_text("CropLeft"),
|
||||
0, 4096, 1);
|
||||
obs_properties_add_int(props, "cut_right", "Cut right pixels",
|
||||
obs_properties_add_int(props, "cut_right", obs_module_text("CropRight"),
|
||||
0, 4096, 1);
|
||||
obs_properties_add_int(props, "cut_bot", "Cut bottom pixels",
|
||||
obs_properties_add_int(props, "cut_bot", obs_module_text("CropBottom"),
|
||||
0, 4096, 1);
|
||||
|
||||
obs_properties_add_bool(props, "swap_redblue", "Swap red and blue");
|
||||
obs_properties_add_bool(props, "lock_x", "Lock X server when "
|
||||
"capturing");
|
||||
obs_properties_add_bool(props, "swap_redblue",
|
||||
obs_module_text("SwapRedBlue"));
|
||||
obs_properties_add_bool(props, "lock_x", obs_module_text("LockX"));
|
||||
|
||||
return props;
|
||||
}
|
||||
|
|
|
@ -28,3 +28,4 @@ target_link_libraries(linux-xshm
|
|||
)
|
||||
|
||||
install_obs_plugin(linux-xshm)
|
||||
install_obs_plugin_data(linux-xshm ../../build/data/obs-plugins/linux-xshm)
|
||||
|
|
|
@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("linux-xshm", "en-US")
|
||||
|
||||
extern struct obs_source_info xshm_input;
|
||||
|
||||
|
@ -26,3 +27,8 @@ bool obs_module_load(uint32_t obs_version)
|
|||
obs_register_source(&xshm_input);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include "xcursor.h"
|
||||
#include "xhelpers.h"
|
||||
|
||||
|
@ -110,8 +110,7 @@ static int_fast32_t xshm_update_geometry(struct xshm_data *data,
|
|||
*/
|
||||
static const char* xshm_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "X11 Shared Memory Screen Input";
|
||||
return obs_module_text("X11SharedMemoryScreenInput");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,7 +155,6 @@ static void xshm_defaults(obs_data_t defaults)
|
|||
*/
|
||||
static obs_properties_t xshm_properties(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
obs_properties_t props = obs_properties_create();
|
||||
int_fast32_t screen_max;
|
||||
|
||||
|
@ -167,8 +165,10 @@ static obs_properties_t xshm_properties(void)
|
|||
screen_max = (screen_max) ? screen_max - 1 : 0;
|
||||
XCloseDisplay(dpy);
|
||||
|
||||
obs_properties_add_int(props, "screen", "Screen", 0, screen_max, 1);
|
||||
obs_properties_add_bool(props, "show_cursor", "Capture Cursor");
|
||||
obs_properties_add_int(props, "screen",
|
||||
obs_module_text("Screen"), 0, screen_max, 1);
|
||||
obs_properties_add_bool(props, "show_cursor",
|
||||
obs_module_text("CaptureCursor"));
|
||||
|
||||
return props;
|
||||
}
|
||||
|
|
|
@ -38,4 +38,4 @@ target_link_libraries(mac-avcapture
|
|||
${COCOA})
|
||||
|
||||
install_obs_plugin(mac-avcapture)
|
||||
|
||||
install_obs_plugin_data(mac-avcapture ../../build/data/obs-plugins/mac-avcapture)
|
||||
|
|
|
@ -5,11 +5,16 @@
|
|||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <media-io/video-io.h>
|
||||
|
||||
#import "AVCaptureInputPort+PreMavericksCompat.h"
|
||||
|
||||
#define TEXT_AVCAPTURE obs_module_text("AVCapture")
|
||||
#define TEXT_DEVICE obs_module_text("Device")
|
||||
#define TEXT_USE_PRESET obs_module_text("UsePreset")
|
||||
#define TEXT_PRESET obs_module_text("Preset")
|
||||
|
||||
#define MILLI_TIMESCALE 1000
|
||||
#define MICRO_TIMESCALE (MILLI_TIMESCALE * 1000)
|
||||
#define NANO_TIMESCALE (MICRO_TIMESCALE * 1000)
|
||||
|
@ -241,8 +246,7 @@ static inline bool update_frame(struct av_capture *capture,
|
|||
|
||||
static const char *av_capture_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Video Capture Device";
|
||||
return TEXT_AVCAPTURE;
|
||||
}
|
||||
|
||||
static void remove_device(struct av_capture *capture)
|
||||
|
@ -593,7 +597,6 @@ static NSString *preset_names(NSString *preset)
|
|||
|
||||
static void av_capture_defaults(obs_data_t settings)
|
||||
{
|
||||
//TODO: localize
|
||||
obs_data_set_default_string(settings, "device_name", "none");
|
||||
obs_data_set_default_bool(settings, "use_preset", true);
|
||||
obs_data_set_default_string(settings, "preset",
|
||||
|
@ -759,9 +762,8 @@ static obs_properties_t av_capture_properties(void)
|
|||
{
|
||||
obs_properties_t props = obs_properties_create();
|
||||
|
||||
/* TODO: locale */
|
||||
obs_property_t dev_list = obs_properties_add_list(props, "device",
|
||||
"Device", OBS_COMBO_TYPE_LIST,
|
||||
TEXT_DEVICE, OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
for (AVCaptureDevice *dev in [AVCaptureDevice
|
||||
devicesWithMediaType:AVMediaTypeVideo]) {
|
||||
|
@ -774,12 +776,13 @@ static obs_properties_t av_capture_properties(void)
|
|||
properties_device_changed);
|
||||
|
||||
obs_property_t use_preset = obs_properties_add_bool(props,
|
||||
"use_preset", "Use preset");
|
||||
"use_preset", TEXT_USE_PRESET);
|
||||
// TODO: implement manual configuration
|
||||
obs_property_set_enabled(use_preset, false);
|
||||
|
||||
obs_property_t preset_list = obs_properties_add_list(props, "preset",
|
||||
"Preset", OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
TEXT_PRESET, OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
for (NSString *preset in presets())
|
||||
obs_property_list_add_string(preset_list,
|
||||
preset_names(preset).UTF8String,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("mac-avcapture", "en-US")
|
||||
|
||||
extern struct obs_source_info av_capture_info;
|
||||
|
||||
|
@ -12,3 +13,8 @@ bool obs_module_load(uint32_t libobs_version)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <util/threading.h>
|
||||
#include <util/c99defs.h>
|
||||
|
||||
|
@ -26,6 +26,11 @@
|
|||
#define set_property AudioUnitSetProperty
|
||||
#define get_property AudioUnitGetProperty
|
||||
|
||||
#define TEXT_AUDIO_INPUT obs_module_text("CoreAudio.InputCapture");
|
||||
#define TEXT_AUDIO_OUTPUT obs_module_text("CoreAudio.OutputCapture");
|
||||
#define TEXT_DEVICE obs_module_text("CoreAudio.Device")
|
||||
#define TEXT_DEVICE_DEFAULT obs_module_text("CoreAudio.Device.Default")
|
||||
|
||||
struct coreaudio_data {
|
||||
char *device_name;
|
||||
char *device_uid;
|
||||
|
@ -630,14 +635,12 @@ static void coreaudio_uninit(struct coreaudio_data *ca)
|
|||
|
||||
static const char *coreaudio_input_getname(void)
|
||||
{
|
||||
/* TODO: Locale */
|
||||
return "CoreAudio Input Capture";
|
||||
return TEXT_AUDIO_INPUT;
|
||||
}
|
||||
|
||||
static const char *coreaudio_output_getname(void)
|
||||
{
|
||||
/* TODO: Locale */
|
||||
return "CoreAudio Output Capture";
|
||||
return TEXT_AUDIO_OUTPUT;
|
||||
}
|
||||
|
||||
static void coreaudio_destroy(void *data)
|
||||
|
@ -710,15 +713,14 @@ static obs_properties_t coreaudio_properties(bool input)
|
|||
|
||||
memset(&devices, 0, sizeof(struct device_list));
|
||||
|
||||
/* TODO: translate */
|
||||
property = obs_properties_add_list(props, "device_id", "Device",
|
||||
property = obs_properties_add_list(props, "device_id", TEXT_DEVICE,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
coreaudio_enum_devices(&devices, input);
|
||||
|
||||
/* TODO: translate */
|
||||
if (devices.items.num)
|
||||
obs_property_list_add_string(property, "Default", "default");
|
||||
obs_property_list_add_string(property, TEXT_DEVICE_DEFAULT,
|
||||
"default");
|
||||
|
||||
for (size_t i = 0; i < devices.items.num; i++) {
|
||||
struct device_item *item = devices.items.array+i;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdlib.h>
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <util/threading.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
@ -260,7 +260,7 @@ static void display_capture_video_render(void *data, effect_t effect)
|
|||
|
||||
static const char *display_capture_getname(void)
|
||||
{
|
||||
return "Display Capture";
|
||||
return obs_module_text("DisplayCapture");
|
||||
}
|
||||
|
||||
static uint32_t display_capture_getwidth(void *data)
|
||||
|
@ -304,7 +304,7 @@ static obs_properties_t display_capture_properties(void)
|
|||
obs_properties_t props = obs_properties_create();
|
||||
|
||||
obs_property_t list = obs_properties_add_list(props,
|
||||
"display", "Display",
|
||||
"display", obs_module_text("DisplayCapture.Display"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
for (unsigned i = 0; i < [NSScreen screens].count; i++) {
|
||||
|
@ -313,7 +313,8 @@ static obs_properties_t display_capture_properties(void)
|
|||
obs_property_list_add_int(list, buf, i);
|
||||
}
|
||||
|
||||
obs_properties_add_bool(props, "show_cursor", "Show Cursor");
|
||||
obs_properties_add_bool(props, "show_cursor",
|
||||
obs_module_text("DisplayCapture.ShowCursor"));
|
||||
|
||||
return props;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("mac-capture", "en-US")
|
||||
|
||||
extern struct obs_source_info coreaudio_input_capture_info;
|
||||
extern struct obs_source_info coreaudio_output_capture_info;
|
||||
|
@ -15,3 +16,8 @@ bool obs_module_load(uint32_t libobs_version)
|
|||
UNUSED_PARAMETER(libobs_version);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -46,4 +46,4 @@ target_link_libraries(obs-ffmpeg
|
|||
${LIBSWRESAMPLE_LIBRARIES})
|
||||
|
||||
install_obs_plugin(obs-ffmpeg)
|
||||
|
||||
install_obs_plugin_data(obs-ffmpeg ../../build/data/obs-plugins/obs-ffmpeg)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <util/base.h>
|
||||
#include <util/circlebuf.h>
|
||||
#include <util/darray.h>
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
|
@ -46,8 +46,7 @@ struct aac_encoder {
|
|||
|
||||
static const char *aac_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "FFmpeg Default AAC Encoder";
|
||||
return obs_module_text("FFmpegAAC");
|
||||
}
|
||||
|
||||
static void aac_warn(const char *func, const char *format, ...)
|
||||
|
@ -242,8 +241,8 @@ static obs_properties_t aac_properties(void)
|
|||
{
|
||||
obs_properties_t props = obs_properties_create();
|
||||
|
||||
/* TODO: locale */
|
||||
obs_properties_add_int(props, "bitrate", "Bitrate", 32, 320, 32);
|
||||
obs_properties_add_int(props, "bitrate",
|
||||
obs_module_text("Bitrate"), 32, 320, 32);
|
||||
return props;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
******************************************************************************/
|
||||
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <util/circlebuf.h>
|
||||
#include <util/threading.h>
|
||||
#include <util/dstr.h>
|
||||
|
@ -398,8 +398,7 @@ fail:
|
|||
|
||||
static const char *ffmpeg_output_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "FFmpeg file output";
|
||||
return obs_module_text("FFmpegOutput");
|
||||
}
|
||||
|
||||
static void ffmpeg_log_callback(void *param, int level, const char *format,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("obs-ffmpeg", "en-US")
|
||||
|
||||
extern struct obs_output_info ffmpeg_output;
|
||||
extern struct obs_encoder_info aac_encoder_info;
|
||||
|
@ -13,3 +14,8 @@ bool obs_module_load(uint32_t obs_version)
|
|||
UNUSED_PARAMETER(obs_version);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -19,3 +19,4 @@ target_link_libraries(obs-libfdk
|
|||
${LIBFDK_LIBRARIES})
|
||||
|
||||
install_obs_plugin(obs-libfdk)
|
||||
install_obs_plugin_data(obs-libfdk ../../build/data/obs-plugins/obs-libfdk)
|
||||
|
|
|
@ -61,16 +61,17 @@ typedef struct libfdk_encoder {
|
|||
|
||||
static const char *libfdk_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "libfdk aac encoder";
|
||||
return obs_module_text("LibFDK");
|
||||
}
|
||||
|
||||
static obs_properties_t libfdk_properties(void)
|
||||
{
|
||||
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");
|
||||
obs_properties_add_int(props, "bitrate",
|
||||
obs_module_text("Bitrate"), 32, 256, 32);
|
||||
obs_properties_add_bool(props, "afterburner",
|
||||
obs_module_text("Afterburner"));
|
||||
|
||||
return props;
|
||||
}
|
||||
|
@ -309,3 +310,9 @@ bool obs_module_load(uint32_t libobs_ver)
|
|||
}
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("obs-libfdk", "en-US")
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -55,4 +55,4 @@ target_link_libraries(obs-outputs
|
|||
${obs-outputs_PLATFORM_DEPS})
|
||||
|
||||
install_obs_plugin(obs-outputs)
|
||||
|
||||
install_obs_plugin_data(obs-outputs ../../build/data/obs-plugins/obs-outputs)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <obs-avc.h>
|
||||
#include <util/platform.h>
|
||||
#include <util/dstr.h>
|
||||
|
@ -34,8 +34,7 @@ struct flv_output {
|
|||
|
||||
static const char *flv_output_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "FLV File Output";
|
||||
return obs_module_text("FLVOutput");
|
||||
}
|
||||
|
||||
static void flv_output_stop(void *data);
|
||||
|
@ -193,8 +192,9 @@ static obs_properties_t flv_output_properties(void)
|
|||
{
|
||||
obs_properties_t props = obs_properties_create();
|
||||
|
||||
/* TODO: locale */
|
||||
obs_properties_add_text(props, "path", "File Path", OBS_TEXT_DEFAULT);
|
||||
obs_properties_add_text(props, "path",
|
||||
obs_module_text("FLVOutput.FilePath"),
|
||||
OBS_TEXT_DEFAULT);
|
||||
return props;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#endif
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("obs-outputs", "en-US")
|
||||
|
||||
extern struct obs_output_info rtmp_output_info;
|
||||
extern struct obs_output_info flv_output_info;
|
||||
|
@ -24,9 +25,11 @@ bool obs_module_load(uint32_t libobs_ver)
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
WSACleanup();
|
||||
}
|
||||
#endif
|
||||
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
******************************************************************************/
|
||||
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <obs-avc.h>
|
||||
#include <util/platform.h>
|
||||
#include <util/circlebuf.h>
|
||||
|
@ -71,8 +71,7 @@ struct rtmp_stream {
|
|||
|
||||
static const char *rtmp_stream_getname(void)
|
||||
{
|
||||
/* TODO: locale stuff */
|
||||
return "RTMP Stream";
|
||||
return obs_module_text("RTMPStream");
|
||||
}
|
||||
|
||||
static void log_rtmp(int level, const char *format, va_list args)
|
||||
|
@ -570,9 +569,9 @@ static obs_properties_t rtmp_stream_properties(void)
|
|||
{
|
||||
obs_properties_t props = obs_properties_create();
|
||||
|
||||
/* TODO: locale */
|
||||
obs_properties_add_int(props, OPT_DROP_THRESHOLD,
|
||||
"Drop threshold (milliseconds)", 200, 10000, 100);
|
||||
obs_module_text("RTMPStream.DropThreshold"),
|
||||
200, 10000, 100);
|
||||
return props;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,4 +15,4 @@ target_link_libraries(obs-x264
|
|||
${LIBX264_LIBRARIES})
|
||||
|
||||
install_obs_plugin(obs-x264)
|
||||
|
||||
install_obs_plugin_data(obs-x264 ../../build/data/obs-plugins/obs-x264)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("obs-x264", "en-US")
|
||||
|
||||
extern struct obs_encoder_info obs_x264_encoder;
|
||||
|
||||
|
@ -11,3 +12,8 @@ bool obs_module_load(uint32_t libobs_ver)
|
|||
UNUSED_PARAMETER(libobs_ver);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include <util/dstr.h>
|
||||
#include <util/darray.h>
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <x264.h>
|
||||
|
||||
struct obs_x264 {
|
||||
|
@ -40,7 +40,6 @@ struct obs_x264 {
|
|||
|
||||
static const char *obs_x264_getname(void)
|
||||
{
|
||||
/* TODO locale lookup */
|
||||
return "x264";
|
||||
}
|
||||
|
||||
|
@ -92,37 +91,39 @@ static inline void add_strings(obs_property_t list, const char *const *strings)
|
|||
}
|
||||
}
|
||||
|
||||
#define TEXT_BITRATE obs_module_text("Bitrate")
|
||||
#define TEXT_BUF_SIZE obs_module_text("BufferSize")
|
||||
#define TEXT_KEYINT_SEC obs_module_text("KeyframeIntervalSec")
|
||||
#define TEXT_PRESET obs_module_text("CPUPreset")
|
||||
#define TEXT_PROFILE obs_module_text("Profile")
|
||||
#define TEXT_TUNE obs_module_text("Tune")
|
||||
#define TEXT_X264_OPTS obs_module_text("EncoderOptions")
|
||||
|
||||
static obs_properties_t obs_x264_props(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
|
||||
obs_properties_t props = obs_properties_create();
|
||||
obs_property_t list;
|
||||
|
||||
obs_properties_add_int(props, "bitrate", "Bitrate", 50, 100000, 1);
|
||||
obs_properties_add_int(props, "buffer_size", "Buffer Size", 50, 100000,
|
||||
obs_properties_add_int(props, "bitrate", TEXT_BITRATE, 50, 100000, 1);
|
||||
obs_properties_add_int(props, "buffer_size", TEXT_BUF_SIZE, 50, 100000,
|
||||
1);
|
||||
obs_properties_add_int(props,
|
||||
"keyint_sec", "Keyframe interval (seconds, 0=auto)",
|
||||
0, 20, 1);
|
||||
obs_properties_add_int(props, "keyint_sec", TEXT_KEYINT_SEC, 0, 20, 1);
|
||||
|
||||
list = obs_properties_add_list(props,
|
||||
"preset", "CPU Usage Preset (encoder speed)",
|
||||
list = obs_properties_add_list(props, "preset", TEXT_PRESET,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
add_strings(list, x264_preset_names);
|
||||
|
||||
list = obs_properties_add_list(props, "profile", "Profile",
|
||||
list = obs_properties_add_list(props, "profile", TEXT_PROFILE,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
obs_property_list_add_string(list, "baseline", "baseline");
|
||||
obs_property_list_add_string(list, "main", "main");
|
||||
obs_property_list_add_string(list, "high", "high");
|
||||
|
||||
list = obs_properties_add_list(props, "tune", "Tune",
|
||||
list = obs_properties_add_list(props, "tune", TEXT_TUNE,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
add_strings(list, x264_tune_names);
|
||||
|
||||
obs_properties_add_text(props, "x264opts",
|
||||
"x264 encoder options (separated by space)",
|
||||
obs_properties_add_text(props, "x264opts", TEXT_X264_OPTS,
|
||||
OBS_TEXT_DEFAULT);
|
||||
|
||||
return props;
|
||||
|
|
|
@ -10,8 +10,7 @@ struct rtmp_common {
|
|||
|
||||
static const char *rtmp_common_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Streaming Services";
|
||||
return obs_module_text("StreamingServices");
|
||||
}
|
||||
|
||||
static void rtmp_common_update(void *data, obs_data_t settings)
|
||||
|
@ -204,9 +203,8 @@ static obs_properties_t rtmp_common_properties(void)
|
|||
obs_property_t list;
|
||||
char *file;
|
||||
|
||||
/* TODO: locale */
|
||||
|
||||
list = obs_properties_add_list(ppts, "service", "Service",
|
||||
list = obs_properties_add_list(ppts, "service",
|
||||
obs_module_text("Service"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
file = obs_find_plugin_file("rtmp-services/services.json");
|
||||
|
@ -217,10 +215,11 @@ static obs_properties_t rtmp_common_properties(void)
|
|||
bfree(file);
|
||||
}
|
||||
|
||||
obs_properties_add_list(ppts, "server", "Server",
|
||||
obs_properties_add_list(ppts, "server", obs_module_text("Server"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_properties_add_text(ppts, "key", "Stream Key", OBS_TEXT_PASSWORD);
|
||||
obs_properties_add_text(ppts, "key", obs_module_text("StreamKey"),
|
||||
OBS_TEXT_PASSWORD);
|
||||
return ppts;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@ struct rtmp_custom {
|
|||
|
||||
static const char *rtmp_custom_name(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Custom Streaming Server";
|
||||
return obs_module_text("CustomStreamingServer");
|
||||
}
|
||||
|
||||
static void rtmp_custom_update(void *data, obs_data_t settings)
|
||||
|
@ -43,10 +42,10 @@ static obs_properties_t rtmp_custom_properties(void)
|
|||
{
|
||||
obs_properties_t ppts = obs_properties_create();
|
||||
|
||||
/* TODO: locale */
|
||||
|
||||
obs_properties_add_text(ppts, "server", "URL", OBS_TEXT_DEFAULT);
|
||||
obs_properties_add_text(ppts, "key", "Stream Key", OBS_TEXT_PASSWORD);
|
||||
|
||||
obs_properties_add_text(ppts, "key", obs_module_text("StreamKey"),
|
||||
OBS_TEXT_PASSWORD);
|
||||
return ppts;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
#include <util/text-lookup.h>
|
||||
#include <util/dstr.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("rtmp-services", "en-US")
|
||||
|
||||
extern struct obs_service_info rtmp_common_service;
|
||||
extern struct obs_service_info rtmp_custom_service;
|
||||
|
||||
|
@ -11,3 +16,8 @@ bool obs_module_load(uint32_t libobs_ver)
|
|||
UNUSED_PARAMETER(libobs_ver);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
#define NUM_TEXTURES 2
|
||||
|
||||
|
|
|
@ -83,8 +83,7 @@ static inline void update_settings(struct monitor_capture *capture,
|
|||
|
||||
static const char *monitor_capture_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Monitor Capture";
|
||||
return obs_module_text("MonitorCapture");
|
||||
}
|
||||
|
||||
static void monitor_capture_destroy(void *data)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("win-capture", "en-US")
|
||||
|
||||
extern struct obs_source_info monitor_capture_info;
|
||||
extern struct obs_source_info window_capture_info;
|
||||
|
@ -13,3 +14,8 @@ bool obs_module_load(uint32_t libobs_ver)
|
|||
UNUSED_PARAMETER(libobs_ver);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,15 @@
|
|||
#include "dc-capture.h"
|
||||
#include <psapi.h>
|
||||
|
||||
#define TEXT_WINDOW_CAPTURE obs_module_text("WindowCapture")
|
||||
#define TEXT_WINDOW obs_module_text("WindowCapture.Window")
|
||||
#define TEXT_MATCH_PRIORITY obs_module_text("WindowCapture.Priority")
|
||||
#define TEXT_MATCH_TITLE obs_module_text("WindowCapture.Priority.Title")
|
||||
#define TEXT_MATCH_CLASS obs_module_text("WindowCapture.Priority.Class")
|
||||
#define TEXT_MATCH_EXE obs_module_text("WindowCapture.Priority.Exe")
|
||||
#define TEXT_CAPTURE_CURSOR obs_module_text("CaptureCursor")
|
||||
#define TEXT_COMPATIBILITY obs_module_text("Compatibility")
|
||||
|
||||
enum window_priority {
|
||||
WINDOW_PRIORITY_CLASS,
|
||||
WINDOW_PRIORITY_TITLE,
|
||||
|
@ -296,8 +305,7 @@ static HWND find_window(struct window_capture *wc)
|
|||
|
||||
static const char *wc_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Window capture";
|
||||
return TEXT_WINDOW_CAPTURE;
|
||||
}
|
||||
|
||||
static void *wc_create(obs_data_t settings, obs_source_t source)
|
||||
|
@ -366,21 +374,19 @@ static obs_properties_t wc_properties(void)
|
|||
obs_properties_t ppts = obs_properties_create();
|
||||
obs_property_t p;
|
||||
|
||||
/* TODO: locale */
|
||||
p = obs_properties_add_list(ppts, "window", "Window",
|
||||
p = obs_properties_add_list(ppts, "window", TEXT_WINDOW,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
fill_window_list(p);
|
||||
|
||||
p = obs_properties_add_list(ppts, "priority", "Window Match Priority",
|
||||
p = obs_properties_add_list(ppts, "priority", TEXT_MATCH_PRIORITY,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
obs_property_list_add_int(p, "Window Title", WINDOW_PRIORITY_TITLE);
|
||||
obs_property_list_add_int(p, "Window Class", WINDOW_PRIORITY_CLASS);
|
||||
obs_property_list_add_int(p, "Executable", WINDOW_PRIORITY_EXE);
|
||||
obs_property_list_add_int(p, TEXT_MATCH_TITLE, WINDOW_PRIORITY_TITLE);
|
||||
obs_property_list_add_int(p, TEXT_MATCH_CLASS, WINDOW_PRIORITY_CLASS);
|
||||
obs_property_list_add_int(p, TEXT_MATCH_EXE, WINDOW_PRIORITY_EXE);
|
||||
|
||||
obs_properties_add_bool(ppts, "cursor", "Capture Cursor");
|
||||
obs_properties_add_bool(ppts, "cursor", TEXT_CAPTURE_CURSOR);
|
||||
|
||||
obs_properties_add_bool(ppts, "compatibility",
|
||||
"Laptop Compatibility Mode");
|
||||
obs_properties_add_bool(ppts, "compatibility", TEXT_COMPATIBILITY);
|
||||
|
||||
return ppts;
|
||||
}
|
||||
|
|
|
@ -32,3 +32,4 @@ target_link_libraries(win-dshow
|
|||
strmiids.lib)
|
||||
|
||||
install_obs_plugin(win-dshow)
|
||||
install_obs_plugin_data(win-dshow ../../build/data/obs-plugins/win-dshow)
|
||||
|
|
|
@ -34,6 +34,19 @@ using namespace DShow;
|
|||
#define LAST_VIDEO_DEV_ID "last_video_device_id"
|
||||
#define LAST_RESOLUTION "last_resolution"
|
||||
|
||||
#define TEXT_INPUT_NAME obs_module_text("VideoCaptureDevice")
|
||||
#define TEXT_DEVICE obs_module_text("Device")
|
||||
#define TEXT_CONFIG_VIDEO obs_module_text("ConfigureVideo")
|
||||
#define TEXT_CONFIG_XBAR obs_module_text("ConfigureCrossbar")
|
||||
#define TEXT_RES_FPS_TYPE obs_module_text("ResFPSType")
|
||||
#define TEXT_CUSTOM_RES obs_module_text("ResFPSType.Custom")
|
||||
#define TEXT_PREFERRED_RES obs_module_text("ResFPSType.DevPreferred")
|
||||
#define TEXT_FPS_MATCHING obs_module_text("FPS.Matching")
|
||||
#define TEXT_FPS_HIGHEST obs_module_text("FPS.Highest")
|
||||
#define TEXT_RESOLUTION obs_module_text("Resolution")
|
||||
#define TEXT_VIDEO_FORMAT obs_module_text("VideoFormat")
|
||||
#define TEXT_FORMAT_UNKNOWN obs_module_text("VideoFormat.Unknown")
|
||||
|
||||
enum ResType {
|
||||
ResType_Preferred,
|
||||
ResType_Custom
|
||||
|
@ -454,8 +467,7 @@ void DShowInput::Update(obs_data_t settings)
|
|||
|
||||
static const char *GetDShowInputName(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "Video Capture Device";
|
||||
return TEXT_INPUT_NAME;
|
||||
}
|
||||
|
||||
static void *CreateDShowInput(obs_data_t settings, obs_source_t source)
|
||||
|
@ -630,7 +642,7 @@ struct VideoFormatName {
|
|||
|
||||
static const VideoFormatName videoFormatNames[] = {
|
||||
/* autoselect format*/
|
||||
{VideoFormat::Any, "Any"},
|
||||
{VideoFormat::Any, "VideoFormat.Any"},
|
||||
|
||||
/* raw formats */
|
||||
{VideoFormat::ARGB, "ARGB"},
|
||||
|
@ -839,12 +851,12 @@ static DStr GetFPSName(long long interval)
|
|||
DStr name;
|
||||
|
||||
if (interval == FPS_MATCHING) {
|
||||
dstr_cat(name, "Match OBS FPS");
|
||||
dstr_cat(name, TEXT_FPS_MATCHING);
|
||||
return name;
|
||||
}
|
||||
|
||||
if (interval == FPS_HIGHEST) {
|
||||
dstr_cat(name, "Highest");
|
||||
dstr_cat(name, TEXT_FPS_HIGHEST);
|
||||
return name;
|
||||
}
|
||||
|
||||
|
@ -867,8 +879,8 @@ static void UpdateFPS(VideoDevice &device, VideoFormat format,
|
|||
|
||||
obs_property_list_clear(list);
|
||||
|
||||
obs_property_list_add_int(list, "Match OBS FPS", FPS_MATCHING);
|
||||
obs_property_list_add_int(list, "Highest", FPS_HIGHEST);
|
||||
obs_property_list_add_int(list, TEXT_FPS_MATCHING, FPS_MATCHING);
|
||||
obs_property_list_add_int(list, TEXT_FPS_HIGHEST, FPS_HIGHEST);
|
||||
|
||||
bool interval_added = interval == FPS_HIGHEST ||
|
||||
interval == FPS_MATCHING;
|
||||
|
@ -905,12 +917,13 @@ static DStr GetVideoFormatName(VideoFormat format)
|
|||
DStr name;
|
||||
for (const VideoFormatName &format_ : videoFormatNames) {
|
||||
if (format_.format == format) {
|
||||
dstr_cat(name, format_.name);
|
||||
dstr_cat(name, obs_module_text(format_.name));
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
dstr_catf(name, "Unknown (%lld)", (long long)format);
|
||||
dstr_cat(name, TEXT_FORMAT_UNKNOWN);
|
||||
dstr_replace(name, "%1", std::to_string((long long)format).c_str());
|
||||
return name;
|
||||
}
|
||||
|
||||
|
@ -942,7 +955,8 @@ static void UpdateVideoFormats(VideoDevice &device, VideoFormat format_,
|
|||
if (format.format == format_)
|
||||
format_added = true;
|
||||
|
||||
size_t idx = obs_property_list_add_int(list, format.name,
|
||||
size_t idx = obs_property_list_add_int(list,
|
||||
obs_module_text(format.name),
|
||||
(long long)format.format);
|
||||
obs_property_list_item_disable(list, idx, !available);
|
||||
}
|
||||
|
@ -1110,10 +1124,9 @@ static obs_properties_t GetDShowProperties(void)
|
|||
|
||||
obs_properties_set_param(ppts, data, PropertiesDataDestroy);
|
||||
|
||||
/* TODO: locale */
|
||||
obs_property_t p = obs_properties_add_list(ppts,
|
||||
VIDEO_DEVICE_ID, "Device",
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
VIDEO_DEVICE_ID, TEXT_DEVICE,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_set_modified_callback(p, DeviceSelectionChanged);
|
||||
|
||||
|
@ -1121,22 +1134,22 @@ static obs_properties_t GetDShowProperties(void)
|
|||
for (const VideoDevice &device : data->devices)
|
||||
AddDevice(p, device);
|
||||
|
||||
obs_properties_add_button(ppts, "video_config", "Configure Video",
|
||||
obs_properties_add_button(ppts, "video_config", TEXT_CONFIG_VIDEO,
|
||||
VideoConfigClicked);
|
||||
obs_properties_add_button(ppts, "xbar_config", "Configure Crossbar",
|
||||
obs_properties_add_button(ppts, "xbar_config", TEXT_CONFIG_XBAR,
|
||||
CrossbarConfigClicked);
|
||||
|
||||
/* ------------------------------------- */
|
||||
|
||||
p = obs_properties_add_list(ppts, RES_TYPE, "Resolution/FPS Type",
|
||||
p = obs_properties_add_list(ppts, RES_TYPE, TEXT_RES_FPS_TYPE,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_property_set_modified_callback(p, ResTypeChanged);
|
||||
|
||||
obs_property_list_add_int(p, "Device Preferred", ResType_Preferred);
|
||||
obs_property_list_add_int(p, "Custom", ResType_Custom);
|
||||
obs_property_list_add_int(p, TEXT_PREFERRED_RES, ResType_Preferred);
|
||||
obs_property_list_add_int(p, TEXT_CUSTOM_RES, ResType_Custom);
|
||||
|
||||
p = obs_properties_add_list(ppts, RESOLUTION, "Resolution",
|
||||
p = obs_properties_add_list(ppts, RESOLUTION, TEXT_RESOLUTION,
|
||||
OBS_COMBO_TYPE_EDITABLE, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_set_modified_callback(p, DeviceResolutionChanged);
|
||||
|
@ -1146,7 +1159,7 @@ static obs_properties_t GetDShowProperties(void)
|
|||
|
||||
obs_property_set_modified_callback(p, DeviceIntervalChanged);
|
||||
|
||||
p = obs_properties_add_list(ppts, VIDEO_FORMAT, "Video Format",
|
||||
p = obs_properties_add_list(ppts, VIDEO_FORMAT, TEXT_VIDEO_FORMAT,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_property_set_modified_callback(p, VideoFormatChanged);
|
||||
|
@ -1155,6 +1168,7 @@ static obs_properties_t GetDShowProperties(void)
|
|||
}
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("win-dshow", "en-US")
|
||||
|
||||
void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param)
|
||||
{
|
||||
|
@ -1198,3 +1212,8 @@ bool obs_module_load(uint32_t libobs_ver)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -15,3 +15,4 @@ target_link_libraries(win-wasapi
|
|||
libobs)
|
||||
|
||||
install_obs_plugin(win-wasapi)
|
||||
install_obs_plugin_data(win-wasapi ../../build/data/obs-plugins/win-wasapi)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("win-wasapi", "en-US")
|
||||
|
||||
void RegisterWASAPIInput();
|
||||
void RegisterWASAPIOutput();
|
||||
|
@ -13,3 +14,8 @@ bool obs_module_load(uint32_t libobs_ver)
|
|||
RegisterWASAPIOutput();
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "enum-wasapi.hpp"
|
||||
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
#include <util/platform.h>
|
||||
#include <util/windows/HRError.hpp>
|
||||
#include <util/windows/ComPtr.hpp>
|
||||
|
@ -421,14 +421,12 @@ DWORD WINAPI WASAPISource::CaptureThread(LPVOID param)
|
|||
|
||||
static const char *GetWASAPIInputName(void)
|
||||
{
|
||||
/* TODO: translate */
|
||||
return "Audio Input Capture (WASAPI)";
|
||||
return obs_module_text("AudioInput");
|
||||
}
|
||||
|
||||
static const char *GetWASAPIOutputName(void)
|
||||
{
|
||||
/* TODO: translate */
|
||||
return "Audio Output Capture (WASAPI)";
|
||||
return obs_module_text("AudioOutput");
|
||||
}
|
||||
|
||||
static void GetWASAPIDefaults(obs_data_t settings)
|
||||
|
@ -476,13 +474,14 @@ static obs_properties_t GetWASAPIProperties(bool input)
|
|||
|
||||
/* TODO: translate */
|
||||
obs_property_t device_prop = obs_properties_add_list(props,
|
||||
OPT_DEVICE_ID, "Device",
|
||||
OPT_DEVICE_ID, obs_module_text("Device"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
GetWASAPIAudioDevices(devices, input);
|
||||
|
||||
if (devices.size())
|
||||
obs_property_list_add_string(device_prop, "Default", "default");
|
||||
obs_property_list_add_string(device_prop,
|
||||
obs_module_text("Default"), "default");
|
||||
|
||||
for (size_t i = 0; i < devices.size(); i++) {
|
||||
AudioDeviceInfo &device = devices[i];
|
||||
|
@ -492,7 +491,7 @@ static obs_properties_t GetWASAPIProperties(bool input)
|
|||
|
||||
obs_property_t prop;
|
||||
prop = obs_properties_add_bool(props, OPT_USE_DEVICE_TIMING,
|
||||
"Use Device Timing");
|
||||
obs_module_text("UseDeviceTiming"));
|
||||
|
||||
return props;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue