Commit 0df59e6a authored by Manuel Günther's avatar Manuel Günther
Browse files

Merge branch 'master' of https://github.com/bioidiap/bob.io.video

parents 1d2c7310 72d3b31f
...@@ -499,7 +499,7 @@ AVCodec* bob::io::video::find_decoder(const std::string& filename, ...@@ -499,7 +499,7 @@ AVCodec* bob::io::video::find_decoder(const std::string& filename,
return retval; return retval;
} }
#if LIBAVFORMAT_VERSION_INT < 0x353c64 // 53.60.100 @ ffmpeg-0.10 #if !defined(HAVE_AVFORMAT_ALLOC_OUTPUT_CONTEXT2) || LIBAVFORMAT_VERSION_INT < 0x353c64 // 53.60.100 @ ffmpeg-0.10
/** /**
* This method was copied from ffmpeg-0.8 and is used in case it is not defined * This method was copied from ffmpeg-0.8 and is used in case it is not defined
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
from setuptools import setup, find_packages, dist from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['bob.blitz', 'bob.io.base'])) dist.Distribution(dict(setup_requires=['bob.blitz', 'bob.io.base']))
from bob.blitz.extension import Extension from bob.blitz.extension import Extension
from bob.extension import pkgconfig
import bob.io.base import bob.io.base
include_dirs = [bob.io.base.get_include()] include_dirs = [bob.io.base.get_include()]
...@@ -30,6 +31,21 @@ try: ...@@ -30,6 +31,21 @@ try:
except pkg_resources.DistributionNotFound as e: except pkg_resources.DistributionNotFound as e:
pil_or_pillow.append('pillow') pil_or_pillow.append('pillow')
define_macros = [('__STDC_CONSTANT_MACROS', None)]
# Checks if we have avformat_alloc_output_context2 defined in libavformat
libavformat_pkg = pkgconfig('libavformat >= 52.31.0')
import ctypes
import ctypes.util
lib = ctypes.util.find_library(libavformat_pkg.libraries()[0])
if lib is not None:
try:
dll = ctypes.CDLL(lib)
if hasattr(dll, 'avformat_alloc_output_context2'):
define_macros.append(('HAVE_AVFORMAT_ALLOC_OUTPUT_CONTEXT2', None))
except OSError:
pass #ignore it
setup( setup(
name='bob.io.video', name='bob.io.video',
...@@ -44,6 +60,7 @@ setup( ...@@ -44,6 +60,7 @@ setup(
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
zip_safe=False,
install_requires=[ install_requires=[
'setuptools', 'setuptools',
...@@ -65,7 +82,7 @@ setup( ...@@ -65,7 +82,7 @@ setup(
boost_modules = ['system'], boost_modules = ['system'],
include_dirs = include_dirs, include_dirs = include_dirs,
version = version, version = version,
define_macros = [('__STDC_CONSTANT_MACROS', None)], define_macros = define_macros,
), ),
Extension("bob.io.video._library", Extension("bob.io.video._library",
[ [
...@@ -81,7 +98,7 @@ setup( ...@@ -81,7 +98,7 @@ setup(
packages = packages, packages = packages,
include_dirs = include_dirs, include_dirs = include_dirs,
version = version, version = version,
define_macros = [('__STDC_CONSTANT_MACROS', None)], define_macros = define_macros,
), ),
], ],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment