bin: use libvlc_Internal API directly

This commit is contained in:
Thomas Guillem 2024-01-30 17:03:59 +01:00 committed by Steve Lhomme
parent bcd17cd1b9
commit 70dc1f9480
5 changed files with 18 additions and 12 deletions

View File

@ -26,7 +26,7 @@ endif
#
# Main VLC executable
#
vlc_LDADD = ../lib/libvlc.la
vlc_LDADD = ../lib/libvlc.la ../src/libvlccore.la
vlc_CPPFLAGS = $(AM_CPPFLAGS)
if !HAVE_WIN32
vlc_SOURCES = vlc.c override.c

View File

@ -41,6 +41,7 @@
#import <Breakpad/Breakpad.h>
#endif
#include "../lib/libvlc_internal.h"
/**
* Handler called when VLC asks to terminate the program.
@ -269,15 +270,16 @@ int main(int i_argc, const char *ppsz_argv[])
return 1;
int ret = 1;
libvlc_set_exit_handler(vlc, vlc_terminate, NULL);
libvlc_SetExitHandler(vlc->p_libvlc_int, vlc_terminate, NULL);
libvlc_set_app_id(vlc, "org.VideoLAN.VLC", PACKAGE_VERSION, PACKAGE_NAME);
libvlc_set_user_agent(vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
if (libvlc_add_intf(vlc, NULL)) {
if (libvlc_InternalAddIntf(vlc->p_libvlc_int, NULL)) {
fprintf(stderr, "VLC cannot start any interface. Exiting.\n");
goto out;
}
libvlc_playlist_play(vlc);
libvlc_InternalPlay(vlc->p_libvlc_int);
/*
* Run the main loop. If the mac interface is not initialized, only the CoreFoundation

View File

@ -20,7 +20,7 @@ if build_vlc and (host_system != 'darwin' or have_osx)
executable('vlc',
vlc_sources,
link_with: [libvlc],
link_with: [libvlc, libvlccore],
include_directories: [vlc_include_dirs],
dependencies: vlc_deps,
install: true,
@ -32,7 +32,7 @@ if build_vlc and (host_system != 'darwin' or have_osx)
executable('vlc-static',
vlc_sources,
link_with: [libvlc],
link_with: [libvlc, libvlccore],
include_directories: [vlc_include_dirs],
dependencies: vlc_deps,
c_args: [vlc_top_builddir_def, vlc_top_srcdir_def],

View File

@ -40,6 +40,8 @@
#endif
#include <unistd.h>
#include "../lib/libvlc_internal.h"
#ifdef __OS2__
# include <iconv.h>
@ -232,17 +234,17 @@ int main(int argc, const char *argv[])
return 1;
int ret = 1;
libvlc_set_exit_handler (vlc, vlc_kill, &self);
libvlc_SetExitHandler(vlc->p_libvlc_int, vlc_kill, &self);
libvlc_set_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION, PACKAGE_NAME);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
if (libvlc_add_intf (vlc, NULL))
if (libvlc_InternalAddIntf (vlc->p_libvlc_int, NULL))
{
fprintf(stderr, "%s: cannot start any interface. Exiting.\n", argv[0]);
goto out;
}
libvlc_playlist_play (vlc);
libvlc_InternalPlay (vlc->p_libvlc_int);
/* Qt insists on catching SIGCHLD via signal handler. To work around that,
* unblock it after all our child threads are created. */

View File

@ -40,6 +40,8 @@
#include <io.h>
#include <shlobj.h>
#include "../lib/libvlc_internal.h"
#ifdef HAVE_BREAKPAD
void CheckCrashDump( const wchar_t* crashdump_path );
void* InstallCrashHandler( const wchar_t* crashdump_path );
@ -242,12 +244,12 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
{
HANDLE sem = CreateSemaphore(NULL, 0, 1, NULL);
libvlc_set_exit_handler(vlc, vlc_kill, &sem);
libvlc_SetExitHandler(vlc->p_libvlc_int, vlc_kill, &sem);
libvlc_set_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION,
PACKAGE_NAME);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
libvlc_add_intf (vlc, NULL);
libvlc_playlist_play (vlc);
libvlc_InternalAddIntf (vlc->p_libvlc_int, NULL);
libvlc_InternalPlay (vlc->p_libvlc_int);
WaitForSingleObject(sem, INFINITE);
CloseHandle(sem);