Skip to content

Commit

Permalink
ffplay: convert ffplay to use SDL2
Browse files Browse the repository at this point in the history
Signed-off-by: Marton Balint <cus@passwd.hu>
  • Loading branch information
cus committed Jan 2, 2016
1 parent c476f63 commit 54114b9
Show file tree
Hide file tree
Showing 2 changed files with 268 additions and 350 deletions.
27 changes: 23 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1969,6 +1969,7 @@ HAVE_LIST="
perl
pod2man
sdl
sdl2
section_data_rel_ro
texi2html
threads
Expand Down Expand Up @@ -2953,8 +2954,8 @@ ffmpeg_deps="avcodec avfilter avformat swresample"
ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
null_filter
setpts_filter trim_filter"
ffplay_deps="avcodec avformat swscale swresample sdl"
ffplay_libs='$sdl_libs'
ffplay_deps="avcodec avformat swscale swresample sdl2"
ffplay_libs='$sdl2_libs'
ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
ffprobe_deps="avcodec avformat"
ffserver_deps="avformat fork sarestart"
Expand Down Expand Up @@ -5579,7 +5580,24 @@ if enabled libdc1394; then
enable libdc1394_1; } ||
die "ERROR: No version of libdc1394 found "
fi
if ! disabled sdl; then

SDL2_CONFIG="${cross_prefix}sdl2-config"
if check_pkg_config sdl2; then
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
enable sdl2
else
if "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
sdl2_libs=$("${SDL2_CONFIG}" --libs)
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
enable sdl2
fi
fi
enabled sdl2 && add_cflags $sdl2_cflags && add_extralibs $sdl2_libs

if ! disabled sdl and ! enabled sdl2; then
SDL_CONFIG="${cross_prefix}sdl-config"
if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
Expand Down Expand Up @@ -6164,6 +6182,7 @@ echo "network support ${network-no}"
echo "threading support ${thread_type-no}"
echo "safe bitstream reader ${safe_bitstream_reader-no}"
echo "SDL support ${sdl-no}"
echo "SDL2 support ${sdl2-no}"
echo "opencl enabled ${opencl-no}"
echo "texi2html enabled ${texi2html-no}"
echo "perl enabled ${perl-no}"
Expand Down Expand Up @@ -6312,7 +6331,7 @@ HOSTLD_O=$HOSTLD_O
TARGET_EXEC=$target_exec $target_exec_args
TARGET_PATH=$target_path
TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
CFLAGS-ffplay=$sdl_cflags
CFLAGS-ffplay=$sdl2_cflags
ZLIB=$($ldflags_filter -lz)
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
Expand Down
Loading

0 comments on commit 54114b9

Please sign in to comment.