diff --git a/.gitmodules b/.gitmodules index daf71be94..0182fcf66 100644 --- a/.gitmodules +++ b/.gitmodules @@ -61,7 +61,8 @@ url = https://github.com/Cyan4973/xxHash.git [submodule "third_party/FFmpeg"] path = third_party/FFmpeg - url = https://github.com/xenia-canary/FFmpeg_radixsplit.git + url = https://github.com/has207/FFmpeg.git + branch = xmaframes [submodule "third_party/premake-androidndk"] path = third_party/premake-androidndk url = https://github.com/Triang3l/premake-androidndk.git diff --git a/premake5.lua b/premake5.lua index 5272229ed..951a26db9 100644 --- a/premake5.lua +++ b/premake5.lua @@ -430,7 +430,7 @@ workspace("xenia") include("third_party/discord-rpc.lua") include("third_party/cxxopts.lua") include("third_party/tomlplusplus.lua") - include("third_party/FFmpeg/premake5.lua") + include("third_party/ffmpeg-xenia/premake5.lua") include("third_party/fmt.lua") include("third_party/glslang-spirv.lua") include("third_party/imgui.lua") diff --git a/src/xenia/apu/premake5.lua b/src/xenia/apu/premake5.lua index a22022563..0b0b297e2 100644 --- a/src/xenia/apu/premake5.lua +++ b/src/xenia/apu/premake5.lua @@ -14,6 +14,7 @@ project("xenia-apu") }) includedirs({ project_root.."/third_party/FFmpeg", + project_root.."/third_party/ffmpeg-xenia", }) filter("platforms:Linux") links({ diff --git a/third_party/ffmpeg-xenia/config.h b/third_party/ffmpeg-xenia/config.h new file mode 100644 index 000000000..f31ca55bd --- /dev/null +++ b/third_party/ffmpeg-xenia/config.h @@ -0,0 +1,421 @@ +/* + * FFmpeg build configuration for xenia. + * Replaces 4 per-platform generated config headers with a single file + * using preprocessor platform detection. + * Undefined macros evaluate to 0 in #if checks. + */ +#ifndef FFMPEG_CONFIG_H +#define FFMPEG_CONFIG_H + +#define FFMPEG_CONFIGURATION "xenia-custom" +#define FFMPEG_LICENSE "LGPL version 2.1 or later" +#define CONFIG_THIS_YEAR 2021 +#define av_restrict restrict +#define EXTERN_PREFIX "" +#define EXTERN_ASM +#define BUILDSUF "" +#define HAVE_MMX2 HAVE_MMXEXT +#define SWS_MAX_FILTER_SIZE 256 + +/* ------------------------------------------------------------------ */ +/* Architecture + CPU features */ +/* Some of these are used in C if() expressions, not just #if, so */ +/* every ARCH_* / HAVE_*_EXTERNAL must be explicitly defined. */ +/* ------------------------------------------------------------------ */ + +/* Zero-default all architecture flags (used in C if() expressions) */ +#define ARCH_AARCH64 0 +#define ARCH_ALPHA 0 +#define ARCH_ARM 0 +#define ARCH_MIPS 0 +#define ARCH_PPC 0 +#define ARCH_X86 0 +#define ARCH_X86_64 0 + +#if defined(__aarch64__) + /* ARM64 (Android) */ + #define SLIBSUF ".so" + #undef ARCH_AARCH64 + #define ARCH_AARCH64 1 + #define HAVE_ARMV8 1 + #define HAVE_NEON 1 + #define HAVE_VFP 1 + #define HAVE_ARMV8_EXTERNAL 1 + #define HAVE_NEON_EXTERNAL 1 + #define HAVE_VFP_EXTERNAL 1 + #define HAVE_ARMV8_INLINE 1 + #define HAVE_NEON_INLINE 1 + #define HAVE_VFP_INLINE 1 + #define HAVE_INTRINSICS_NEON 1 + #define HAVE_ALIGNED_STACK 1 + #define HAVE_FAST_64BIT 1 + #define HAVE_FAST_CLZ 1 + #define HAVE_SIMD_ALIGN_16 1 +#elif defined(__x86_64__) || defined(_M_X64) + /* x86_64 (Windows, Linux, Android x86_64) */ + #if defined(_WIN32) + #define SLIBSUF ".dll" + #else + #define SLIBSUF ".so" + #endif + #undef ARCH_X86 + #define ARCH_X86 1 + #undef ARCH_X86_64 + #define ARCH_X86_64 1 + #define HAVE_AESNI 1 + #define HAVE_AMD3DNOW 1 + #define HAVE_AMD3DNOWEXT 1 + #define HAVE_AVX 1 + #define HAVE_AVX2 1 + #define HAVE_AVX512 1 + #define HAVE_FMA3 1 + #define HAVE_FMA4 1 + #define HAVE_MMX 1 + #define HAVE_MMXEXT 1 + #define HAVE_SSE 1 + #define HAVE_SSE2 1 + #define HAVE_SSE3 1 + #define HAVE_SSE4 1 + #define HAVE_SSE42 1 + #define HAVE_SSSE3 1 + #define HAVE_XOP 1 + #define HAVE_CPUNOP 1 + #define HAVE_I686 1 + #define HAVE_ALIGNED_STACK 1 + #define HAVE_FAST_64BIT 1 + #define HAVE_FAST_CLZ 1 + #define HAVE_FAST_CMOV 1 + #define HAVE_LOCAL_ALIGNED 1 + #define HAVE_SIMD_ALIGN_16 1 + #define HAVE_SIMD_ALIGN_32 1 + #define HAVE_SIMD_ALIGN_64 1 + /* GCC/Clang x86 inline asm variants */ + #if !defined(_MSC_VER) + #define HAVE_AESNI_INLINE 1 + #define HAVE_AMD3DNOW_INLINE 1 + #define HAVE_AMD3DNOWEXT_INLINE 1 + #define HAVE_AVX_INLINE 1 + #define HAVE_AVX2_INLINE 1 + #define HAVE_AVX512_INLINE 1 + #define HAVE_FMA3_INLINE 1 + #define HAVE_FMA4_INLINE 1 + #define HAVE_MMX_INLINE 1 + #define HAVE_MMXEXT_INLINE 1 + #define HAVE_SSE_INLINE 1 + #define HAVE_SSE2_INLINE 1 + #define HAVE_SSE3_INLINE 1 + #define HAVE_SSE4_INLINE 1 + #define HAVE_SSE42_INLINE 1 + #define HAVE_SSSE3_INLINE 1 + #define HAVE_XOP_INLINE 1 + #define HAVE_MM_EMPTY 1 + #define HAVE_EBP_AVAILABLE 1 + #define HAVE_EBX_AVAILABLE 1 + #define HAVE_XMM_CLOBBERS 1 + #define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1 + #endif +#else + #error "Unsupported architecture for FFmpeg build" +#endif + +/* Endianness (used in C expressions, not just #if) */ +#define HAVE_BIGENDIAN 0 + +/* Zero-default all INLINE flags (only set to 1 on GCC/Clang above) */ +#ifndef HAVE_AESNI_INLINE +#define HAVE_AESNI_INLINE 0 +#endif +#ifndef HAVE_AMD3DNOW_INLINE +#define HAVE_AMD3DNOW_INLINE 0 +#endif +#ifndef HAVE_AMD3DNOWEXT_INLINE +#define HAVE_AMD3DNOWEXT_INLINE 0 +#endif +#ifndef HAVE_AVX_INLINE +#define HAVE_AVX_INLINE 0 +#endif +#ifndef HAVE_AVX2_INLINE +#define HAVE_AVX2_INLINE 0 +#endif +#ifndef HAVE_AVX512_INLINE +#define HAVE_AVX512_INLINE 0 +#endif +#ifndef HAVE_FMA3_INLINE +#define HAVE_FMA3_INLINE 0 +#endif +#ifndef HAVE_FMA4_INLINE +#define HAVE_FMA4_INLINE 0 +#endif +#ifndef HAVE_MMX_INLINE +#define HAVE_MMX_INLINE 0 +#endif +#ifndef HAVE_MMXEXT_INLINE +#define HAVE_MMXEXT_INLINE 0 +#endif +#ifndef HAVE_SSE_INLINE +#define HAVE_SSE_INLINE 0 +#endif +#ifndef HAVE_SSE2_INLINE +#define HAVE_SSE2_INLINE 0 +#endif +#ifndef HAVE_SSE3_INLINE +#define HAVE_SSE3_INLINE 0 +#endif +#ifndef HAVE_SSE4_INLINE +#define HAVE_SSE4_INLINE 0 +#endif +#ifndef HAVE_SSE42_INLINE +#define HAVE_SSE42_INLINE 0 +#endif +#ifndef HAVE_SSSE3_INLINE +#define HAVE_SSSE3_INLINE 0 +#endif +#ifndef HAVE_XOP_INLINE +#define HAVE_XOP_INLINE 0 +#endif + +/* x86asm (nasm/yasm) is not used; all EXTERNAL flags are 0 */ +#define HAVE_X86ASM 0 +#define HAVE_AESNI_EXTERNAL 0 +#define HAVE_AMD3DNOW_EXTERNAL 0 +#define HAVE_AMD3DNOWEXT_EXTERNAL 0 +#define HAVE_AVX_EXTERNAL 0 +#define HAVE_AVX2_EXTERNAL 0 +#define HAVE_AVX512_EXTERNAL 0 +#define HAVE_FMA3_EXTERNAL 0 +#define HAVE_FMA4_EXTERNAL 0 +#define HAVE_MMX_EXTERNAL 0 +#define HAVE_MMXEXT_EXTERNAL 0 +#define HAVE_SSE_EXTERNAL 0 +#define HAVE_SSE2_EXTERNAL 0 +#define HAVE_SSE3_EXTERNAL 0 +#define HAVE_SSE4_EXTERNAL 0 +#define HAVE_SSE42_EXTERNAL 0 +#define HAVE_SSSE3_EXTERNAL 0 +#define HAVE_XOP_EXTERNAL 0 +#define HAVE_CPUNOP_EXTERNAL 0 +#define HAVE_I686_EXTERNAL 0 + +/* MIPS CPU features (used in C if() expressions) */ +#define HAVE_MIPSFPU 0 +#define HAVE_MIPSDSP 0 + +/* CPU features used in C expressions cross-platform (e.g. mem.c ALIGN) */ +#ifndef HAVE_AVX +#define HAVE_AVX 0 +#endif +#ifndef HAVE_AVX512 +#define HAVE_AVX512 0 +#endif + +/* Disabled features (used in C if() expressions, not just #if) */ +#define CONFIG_FRAME_THREAD_ENCODER 0 +#define CONFIG_GRAY 0 +#define CONFIG_MEMORY_POISONING 0 +#define CONFIG_MPEG4_DECODER 0 +#define CONFIG_SMALL 0 +#define CONFIG_ZLIB 0 + +/* ------------------------------------------------------------------ */ +/* OS-specific defines */ +/* ------------------------------------------------------------------ */ + +#if defined(_WIN32) + /* Windows (MSVC) */ + #define HAVE_W32THREADS 1 + #define HAVE_WINDOWS_H 1 + #define HAVE_IO_H 1 + #define HAVE_DIRECT_H 1 + #define HAVE_DXGIDEBUG_H 1 + #define HAVE_DXVA_H 1 + #define HAVE_ALIGNED_MALLOC 1 + #define HAVE_BCRYPT 1 + #define HAVE_DOS_PATHS 1 + #define HAVE_LIBC_MSVCRT 1 + #define HAVE_MEMORYBARRIER 1 + #define HAVE_RDTSC 1 + #define HAVE_COMMANDLINETOARGVW 1 + #define HAVE_GETMODULEHANDLE 1 + #define HAVE_GETPROCESSAFFINITYMASK 1 + #define HAVE_GETPROCESSMEMORYINFO 1 + #define HAVE_GETPROCESSTIMES 1 + #define HAVE_GETSTDHANDLE 1 + #define HAVE_GETSYSTEMTIMEASFILETIME 1 + #define HAVE_KBHIT 1 + #define HAVE_MAPVIEWOFFILE 1 + #define HAVE_PEEKNAMEDPIPE 1 + #define HAVE_SETCONSOLETEXTATTRIBUTE 1 + #define HAVE_SETCONSOLECTRLHANDLER 1 + #define HAVE_SETDLLDIRECTORY 1 + #define HAVE_SETMODE 1 + #define HAVE_SLEEP 1 + #define HAVE_VIRTUALALLOC 1 +#else + /* POSIX (Linux, Android) */ + #define HAVE_DOS_PATHS 0 + #define HAVE_PTHREADS 1 + #define HAVE_INLINE_ASM 1 + #define HAVE_UNISTD_H 1 + #define HAVE_ARPA_INET_H 1 + #define HAVE_ASM_TYPES_H 1 + #define HAVE_DIRENT_H 1 + #define HAVE_LINUX_PERF_EVENT_H 1 + #define HAVE_POLL_H 1 + #define HAVE_SYS_PARAM_H 1 + #define HAVE_SYS_RESOURCE_H 1 + #define HAVE_SYS_SELECT_H 1 + #define HAVE_SYS_TIME_H 1 + #define HAVE_SYS_UN_H 1 + #define HAVE_TERMIOS_H 1 + #define HAVE_SEM_TIMEDWAIT 1 + #define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1 + #define HAVE_SECTION_DATA_REL_RO 1 + #define HAVE_CLOCK_GETTIME 1 + #define HAVE_FCNTL 1 + #define HAVE_GETADDRINFO 1 + #define HAVE_GETOPT 1 + #define HAVE_GETRUSAGE 1 + #define HAVE_GETTIMEOFDAY 1 + #define HAVE_GMTIME_R 1 + #define HAVE_INET_ATON 1 + #define HAVE_LOCALTIME_R 1 + #define HAVE_LSTAT 1 + #define HAVE_MEMALIGN 1 + #define HAVE_MKSTEMP 1 + #define HAVE_MMAP 1 + #define HAVE_MPROTECT 1 + #define HAVE_NANOSLEEP 1 + #define HAVE_POSIX_MEMALIGN 1 + #define HAVE_SCHED_GETAFFINITY 1 + #define HAVE_SETRLIMIT 1 + #define HAVE_STRERROR_R 1 + #define HAVE_SYSCONF 1 + #define HAVE_USLEEP 1 + #define HAVE_INLINE_ASM_LABELS 1 + #define HAVE_INLINE_ASM_NONLOCAL_LABELS 1 + #define HAVE_SYMVER_ASM_LABEL 1 + #define HAVE_SYMVER_GNU_ASM 1 + #define HAVE_SOCKLEN_T 1 + #define HAVE_STRUCT_ADDRINFO 1 + #define HAVE_STRUCT_GROUP_SOURCE_REQ 1 + #define HAVE_STRUCT_IP_MREQ_SOURCE 1 + #define HAVE_STRUCT_IPV6_MREQ 1 + #define HAVE_STRUCT_MSGHDR_MSG_FLAGS 1 + #define HAVE_STRUCT_POLLFD 1 + #define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1 + #define HAVE_STRUCT_SOCKADDR_IN6 1 + #define HAVE_STRUCT_SOCKADDR_STORAGE 1 + #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 + #define CONFIG_PIC 1 + #if defined(__ANDROID__) + #define HAVE_ARC4RANDOM 1 + #define HAVE_RSYNC_CONTIMEOUT 1 + #else + /* Linux desktop */ + #define HAVE_PTHREAD_CANCEL 1 + #define HAVE_SYMVER 1 + #define HAVE_SYS_SOUNDCARD_H 1 + #define HAVE_GLOB 1 + #define CONFIG_ICONV 1 + #endif +#endif + +/* ------------------------------------------------------------------ */ +/* Common to all platforms */ +/* ------------------------------------------------------------------ */ + +#define HAVE_FAST_UNALIGNED 1 +#define HAVE_THREADS 1 +#define HAVE_ACCESS 1 +#define HAVE_ISATTY 1 +#define HAVE_MALLOC_H 1 +#define HAVE_PRAGMA_DEPRECATED 1 + +/* Math functions */ +#define HAVE_ATANF 1 +#define HAVE_ATAN2F 1 +#define HAVE_CBRT 1 +#define HAVE_CBRTF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COSF 1 +#define HAVE_ERF 1 +#define HAVE_EXP2 1 +#define HAVE_EXP2F 1 +#define HAVE_EXPF 1 +#define HAVE_HYPOT 1 +#define HAVE_ISFINITE 1 +#define HAVE_ISINF 1 +#define HAVE_ISNAN 1 +#define HAVE_LDEXPF 1 +#define HAVE_LLRINT 1 +#define HAVE_LLRINTF 1 +#define HAVE_LOG2 1 +#define HAVE_LOG2F 1 +#define HAVE_LOG10F 1 +#define HAVE_LRINT 1 +#define HAVE_LRINTF 1 +#define HAVE_POWF 1 +#define HAVE_RINT 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SINF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 + +/* Enabled library components */ +#define CONFIG_AVCODEC 1 +#define CONFIG_AVFORMAT 1 +#define CONFIG_AVUTIL 1 +#define CONFIG_RUNTIME_CPUDETECT 1 +#define CONFIG_SAFE_BITSTREAM_READER 1 +#define CONFIG_STATIC 1 +#define CONFIG_SWSCALE_ALPHA 1 + +/* DSP / transform support */ +#define CONFIG_DCT 1 +#define CONFIG_FAAN 1 +#define CONFIG_FAANDCT 1 +#define CONFIG_FAANIDCT 1 +#define CONFIG_FAST_UNALIGNED 1 +#define CONFIG_FDCTDSP 1 +#define CONFIG_FFT 1 +#define CONFIG_IDCTDSP 1 +#define CONFIG_MDCT 1 +#define CONFIG_RDFT 1 +#define CONFIG_SINEWIN 1 + +/* Audio codec support */ +#define CONFIG_MPEGAUDIO 1 +#define CONFIG_MPEGAUDIODSP 1 +#define CONFIG_MPEGAUDIOHEADER 1 +#define CONFIG_WMA_FREQS 1 +#define CONFIG_RIFFDEC 1 + +/* Category enables */ +#define CONFIG_BSFS 1 +#define CONFIG_DECODERS 1 +#define CONFIG_DEMUXERS 1 +#define CONFIG_PARSERS 1 +#define CONFIG_PROTOCOLS 1 + +/* Enabled codecs */ +#define CONFIG_MP3_DECODER 1 +#define CONFIG_MP3FLOAT_DECODER 1 +#define CONFIG_WMAPRO_DECODER 1 +#define CONFIG_WMAV2_DECODER 1 +#define CONFIG_XMAFRAMES_DECODER 1 + +/* Enabled parsers */ +#define CONFIG_MPEGAUDIO_PARSER 1 + +/* Enabled demuxers */ +#define CONFIG_ASF_DEMUXER 1 +#define CONFIG_MP3_DEMUXER 1 + +/* Enabled protocols */ +#define CONFIG_FILE_PROTOCOL 1 + +/* Enabled bitstream filters */ +#define CONFIG_NULL_BSF 1 + +#endif /* FFMPEG_CONFIG_H */ diff --git a/third_party/ffmpeg-xenia/libavcodec/bsf_list.c b/third_party/ffmpeg-xenia/libavcodec/bsf_list.c new file mode 100644 index 000000000..d31ece942 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavcodec/bsf_list.c @@ -0,0 +1,3 @@ +static const AVBitStreamFilter * const bitstream_filters[] = { + &ff_null_bsf, + NULL }; diff --git a/third_party/ffmpeg-xenia/libavcodec/codec_list.c b/third_party/ffmpeg-xenia/libavcodec/codec_list.c new file mode 100644 index 000000000..c77643c83 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavcodec/codec_list.c @@ -0,0 +1,7 @@ +static const AVCodec * const codec_list[] = { + &ff_mp3float_decoder, + &ff_mp3_decoder, + &ff_wmapro_decoder, + &ff_wmav2_decoder, + &ff_xmaframes_decoder, + NULL }; diff --git a/third_party/ffmpeg-xenia/libavcodec/parser_list.c b/third_party/ffmpeg-xenia/libavcodec/parser_list.c new file mode 100644 index 000000000..f0dc7f295 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavcodec/parser_list.c @@ -0,0 +1,3 @@ +static const AVCodecParser * const parser_list[] = { + &ff_mpegaudio_parser, + NULL }; diff --git a/third_party/ffmpeg-xenia/libavcodec/premake5.lua b/third_party/ffmpeg-xenia/libavcodec/premake5.lua new file mode 100644 index 000000000..aa63e18f2 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavcodec/premake5.lua @@ -0,0 +1,160 @@ +project("libavcodec") + uuid("9DB2830C-D326-48ED-B4CC-08EA6A1B7272") + kind("StaticLib") + language("C") + ffmpeg_common() + + filter("files:not ../../FFmpeg/libavcodec/wmaprodec.c") + warnings "Off" + filter({}) + + links({ + "libavutil", + }) + + -- libavcodec/Makefile: + -- HEADERS: + files({ + "../../FFmpeg/libavcodec/ac3_parser.h", + "../../FFmpeg/libavcodec/adts_parser.h", + "../../FFmpeg/libavcodec/avcodec.h", + "../../FFmpeg/libavcodec/avdct.h", + "../../FFmpeg/libavcodec/avfft.h", + "../../FFmpeg/libavcodec/bsf.h", + "../../FFmpeg/libavcodec/codec.h", + "../../FFmpeg/libavcodec/codec_desc.h", + "../../FFmpeg/libavcodec/codec_id.h", + "../../FFmpeg/libavcodec/codec_par.h", + "../../FFmpeg/libavcodec/d3d11va.h", + "../../FFmpeg/libavcodec/dirac.h", + "../../FFmpeg/libavcodec/dv_profile.h", + "../../FFmpeg/libavcodec/dxva2.h", + "../../FFmpeg/libavcodec/jni.h", + "../../FFmpeg/libavcodec/mediacodec.h", + "../../FFmpeg/libavcodec/packet.h", + "../../FFmpeg/libavcodec/qsv.h", + "../../FFmpeg/libavcodec/vaapi.h", + "../../FFmpeg/libavcodec/vdpau.h", + "../../FFmpeg/libavcodec/version.h", + "../../FFmpeg/libavcodec/videotoolbox.h", + "../../FFmpeg/libavcodec/vorbis_parser.h", + "../../FFmpeg/libavcodec/xvmc.h", + }) + -- OBJS: + files({ + "../../FFmpeg/libavcodec/ac3_parser.c", + "../../FFmpeg/libavcodec/adts_parser.c", + "../../FFmpeg/libavcodec/allcodecs.c", + "../../FFmpeg/libavcodec/avcodec.c", + "../../FFmpeg/libavcodec/avdct.c", + "../../FFmpeg/libavcodec/avpacket.c", + "../../FFmpeg/libavcodec/avpicture.c", + "../../FFmpeg/libavcodec/bitstream.c", + "../../FFmpeg/libavcodec/bitstream_filter.c", + "../../FFmpeg/libavcodec/bitstream_filters.c", + "../../FFmpeg/libavcodec/bsf.c", + "../../FFmpeg/libavcodec/codec_desc.c", + "../../FFmpeg/libavcodec/codec_par.c", + "../../FFmpeg/libavcodec/d3d11va.c", + "../../FFmpeg/libavcodec/decode.c", + "../../FFmpeg/libavcodec/dirac.c", + "../../FFmpeg/libavcodec/dv_profile.c", + "../../FFmpeg/libavcodec/encode.c", + "../../FFmpeg/libavcodec/imgconvert.c", + "../../FFmpeg/libavcodec/jni.c", + "../../FFmpeg/libavcodec/mathtables.c", + "../../FFmpeg/libavcodec/mediacodec.c", + "../../FFmpeg/libavcodec/mpeg12framerate.c", + "../../FFmpeg/libavcodec/options.c", + "../../FFmpeg/libavcodec/parser.c", + "../../FFmpeg/libavcodec/parsers.c", + "../../FFmpeg/libavcodec/profiles.c", + "../../FFmpeg/libavcodec/qsv_api.c", + "../../FFmpeg/libavcodec/raw.c", + "../../FFmpeg/libavcodec/utils.c", + "../../FFmpeg/libavcodec/vorbis_parser.c", + "../../FFmpeg/libavcodec/xiph.c", + "../../FFmpeg/libavcodec/dct.c", + "../../FFmpeg/libavcodec/dct32_fixed.c", + "../../FFmpeg/libavcodec/dct32_float.c", + "../../FFmpeg/libavcodec/faandct.c", + "../../FFmpeg/libavcodec/faanidct.c", + "../../FFmpeg/libavcodec/fdctdsp.c", + "../../FFmpeg/libavcodec/jfdctfst.c", + "../../FFmpeg/libavcodec/jfdctint.c", + "../../FFmpeg/libavcodec/idctdsp.c", + "../../FFmpeg/libavcodec/simple_idct.c", + "../../FFmpeg/libavcodec/jrevdct.c", + "../../FFmpeg/libavcodec/mdct_float.c", + "../../FFmpeg/libavcodec/mdct_fixed_32.c", + "../../FFmpeg/libavcodec/mpegaudio.c", + "../../FFmpeg/libavcodec/mpegaudiodec_common.c", + "../../FFmpeg/libavcodec/mpegaudiodsp.c", + "../../FFmpeg/libavcodec/mpegaudiodsp_data.c", + "../../FFmpeg/libavcodec/mpegaudiodsp_fixed.c", + "../../FFmpeg/libavcodec/mpegaudiodsp_float.c", + "../../FFmpeg/libavcodec/mpegaudiodecheader.c", + "../../FFmpeg/libavcodec/mpegaudiodata.c", + "../../FFmpeg/libavcodec/rdft.c", + "../../FFmpeg/libavcodec/sinewin.c", + "../../FFmpeg/libavcodec/wma_freqs.c", + "../../FFmpeg/libavcodec/mpegaudiodec_fixed.c", + "../../FFmpeg/libavcodec/mpegaudiodec_float.c", + "../../FFmpeg/libavcodec/wmaprodec.c", + "../../FFmpeg/libavcodec/wma.c", + "../../FFmpeg/libavcodec/wma_common.c", + "../../FFmpeg/libavcodec/wmadec.c", + "../../FFmpeg/libavcodec/aactab.c", + "../../FFmpeg/libavcodec/mpegaudio_parser.c", + "../../FFmpeg/libavcodec/null_bsf.c", + "../../FFmpeg/libavcodec/pthread.c", + "../../FFmpeg/libavcodec/pthread_slice.c", + "../../FFmpeg/libavcodec/pthread_frame.c", + "../../FFmpeg/libavcodec/avfft.c", + "../../FFmpeg/libavcodec/fft_float.c", + "../../FFmpeg/libavcodec/fft_fixed_32.c", + "../../FFmpeg/libavcodec/fft_init_table.c", + }) + filter({"platforms:Windows"}) + files({ + "../../FFmpeg/libavcodec/file_open.c", + }) + filter({}) + + -- libavcodec/aarch64/Makefile: + -- OBJS: + filter({"platforms:Android-ARM64"}) + files({ + "../../FFmpeg/libavcodec/aarch64/fft_init_aarch64.c", + "../../FFmpeg/libavcodec/aarch64/idctdsp_init_aarch64.c", + "../../FFmpeg/libavcodec/aarch64/mpegaudiodsp_init.c", + }) + filter({}) + -- NEON-OBJS: + filter({"platforms:Android-ARM64"}) + files({ + "../../FFmpeg/libavcodec/aarch64/fft_neon.S", + "../../FFmpeg/libavcodec/aarch64/simple_idct_neon.S", + "../../FFmpeg/libavcodec/aarch64/mdct_neon.S", + "../../FFmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S", + }) + filter({}) + + -- libavcodec/x86/Makefile: + -- OBJS: + filter({"platforms:Android-x86_64 or platforms:Linux or platforms:Windows"}) + files({ + "../../FFmpeg/libavcodec/x86/constants.c", + "../../FFmpeg/libavcodec/x86/dct_init.c", + "../../FFmpeg/libavcodec/x86/fdctdsp_init.c", + "../../FFmpeg/libavcodec/x86/fft_init.c", + "../../FFmpeg/libavcodec/x86/idctdsp_init.c", + "../../FFmpeg/libavcodec/x86/mpegaudiodsp.c", + }) + filter({}) + -- MMX-OBJS: + filter({"platforms:Android-x86_64 or platforms:Linux or platforms:Windows"}) + files({ + "../../FFmpeg/libavcodec/x86/fdct.c", + }) + filter({}) diff --git a/third_party/ffmpeg-xenia/libavformat/demuxer_list.c b/third_party/ffmpeg-xenia/libavformat/demuxer_list.c new file mode 100644 index 000000000..26b4f2049 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavformat/demuxer_list.c @@ -0,0 +1,4 @@ +static const AVInputFormat * const demuxer_list[] = { + &ff_asf_demuxer, + &ff_mp3_demuxer, + NULL }; diff --git a/third_party/ffmpeg-xenia/libavformat/muxer_list.c b/third_party/ffmpeg-xenia/libavformat/muxer_list.c new file mode 100644 index 000000000..f36d9499c --- /dev/null +++ b/third_party/ffmpeg-xenia/libavformat/muxer_list.c @@ -0,0 +1,2 @@ +static const AVOutputFormat * const muxer_list[] = { + NULL }; diff --git a/third_party/ffmpeg-xenia/libavformat/premake5.lua b/third_party/ffmpeg-xenia/libavformat/premake5.lua new file mode 100644 index 000000000..689266ff9 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavformat/premake5.lua @@ -0,0 +1,54 @@ +project("libavformat") + uuid("CEF2E128-AA08-4A36-8045-0AA68A556364") + kind("StaticLib") + language("C") + ffmpeg_common() + + filter("files:not wmaprodec.c") + warnings "Off" + filter({}) + + links({ + "libavutil", + "libavcodec", + }) + + -- libavformat/Makefile: + -- HEADERS: + files({ + "../../FFmpeg/libavformat/avformat.h", + "../../FFmpeg/libavformat/avio.h", + "../../FFmpeg/libavformat/version.h", + }) + -- OBJS: + files({ + "../../FFmpeg/libavformat/allformats.c", + "../../FFmpeg/libavformat/avio.c", + "../../FFmpeg/libavformat/aviobuf.c", + "../../FFmpeg/libavformat/dump.c", + "../../FFmpeg/libavformat/format.c", + "../../FFmpeg/libavformat/id3v1.c", + "../../FFmpeg/libavformat/id3v2.c", + "../../FFmpeg/libavformat/metadata.c", + "../../FFmpeg/libavformat/mux.c", + "../../FFmpeg/libavformat/options.c", + "../../FFmpeg/libavformat/os_support.c", + "../../FFmpeg/libavformat/protocols.c", + "../../FFmpeg/libavformat/riff.c", + "../../FFmpeg/libavformat/sdp.c", + "../../FFmpeg/libavformat/url.c", + "../../FFmpeg/libavformat/utils.c", + "../../FFmpeg/libavformat/riffdec.c", + "../../FFmpeg/libavformat/asfdec_f.c", + "../../FFmpeg/libavformat/asf.c", + "../../FFmpeg/libavformat/asfcrypt.c", + "../../FFmpeg/libavformat/avlanguage.c", + "../../FFmpeg/libavformat/mp3dec.c", + "../../FFmpeg/libavformat/replaygain.c", + "../../FFmpeg/libavformat/file.c", + }) + filter({"platforms:Windows"}) + files({ + "../../FFmpeg/libavformat/file_open.c", + }) + filter({}) diff --git a/third_party/ffmpeg-xenia/libavformat/protocol_list.c b/third_party/ffmpeg-xenia/libavformat/protocol_list.c new file mode 100644 index 000000000..2f36e9687 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavformat/protocol_list.c @@ -0,0 +1,3 @@ +static const URLProtocol * const url_protocols[] = { + &ff_file_protocol, + NULL }; diff --git a/third_party/ffmpeg-xenia/libavutil/avconfig.h b/third_party/ffmpeg-xenia/libavutil/avconfig.h new file mode 100644 index 000000000..c289fbb55 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavutil/avconfig.h @@ -0,0 +1,6 @@ +/* Generated by ffmpeg configure */ +#ifndef AVUTIL_AVCONFIG_H +#define AVUTIL_AVCONFIG_H +#define AV_HAVE_BIGENDIAN 0 +#define AV_HAVE_FAST_UNALIGNED 1 +#endif /* AVUTIL_AVCONFIG_H */ diff --git a/third_party/ffmpeg-xenia/libavutil/ffversion.h b/third_party/ffmpeg-xenia/libavutil/ffversion.h new file mode 100644 index 000000000..4c38fb3ba --- /dev/null +++ b/third_party/ffmpeg-xenia/libavutil/ffversion.h @@ -0,0 +1,4 @@ +#ifndef AVUTIL_FFVERSION_H +#define AVUTIL_FFVERSION_H +#define FFMPEG_VERSION "xenia" +#endif /* AVUTIL_FFVERSION_H */ diff --git a/third_party/ffmpeg-xenia/libavutil/premake5.lua b/third_party/ffmpeg-xenia/libavutil/premake5.lua new file mode 100644 index 000000000..a09383359 --- /dev/null +++ b/third_party/ffmpeg-xenia/libavutil/premake5.lua @@ -0,0 +1,216 @@ +project("libavutil") + uuid("19216035-F781-4F15-B009-213B7E3A18AC") + kind("StaticLib") + language("C") + ffmpeg_common() + + filter("files:not wmaprodec.c") + warnings "Off" + filter({}) + + -- libavutil/Makefile: + -- HEADERS: + files({ + "../../FFmpeg/libavutil/adler32.h", + "../../FFmpeg/libavutil/aes.h", + "../../FFmpeg/libavutil/aes_ctr.h", + "../../FFmpeg/libavutil/attributes.h", + "../../FFmpeg/libavutil/audio_fifo.h", + "../../FFmpeg/libavutil/avassert.h", + "../../FFmpeg/libavutil/avstring.h", + "../../FFmpeg/libavutil/avutil.h", + "../../FFmpeg/libavutil/base64.h", + "../../FFmpeg/libavutil/blowfish.h", + "../../FFmpeg/libavutil/bprint.h", + "../../FFmpeg/libavutil/bswap.h", + "../../FFmpeg/libavutil/buffer.h", + "../../FFmpeg/libavutil/cast5.h", + "../../FFmpeg/libavutil/camellia.h", + "../../FFmpeg/libavutil/channel_layout.h", + "../../FFmpeg/libavutil/common.h", + "../../FFmpeg/libavutil/cpu.h", + "../../FFmpeg/libavutil/crc.h", + "../../FFmpeg/libavutil/des.h", + "../../FFmpeg/libavutil/dict.h", + "../../FFmpeg/libavutil/display.h", + "../../FFmpeg/libavutil/dovi_meta.h", + "../../FFmpeg/libavutil/downmix_info.h", + "../../FFmpeg/libavutil/encryption_info.h", + "../../FFmpeg/libavutil/error.h", + "../../FFmpeg/libavutil/eval.h", + "../../FFmpeg/libavutil/fifo.h", + "../../FFmpeg/libavutil/file.h", + "../../FFmpeg/libavutil/frame.h", + "../../FFmpeg/libavutil/hash.h", + "../../FFmpeg/libavutil/hdr_dynamic_metadata.h", + "../../FFmpeg/libavutil/hmac.h", + "../../FFmpeg/libavutil/hwcontext.h", + "../../FFmpeg/libavutil/hwcontext_cuda.h", + "../../FFmpeg/libavutil/hwcontext_d3d11va.h", + "../../FFmpeg/libavutil/hwcontext_drm.h", + "../../FFmpeg/libavutil/hwcontext_dxva2.h", + "../../FFmpeg/libavutil/hwcontext_qsv.h", + "../../FFmpeg/libavutil/hwcontext_mediacodec.h", + "../../FFmpeg/libavutil/hwcontext_opencl.h", + "../../FFmpeg/libavutil/hwcontext_vaapi.h", + "../../FFmpeg/libavutil/hwcontext_videotoolbox.h", + "../../FFmpeg/libavutil/hwcontext_vdpau.h", + "../../FFmpeg/libavutil/hwcontext_vulkan.h", + "../../FFmpeg/libavutil/imgutils.h", + "../../FFmpeg/libavutil/intfloat.h", + "../../FFmpeg/libavutil/intreadwrite.h", + "../../FFmpeg/libavutil/lfg.h", + "../../FFmpeg/libavutil/log.h", + "../../FFmpeg/libavutil/macros.h", + "../../FFmpeg/libavutil/mathematics.h", + "../../FFmpeg/libavutil/mastering_display_metadata.h", + "../../FFmpeg/libavutil/md5.h", + "../../FFmpeg/libavutil/mem.h", + "../../FFmpeg/libavutil/motion_vector.h", + "../../FFmpeg/libavutil/murmur3.h", + "../../FFmpeg/libavutil/opt.h", + "../../FFmpeg/libavutil/parseutils.h", + "../../FFmpeg/libavutil/pixdesc.h", + "../../FFmpeg/libavutil/pixelutils.h", + "../../FFmpeg/libavutil/pixfmt.h", + "../../FFmpeg/libavutil/random_seed.h", + "../../FFmpeg/libavutil/rc4.h", + "../../FFmpeg/libavutil/rational.h", + "../../FFmpeg/libavutil/replaygain.h", + "../../FFmpeg/libavutil/ripemd.h", + "../../FFmpeg/libavutil/samplefmt.h", + "../../FFmpeg/libavutil/sha.h", + "../../FFmpeg/libavutil/sha512.h", + "../../FFmpeg/libavutil/spherical.h", + "../../FFmpeg/libavutil/stereo3d.h", + "../../FFmpeg/libavutil/threadmessage.h", + "../../FFmpeg/libavutil/time.h", + "../../FFmpeg/libavutil/timecode.h", + "../../FFmpeg/libavutil/timestamp.h", + "../../FFmpeg/libavutil/tree.h", + "../../FFmpeg/libavutil/twofish.h", + "../../FFmpeg/libavutil/version.h", + "../../FFmpeg/libavutil/video_enc_params.h", + "../../FFmpeg/libavutil/xtea.h", + "../../FFmpeg/libavutil/tea.h", + "../../FFmpeg/libavutil/tx.h", + "../../FFmpeg/libavutil/film_grain_params.h", + }) + -- ARCH_HEADERS: + files({ + "../../FFmpeg/libavutil/bswap.h", + "../../FFmpeg/libavutil/intmath.h", + "../../FFmpeg/libavutil/intreadwrite.h", + "../../FFmpeg/libavutil/timer.h", + }) + -- BUILT_HEADERS (local xenia-specific copies): + files({ + "avconfig.h", + "ffversion.h", + }) + -- OBJS: + files({ + "../../FFmpeg/libavutil/adler32.c", + "../../FFmpeg/libavutil/aes.c", + "../../FFmpeg/libavutil/aes_ctr.c", + "../../FFmpeg/libavutil/audio_fifo.c", + "../../FFmpeg/libavutil/avstring.c", + "../../FFmpeg/libavutil/avsscanf.c", + "../../FFmpeg/libavutil/base64.c", + "../../FFmpeg/libavutil/blowfish.c", + "../../FFmpeg/libavutil/bprint.c", + "../../FFmpeg/libavutil/buffer.c", + "../../FFmpeg/libavutil/cast5.c", + "../../FFmpeg/libavutil/camellia.c", + "../../FFmpeg/libavutil/channel_layout.c", + "../../FFmpeg/libavutil/color_utils.c", + "../../FFmpeg/libavutil/cpu.c", + "../../FFmpeg/libavutil/crc.c", + "../../FFmpeg/libavutil/des.c", + "../../FFmpeg/libavutil/dict.c", + "../../FFmpeg/libavutil/display.c", + "../../FFmpeg/libavutil/dovi_meta.c", + "../../FFmpeg/libavutil/downmix_info.c", + "../../FFmpeg/libavutil/encryption_info.c", + "../../FFmpeg/libavutil/error.c", + "../../FFmpeg/libavutil/eval.c", + "../../FFmpeg/libavutil/fifo.c", + "../../FFmpeg/libavutil/file.c", + "../../FFmpeg/libavutil/file_open.c", + "../../FFmpeg/libavutil/float_dsp.c", + "../../FFmpeg/libavutil/fixed_dsp.c", + "../../FFmpeg/libavutil/frame.c", + "../../FFmpeg/libavutil/hash.c", + "../../FFmpeg/libavutil/hdr_dynamic_metadata.c", + "../../FFmpeg/libavutil/hmac.c", + "../../FFmpeg/libavutil/hwcontext.c", + "../../FFmpeg/libavutil/imgutils.c", + "../../FFmpeg/libavutil/integer.c", + "../../FFmpeg/libavutil/intmath.c", + "../../FFmpeg/libavutil/lfg.c", + "../../FFmpeg/libavutil/lls.c", + "../../FFmpeg/libavutil/log.c", + "../../FFmpeg/libavutil/log2_tab.c", + "../../FFmpeg/libavutil/mathematics.c", + "../../FFmpeg/libavutil/mastering_display_metadata.c", + "../../FFmpeg/libavutil/md5.c", + "../../FFmpeg/libavutil/mem.c", + "../../FFmpeg/libavutil/murmur3.c", + "../../FFmpeg/libavutil/opt.c", + "../../FFmpeg/libavutil/parseutils.c", + "../../FFmpeg/libavutil/pixdesc.c", + "../../FFmpeg/libavutil/pixelutils.c", + "../../FFmpeg/libavutil/random_seed.c", + "../../FFmpeg/libavutil/rational.c", + "../../FFmpeg/libavutil/reverse.c", + "../../FFmpeg/libavutil/rc4.c", + "../../FFmpeg/libavutil/ripemd.c", + "../../FFmpeg/libavutil/samplefmt.c", + "../../FFmpeg/libavutil/sha.c", + "../../FFmpeg/libavutil/sha512.c", + "../../FFmpeg/libavutil/slicethread.c", + "../../FFmpeg/libavutil/spherical.c", + "../../FFmpeg/libavutil/stereo3d.c", + "../../FFmpeg/libavutil/threadmessage.c", + "../../FFmpeg/libavutil/time.c", + "../../FFmpeg/libavutil/timecode.c", + "../../FFmpeg/libavutil/tree.c", + "../../FFmpeg/libavutil/twofish.c", + "../../FFmpeg/libavutil/utils.c", + "../../FFmpeg/libavutil/xga_font_data.c", + "../../FFmpeg/libavutil/xtea.c", + "../../FFmpeg/libavutil/tea.c", + "../../FFmpeg/libavutil/tx.c", + "../../FFmpeg/libavutil/tx_float.c", + "../../FFmpeg/libavutil/tx_double.c", + "../../FFmpeg/libavutil/tx_int32.c", + "../../FFmpeg/libavutil/video_enc_params.c", + "../../FFmpeg/libavutil/film_grain_params.c", + }) + + -- libavutil/aarch64/Makefile: + -- OBJS: + filter({"platforms:Android-ARM64"}) + files({ + "../../FFmpeg/libavutil/aarch64/cpu.c", + "../../FFmpeg/libavutil/aarch64/float_dsp_init.c", + }) + filter({}) + -- NEON-OBJS: + filter({"platforms:Android-ARM64"}) + files({ + "../../FFmpeg/libavutil/aarch64/float_dsp_neon.S", + }) + filter({}) + + -- libavutil/x86/Makefile: + -- OBJS: + filter({"platforms:Android-x86_64 or platforms:Linux or platforms:Windows"}) + files({ + "../../FFmpeg/libavutil/x86/cpu.c", + "../../FFmpeg/libavutil/x86/fixed_dsp_init.c", + "../../FFmpeg/libavutil/x86/float_dsp_init.c", + "../../FFmpeg/libavutil/x86/imgutils_init.c", + "../../FFmpeg/libavutil/x86/lls_init.c", + }) + filter({}) diff --git a/third_party/ffmpeg-xenia/premake5.lua b/third_party/ffmpeg-xenia/premake5.lua new file mode 100644 index 000000000..dd5c773bb --- /dev/null +++ b/third_party/ffmpeg-xenia/premake5.lua @@ -0,0 +1,42 @@ +group("third_party") + +-- +-- Call this function in subproject scope to set the needed include +-- dirs and defines. +-- +function ffmpeg_common() + defines({ + "HAVE_AV_CONFIG_H", + "_USE_MATH_DEFINES", -- For M_PI/etc + }) + + -- Paths are relative to the calling script (sub-library premake files), + -- which are one level deeper (e.g. libavcodec/premake5.lua). + includedirs({ + "..", -- ffmpeg-xenia/ (config.h, avconfig.h, ffversion.h) + "../../FFmpeg", -- FFmpeg source headers + }) + filter({"platforms:Windows", "configurations:Debug or configurations:Checked"}) + optimize("Size") -- dead code elimination is mandatory + removebuildoptions({ + "/RTCsu", -- '/O1' and '/RTCs' command-line options are incompatible + }) + filter({"platforms:Windows", "configurations:Release"}) + linktimeoptimization("Off") + filter("platforms:Windows") + includedirs({ + "../../FFmpeg/compat/atomics/win32", + }) + links({ + "bcrypt", + }) + filter("platforms:Linux") + includedirs({ + "../../FFmpeg/compat/atomics/gcc", + }) + filter({}) +end + +include("libavcodec/premake5.lua") +include("libavformat/premake5.lua") +include("libavutil/premake5.lua")