Skip to content

Commit

Permalink
Detect ffmpeg/libswscale/swscale.h
Browse files Browse the repository at this point in the history
  • Loading branch information
wedesoft committed Dec 21, 2013
1 parent 5578b56 commit bf89e34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require 'rake/loaders/makefile'
require 'rbconfig'

PKG_NAME = 'hornetseye-xorg'
PKG_VERSION = '1.0.3'
PKG_VERSION = '1.0.5'
CFG = RbConfig::CONFIG
CXX = ENV[ 'CXX' ] || 'g++'
RB_FILES = FileList[ 'lib/**/*.rb' ]
Expand Down Expand Up @@ -105,11 +105,16 @@ file 'ext/config.h' do |t|
# need to compile with -D__STDC_CONSTANT_MACROS
if check_c_header 'libswscale/swscale.h'
s << "#define HAVE_LIBSWSCALE_INCDIR 1\n"
s << "#undef HAVE_FFMPEG_LIBSWSCALE_INCDIR 1\n"
elsif check_c_header 'ffmpeg/libswscale/swscale.h'
s << "#undef HAVE_LIBSWSCALE_INCDIR\n"
s << "#define HAVE_FFMPEG_LIBSWSCALE_INCDIR 1\n"
else
unless check_c_header 'ffmpeg/swscale.h'
raise 'Cannot find swscale.h header file'
end
s << "#undef HAVE_LIBSWSCALE_INCDIR\n"
s << "#undef HAVE_FFMPEG_LIBSWSCALE_INCDIR 1\n"
end
File.open( t.name, 'w' ) { |f| f.puts s }
end
Expand Down
2 changes: 2 additions & 0 deletions ext/ximagepainter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
extern "C" {
#ifndef HAVE_LIBSWSCALE_INCDIR
#include <ffmpeg/swscale.h>
#elif HAVE_FFMPEG_LIBSWSCALE_INCDIR
#include <ffmpeg/libswscale/swscale.h>
#else
#include <libswscale/swscale.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions ext/xvideoimagepainter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
extern "C" {
#ifndef HAVE_LIBSWSCALE_INCDIR
#include <ffmpeg/swscale.h>
#elif HAVE_FFMPEG_LIBSWSCALE_INCDIR
#include <ffmpeg/libswscale/swscale.h>
#else
#include <libswscale/swscale.h>
#endif
Expand Down

0 comments on commit bf89e34

Please sign in to comment.