diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..77e49e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +ffplay_standalone +*.kate-swp diff --git a/cmdutils.c b/cmdutils.c index 156c138..b7081c9 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -30,7 +30,7 @@ references to libraries that are not being built. */ #include "config.h" -#include "compat/va_copy.h" +//#include "compat/va_copy.h" #include "libavformat/avformat.h" #include "libswscale/swscale.h" #include "libswscale/version.h" @@ -39,22 +39,26 @@ #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/display.h" -#include "libavutil/getenv_utf8.h" +//#include "libavutil/getenv_utf8.h" #include "libavutil/mathematics.h" #include "libavutil/imgutils.h" -#include "libavutil/libm.h" +//#include "libavutil/libm.h" #include "libavutil/parseutils.h" #include "libavutil/eval.h" #include "libavutil/dict.h" #include "libavutil/opt.h" #include "cmdutils.h" -#include "fopen_utf8.h" +//#include "fopen_utf8.h" #include "opt_common.h" #ifdef _WIN32 #include #include "compat/w32dlfcn.h" #endif +#define getenv_utf8 getenv +#define freeenv_utf8 +#define fopen_utf8 fopen + AVDictionary *sws_dict; AVDictionary *swr_opts; AVDictionary *format_opts, *codec_opts; diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..09871f8 --- /dev/null +++ b/compile.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +SDL2_FLAGS=$(sdl2-config --cflags --libs) +LAVU_FLAGS=$(pkg-config libavutil --cflags --libs) +LAVF_FLAGS=$(pkg-config libavformat --cflags --libs) +LAVC_FLAGS=$(pkg-config libavcodec --cflags --libs) +LAVFI_FLAGS=$(pkg-config libavfilter --cflags --libs) +LSWS_FLAGS=$(pkg-config libswscale --cflags --libs) +LSWR_FLAGS=$(pkg-config libswresample --cflags --libs) +LPP_FLAGS=$(pkg-config libpostproc --cflags --libs) + +EXTRA_FLAGS=-lm + +exec gcc *.c -Istubs ${SDL2_FLAGS} ${LAVU_FLAGS} ${LAVF_FLAGS} ${LAVC_FLAGS} ${LAVFI_FLAGS} ${LSWS_FLAGS} ${LSWR_FLAGS} ${LPP_FLAGS} ${EXTRA_FLAGS} -o ffplay_standalone diff --git a/ffplay.c b/ffplay.c index d8c69e1..e936e68 100644 --- a/ffplay.c +++ b/ffplay.c @@ -44,7 +44,9 @@ #include "libavutil/time.h" #include "libavutil/bprint.h" #include "libavformat/avformat.h" +#if CONFIG_AVDEVICE #include "libavdevice/avdevice.h" +#endif #include "libswscale/swscale.h" #include "libavutil/opt.h" #include "libavutil/tx.h" diff --git a/opt_common.c b/opt_common.c index 02d7048..cec284a 100644 --- a/opt_common.c +++ b/opt_common.c @@ -48,8 +48,10 @@ #include "libavformat/avformat.h" #include "libavformat/version.h" +#if CONFIG_AVDEVICE #include "libavdevice/avdevice.h" #include "libavdevice/version.h" +#endif #include "libavfilter/avfilter.h" #include "libavfilter/version.h" @@ -187,7 +189,9 @@ static void print_all_libs_info(int flags, int level) PRINT_LIB_INFO(avutil, AVUTIL, flags, level); PRINT_LIB_INFO(avcodec, AVCODEC, flags, level); PRINT_LIB_INFO(avformat, AVFORMAT, flags, level); +#if CONFIG_AVDEVICE PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level); +#endif PRINT_LIB_INFO(avfilter, AVFILTER, flags, level); PRINT_LIB_INFO(swscale, SWSCALE, flags, level); PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level); diff --git a/stubs/config.h b/stubs/config.h new file mode 100644 index 0000000..69b724a --- /dev/null +++ b/stubs/config.h @@ -0,0 +1,17 @@ +#define CONFIG_AVUTIL 1 +#define CONFIG_AVCODEC 1 +#define CONFIG_AVFORMAT 1 +#define CONFIG_AVDEVICE 0 +#define CONFIG_AVFILTER 1 +#define CONFIG_SWSCALE 1 +#define CONFIG_SWRESAMPLE 1 +#define CONFIG_POSTPROC 1 + +#define FFMPEG_DATADIR NULL + +#define CONFIG_THIS_YEAR 2024 + +#define FFMPEG_CONFIGURATION "N/A" +#define CC_IDENT "N/A" + +#include diff --git a/stubs/config_components.h b/stubs/config_components.h new file mode 100644 index 0000000..e69de29