clang-format: Apply formatting
Code submissions have continually suffered from formatting inconsistencies that constantly have to be addressed. Using clang-format simplifies this by making code formatting more consistent, and allows automation of the code formatting so that maintainers can focus more on the code itself instead of code formatting.
This commit is contained in:
@@ -53,10 +53,12 @@ LIBVLC_MEDIA_LIST_PLAYER_RELEASE libvlc_media_list_player_release_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_PLAY libvlc_media_list_player_play_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_PAUSE libvlc_media_list_player_pause_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_STOP libvlc_media_list_player_stop_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_PLAYER libvlc_media_list_player_set_media_player_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_PLAYER
|
||||
libvlc_media_list_player_set_media_player_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_LIST libvlc_media_list_player_set_media_list_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_EVENT_MANAGER libvlc_media_list_player_event_manager_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_SET_PLAYBACK_MODE libvlc_media_list_player_set_playback_mode_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_SET_PLAYBACK_MODE
|
||||
libvlc_media_list_player_set_playback_mode_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_NEXT libvlc_media_list_player_next_;
|
||||
LIBVLC_MEDIA_LIST_PLAYER_PREVIOUS libvlc_media_list_player_previous_;
|
||||
|
||||
@@ -70,14 +72,16 @@ uint64_t time_start = 0;
|
||||
|
||||
static bool load_vlc_funcs(void)
|
||||
{
|
||||
#define LOAD_VLC_FUNC(func) \
|
||||
do { \
|
||||
func ## _ = os_dlsym(libvlc_module, #func); \
|
||||
if (!func ## _) { \
|
||||
blog(LOG_WARNING, "Could not func VLC function %s, " \
|
||||
"VLC loading failed", #func); \
|
||||
return false; \
|
||||
} \
|
||||
#define LOAD_VLC_FUNC(func) \
|
||||
do { \
|
||||
func##_ = os_dlsym(libvlc_module, #func); \
|
||||
if (!func##_) { \
|
||||
blog(LOG_WARNING, \
|
||||
"Could not func VLC function %s, " \
|
||||
"VLC loading failed", \
|
||||
#func); \
|
||||
return false; \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
/* libvlc core */
|
||||
@@ -133,23 +137,22 @@ static bool load_vlc_funcs(void)
|
||||
static bool load_libvlc_module(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
char *path_utf8 = NULL;
|
||||
char *path_utf8 = NULL;
|
||||
wchar_t path[1024];
|
||||
LSTATUS status;
|
||||
DWORD size;
|
||||
HKEY key;
|
||||
DWORD size;
|
||||
HKEY key;
|
||||
|
||||
memset(path, 0, 1024 * sizeof(wchar_t));
|
||||
|
||||
status = RegOpenKeyW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\VideoLAN\\VLC",
|
||||
&key);
|
||||
status = RegOpenKeyW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\VideoLAN\\VLC",
|
||||
&key);
|
||||
if (status != ERROR_SUCCESS)
|
||||
return false;
|
||||
|
||||
size = 1024;
|
||||
status = RegQueryValueExW(key, L"InstallDir", NULL, NULL,
|
||||
(LPBYTE)path, &size);
|
||||
status = RegQueryValueExW(key, L"InstallDir", NULL, NULL, (LPBYTE)path,
|
||||
&size);
|
||||
if (status == ERROR_SUCCESS) {
|
||||
wcscat(path, L"\\libvlc.dll");
|
||||
os_wcs_to_utf8_ptr(path, 0, &path_utf8);
|
||||
@@ -201,7 +204,7 @@ bool obs_module_load(void)
|
||||
{
|
||||
if (!load_libvlc_module()) {
|
||||
blog(LOG_INFO, "Couldn't find VLC installation, VLC video "
|
||||
"source disabled");
|
||||
"source disabled");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -22,99 +22,81 @@ typedef libvlc_instance_t *(*LIBVLC_NEW)(int argc, const char *const *argv);
|
||||
typedef void (*LIBVLC_RELEASE)(libvlc_instance_t *p_instance);
|
||||
typedef int64_t (*LIBVLC_CLOCK)(void);
|
||||
typedef int (*LIBVLC_EVENT_ATTACH)(libvlc_event_manager_t *p_event_manager,
|
||||
libvlc_event_type_t i_event_type,
|
||||
libvlc_callback_t f_callback,
|
||||
void *user_data);
|
||||
libvlc_event_type_t i_event_type,
|
||||
libvlc_callback_t f_callback,
|
||||
void *user_data);
|
||||
|
||||
/* libvlc media */
|
||||
typedef libvlc_media_t *(*LIBVLC_MEDIA_NEW_PATH)(
|
||||
libvlc_instance_t *p_instance, const char *path);
|
||||
typedef libvlc_media_t *(*LIBVLC_MEDIA_NEW_PATH)(libvlc_instance_t *p_instance,
|
||||
const char *path);
|
||||
typedef libvlc_media_t *(*LIBVLC_MEDIA_NEW_LOCATION)(
|
||||
libvlc_instance_t *p_instance, const char *location);
|
||||
typedef void (*LIBVLC_MEDIA_ADD_OPTION)(libvlc_media_t *p_md, const char *options);
|
||||
libvlc_instance_t *p_instance, const char *location);
|
||||
typedef void (*LIBVLC_MEDIA_ADD_OPTION)(libvlc_media_t *p_md,
|
||||
const char *options);
|
||||
typedef void (*LIBVLC_MEDIA_RETAIN)(libvlc_media_t *p_md);
|
||||
typedef void (*LIBVLC_MEDIA_RELEASE)(libvlc_media_t *p_md);
|
||||
|
||||
/* libvlc media player */
|
||||
typedef libvlc_media_player_t *(*LIBVLC_MEDIA_PLAYER_NEW)(
|
||||
libvlc_instance_t *p_libvlc);
|
||||
libvlc_instance_t *p_libvlc);
|
||||
typedef libvlc_media_player_t *(*LIBVLC_MEDIA_PLAYER_NEW_FROM_MEDIA)(
|
||||
libvlc_media_t *p_md);
|
||||
typedef void (*LIBVLC_MEDIA_PLAYER_RELEASE)(
|
||||
libvlc_media_player_t *p_mi);
|
||||
typedef void (*LIBVLC_VIDEO_SET_CALLBACKS)(
|
||||
libvlc_media_player_t *mp,
|
||||
libvlc_video_lock_cb lock,
|
||||
libvlc_video_unlock_cb unlock,
|
||||
libvlc_video_display_cb display,
|
||||
void *opaque);
|
||||
libvlc_media_t *p_md);
|
||||
typedef void (*LIBVLC_MEDIA_PLAYER_RELEASE)(libvlc_media_player_t *p_mi);
|
||||
typedef void (*LIBVLC_VIDEO_SET_CALLBACKS)(libvlc_media_player_t *mp,
|
||||
libvlc_video_lock_cb lock,
|
||||
libvlc_video_unlock_cb unlock,
|
||||
libvlc_video_display_cb display,
|
||||
void *opaque);
|
||||
typedef void (*LIBVLC_VIDEO_SET_FORMAT_CALLBACKS)(
|
||||
libvlc_media_player_t *mp,
|
||||
libvlc_video_format_cb setup,
|
||||
libvlc_video_cleanup_cb cleanup);
|
||||
libvlc_media_player_t *mp, libvlc_video_format_cb setup,
|
||||
libvlc_video_cleanup_cb cleanup);
|
||||
typedef void (*LIBVLC_AUDIO_SET_CALLBACKS)(
|
||||
libvlc_media_player_t *mp,
|
||||
libvlc_audio_play_cb play,
|
||||
libvlc_audio_pause_cb pause,
|
||||
libvlc_audio_resume_cb resume,
|
||||
libvlc_audio_flush_cb flush,
|
||||
libvlc_audio_drain_cb drain,
|
||||
void *opaque);
|
||||
libvlc_media_player_t *mp, libvlc_audio_play_cb play,
|
||||
libvlc_audio_pause_cb pause, libvlc_audio_resume_cb resume,
|
||||
libvlc_audio_flush_cb flush, libvlc_audio_drain_cb drain, void *opaque);
|
||||
typedef void (*LIBVLC_AUDIO_SET_FORMAT_CALLBACKS)(
|
||||
libvlc_media_player_t *mp,
|
||||
libvlc_audio_setup_cb setup,
|
||||
libvlc_audio_cleanup_cb cleanup);
|
||||
typedef int (*LIBVLC_MEDIA_PLAYER_PLAY)(
|
||||
libvlc_media_player_t *p_mi);
|
||||
typedef void (*LIBVLC_MEDIA_PLAYER_STOP)(
|
||||
libvlc_media_player_t *p_mi);
|
||||
libvlc_media_player_t *mp, libvlc_audio_setup_cb setup,
|
||||
libvlc_audio_cleanup_cb cleanup);
|
||||
typedef int (*LIBVLC_MEDIA_PLAYER_PLAY)(libvlc_media_player_t *p_mi);
|
||||
typedef void (*LIBVLC_MEDIA_PLAYER_STOP)(libvlc_media_player_t *p_mi);
|
||||
typedef libvlc_time_t (*LIBVLC_MEDIA_PLAYER_GET_TIME)(
|
||||
libvlc_media_player_t *p_mi);
|
||||
typedef int (*LIBVLC_VIDEO_GET_SIZE)(
|
||||
libvlc_media_player_t *p_mi,
|
||||
unsigned num,
|
||||
unsigned *px,
|
||||
unsigned *py);
|
||||
libvlc_media_player_t *p_mi);
|
||||
typedef int (*LIBVLC_VIDEO_GET_SIZE)(libvlc_media_player_t *p_mi, unsigned num,
|
||||
unsigned *px, unsigned *py);
|
||||
typedef libvlc_event_manager_t *(*LIBVLC_MEDIA_PLAYER_EVENT_MANAGER)(
|
||||
libvlc_media_player_t *p_mp);
|
||||
libvlc_media_player_t *p_mp);
|
||||
|
||||
/* libvlc media list */
|
||||
typedef libvlc_media_list_t *(*LIBVLC_MEDIA_LIST_NEW)(
|
||||
libvlc_instance_t *p_instance);
|
||||
libvlc_instance_t *p_instance);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_RELEASE)(libvlc_media_list_t *p_ml);
|
||||
typedef int (*LIBVLC_MEDIA_LIST_ADD_MEDIA)(libvlc_media_list_t *p_ml,
|
||||
libvlc_media_t *p_md);
|
||||
libvlc_media_t *p_md);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_LOCK)(libvlc_media_list_t *p_ml);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_UNLOCK)(libvlc_media_list_t *p_ml);
|
||||
typedef libvlc_event_manager_t *(*LIBVLC_MEDIA_LIST_EVENT_MANAGER)(
|
||||
libvlc_media_list_t *p_ml);
|
||||
libvlc_media_list_t *p_ml);
|
||||
|
||||
/* libvlc media list player */
|
||||
typedef libvlc_media_list_player_t *(*LIBVLC_MEDIA_LIST_PLAYER_NEW)(
|
||||
libvlc_instance_t * p_instance);
|
||||
libvlc_instance_t *p_instance);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_RELEASE)(
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_PLAY)(
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_PLAY)(libvlc_media_list_player_t *p_mlp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_PAUSE)(
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_STOP)(
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_STOP)(libvlc_media_list_player_t *p_mlp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_PLAYER)(
|
||||
libvlc_media_list_player_t *p_mlp,
|
||||
libvlc_media_player_t *p_mp);
|
||||
libvlc_media_list_player_t *p_mlp, libvlc_media_player_t *p_mp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_LIST)(
|
||||
libvlc_media_list_player_t *p_mlp,
|
||||
libvlc_media_list_t *p_mlist);
|
||||
libvlc_media_list_player_t *p_mlp, libvlc_media_list_t *p_mlist);
|
||||
typedef libvlc_event_manager_t *(*LIBVLC_MEDIA_LIST_PLAYER_EVENT_MANAGER)(
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
typedef void (*LIBVLC_MEDIA_LIST_PLAYER_SET_PLAYBACK_MODE)(
|
||||
libvlc_media_list_player_t *p_mlp,
|
||||
libvlc_playback_mode_t e_mode);
|
||||
typedef int (*LIBVLC_MEDIA_LIST_PLAYER_NEXT)(
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
libvlc_media_list_player_t *p_mlp, libvlc_playback_mode_t e_mode);
|
||||
typedef int (*LIBVLC_MEDIA_LIST_PLAYER_NEXT)(libvlc_media_list_player_t *p_mlp);
|
||||
typedef int (*LIBVLC_MEDIA_LIST_PLAYER_PREVIOUS)(
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
libvlc_media_list_player_t *p_mlp);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -159,82 +141,88 @@ extern LIBVLC_MEDIA_LIST_PLAYER_RELEASE libvlc_media_list_player_release_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_PLAY libvlc_media_list_player_play_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_PAUSE libvlc_media_list_player_pause_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_STOP libvlc_media_list_player_stop_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_PLAYER libvlc_media_list_player_set_media_player_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_LIST libvlc_media_list_player_set_media_list_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_EVENT_MANAGER libvlc_media_list_player_event_manager_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_SET_PLAYBACK_MODE libvlc_media_list_player_set_playback_mode_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_PLAYER
|
||||
libvlc_media_list_player_set_media_player_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_SET_MEDIA_LIST
|
||||
libvlc_media_list_player_set_media_list_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_EVENT_MANAGER
|
||||
libvlc_media_list_player_event_manager_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_SET_PLAYBACK_MODE
|
||||
libvlc_media_list_player_set_playback_mode_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_NEXT libvlc_media_list_player_next_;
|
||||
extern LIBVLC_MEDIA_LIST_PLAYER_PREVIOUS libvlc_media_list_player_previous_;
|
||||
|
||||
#define EXTENSIONS_AUDIO \
|
||||
"*.3ga;" \
|
||||
"*.669;" \
|
||||
"*.a52;" \
|
||||
"*.aac;" \
|
||||
"*.ac3;" \
|
||||
"*.adt;" \
|
||||
"*.adts;" \
|
||||
"*.aif;"\
|
||||
"*.aifc;"\
|
||||
"*.aiff;"\
|
||||
"*.amb;" \
|
||||
"*.amr;" \
|
||||
"*.aob;" \
|
||||
"*.ape;" \
|
||||
"*.au;" \
|
||||
"*.awb;" \
|
||||
"*.caf;" \
|
||||
"*.dts;" \
|
||||
"*.flac;"\
|
||||
"*.it;" \
|
||||
"*.kar;" \
|
||||
"*.m4a;" \
|
||||
"*.m4b;" \
|
||||
"*.m4p;" \
|
||||
"*.m5p;" \
|
||||
"*.mid;" \
|
||||
"*.mka;" \
|
||||
"*.mlp;" \
|
||||
"*.mod;" \
|
||||
"*.mpa;" \
|
||||
"*.mp1;" \
|
||||
"*.mp2;" \
|
||||
"*.mp3;" \
|
||||
"*.mpc;" \
|
||||
"*.mpga;" \
|
||||
"*.mus;" \
|
||||
"*.oga;" \
|
||||
"*.ogg;" \
|
||||
"*.oma;" \
|
||||
"*.opus;" \
|
||||
"*.qcp;" \
|
||||
"*.ra;" \
|
||||
"*.rmi;" \
|
||||
"*.s3m;" \
|
||||
"*.sid;" \
|
||||
"*.spx;" \
|
||||
"*.tak;" \
|
||||
"*.thd;" \
|
||||
"*.tta;" \
|
||||
"*.voc;" \
|
||||
"*.vqf;" \
|
||||
"*.w64;" \
|
||||
"*.wav;" \
|
||||
"*.wma;" \
|
||||
"*.wv;" \
|
||||
"*.xa;" \
|
||||
"*.3ga;" \
|
||||
"*.669;" \
|
||||
"*.a52;" \
|
||||
"*.aac;" \
|
||||
"*.ac3;" \
|
||||
"*.adt;" \
|
||||
"*.adts;" \
|
||||
"*.aif;" \
|
||||
"*.aifc;" \
|
||||
"*.aiff;" \
|
||||
"*.amb;" \
|
||||
"*.amr;" \
|
||||
"*.aob;" \
|
||||
"*.ape;" \
|
||||
"*.au;" \
|
||||
"*.awb;" \
|
||||
"*.caf;" \
|
||||
"*.dts;" \
|
||||
"*.flac;" \
|
||||
"*.it;" \
|
||||
"*.kar;" \
|
||||
"*.m4a;" \
|
||||
"*.m4b;" \
|
||||
"*.m4p;" \
|
||||
"*.m5p;" \
|
||||
"*.mid;" \
|
||||
"*.mka;" \
|
||||
"*.mlp;" \
|
||||
"*.mod;" \
|
||||
"*.mpa;" \
|
||||
"*.mp1;" \
|
||||
"*.mp2;" \
|
||||
"*.mp3;" \
|
||||
"*.mpc;" \
|
||||
"*.mpga;" \
|
||||
"*.mus;" \
|
||||
"*.oga;" \
|
||||
"*.ogg;" \
|
||||
"*.oma;" \
|
||||
"*.opus;" \
|
||||
"*.qcp;" \
|
||||
"*.ra;" \
|
||||
"*.rmi;" \
|
||||
"*.s3m;" \
|
||||
"*.sid;" \
|
||||
"*.spx;" \
|
||||
"*.tak;" \
|
||||
"*.thd;" \
|
||||
"*.tta;" \
|
||||
"*.voc;" \
|
||||
"*.vqf;" \
|
||||
"*.w64;" \
|
||||
"*.wav;" \
|
||||
"*.wma;" \
|
||||
"*.wv;" \
|
||||
"*.xa;" \
|
||||
"*.xm"
|
||||
|
||||
#define EXTENSIONS_VIDEO "*.3g2;*.3gp;*.3gp2;*.3gpp;*.amv;*.asf;*.avi;" \
|
||||
"*.bik;*.bin;*.crf;*.divx;*.drc;*.dv;*.evo;*.f4v;*.flv;*.gvi;*.gxf;" \
|
||||
#define EXTENSIONS_VIDEO \
|
||||
"*.3g2;*.3gp;*.3gp2;*.3gpp;*.amv;*.asf;*.avi;" \
|
||||
"*.bik;*.bin;*.crf;*.divx;*.drc;*.dv;*.evo;*.f4v;*.flv;*.gvi;*.gxf;" \
|
||||
"*.iso;*.m1v;*.m2v;*.m2t;*.m2ts;*.m4v;*.mkv;*.mov;*.mp2;*.mp2v;*.mp4;" \
|
||||
"*.mp4v;*.mpe;*.mpeg;*.mpeg1;*.mpeg2;*.mpeg4;*.mpg;*.mpv2;*.mts;" \
|
||||
"*.mtv;*.mxf;*.mxg;*.nsv;*.nuv;*.ogg;*.ogm;*.ogv;*.ogx;*.ps;*.rec;" \
|
||||
"*.rm;*.rmvb;*.rpl;*.thp;*.tod;*.ts;*.tts;*.txd;*.vob;*.vro;*.webm;" \
|
||||
"*.mp4v;*.mpe;*.mpeg;*.mpeg1;*.mpeg2;*.mpeg4;*.mpg;*.mpv2;*.mts;" \
|
||||
"*.mtv;*.mxf;*.mxg;*.nsv;*.nuv;*.ogg;*.ogm;*.ogv;*.ogx;*.ps;*.rec;" \
|
||||
"*.rm;*.rmvb;*.rpl;*.thp;*.tod;*.ts;*.tts;*.txd;*.vob;*.vro;*.webm;" \
|
||||
"*.wm;*.wmv;*.wtv;*.xesc"
|
||||
|
||||
#define EXTENSIONS_PLAYLIST "*.asx;*.b4s;*.cue;*.ifo;*.m3u;*.m3u8;*.pls;" \
|
||||
#define EXTENSIONS_PLAYLIST \
|
||||
"*.asx;*.b4s;*.cue;*.ifo;*.m3u;*.m3u8;*.pls;" \
|
||||
"*.ram;*.rar;*.sdp;*.vlc;*.xspf;*.wax;*.wvx;*.zip;*.conf"
|
||||
|
||||
#define EXTENSIONS_MEDIA EXTENSIONS_VIDEO ";" EXTENSIONS_AUDIO ";" \
|
||||
EXTENSIONS_PLAYLIST
|
||||
#define EXTENSIONS_MEDIA \
|
||||
EXTENSIONS_VIDEO ";" EXTENSIONS_AUDIO ";" EXTENSIONS_PLAYLIST
|
||||
|
@@ -4,11 +4,13 @@
|
||||
#include <util/platform.h>
|
||||
#include <util/dstr.h>
|
||||
|
||||
#define do_log(level, format, ...) \
|
||||
#define do_log(level, format, ...) \
|
||||
blog(level, "[vlc_source: '%s'] " format, \
|
||||
obs_source_get_name(ss->source), ##__VA_ARGS__)
|
||||
obs_source_get_name(ss->source), ##__VA_ARGS__)
|
||||
|
||||
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#define S_PLAYLIST "playlist"
|
||||
#define S_LOOP "loop"
|
||||
@@ -35,6 +37,8 @@
|
||||
#define T_SUBTITLE_ENABLE T_("SubtitleEnable")
|
||||
#define T_SUBTITLE_TRACK T_("SubtitleTrack")
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
struct media_file_data {
|
||||
@@ -94,8 +98,8 @@ static libvlc_media_t *get_media(struct darray *array, const char *path)
|
||||
static inline libvlc_media_t *create_media_from_file(const char *file)
|
||||
{
|
||||
return (file && strstr(file, "://") != NULL)
|
||||
? libvlc_media_new_location_(libvlc, file)
|
||||
: libvlc_media_new_path_(libvlc, file);
|
||||
? libvlc_media_new_location_(libvlc, file)
|
||||
: libvlc_media_new_path_(libvlc, file);
|
||||
}
|
||||
|
||||
static void free_files(struct darray *array)
|
||||
@@ -113,25 +117,26 @@ static void free_files(struct darray *array)
|
||||
|
||||
static inline bool chroma_is(const char *chroma, const char *val)
|
||||
{
|
||||
return *(uint32_t*)chroma == *(uint32_t*)val;
|
||||
return *(uint32_t *)chroma == *(uint32_t *)val;
|
||||
}
|
||||
|
||||
static enum video_format convert_vlc_video_format(char *chroma, bool *full)
|
||||
{
|
||||
*full = false;
|
||||
|
||||
#define CHROMA_TEST(val, ret) \
|
||||
if (chroma_is(chroma, val)) return ret
|
||||
#define CHROMA_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(chroma, val)) { \
|
||||
*(uint32_t*)chroma = *(uint32_t*)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
#define CHROMA_TEST(val, ret) \
|
||||
if (chroma_is(chroma, val)) \
|
||||
return ret
|
||||
#define CHROMA_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(chroma, val)) { \
|
||||
*(uint32_t *)chroma = *(uint32_t *)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
} while (false)
|
||||
#define CHROMA_CONV_FULL(val, new_val, ret) \
|
||||
do { \
|
||||
*full = true; \
|
||||
#define CHROMA_CONV_FULL(val, new_val, ret) \
|
||||
do { \
|
||||
*full = true; \
|
||||
CHROMA_CONV(val, new_val, ret); \
|
||||
} while (false)
|
||||
|
||||
@@ -205,12 +210,12 @@ static enum video_format convert_vlc_video_format(char *chroma, bool *full)
|
||||
#undef CHROMA_CONV
|
||||
#undef CHROMA_TEST
|
||||
|
||||
*(uint32_t*)chroma = *(uint32_t*)"BGRA";
|
||||
*(uint32_t *)chroma = *(uint32_t *)"BGRA";
|
||||
return VIDEO_FORMAT_BGRA;
|
||||
}
|
||||
|
||||
static inline unsigned get_format_lines(enum video_format format,
|
||||
unsigned height, size_t plane)
|
||||
unsigned height, size_t plane)
|
||||
{
|
||||
switch (format) {
|
||||
case VIDEO_FORMAT_I420:
|
||||
@@ -233,14 +238,15 @@ static inline unsigned get_format_lines(enum video_format format,
|
||||
|
||||
static enum audio_format convert_vlc_audio_format(char *format)
|
||||
{
|
||||
#define AUDIO_TEST(val, ret) \
|
||||
if (chroma_is(format, val)) return ret
|
||||
#define AUDIO_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(format, val)) { \
|
||||
*(uint32_t*)format = *(uint32_t*)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
#define AUDIO_TEST(val, ret) \
|
||||
if (chroma_is(format, val)) \
|
||||
return ret
|
||||
#define AUDIO_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(format, val)) { \
|
||||
*(uint32_t *)format = *(uint32_t *)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
AUDIO_TEST("S16N", AUDIO_FORMAT_16BIT);
|
||||
@@ -262,7 +268,7 @@ static enum audio_format convert_vlc_audio_format(char *format)
|
||||
#undef AUDIO_CONV
|
||||
#undef AUDIO_TEST
|
||||
|
||||
*(uint32_t*)format = *(uint32_t*)"FL32";
|
||||
*(uint32_t *)format = *(uint32_t *)"FL32";
|
||||
return AUDIO_FORMAT_FLOAT;
|
||||
}
|
||||
|
||||
@@ -286,7 +292,7 @@ static void vlcs_destroy(void *data)
|
||||
libvlc_media_player_release_(c->media_player);
|
||||
}
|
||||
|
||||
bfree((void*)c->audio.data[0]);
|
||||
bfree((void *)c->audio.data[0]);
|
||||
obs_source_frame_free(&c->frame);
|
||||
|
||||
free_files(&c->files.da);
|
||||
@@ -312,7 +318,8 @@ static void vlcs_video_display(void *data, void *picture)
|
||||
}
|
||||
|
||||
static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
|
||||
unsigned *height, unsigned *pitches, unsigned *lines)
|
||||
unsigned *height, unsigned *pitches,
|
||||
unsigned *lines)
|
||||
{
|
||||
struct vlc_source *c = *p_data;
|
||||
enum video_format new_format;
|
||||
@@ -334,25 +341,24 @@ static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
|
||||
libvlc_video_get_size_(c->media_player, 0, &new_width, &new_height);
|
||||
|
||||
if (new_width && new_height) {
|
||||
*width = new_width;
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
}
|
||||
|
||||
/* don't allocate a new frame if format/width/height hasn't changed */
|
||||
if (c->frame.format != new_format ||
|
||||
c->frame.width != *width ||
|
||||
if (c->frame.format != new_format || c->frame.width != *width ||
|
||||
c->frame.height != *height) {
|
||||
obs_source_frame_free(&c->frame);
|
||||
obs_source_frame_init(&c->frame, new_format, *width, *height);
|
||||
|
||||
c->frame.format = new_format;
|
||||
c->frame.full_range = new_range;
|
||||
range = c->frame.full_range ?
|
||||
VIDEO_RANGE_FULL : VIDEO_RANGE_PARTIAL;
|
||||
range = c->frame.full_range ? VIDEO_RANGE_FULL
|
||||
: VIDEO_RANGE_PARTIAL;
|
||||
video_format_get_parameters(VIDEO_CS_DEFAULT, range,
|
||||
c->frame.color_matrix,
|
||||
c->frame.color_range_min,
|
||||
c->frame.color_range_max);
|
||||
c->frame.color_matrix,
|
||||
c->frame.color_range_min,
|
||||
c->frame.color_range_max);
|
||||
}
|
||||
|
||||
while (c->frame.data[i]) {
|
||||
@@ -365,17 +371,17 @@ static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
|
||||
}
|
||||
|
||||
static void vlcs_audio_play(void *data, const void *samples, unsigned count,
|
||||
int64_t pts)
|
||||
int64_t pts)
|
||||
{
|
||||
struct vlc_source *c = data;
|
||||
size_t size = get_audio_size(c->audio.format, c->audio.speakers, count);
|
||||
|
||||
if (c->audio_capacity < count) {
|
||||
c->audio.data[0] = brealloc((void*)c->audio.data[0], size);
|
||||
c->audio.data[0] = brealloc((void *)c->audio.data[0], size);
|
||||
c->audio_capacity = count;
|
||||
}
|
||||
|
||||
memcpy((void*)c->audio.data[0], samples, size);
|
||||
memcpy((void *)c->audio.data[0], samples, size);
|
||||
c->audio.timestamp = (uint64_t)pts * 1000ULL - time_start;
|
||||
c->audio.frames = count;
|
||||
|
||||
@@ -383,7 +389,7 @@ static void vlcs_audio_play(void *data, const void *samples, unsigned count,
|
||||
}
|
||||
|
||||
static int vlcs_audio_setup(void **p_data, char *format, unsigned *rate,
|
||||
unsigned *channels)
|
||||
unsigned *channels)
|
||||
{
|
||||
struct vlc_source *c = *p_data;
|
||||
enum audio_format new_audio_format;
|
||||
@@ -395,22 +401,22 @@ static int vlcs_audio_setup(void **p_data, char *format, unsigned *rate,
|
||||
/* don't free audio data if the data is the same format */
|
||||
if (c->audio.format == new_audio_format &&
|
||||
c->audio.samples_per_sec == *rate &&
|
||||
c->audio.speakers == (enum speaker_layout)*channels)
|
||||
c->audio.speakers == (enum speaker_layout) * channels)
|
||||
return 0;
|
||||
|
||||
c->audio_capacity = 0;
|
||||
bfree((void*)c->audio.data[0]);
|
||||
bfree((void *)c->audio.data[0]);
|
||||
|
||||
memset(&c->audio, 0, sizeof(c->audio));
|
||||
c->audio.speakers = (enum speaker_layout)*channels;
|
||||
c->audio.speakers = (enum speaker_layout) * channels;
|
||||
c->audio.samples_per_sec = *rate;
|
||||
c->audio.format = new_audio_format;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void add_file(struct vlc_source *c, struct darray *array,
|
||||
const char *path, int network_caching, int track_index,
|
||||
int subtitle_index, bool subtitle_enable)
|
||||
const char *path, int network_caching, int track_index,
|
||||
int subtitle_index, bool subtitle_enable)
|
||||
{
|
||||
DARRAY(struct media_file_data) new_files;
|
||||
struct media_file_data data;
|
||||
@@ -438,21 +444,20 @@ static void add_file(struct vlc_source *c, struct darray *array,
|
||||
if (is_url) {
|
||||
struct dstr network_caching_option = {0};
|
||||
dstr_catf(&network_caching_option,
|
||||
":network-caching=%d", network_caching);
|
||||
":network-caching=%d", network_caching);
|
||||
libvlc_media_add_option_(new_media,
|
||||
network_caching_option.array);
|
||||
network_caching_option.array);
|
||||
dstr_free(&network_caching_option);
|
||||
}
|
||||
struct dstr track_option = { 0 };
|
||||
dstr_catf(&track_option,
|
||||
":audio-track=%d", track_index - 1);
|
||||
struct dstr track_option = {0};
|
||||
dstr_catf(&track_option, ":audio-track=%d", track_index - 1);
|
||||
libvlc_media_add_option_(new_media, track_option.array);
|
||||
dstr_free(&track_option);
|
||||
|
||||
struct dstr sub_option = {0};
|
||||
if (subtitle_enable) {
|
||||
dstr_catf(&sub_option,
|
||||
":sub-track=%d", subtitle_index - 1);
|
||||
dstr_catf(&sub_option, ":sub-track=%d",
|
||||
subtitle_index - 1);
|
||||
}
|
||||
libvlc_media_add_option_(new_media, sub_option.array);
|
||||
dstr_free(&sub_option);
|
||||
@@ -481,8 +486,10 @@ static bool valid_extension(const char *ext)
|
||||
e = strchr(b, ';');
|
||||
|
||||
for (;;) {
|
||||
if (e) dstr_ncopy(&test, b, e - b);
|
||||
else dstr_copy(&test, b);
|
||||
if (e)
|
||||
dstr_ncopy(&test, b, e - b);
|
||||
else
|
||||
dstr_copy(&test, b);
|
||||
|
||||
if (dstr_cmp(&test, ext) == 0) {
|
||||
valid = true;
|
||||
@@ -569,17 +576,15 @@ static void vlcs_update(void *data, obs_data_t *settings)
|
||||
dstr_cat_ch(&dir_path, '/');
|
||||
dstr_cat(&dir_path, ent->d_name);
|
||||
add_file(c, &new_files.da, dir_path.array,
|
||||
network_caching, track_index,
|
||||
subtitle_index,
|
||||
subtitle_enable);
|
||||
network_caching, track_index,
|
||||
subtitle_index, subtitle_enable);
|
||||
}
|
||||
|
||||
dstr_free(&dir_path);
|
||||
os_closedir(dir);
|
||||
} else {
|
||||
add_file(c, &new_files.da, path, network_caching,
|
||||
track_index, subtitle_index,
|
||||
subtitle_enable);
|
||||
track_index, subtitle_index, subtitle_enable);
|
||||
}
|
||||
|
||||
obs_data_release(item);
|
||||
@@ -634,19 +639,19 @@ static void vlcs_update(void *data, obs_data_t *settings)
|
||||
libvlc_media_list_lock_(media_list);
|
||||
for (size_t i = 0; i < c->files.num; i++)
|
||||
libvlc_media_list_add_media_(media_list,
|
||||
c->files.array[i].media);
|
||||
c->files.array[i].media);
|
||||
libvlc_media_list_unlock_(media_list);
|
||||
|
||||
libvlc_media_list_player_set_media_list_(c->media_list_player,
|
||||
media_list);
|
||||
media_list);
|
||||
libvlc_media_list_release_(media_list);
|
||||
|
||||
libvlc_media_list_player_set_playback_mode_(c->media_list_player,
|
||||
c->loop ? libvlc_playback_mode_loop :
|
||||
libvlc_playback_mode_default);
|
||||
libvlc_media_list_player_set_playback_mode_(
|
||||
c->media_list_player, c->loop ? libvlc_playback_mode_loop
|
||||
: libvlc_playback_mode_default);
|
||||
|
||||
if (c->files.num &&
|
||||
(c->behavior == BEHAVIOR_ALWAYS_PLAY || obs_source_active(c->source)))
|
||||
if (c->files.num && (c->behavior == BEHAVIOR_ALWAYS_PLAY ||
|
||||
obs_source_active(c->source)))
|
||||
libvlc_media_list_player_play_(c->media_list_player);
|
||||
else
|
||||
obs_source_output_video(c->source, NULL);
|
||||
@@ -701,7 +706,7 @@ static void vlcs_playlist_prev(void *data)
|
||||
}
|
||||
|
||||
static void vlcs_play_pause_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
@@ -713,7 +718,7 @@ static void vlcs_play_pause_hotkey(void *data, obs_hotkey_id id,
|
||||
}
|
||||
|
||||
static void vlcs_restart_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
@@ -724,8 +729,8 @@ static void vlcs_restart_hotkey(void *data, obs_hotkey_id id,
|
||||
vlcs_restart(c);
|
||||
}
|
||||
|
||||
static void vlcs_stop_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
static void vlcs_stop_hotkey(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey,
|
||||
bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
@@ -737,7 +742,7 @@ static void vlcs_stop_hotkey(void *data, obs_hotkey_id id,
|
||||
}
|
||||
|
||||
static void vlcs_playlist_next_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
@@ -749,7 +754,7 @@ static void vlcs_playlist_next_hotkey(void *data, obs_hotkey_id id,
|
||||
}
|
||||
|
||||
static void vlcs_playlist_prev_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
@@ -765,30 +770,25 @@ static void *vlcs_create(obs_data_t *settings, obs_source_t *source)
|
||||
struct vlc_source *c = bzalloc(sizeof(*c));
|
||||
c->source = source;
|
||||
|
||||
c->play_pause_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.PlayPause",
|
||||
obs_module_text("PlayPause"),
|
||||
vlcs_play_pause_hotkey, c);
|
||||
c->play_pause_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.PlayPause", obs_module_text("PlayPause"),
|
||||
vlcs_play_pause_hotkey, c);
|
||||
|
||||
c->restart_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.Restart",
|
||||
obs_module_text("Restart"),
|
||||
vlcs_restart_hotkey, c);
|
||||
c->restart_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.Restart", obs_module_text("Restart"),
|
||||
vlcs_restart_hotkey, c);
|
||||
|
||||
c->stop_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.Stop",
|
||||
obs_module_text("Stop"),
|
||||
vlcs_stop_hotkey, c);
|
||||
c->stop_hotkey = obs_hotkey_register_source(source, "VLCSource.Stop",
|
||||
obs_module_text("Stop"),
|
||||
vlcs_stop_hotkey, c);
|
||||
|
||||
c->playlist_next_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.PlaylistNext",
|
||||
obs_module_text("PlaylistNext"),
|
||||
vlcs_playlist_next_hotkey, c);
|
||||
c->playlist_next_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.PlaylistNext",
|
||||
obs_module_text("PlaylistNext"), vlcs_playlist_next_hotkey, c);
|
||||
|
||||
c->playlist_prev_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.PlaylistPrev",
|
||||
obs_module_text("PlaylistPrev"),
|
||||
vlcs_playlist_prev_hotkey, c);
|
||||
c->playlist_prev_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.PlaylistPrev",
|
||||
obs_module_text("PlaylistPrev"), vlcs_playlist_prev_hotkey, c);
|
||||
|
||||
pthread_mutex_init_value(&c->mutex);
|
||||
if (pthread_mutex_init(&c->mutex, NULL) != 0)
|
||||
@@ -806,23 +806,22 @@ static void *vlcs_create(obs_data_t *settings, obs_source_t *source)
|
||||
goto error;
|
||||
|
||||
libvlc_media_list_player_set_media_player_(c->media_list_player,
|
||||
c->media_player);
|
||||
c->media_player);
|
||||
|
||||
libvlc_video_set_callbacks_(c->media_player,
|
||||
vlcs_video_lock, NULL, vlcs_video_display,
|
||||
c);
|
||||
libvlc_video_set_format_callbacks_(c->media_player,
|
||||
vlcs_video_format, NULL);
|
||||
libvlc_video_set_callbacks_(c->media_player, vlcs_video_lock, NULL,
|
||||
vlcs_video_display, c);
|
||||
libvlc_video_set_format_callbacks_(c->media_player, vlcs_video_format,
|
||||
NULL);
|
||||
|
||||
libvlc_audio_set_callbacks_(c->media_player,
|
||||
vlcs_audio_play, NULL, NULL, NULL, NULL, c);
|
||||
libvlc_audio_set_format_callbacks_(c->media_player,
|
||||
vlcs_audio_setup, NULL);
|
||||
libvlc_audio_set_callbacks_(c->media_player, vlcs_audio_play, NULL,
|
||||
NULL, NULL, NULL, c);
|
||||
libvlc_audio_set_format_callbacks_(c->media_player, vlcs_audio_setup,
|
||||
NULL);
|
||||
|
||||
libvlc_event_manager_t *event_manager;
|
||||
event_manager = libvlc_media_player_event_manager_(c->media_player);
|
||||
libvlc_event_attach_(event_manager, libvlc_MediaPlayerEndReached,
|
||||
vlcs_stopped, c);
|
||||
vlcs_stopped, c);
|
||||
|
||||
obs_source_update(source, NULL);
|
||||
|
||||
@@ -864,7 +863,7 @@ static void vlcs_defaults(obs_data_t *settings)
|
||||
obs_data_set_default_bool(settings, S_LOOP, true);
|
||||
obs_data_set_default_bool(settings, S_SHUFFLE, false);
|
||||
obs_data_set_default_string(settings, S_BEHAVIOR,
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
obs_data_set_default_int(settings, S_NETWORK_CACHING, 400);
|
||||
obs_data_set_default_int(settings, S_TRACK, 1);
|
||||
obs_data_set_default_bool(settings, S_SUBTITLE_ENABLE, false);
|
||||
@@ -900,13 +899,14 @@ static obs_properties_t *vlcs_properties(void *data)
|
||||
}
|
||||
|
||||
p = obs_properties_add_list(ppts, S_BEHAVIOR, T_BEHAVIOR,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_STOP_RESTART,
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_PAUSE_UNPAUSE,
|
||||
S_BEHAVIOR_PAUSE_UNPAUSE);
|
||||
S_BEHAVIOR_PAUSE_UNPAUSE);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_ALWAYS_PLAY,
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
|
||||
dstr_cat(&filter, "Media Files (");
|
||||
dstr_copy(&exts, EXTENSIONS_MEDIA);
|
||||
@@ -930,18 +930,18 @@ static obs_properties_t *vlcs_properties(void *data)
|
||||
dstr_cat(&filter, ")");
|
||||
|
||||
obs_properties_add_editable_list(ppts, S_PLAYLIST, T_PLAYLIST,
|
||||
OBS_EDITABLE_LIST_TYPE_FILES_AND_URLS,
|
||||
filter.array, path.array);
|
||||
OBS_EDITABLE_LIST_TYPE_FILES_AND_URLS,
|
||||
filter.array, path.array);
|
||||
dstr_free(&path);
|
||||
dstr_free(&filter);
|
||||
dstr_free(&exts);
|
||||
|
||||
obs_properties_add_int(ppts, S_NETWORK_CACHING, T_NETWORK_CACHING,
|
||||
100, 60000, 10);
|
||||
obs_properties_add_int(ppts, S_NETWORK_CACHING, T_NETWORK_CACHING, 100,
|
||||
60000, 10);
|
||||
obs_properties_add_int(ppts, S_TRACK, T_TRACK, 1, 10, 1);
|
||||
obs_properties_add_bool(ppts, S_SUBTITLE_ENABLE, T_SUBTITLE_ENABLE);
|
||||
obs_properties_add_int(ppts, S_SUBTITLE_TRACK, T_SUBTITLE_TRACK,
|
||||
1, 10, 1);
|
||||
obs_properties_add_int(ppts, S_SUBTITLE_TRACK, T_SUBTITLE_TRACK, 1, 10,
|
||||
1);
|
||||
|
||||
return ppts;
|
||||
}
|
||||
@@ -949,9 +949,8 @@ static obs_properties_t *vlcs_properties(void *data)
|
||||
struct obs_source_info vlc_source_info = {
|
||||
.id = "vlc_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO |
|
||||
OBS_SOURCE_AUDIO |
|
||||
OBS_SOURCE_DO_NOT_DUPLICATE,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO | OBS_SOURCE_AUDIO |
|
||||
OBS_SOURCE_DO_NOT_DUPLICATE,
|
||||
.get_name = vlcs_get_name,
|
||||
.create = vlcs_create,
|
||||
.destroy = vlcs_destroy,
|
||||
@@ -959,5 +958,5 @@ struct obs_source_info vlc_source_info = {
|
||||
.get_defaults = vlcs_defaults,
|
||||
.get_properties = vlcs_properties,
|
||||
.activate = vlcs_activate,
|
||||
.deactivate = vlcs_deactivate
|
||||
.deactivate = vlcs_deactivate,
|
||||
};
|
||||
|
Reference in New Issue
Block a user