-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libdvdnav,libdvdread] New ports, with ffmpeg integration (#40898)
- Loading branch information
Showing
14 changed files
with
313 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
diff --git a/msvc/config.h b/msvc/config.h | ||
index 25f68fb..c3f00f1 100644 | ||
--- a/msvc/config.h | ||
+++ b/msvc/config.h | ||
@@ -28,7 +28,8 @@ | ||
#define inline __inline | ||
/* #undef size_t */ | ||
|
||
-#define ssize_t __int64 | ||
+#include <windows.h> | ||
+typedef SSIZE_T ssize_t; | ||
|
||
#ifndef PATH_MAX | ||
#define PATH_MAX MAX_PATH | ||
@@ -43,14 +44,6 @@ | ||
#define S_ISCHR(m) 0 | ||
|
||
/* Fallback types (very x86-centric, sorry) */ | ||
-typedef unsigned char uint8_t; | ||
-typedef signed char int8_t; | ||
-typedef unsigned short uint16_t; | ||
-typedef signed short int16_t; | ||
-typedef unsigned int uint32_t; | ||
-typedef signed int int32_t; | ||
-typedef unsigned __int64 uint64_t; | ||
-typedef signed __int64 int64_t; | ||
-typedef unsigned int uintptr_t; | ||
+#include <stdint.h> | ||
|
||
#endif /* LIBDVNAV_CONFIG_H */ | ||
diff --git a/msvc/include/sys/time.h b/msvc/include/sys/time.h | ||
index 843e252..8014739 100644 | ||
--- a/msvc/include/sys/time.h | ||
+++ b/msvc/include/sys/time.h | ||
@@ -26,3 +26,4 @@ | ||
*/ | ||
|
||
#include <time.h> | ||
+#include <winsock2.h> | ||
diff --git a/src/dvdnav_internal.h b/src/dvdnav_internal.h | ||
index 495f032..a0aaeaf 100644 | ||
--- a/src/dvdnav_internal.h | ||
+++ b/src/dvdnav_internal.h | ||
@@ -39,6 +39,7 @@ typedef CRITICAL_SECTION pthread_mutex_t; | ||
#ifndef HAVE_GETTIMEOFDAY | ||
/* replacement gettimeofday implementation */ | ||
#include <sys/timeb.h> | ||
+#include <winsock2.h> | ||
static inline int _private_gettimeofday( struct timeval *tv, void *tz ) | ||
{ | ||
struct timeb t; | ||
@@ -232,7 +233,7 @@ int64_t dvdnav_convert_time(dvd_time_t *time); | ||
#define printerrf(format, args...) \ | ||
do { if (this) snprintf(this->err_str, MAX_ERR_LEN, format, ## args); } while (0) | ||
#else | ||
-#ifdef _MSC_VER | ||
+#if 0 | ||
#define printerrf(str) \ | ||
do { if (this) snprintf(this->err_str, MAX_ERR_LEN, str); } while (0) | ||
#else | ||
diff --git a/src/read_cache.c b/src/read_cache.c | ||
index 1b2862d..abc786a 100644 | ||
--- a/src/read_cache.c | ||
+++ b/src/read_cache.c | ||
@@ -87,7 +87,7 @@ struct read_cache_s { | ||
# if READ_CACHE_TRACE | ||
# define dprintf(fmt, ...) fprintf(MSG_OUT, "libdvdnav: %s: "fmt, __func__ , __VA_ARGS__) | ||
# else | ||
-#ifdef _MSC_VER | ||
+#if 0 | ||
# define dprintf(fmt, str) /* Nowt */ | ||
#else | ||
# define dprintf(fmt, ...) /* Nowt */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/configure.ac b/configure.ac | ||
index 595378b..516f26e 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -118,6 +118,7 @@ dnl | ||
dnl This should be after all checks | ||
dnl --------------------------------------------- | ||
AS_CASE([$host_os], | ||
+ [*mingw32*], LDFLAGS="-no-undefined $LDFLAGS", | ||
[os2*], [LDFLAGS="$LDFLAGS -no-undefined"]) | ||
|
||
dnl --------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
vcpkg_from_gitlab( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
GITLAB_URL https://code.videolan.org/ | ||
REPO videolan/libdvdnav | ||
REF ${VERSION} | ||
SHA512 080814c30f193176393bf6d4496a1e815b3b288cd102201ba177a13a46f733e1e0b5e05d6ca169e902c669d6f3567926c97e5a20a6712ed5620dcb10c3c3a022 | ||
HEAD_REF master | ||
PATCHES | ||
msvc.diff | ||
no-undefined.diff | ||
) | ||
file(REMOVE_RECURSE "${SOURCE_PATH}/msvc/include/inttypes.h") | ||
|
||
vcpkg_find_acquire_program(PKGCONFIG) | ||
cmake_path(GET PKGCONFIG PARENT_PATH pkgconfig_dir) | ||
vcpkg_add_to_path("${pkgconfig_dir}") | ||
|
||
set(cppflags "") | ||
if(VCPKG_TARGET_IS_WINDOWS) | ||
# PATH_MAX from msvc/libdvdcss.vcxproj | ||
set(cppflags "CPPFLAGS=\$CPPFLAGS -DPATH_MAX=2048 -DWIN32_LEAN_AND_MEAN") | ||
if(NOT VCPKG_TARGET_IS_MINGW) | ||
cmake_path(RELATIVE_PATH SOURCE_PATH BASE_DIRECTORY "${CURRENT_BUILDTREES_DIR}" OUTPUT_VARIABLE sources) | ||
string(APPEND cppflags " -I../${sources}/msvc/include -D_CRT_SECURE_NO_WARNINGS") | ||
endif() | ||
endif() | ||
|
||
vcpkg_configure_make( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
AUTOCONFIG | ||
OPTIONS | ||
${cppflags} | ||
) | ||
vcpkg_install_make() | ||
vcpkg_copy_pdbs() | ||
vcpkg_fixup_pkgconfig() | ||
|
||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/debug/include" | ||
"${CURRENT_PACKAGES_DIR}/debug/share" | ||
) | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "libdvdnav", | ||
"version-semver": "6.1.1", | ||
"description": "Library to navigate DVD disks", | ||
"homepage": "https://www.videolan.org/developers/libdvdnav.html", | ||
"license": "GPL-2.0-or-later", | ||
"supports": "!uwp & !xbox", | ||
"dependencies": [ | ||
"libdvdread" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/msvc/config.h b/msvc/config.h | ||
index 4e9b60e..2f1e615 100644 | ||
--- a/msvc/config.h | ||
+++ b/msvc/config.h | ||
@@ -28,7 +28,6 @@ | ||
#define inline __inline | ||
/* #undef size_t */ | ||
|
||
-#define ssize_t __int64 | ||
|
||
#ifndef PATH_MAX | ||
#define PATH_MAX MAX_PATH | ||
@@ -43,14 +42,6 @@ | ||
#define S_ISCHR(m) 0 | ||
|
||
/* Fallback types (very x86-centric, sorry) */ | ||
-typedef unsigned char uint8_t; | ||
-typedef signed char int8_t; | ||
-typedef unsigned short uint16_t; | ||
-typedef signed short int16_t; | ||
-typedef unsigned int uint32_t; | ||
-typedef signed int int32_t; | ||
-typedef unsigned __int64 uint64_t; | ||
-typedef signed __int64 int64_t; | ||
-typedef unsigned int uintptr_t; | ||
+#include <stdint.h> | ||
|
||
#endif /* LIBDVDREAD_CONFIG_H */ | ||
diff --git a/src/dvd_reader.c b/src/dvd_reader.c | ||
index c4d9641..b3b0158 100644 | ||
--- a/src/dvd_reader.c | ||
+++ b/src/dvd_reader.c | ||
@@ -60,6 +60,7 @@ | ||
|
||
#if defined(_WIN32) | ||
# include <windows.h> | ||
+# include <winsock2.h> | ||
# include "msvc/contrib/win32_cs.h" | ||
#endif | ||
|
||
diff --git a/src/dvdread/dvd_reader.h b/src/dvdread/dvd_reader.h | ||
index 5681e0e..6c1cee6 100644 | ||
--- a/src/dvdread/dvd_reader.h | ||
+++ b/src/dvdread/dvd_reader.h | ||
@@ -24,7 +24,9 @@ | ||
#define LIBDVDREAD_DVD_READER_H | ||
|
||
#ifdef _MSC_VER | ||
-#include <config.h> | ||
+#include <windows.h> | ||
+typedef SSIZE_T ssize_t; | ||
+#include <stdint.h> | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/configure.ac b/configure.ac | ||
index a60ef0c..eeb6715 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -63,6 +63,7 @@ AS_CASE([$host], | ||
[*mingw32* | *cygwin*], [AC_CHECK_FUNCS(gettimeofday)]) | ||
|
||
AS_CASE([$host], | ||
+ [*mingw32*], LDFLAGS="-no-undefined $LDFLAGS", | ||
[*-os2-*], LDFLAGS="-no-undefined -Zbin-files $LDFLAGS") | ||
|
||
AS_CASE([$host], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
vcpkg_from_gitlab( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
GITLAB_URL https://code.videolan.org/ | ||
REPO videolan/libdvdread | ||
REF ${VERSION} | ||
SHA512 9eb6d551489ab1d214c56461eebafd6ecba7de8dcc60aecb7e22f82c019fd3d045fc09af66507c2e14bc53e099aec8e87620dfd988fe047a7bfa5e5d1d2c46bd | ||
HEAD_REF master | ||
PATCHES | ||
msvc.diff | ||
no-undefined.diff | ||
) | ||
file(REMOVE_RECURSE "${SOURCE_PATH}/msvc/include/inttypes.h") | ||
file(TOUCH "${SOURCE_PATH}/msvc/include/strings.h") | ||
file(WRITE "${SOURCE_PATH}/ChangeLog" "Cf. https://code.videolan.org/videolan/libdvdread/-/commits/${VERSION}/") # not in git | ||
|
||
vcpkg_find_acquire_program(PKGCONFIG) | ||
cmake_path(GET PKGCONFIG PARENT_PATH pkgconfig_dir) | ||
vcpkg_add_to_path("${pkgconfig_dir}") | ||
|
||
set(cppflags "") | ||
if(VCPKG_TARGET_IS_WINDOWS) | ||
# PATH_MAX from msvc/libdvdcss.vcxproj | ||
set(cppflags "CPPFLAGS=\$CPPFLAGS -DPATH_MAX=2048 -DWIN32_LEAN_AND_MEAN") | ||
if(NOT VCPKG_TARGET_IS_MINGW) | ||
cmake_path(RELATIVE_PATH SOURCE_PATH BASE_DIRECTORY "${CURRENT_BUILDTREES_DIR}" OUTPUT_VARIABLE sources) | ||
string(APPEND cppflags " -I../${sources}/msvc/include -D_CRT_SECURE_NO_WARNINGS") | ||
endif() | ||
endif() | ||
|
||
vcpkg_configure_make( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
AUTOCONFIG | ||
OPTIONS | ||
--disable-apidoc | ||
--with-libdvdcss | ||
${cppflags} | ||
) | ||
vcpkg_install_make() | ||
vcpkg_copy_pdbs() | ||
vcpkg_fixup_pkgconfig() | ||
|
||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/debug/include" | ||
"${CURRENT_PACKAGES_DIR}/debug/share" | ||
) | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "libdvdread", | ||
"version-semver": "6.1.3", | ||
"description": "Library to read DVD disks", | ||
"homepage": "https://www.videolan.org/developers/libdvdnav.html", | ||
"license": "GPL-2.0-or-later", | ||
"supports": "!uwp & !xbox", | ||
"dependencies": [ | ||
"libdvdcss" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "f485b361aac72478f3e46980db33aa01d2be99e4", | ||
"version-semver": "6.1.1", | ||
"port-version": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "6ffa5a51a9de24eab67fc6f620f05e03f5a21222", | ||
"version-semver": "6.1.3", | ||
"port-version": 0 | ||
} | ||
] | ||
} |