Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
  • abdsaber000/vlc
  • falbrechtskirchinger/vlc
  • b.sullender/vlc
  • hulxv/vlc
  • zyad-ayad/vlc
408 results
Show changes
Commits on Source (10094)
......@@ -20,6 +20,7 @@
.dirstamp
ABOUT-NLS
aclocal.m4
Cargo.lock
ChangeLog
compile
config.status
......@@ -47,9 +48,15 @@ wxvlc
vlc_install_dir/*
plugins.dat
patches/*
share/macosx/Info.plist
Frameworks
# Ignore build dirs
build*/
target*/
contrib-*
install-*
xcodeproj/
!buildsystem/
!build.rs
!extras/package/apple/build.sh
......@@ -926,6 +926,7 @@ Haakon Meland Eriksen - Norwegian
Han HoJoong - Korean
Hardik Kishorpuri Goswami - Gujarati
Hemanta Nandi - Bengali (India)
Hugo Carvalho - Portuguese
Huw Waters - Welsh
H.Shalitha Vikum - Sinhala
Ibrahima Sarr - Fulah
......
[workspace]
members = [
"src/rust/vlcrs-core",
"src/rust/vlcrs-macros",
"src/rust/vlcrs-messages",
"src/rust/vlcrs-utils",
"modules/logger/telegraf-rs/"
]
resolver = "2"
[workspace.package]
version = "4.0.0"
license = "LGPL-2.1-or-later"
[workspace.dependencies]
vlcrs-core = { path = "src/rust/vlcrs-core" }
vlcrs-macros = { path = "src/rust/vlcrs-macros" }
......@@ -6,10 +6,12 @@
# something. DIST_SUBDIRS stores the directories where nothing is built but
# which have makefiles with distribution information.
# - src (libvlccore) is nedeed by modules
SUBDIRS = compat doc po share src modules lib bin test
SUBDIRS = compat po share src modules lib doc bin test
DIST_SUBDIRS = m4 $(SUBDIRS)
EXTRA_DIST = \
buildsystem/cargo-test.py \
buildsystem/check_qml_module.py \
extras/include/x86/x86inc.asm \
extras/include/x86/x86util.asm \
extras/package/macosx/package.mak \
......@@ -25,21 +27,19 @@ BUILT_SOURCES = $(BUILT_SOURCES_distclean)
SUFFIXES =
DISTCHECK_CONFIGURE_FLAGS = \
AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-fast-install \
--disable-a52 \
--disable-alsa \
--disable-avcodec --disable-avformat \
--disable-postproc --disable-swscale \
--disable-dbus \
--disable-mad --disable-libmpeg2 \
--disable-mad \
--disable-faad --disable-skins2 \
--disable-live555 \
--disable-lua \
--disable-fribidi \
--with-kde-solid='$${datadir}/kde4/apps'
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = \
1.11 \
-Wall \
......@@ -51,7 +51,7 @@ AUTOMAKE_OPTIONS = \
ChangeLog: Makefile.am
rm -f -- "$@"
cd doc && $(MAKE) $(AM_MAKEFLAGS) changelogs
$(LN_S) -f doc/ChangeLog-2021 "$@"
$(LN_S) -f doc/ChangeLog-2024 "$@"
###############################################################################
......@@ -63,15 +63,11 @@ EXTRA_DIST += \
extras/tools/tools.mak \
extras/tools/SHA512SUMS \
extras/tools/automake-clang.patch \
extras/tools/bison-macOS-7df04f9.patch \
extras/tools/bison-macOS-c41f233c.patch \
extras/tools/cmake-enable-ALPN-support-on-macOS-10.14.patch \
extras/tools/libtool-2.4.7-bitcode.patch \
extras/tools/libtool-2.4.7-clang-libs.patch \
extras/tools/libtool-2.4.7-response-files.patch \
extras/tools/libtool-2.5.4-clang-libs.patch \
extras/tools/libtool-2.4.7-lpthread.patch \
extras/tools/libtool-2.4.7-embed-bitcode.patch \
extras/tools/ragel-6.8-javacodegen.patch
extras/tools/libtool-2.5.4-embed-bitcode.patch
###############################################################################
# Various utilities ( editor syntax files, D-Bus controller ... )
......
......@@ -7,7 +7,7 @@ Platform support changes:
- macOS 10.11 or later
- iOS 9 or later
- Android 4.1.x or later (API-16)
- GCC 5.0 or Clang 3.4 (or equivalent)
- GCC 8.0 or Clang 8 (or equivalent)
* Windows on ARM is now supported
* Universal Windows is only supported for Windows 10 (not Windows 8 anymore)
......@@ -32,12 +32,14 @@ Core:
* Support of HTML help (via the vlc_plugin.h:set_help_html macro)
Audio output:
* PipeWire (native) audio output support
* ALSA: HDMI passthrough support.
Use --alsa-passthrough to configure S/PDIF or HDMI passthrough.
* Remove the DirectSound plugin (API obsolete after Windows 7)
Demuxer:
* Support for HEIF image and grid image formats
* Support for Farbfeld images
* Support for DASH WebM
* Support for DVBSUB in mkv
* Support for DAV video files
......@@ -69,6 +71,7 @@ Access:
* Deprecates Audio CD CDDB lookups in favor of more accurate Musicbrainz
* Improved CD-TEXT and added Shift-JIS encoding support
* Support for YoutubeDL (where available).
* On-the-fly Zstandard (zstd) file decompression (where available).
Access output:
* Added support for the RIST (Reliable Internet Stream Transport) Protocol
......
......@@ -2,5 +2,8 @@ vlc_win32_rc.rc
vlc-cache-gen
vlc-static
vlc-wrapper
vlc-osx
vlc-osx-static
Contents/*
vlc
*.exe
......@@ -19,18 +19,21 @@ AM_CFLAGS = $(CFLAGS_vlc)
if HAVE_DBUS
AM_CPPFLAGS += -DHAVE_DBUS
endif
if HAVE_EMSCRIPTEN
AM_CFLAGS += -sMAIN_MODULE=1
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
vlc_LDADD += $(LIBDL)
else
vlc_SOURCES = winvlc.c
vlc_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
EXTRA_vlc_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
vlc_LDFLAGS = -mwindows -Wc,-static
vlc_LDADD += vlc_win32_rc.$(OBJEXT)
libbreakpad_wrapper_la_SOURCES = breakpad.cpp
......@@ -40,7 +43,7 @@ libbreakpad_wrapper_la_CXXFLAGS = $(AM_CXXFLAGS) $(BREAKPAD_CFLAGS) -DBREAKPAD_U
if HAVE_BREAKPAD
noinst_LTLIBRARIES = libbreakpad_wrapper.la
vlc_LDADD += libbreakpad_wrapper.la -lstdc++ -lwininet
vlc_DEPENDENCIES += libbreakpad_wrapper.la
EXTRA_vlc_DEPENDENCIES += libbreakpad_wrapper.la
vlc_CPPFLAGS += -DHAVE_BREAKPAD
endif
endif
......@@ -57,8 +60,8 @@ vlc_osx_LDADD = ../lib/libvlc.la
vlc_osx_static_SOURCES = $(vlc_osx_SOURCES)
vlc_osx_static_OBJCFLAGS = $(AM_OBJCFLAGS) \
-DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" \
-DTOP_SRCDIR=\"$$(cd "$(top_srcdir)"; pwd)\" \
-DTOP_BUILDDIR=\"$(abs_top_builddir)\" \
-DTOP_SRCDIR=\"$(abs_top_srcdir)\" \
$(NULL)
vlc_osx_static_LDFLAGS = $(vlc_osx_LDFLAGS) -static
vlc_osx_static_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/../lib/.libs/"
......@@ -77,11 +80,11 @@ endif
#
vlc_static_SOURCES = $(vlc_SOURCES)
vlc_static_CFLAGS = $(AM_CFLAGS) \
-DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" \
-DTOP_SRCDIR=\"$$(cd "$(top_srcdir)"; pwd)\" \
-DTOP_BUILDDIR=\"$(abs_top_builddir)\" \
-DTOP_SRCDIR=\"$(abs_top_srcdir)\" \
$(NULL)
vlc_static_CPPFLAGS = $(vlc_CPPFLAGS)
vlc_static_DEPENDENCIES = $(vlc_DEPENDENCIES)
EXTRA_vlc_static_DEPENDENCIES = $(EXTRA_vlc_DEPENDENCIES)
vlc_static_LDADD = $(vlc_LDADD)
vlc_static_LDFLAGS = $(vlc_LDFLAGS) -no-install -static
......@@ -119,7 +122,7 @@ vlc_cache_gen_LDADD = \
if HAVE_WIN32
vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT)
vlc_cache_gen_LDFLAGS = -Wc,-static
vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
EXTRA_vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
endif
#
......@@ -143,7 +146,7 @@ endif
../modules/plugins.dat: vlc-cache-gen$(EXEEXT)
$(AM_V_at)rm -f ../modules/plugins.dat
$(AM_V_GEN)if test "$(build)" = "$(host)"; then \
./vlc-cache-gen$(EXEEXT) `realpath ../modules` ; \
./vlc-cache-gen$(EXEEXT) `cd "../modules" ; pwd -P` ; \
else \
echo "Cross-compilation: cache generation skipped!" ; \
fi
......@@ -30,6 +30,7 @@
#include <memory>
#include <map>
#include <string>
#include <sstream>
using google_breakpad::ExceptionHandler;
......@@ -42,41 +43,44 @@ static bool FilterCallback(void*, EXCEPTION_POINTERS*, MDRawAssertionInfo*)
extern "C"
{
#define WIDEN_(x) L ## x
#define WIDEN(x) WIDEN_(x)
void CheckCrashDump( const wchar_t* path )
{
wchar_t pattern[MAX_PATH];
WIN32_FIND_DATA data;
_snwprintf( pattern, MAX_PATH, L"%s/*.dmp", path );
HANDLE h = FindFirstFile( pattern, &data );
std::wstringstream pattern;
WIN32_FIND_DATAW data;
pattern << path << L"/*.dmp";
HANDLE h = FindFirstFileW( pattern.str().c_str(), &data );
if (h == INVALID_HANDLE_VALUE)
return;
int answer = MessageBox( NULL, L"Ooops: VLC media player just crashed.\n" \
int answer = MessageBoxW( NULL, L"Ooops: VLC media player just crashed.\n" \
"Would you like to send a bug report to the developers team?",
L"VLC crash reporting", MB_YESNO);
std::map<std::wstring, std::wstring> params;
params[L"prod"] = L"VLC";
params[L"ver"] = TEXT(PACKAGE_VERSION);
params[L"ver"] = WIDEN(PACKAGE_VERSION);
do
{
wchar_t fullPath[MAX_PATH];
_snwprintf( fullPath, MAX_PATH, L"%s/%s", path, data.cFileName );
std::wstringstream fullPath;
fullPath << path << L'/' << data.cFileName;
if( answer == IDYES )
{
std::map<std::wstring, std::wstring> files;
files[L"upload_file_minidump"] = fullPath;
files[L"upload_file_minidump"] = fullPath.str();
google_breakpad::HTTPUpload::SendRequest(
TEXT( BREAKPAD_URL "/reports" ), params, files,
WIDEN( BREAKPAD_URL "/reports" ), params, files,
NULL, NULL, NULL );
}
DeleteFile( fullPath );
} while ( FindNextFile( h, &data ) );
DeleteFileW( fullPath.str().c_str() );
} while ( FindNextFileW( h, &data ) );
FindClose(h);
}
void* InstallCrashHandler( const wchar_t* crashdump_path )
{
// Breakpad needs the folder to exist to generate the crashdump
CreateDirectory( crashdump_path, NULL );
CreateDirectoryW( crashdump_path, NULL );
return new(std::nothrow) ExceptionHandler( crashdump_path, FilterCallback,
NULL, NULL, ExceptionHandler::HANDLER_ALL);
}
......
......@@ -41,6 +41,7 @@
#import <Breakpad/Breakpad.h>
#endif
#include "../lib/libvlc_internal.h"
/**
* Handler called when VLC asks to terminate the program.
......@@ -227,7 +228,10 @@ int main(int i_argc, const char *ppsz_argv[])
/* Handle parameters */
const char *argv[i_argc + 2];
const char **argv = calloc(i_argc + 2, sizeof (argv[0]));
if (argv == NULL)
exit(1);
int argc = 0;
argv[argc++] = "--no-ignore-config";
......@@ -263,21 +267,38 @@ int main(int i_argc, const char *ppsz_argv[])
argc += i_argc;
argv[argc] = NULL;
/* Initialize libvlc */
libvlc_instance_t *vlc = libvlc_new(argc, argv);
if (vlc == NULL)
return 1;
dispatch_queue_t intf_queue = dispatch_queue_create("org.videolan.vlc", NULL);
__block bool intf_started = true;
__block libvlc_instance_t *vlc = NULL;
int ret = 1;
libvlc_set_exit_handler(vlc, 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);
dispatch_async(intf_queue, ^{
/* Initialize libvlc */
vlc = libvlc_new(argc, argv);
if (vlc == NULL)
{
dispatch_sync(dispatch_get_main_queue(), ^{
intf_started = false;
CFRunLoopStop(CFRunLoopGetMain());
});
return;
}
if (libvlc_add_intf(vlc, NULL)) {
fprintf(stderr, "VLC cannot start any interface. Exiting.\n");
goto out;
}
libvlc_playlist_play(vlc);
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_InternalAddIntf(vlc->p_libvlc_int, NULL)) {
fprintf(stderr, "VLC cannot start any interface. Exiting.\n");
dispatch_sync(dispatch_get_main_queue(), ^{
intf_started = false;
CFRunLoopStop(CFRunLoopGetMain());
});
return;
}
libvlc_InternalPlay(vlc->p_libvlc_int);
});
/*
* Run the main loop. If the mac interface is not initialized, only the CoreFoundation
......@@ -285,22 +306,24 @@ int main(int i_argc, const char *ppsz_argv[])
* before actually starting the loop.
*/
@autoreleasepool {
if(NSApp == nil) {
CFRunLoopRun();
} else {
[NSApp run];
}
CFRunLoopRun();
}
if (!intf_started)
goto out;
ret = 0;
/* Cleanup */
out:
dispatch_release(intf_queue);
free(argv);
dispatch_release(sigIntSource);
dispatch_release(sigTermSource);
dispatch_release(sigChldSource);
libvlc_release(vlc);
if (vlc)
libvlc_release(vlc);
#ifdef HAVE_BREAKPAD
if (breakpad)
......
# Do we build the main VLC binary?
build_vlc = get_option('vlc')
if build_vlc and (host_system != 'darwin' or have_osx)
if build_vlc and (host_system != 'darwin' or have_osx) and not have_win_store and host_system != 'android'
vlc_sources = []
vlc_deps = [m_lib, dl_lib, threads_dep]
......@@ -16,11 +16,14 @@ if build_vlc and (host_system != 'darwin' or have_osx)
vlc_sources += ['winvlc.c']
else
vlc_sources += ['vlc.c', 'override.c']
if x11_dep.found()
vlc_deps += [x11_dep]
endif
endif
executable('vlc',
vlc_sources,
link_with: [libvlc],
link_with: [libvlc, libvlccore],
include_directories: [vlc_include_dirs],
dependencies: vlc_deps,
install: true,
......@@ -32,11 +35,27 @@ 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],
objc_args: [vlc_top_builddir_def, vlc_top_srcdir_def],
win_subsystem: 'windows'
)
vlc_cache_gen_dep = executable('vlc-cache-gen',
['cachegen.c'],
link_with: [vlc_libcompat, libvlc],
include_directories: [vlc_include_dirs],
)
plugins_dat = custom_target('plugins.dat',
# `vlc_cache_gen_dep.full_path()` doesn't work since the executable is not built yet.
# `vlc_cache_gen_dep` creates a build order dependency.
command: [vlc_cache_gen_dep, meson.global_build_root() / 'modules'],
# ninja command will be `ninja bin/plugins.dat`
output: 'plugins.dat',
build_by_default: not meson.is_cross_build(),
)
endif
......@@ -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. */
......
......@@ -39,7 +39,8 @@
#include <fcntl.h>
#include <io.h>
#include <shlobj.h>
#define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
#include "../lib/libvlc_internal.h"
#ifdef HAVE_BREAKPAD
void CheckCrashDump( const wchar_t* crashdump_path );
......@@ -58,41 +59,8 @@ static char *FromWide (const wchar_t *wide)
return out;
}
#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
static BOOL SetDefaultDllDirectories_(DWORD flags)
{
HMODULE h = GetModuleHandle(TEXT("kernel32.dll"));
if (h == NULL)
return FALSE;
BOOL (WINAPI * SetDefaultDllDirectoriesReal)(DWORD);
SetDefaultDllDirectoriesReal = (BOOL (WINAPI *)(DWORD))
GetProcAddress(h, "SetDefaultDllDirectories");
if (SetDefaultDllDirectoriesReal == NULL)
return FALSE;
return SetDefaultDllDirectoriesReal(flags);
}
# define SetDefaultDllDirectories SetDefaultDllDirectories_
#endif
static void PrioritizeSystem32(void)
{
#ifndef HAVE_PROCESS_MITIGATION_IMAGE_LOAD_POLICY
typedef struct _PROCESS_MITIGATION_IMAGE_LOAD_POLICY {
union {
DWORD Flags;
struct {
DWORD NoRemoteImages :1;
DWORD NoLowMandatoryLabelImages :1;
DWORD PreferSystem32Images :1;
DWORD ReservedFlags :29;
};
};
} PROCESS_MITIGATION_IMAGE_LOAD_POLICY;
#endif
#if _WIN32_WINNT < _WIN32_WINNT_WIN8
BOOL (WINAPI *SetProcessMitigationPolicy)(PROCESS_MITIGATION_POLICY, PVOID, SIZE_T);
HINSTANCE h_Kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
......@@ -105,7 +73,7 @@ static void PrioritizeSystem32(void)
#endif
PROCESS_MITIGATION_IMAGE_LOAD_POLICY m = { .Flags = 0 };
m.PreferSystem32Images = 1;
SetProcessMitigationPolicy( 10 /* ProcessImageLoadPolicy */, &m, sizeof( m ) );
SetProcessMitigationPolicy( ProcessImageLoadPolicy, &m, sizeof( m ) );
}
static void vlc_kill(void *data)
......@@ -141,21 +109,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
/* SetProcessDEPPolicy, SetDllDirectory, & Co. */
HINSTANCE h_Kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
if (h_Kernel32 != NULL)
{
/* Enable DEP */
#ifndef PROCESS_DEP_ENABLE
# define PROCESS_DEP_ENABLE 1
#endif /* PROCESS_DEP_ENABLE */
BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
mySetProcessDEPPolicy = (BOOL (WINAPI *)(DWORD))
GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");
if(mySetProcessDEPPolicy)
mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);
}
/* Enable DEP */
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
/* Do NOT load any library from cwd. */
SetDllDirectory(TEXT(""));
......@@ -178,10 +133,10 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
char *argv[argc + 3];
BOOL crash_handling = TRUE;
int j = 0;
char *lang = NULL;
WCHAR *lang = NULL;
argv[j++] = FromWide( L"--media-library" );
argv[j++] = FromWide( L"--no-ignore-config" );
argv[j++] = strdup("--media-library");
argv[j++] = strdup("--no-ignore-config");
for (int i = 1; i < argc; i++)
{
if(!wcscmp(wargv[i], L"--no-crashdump"))
......@@ -192,7 +147,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
if (!wcsncmp(wargv[i], L"--language", 10) )
{
if (i < argc - 1 && wcsncmp( wargv[i + 1], L"--", 2 ))
lang = FromWide (wargv[++i]);
lang = _wcsdup (wargv[++i]);
continue;
}
......@@ -207,13 +162,15 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
void* eh = NULL;
if(crash_handling)
{
static wchar_t path[MAX_PATH];
wchar_t path[MAX_PATH];
if( S_OK != SHGetFolderPathW( NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE,
NULL, SHGFP_TYPE_CURRENT, path ) )
fprintf( stderr, "Can't open the vlc conf PATH\n" );
_snwprintf( path+wcslen( path ), MAX_PATH, L"%s", L"\\vlc\\crashdump" );
CheckCrashDump( &path[0] );
eh = InstallCrashHandler( &path[0] );
else if ( !wcscat_s( path, MAX_PATH, L"\\vlc\\crashdump" ) )
{
CheckCrashDump( path );
eh = InstallCrashHandler( path );
}
}
#else
(void)crash_handling;
......@@ -231,14 +188,14 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
WCHAR szData[256];
DWORD len = 256;
if( RegQueryValueEx( h_key, TEXT("Lang"), NULL, NULL, (LPBYTE) &szData, &len ) == ERROR_SUCCESS )
lang = FromWide( szData );
lang = _wcsdup( szData );
}
}
if (lang && strncmp( lang, "auto", 4 ) )
if (lang && wcsncmp( lang, L"auto", 4 ) )
{
char tmp[11];
snprintf(tmp, 11, "LANG=%s", lang);
snprintf(tmp, 11, "LANG=%ls", lang);
putenv(tmp);
}
free(lang);
......@@ -250,13 +207,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, "globalhotkeys,none");
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);
......
......@@ -17,8 +17,6 @@ if test "$#" != "0"; then
exit 1
fi
ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
# Check for tools directory
if test -z ${VLC_TOOLS}; then
VLC_TOOLS=extras/tools/build
......@@ -27,6 +25,13 @@ if test -d ${VLC_TOOLS}/bin; then
VLC_TOOLS_PATH="$( cd "${VLC_TOOLS}/bin" ; pwd -P )"
PATH="$VLC_TOOLS_PATH:$PATH"
fi
if test -d ${VLC_TOOLS}/share/aclocal; then
# https://www.gnu.org/software/automake/manual/html_node/Macro-Search-Path.html
ACLOCAL_ARGS="${ACLOCAL_ARGS} -I ${VLC_TOOLS}/share/aclocal/"
fi
if test -f ${VLC_TOOLS}/share/autoconf-vlc/build-aux/config.guess -a -f ${VLC_TOOLS}/share/autoconf-vlc/build-aux/config.sub; then
export autom4te_buildauxdir="$( cd "${VLC_TOOLS}/share/autoconf-vlc/build-aux" ; pwd -P )"
fi
###
### Get a sane environment, just in case
......
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright (C) 2022 Loïc Branstett <loic@videolabs.io>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
# This is a wrapper/interceptor script for Cargo (the Rust package manager) that adds
# the ability to specify an output directory for the final compiler artifact
# (archive lib, depfile).
#
# Usage: ./buildsystem/cargo-output.py --output=out/ --depfile NORMAL_CARGO_INVOCATION
# Usage: ./buildsystem/cargo-output.py --output=out/ --depfile /usr/bin/cargo
# --target=x86_64-unknown-linux-gnu rustc --crate-type=staticlib
#
# The resulting static library will be put in the output directory as well as its depfile
# if asked (--depfile) and available
import os, sys, json, pathlib, shutil, subprocess, argparse
def dir_path(string):
if os.path.isdir(string):
return string
else:
raise NotADirectoryError(string)
parser = argparse.ArgumentParser()
parser.add_argument("--depfile", action="store_true")
parser.add_argument("-o", "--output", type=dir_path)
parser.add_argument("cargo_cmds", nargs=argparse.REMAINDER)
args = parser.parse_args()
cargo_argv = args.cargo_cmds
# Insert Cargo argument `--message-format=json-render-diagnostics`
# before a `--` (if there are any) to still be in Cargo arguments
# and not in the inner thing (rustc, ...)
cargo_argv.insert(
cargo_argv.index('--') if '--' in cargo_argv else len(cargo_argv),
"--message-format=json-render-diagnostics"
)
# Execute the cargo build and redirect stdout (and not stderr)
cargo_r = subprocess.run(cargo_argv, stdout=subprocess.PIPE)
# We don't use `check=True` in the above `run` method call because it
# raise an execption and outputing a python traceback isn't useful at all
if cargo_r.returncode != 0:
sys.exit(cargo_r.returncode)
# Get the jsons output
cargo_stdout = cargo_r.stdout.decode('utf-8')
cargo_jsons = [json.loads(line) for line in cargo_stdout.splitlines()]
# We are only interrested in the final artifact (ie the output, not it's deps)
last_compiler_artifact = next(
j for j in reversed(cargo_jsons) if j["reason"] == "compiler-artifact")
# We only take the first one, because the other one are just aliases and thus
# are not relevant for us
first_compiler_artifact_filename = last_compiler_artifact["filenames"][0]
for filename in [first_compiler_artifact_filename]:
shutil.copy2(filename, args.output)
if args.depfile:
shutil.copy2(pathlib.Path(filename).with_suffix(".d"), args.output)
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright (C) 2022 Loïc Branstett <loic@videolabs.io>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
# This script is meant to find the required native libs of an empty Rust crate
# compiled as a static lib.
#
# Usage: ./buildsystem/cargo-rustc-static-libs.py /usr/bin/cargo
# Usage: ./buildsystem/cargo-rustc-static-libs.py /usr/bin/cargo --target=x86_64-unknown-linux-gnu
#
# The result is then printed to the standard output.
import os, sys, json, subprocess, tempfile, argparse
NATIVE_STATIC_LIBS="native-static-libs"
parser = argparse.ArgumentParser()
parser.add_argument("cargo_cmds", nargs=argparse.REMAINDER)
args = parser.parse_args()
cargo_argv = args.cargo_cmds
cargo_argv.append("rustc")
cargo_argv.append("--message-format=json")
cargo_argv.append("--crate-type=staticlib")
cargo_argv.append("--quiet")
cargo_argv.append("--")
cargo_argv.append("--print=native-static-libs")
with tempfile.TemporaryDirectory() as tmpdir:
os.chdir(tmpdir)
with open("Cargo.toml", "w") as cargo_toml:
cargo_toml.write("""
[package]
name = "native-static-libs"
version = "0.0.0"
[lib]
path = "lib.rs"
""")
with open("lib.rs", "w") as lib_rs:
lib_rs.write("#![allow(dead_code)] fn main(){}")
# Execute the cargo build and redirect stdout (and not stderr)
cargo_r = subprocess.run(cargo_argv, stdout=subprocess.PIPE)
# We don't use `check=True in run because it raise an execption
# and outputing a python traceback isn't useful at all.
#
# We also exit here so that the output o tmp dir is not cleared when
# there is an error.
if cargo_r.returncode != 0:
print("command: {cargo_argv}", file=sys.stderr)
print("cwd: {tmpdir}", file=sys.stderr)
sys.exit(cargo_r.returncode)
# Get the jsons output
cargo_stdout = cargo_r.stdout.decode('utf-8')
cargo_jsons = [json.loads(line) for line in cargo_stdout.splitlines()]
# Print the last message with a `NATIVE_STATIC_LIBS` message
for j in reversed(cargo_jsons):
if j["reason"] == "compiler-message":
msg = j["message"]["message"]
if msg.startswith(NATIVE_STATIC_LIBS):
print(msg[len(NATIVE_STATIC_LIBS + ": "):])
#!/usr/bin/python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright (C) 2024 Alexandre Janniaux <ajanni@videolabs.io>
#
# Helper script to implement a cargo-based automake test driver.
# See modules/Makefile.am and included Makefile for usage.
import os, sys
import argparse
parser = argparse.ArgumentParser(
prog='cargo-test',
description='Automake test driver for cargo-based tests')
parser.add_argument('--test-name')
parser.add_argument('--log-file')
parser.add_argument('--trs-file')
parser.add_argument('--color-tests')
parser.add_argument('--expect-failure')
parser.add_argument('--enable-hard-errors')
parser.add_argument('--working-directory', default=os.getcwd())
args = []
other_args = None
for arg in sys.argv[1:]:
if other_args is not None:
other_args.append(arg)
continue
if arg == "--":
other_args = []
continue
args.append(arg)
args = parser.parse_args(args)
test_name = args.test_name
if test_name.endswith('.cargo'):
test_name = test_name[:-len('.cargo')]
# TODO: handle also additional parameter to select sub-tests
# test_name = "::".join(args.test_name.split('.')[1:-1])
import subprocess, os
cmd = ['cargo', 'test',
'--offline', '--locked',
'--color', 'always' if args.color_tests == 'yes' else 'never',
'--package', test_name,
'--',
'-Z', 'unstable-options',
'--format=json', '--show-output']
out = subprocess.run(
cmd,
cwd=args.working_directory,
capture_output=True,
text=True,
close_fds=False, # Necessary for jobserver
env=os.environ | {
'DYLD_LIBRARY_PATH': os.environ['top_builddir'] + '/src/.libs',
'LD_LIBRARY_PATH': os.environ['top_builddir'] + '/src/.libs',
}
)
sys.stderr.write(str(out.stderr))
import json
log_file = open(args.log_file, 'wt')
trs_file = open(args.trs_file, 'wt')
for line in out.stdout.splitlines():
meta = json.loads(line)
if meta['type'] == 'test' and \
meta['event'] in ['ok', 'failed']:
result = 'PASS' if meta['event'] == 'ok' else 'FAIL'
PASS = '\033[92m'
FAIL = '\033[91m'
ENDC = '\033[0m'
color = PASS if meta['event'] == 'ok' else FAIL
if args.color_tests == 'yes':
print('{}{}{}: {}'.format(color, result, ENDC, meta['name']))
else:
print('{}: {}'.format(result, meta['name']))
trs_file.write(':test-result: {} {}\n'.format(result, meta['name']))
log_file.write('test: {}\n{}\n\n'.format(meta['name'], meta.get('stdout', '')))
log_file.close()
# TODO: define :global-test-result: correctly
trs_file.write(':global-test-result: {}\n'.format('PASS'))
# TODO: define :recheck: correctly
trs_file.write(':recheck: no\n')
trs_file.write(':copy-in-global-log: no\n')
trs_file.close()
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import argparse
import os
import subprocess
from tempfile import NamedTemporaryFile
def checkQmakePath(path):
if path is None:
return False
if path == "**Unknown**":
return False
if not os.path.isdir(path):
return False
return True
def findProgram(path, progName):
if not checkQmakePath(path):
return None
progPath = os.path.join(path, progName)
if not os.path.isfile(progPath):
return None
return progPath
class QmlModuleChecker:
def __init__(self):
self.qt5 = True
self.qmlimportscanner = None
self.qmlpath = None
def genQmlFile(self, f, modules):
for module, version in modules:
f.write("import {} {}\n".format(module, version))
f.write("Item {}\n")
f.flush()
def scanImports(self, f, modules):
ret = subprocess.run(
[
self.qmlimportscanner,
"-qmlFiles", f.name,
"-importPath", self.qmlpath
],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
)
if ret.returncode != 0:
print(ret.stderr.strip())
return None
return json.loads(ret.stdout)
def checkImports(self, scanlist, modules):
ret = True
for name, version in modules:
found = False
for entry in scanlist:
if entry["type"] == "module" and entry["name"] == name:
#qt6 modules have no version
if self.qt5 and not entry["version"] == version:
continue
if "classname" in entry:
found = True
break
print("checking for {} {}... {}".format(name, version, "yes" if found else "no"))
if not found:
ret = False
return ret
def getInstallInfo(self, qmake, qtconf):
qmake_cmd = [ qmake, "-query" ]
if qtconf:
qmake_cmd += [ "-qtconf", qtconf ]
ret = subprocess.run(
qmake_cmd,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
encoding="utf8"
)
if ret.returncode != 0:
print(ret.stderr.strip())
return False
binpath_host = None
libexec_host = None
binpath_install = None
libexec_install = None
qtmajor = ""
for l in ret.stdout.splitlines():
l.strip()
if l.startswith("QT_HOST_BINS:"):
binpath_host = l.split(":", 1)[1]
elif l.startswith("QT_HOST_LIBEXECS:"):
libexec_host = l.split(":", 1)[1]
elif l.startswith("QT_INSTALL_BINS:"):
binpath_install = l.split(":", 1)[1]
elif l.startswith("QT_INSTALL_LIBEXECS:"):
libexec_install = l.split(":", 1)[1]
elif l.startswith("QT_INSTALL_QML:"):
self.qmlpath = l.split(":", 1)[1]
elif l.startswith("QT_VERSION:"):
qmlversion = l.split(":", 1)[1]
qtmajor = qmlversion.split(".")[0]
if qtmajor == "6":
self.qt5 = False
if not checkQmakePath(self.qmlpath):
print("Qml path {} not found".format(self.qmlpath))
return False
self.qmlimportscanner = findProgram(binpath_install, "qmlimportscanner")
if self.qmlimportscanner is not None:
return True
#Qt6 may place qmlimportscanner in libexec_host
self.qmlimportscanner = findProgram(libexec_install, "qmlimportscanner")
if self.qmlimportscanner is not None:
return True
self.qmlimportscanner = findProgram(binpath_host, "qmlimportscanner")
if self.qmlimportscanner is not None:
return True
#Qt6 may place qmlimportscanner in libexec_host
self.qmlimportscanner = findProgram(libexec_host, "qmlimportscanner")
if self.qmlimportscanner is not None:
return True
print("qmlimportscanner not found")
return False
class KeyValue(argparse.Action):
def __call__( self , parser, namespace,
values, option_string = None):
setattr(namespace, self.dest, [])
for value in values:
key, value = value.split('=')
getattr(namespace, self.dest).append((key, value))
def main():
parser = argparse.ArgumentParser("check for qml runtime dependencies")
parser.add_argument(
"--qmake", type=str, required=True,
help="native qmake path")
parser.add_argument(
"--qtconf", type=str, required=False,
help="qmake qtconf path")
parser.add_argument(
"--modules", nargs="+", action=KeyValue, required=True,
help="list of modules to check in the form module=version (ex QtQuick=2.12)")
args = parser.parse_args()
moduleChecker = QmlModuleChecker()
if not moduleChecker.getInstallInfo(args.qmake, args.qtconf):
exit(-1)
with NamedTemporaryFile(mode="w+", suffix=".qml") as f:
moduleChecker.genQmlFile(f, args.modules)
scanlist = moduleChecker.scanImports(f, args.modules)
if scanlist is None:
exit(-1)
if not moduleChecker.checkImports(scanlist, args.modules):
exit(-1)
exit(0)
if __name__ == "__main__":
main()
File mode changed from 100644 to 100755
# SIMD checks
enable_sse = false
enable_avx = false
if host_machine.cpu_family().startswith('x86')
enable_sse = get_option('sse').allowed()
enable_avx = get_option('avx').allowed()
endif
# Check for fully workin SSE2 intrinsics
have_sse2_intrinsics = cc.compiles('''
have_sse2_intrinsics = enable_sse and cc.compiles('''
#include <emmintrin.h>
#include <stdint.h>
uint64_t frobzor;
......@@ -18,69 +25,83 @@ have_sse2_intrinsics = cc.compiles('''
frobzor = (uint64_t)_mm_movepi64_pi64(a);
}
''', args: ['-msse2'], name: 'SSE2 intrinsics check')
cdata.set('HAVE_SSE2_INTRINSICS', have_sse2_intrinsics)
if have_sse2_intrinsics
cdata.set('HAVE_SSE2_INTRINSICS', 1)
endif
# Check for SSE2 inline assembly support
can_compile_sse2 = cc.compiles('''
can_compile_sse2 = enable_sse and cc.compiles('''
void f() {
void *p;
asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
}
''', args: ['-msse'], name: 'SSE2 inline asm check')
cdata.set('CAN_COMPILE_SSE2', can_compile_sse2)
if can_compile_sse2
cdata.set('CAN_COMPILE_SSE2', 1)
endif
have_sse2 = can_compile_sse2
# Check for SSE3 inline assembly support
can_compile_sse3 = cc.compiles('''
can_compile_sse3 = enable_sse and cc.compiles('''
void f() {
void *p;
asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
}
''', args: ['-msse'], name: 'SSE3 inline asm check')
cdata.set('CAN_COMPILE_SSE3', can_compile_sse3)
if can_compile_sse3
cdata.set('CAN_COMPILE_SSE3', 1)
endif
# Check for SSSE3 inline assembly support
can_compile_2_sse3 = cc.compiles('''
can_compile_2_sse3 = enable_sse and cc.compiles('''
void f() {
void *p;
asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
}
''', args: ['-msse'], name: 'SSSE3 inline asm check')
cdata.set('CAN_COMPILE_SSSE3', can_compile_2_sse3)
if can_compile_2_sse3
cdata.set('CAN_COMPILE_SSSE3', 1)
endif
have_sse3 = can_compile_sse3 and can_compile_2_sse3
# Check for SSE4.1 inline assembly support
can_compile_sse4_1 = cc.compiles('''
can_compile_sse4_1 = enable_sse and cc.compiles('''
void f() {
void *p;
asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
}
''', args: ['-msse'], name: 'SSE4.1 inline asm check')
cdata.set('CAN_COMPILE_SSE4_1', can_compile_sse4_1)
if can_compile_sse4_1
cdata.set('CAN_COMPILE_SSE4_1', 1)
endif
have_sse4_1 = can_compile_sse4_1
# Check for SSE4.2 inline assembly support
can_compile_sse4_2 = cc.compiles('''
can_compile_sse4_2 = enable_sse and cc.compiles('''
void f() {
void *p;
asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
}
''', args: ['-msse'], name: 'SSE4.2 inline asm check')
cdata.set('CAN_COMPILE_SSE4_2', can_compile_sse4_2)
if can_compile_sse4_2
cdata.set('CAN_COMPILE_SSE4_2', 1)
endif
have_sse4_2 = can_compile_sse4_2
# Check for SSE4A inline assembly support
can_compile_sse4A = cc.compiles('''
can_compile_sse4A = enable_sse and cc.compiles('''
void f() {
void *p;
asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
}
''', args: ['-msse'], name: 'SSE4A inline asm check')
cdata.set('CAN_COMPILE_SSE4A', can_compile_sse4A)
if can_compile_sse4A
cdata.set('CAN_COMPILE_SSE4A', 1)
endif
have_sse4A = can_compile_sse4A
# Check for fully workin AVX2 intrinsics
have_avx2_intrinsics = cc.compiles('''
have_avx2_intrinsics = enable_avx and cc.compiles('''
#include <immintrin.h>
#include <stdint.h>
uint64_t frobzor;
......@@ -97,26 +118,32 @@ have_avx2_intrinsics = cc.compiles('''
frobzor = (uint64_t)_mm256_extract_epi64(a, 0);
}
''', args: ['-mavx2'], name: 'AVX2 intrinsics check')
cdata.set('HAVE_AVX2_INTRINSICS', have_avx2_intrinsics)
if have_avx2_intrinsics
cdata.set('HAVE_AVX2_INTRINSICS', 1)
endif
# Check for AVX inline assembly support
can_compile_avx = cc.compiles('''
can_compile_avx = enable_avx and cc.compiles('''
void f() {
void *p;
asm volatile("vxorps %%ymm1,%%ymm2,%%ymm3"::"r"(p):"ymm1", "ymm2", "ymm3");
}
''', args: ['-mavx'], name: 'AVX inline asm check')
cdata.set('CAN_COMPILE_AVX', can_compile_avx)
if can_compile_avx
cdata.set('CAN_COMPILE_AVX', 1)
endif
have_avx = can_compile_avx
# Check for AVX2 inline assembly support
can_compile_avx2 = cc.compiles('''
can_compile_avx2 = enable_avx and cc.compiles('''
void f() {
void *p;
asm volatile("vpunpckhqdq %%ymm1,%%ymm2,%%ymm3"::"r"(p):"ymm1", "ymm2", "ymm3");
}
''', args: ['-mavx'], name: 'AVX2 inline asm check')
cdata.set('CAN_COMPILE_AVX2', can_compile_avx2)
if can_compile_avx2
cdata.set('CAN_COMPILE_AVX2', 1)
endif
have_avx2 = can_compile_avx2
# TODO: ARM Neon checks and SVE checks
......
test_heap
test_strnstr
test_*