diff options
-rw-r--r-- | build/all.gyp | 1 | ||||
-rw-r--r-- | media/media.gyp | 16 | ||||
-rwxr-xr-x | third_party/ffmpeg/ffmpeg.gyp | 100 | ||||
-rw-r--r-- | third_party/ffmpeg/ffmpeg.vcproj | 196 | ||||
-rwxr-xr-x | third_party/ffmpeg/generate_libs.bat | 8 | ||||
-rw-r--r-- | third_party/ffmpeg/generate_libs.py | 36 | ||||
-rw-r--r-- | third_party/ffmpeg/generate_libs.rules | 18 |
7 files changed, 139 insertions, 236 deletions
diff --git a/build/all.gyp b/build/all.gyp index 1d65704..fefcc17 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -29,6 +29,7 @@ '../skia/skia.gyp:*', '../testing/gtest.gyp:*', '../third_party/bzip2/bzip2.gyp:*', + '../third_party/ffmpeg/ffmpeg.gyp:*', '../third_party/icu38/icu38.gyp:*', '../third_party/libjpeg/libjpeg.gyp:*', '../third_party/libpng/libpng.gyp:*', diff --git a/media/media.gyp b/media/media.gyp index 00a4675..b924a42 100644 --- a/media/media.gyp +++ b/media/media.gyp @@ -22,6 +22,7 @@ 'type': 'static_library', 'dependencies': [ '../base/base.gyp:base', + '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg', ], 'include_dirs': [ '..', @@ -87,13 +88,9 @@ 'filters/video_renderer_base.cc', 'filters/video_renderer_base.h', ], - 'include_dirs': [ - '../third_party/ffmpeg/include', - ], 'direct_dependent_settings': { 'include_dirs': [ '..', - '../third_party/ffmpeg/include', ], }, 'conditions': [ @@ -117,16 +114,6 @@ 'filters/ffmpeg_video_decoder.cc', ], }], - ['OS =="win"', { - 'include_dirs': [ - '../third_party/ffmpeg/include/win', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../third_party/ffmpeg/include/win', - ], - }, - }], ], }, { @@ -184,6 +171,7 @@ 'dependencies': [ 'media', '../base/base.gyp:base', + '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg', ], 'sources': [ 'player/player.cc', diff --git a/third_party/ffmpeg/ffmpeg.gyp b/third_party/ffmpeg/ffmpeg.gyp new file mode 100755 index 0000000..583d820 --- /dev/null +++ b/third_party/ffmpeg/ffmpeg.gyp @@ -0,0 +1,100 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'includes': [ + '../../build/common.gypi', + ], + 'target_defaults': { + 'conditions': [ + ['OS!="linux"', {'sources/': [['exclude', '/linux/']]}], + ['OS!="mac"', {'sources/': [['exclude', '/mac/']]}], + ['OS!="win"', {'sources/': [['exclude', '/win/']]}], + ], + }, + 'targets': [ + { + 'target_name': 'ffmpeg', + 'type': 'none', + 'msvs_guid': 'D7A94F58-576A-45D9-A45F-EB87C63ABBB0', + 'sources': [ + 'include/libavcodec/avcodec.h', + 'include/libavcodec/opt.h', + 'include/libavcodec/vdpau.h', + 'include/libavcodec/xvmc.h', + 'include/libavdevice/avdevice.h', + 'include/libavformat/avformat.h', + 'include/libavformat/avio.h', + 'include/libavutil/adler32.h', + 'include/libavutil/avstring.h', + 'include/libavutil/avutil.h', + 'include/libavutil/base64.h', + 'include/libavutil/common.h', + 'include/libavutil/crc.h', + 'include/libavutil/fifo.h', + 'include/libavutil/intfloat_readwrite.h', + 'include/libavutil/log.h', + 'include/libavutil/lzo.h', + 'include/libavutil/mathematics.h', + 'include/libavutil/md5.h', + 'include/libavutil/mem.h', + 'include/libavutil/pixfmt.h', + 'include/libavutil/rational.h', + 'include/libavutil/sha1.h', + 'include/win/inttypes.h', + 'include/win/stdint.h', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include', + ], + }, + 'conditions': [ + ['OS=="win"', { + 'sources': [ + 'avcodec-52.def', + 'avformat-52.def', + 'avutil-50.def', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include/win', + ], + 'link_settings': { + 'libraries': [ + '<(PRODUCT_DIR)/lib/avcodec-52.lib', + '<(PRODUCT_DIR)/lib/avformat-52.lib', + '<(PRODUCT_DIR)/lib/avutil-50.lib', + ], + }, + }, + 'rules': [ + { + 'rule_name': 'generate_libs', + 'extension': 'def', + 'inputs': [ + 'generate_libs.py', + ], + 'outputs': [ + '<(PRODUCT_DIR)/lib/<(RULE_INPUT_ROOT).lib', + ], + 'variables': { + 'def_files': [ + 'avcodec-52.def', + 'avformat-52.def', + 'avutil-50.def', + ], + }, + 'action': ['python', '<@(_inputs)', '-o', '<(PRODUCT_DIR)/lib', '<@(RULE_INPUT_PATH)'], + 'message': 'Generating import libraries', + }, + ], + }], + ], + }, + ], +} diff --git a/third_party/ffmpeg/ffmpeg.vcproj b/third_party/ffmpeg/ffmpeg.vcproj deleted file mode 100644 index 189b977..0000000 --- a/third_party/ffmpeg/ffmpeg.vcproj +++ /dev/null @@ -1,196 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="ffmpeg" - ProjectGUID="{D7A94F58-576A-45D9-A45F-EB87C63ABBB0}" - RootNamespace="ffmpeg" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - <ToolFile - RelativePath="generate_libs.rules" - /> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - ConfigurationType="10" - InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - ConfigurationType="10" - InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\release.vsprops" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="include" - > - <Filter - Name="libavcodec" - > - <File - RelativePath=".\include\libavcodec\avcodec.h" - > - </File> - <File - RelativePath=".\include\libavcodec\opt.h" - > - </File> - <File - RelativePath=".\include\libavcodec\vdpau.h" - > - </File> - </Filter> - <Filter - Name="libavformat" - > - <File - RelativePath=".\include\libavformat\avformat.h" - > - </File> - <File - RelativePath=".\include\libavformat\avio.h" - > - </File> - <File - RelativePath=".\include\libavformat\rtsp.h" - > - </File> - <File - RelativePath=".\include\libavformat\rtspcodes.h" - > - </File> - </Filter> - <Filter - Name="libavdevice" - > - <File - RelativePath=".\include\libavdevice\avdevice.h" - > - </File> - </Filter> - <Filter - Name="libavutil" - > - <File - RelativePath=".\include\libavutil\adler32.h" - > - </File> - <File - RelativePath=".\include\libavutil\avstring.h" - > - </File> - <File - RelativePath=".\include\libavutil\avutil.h" - > - </File> - <File - RelativePath=".\include\libavutil\base64.h" - > - </File> - <File - RelativePath=".\include\libavutil\common.h" - > - </File> - <File - RelativePath=".\include\libavutil\crc.h" - > - </File> - <File - RelativePath=".\include\libavutil\fifo.h" - > - </File> - <File - RelativePath=".\include\libavutil\intfloat_readwrite.h" - > - </File> - <File - RelativePath=".\include\libavutil\log.h" - > - </File> - <File - RelativePath=".\include\libavutil\lzo.h" - > - </File> - <File - RelativePath=".\include\libavutil\mathematics.h" - > - </File> - <File - RelativePath=".\include\libavutil\md5.h" - > - </File> - <File - RelativePath=".\include\libavutil\mem.h" - > - </File> - <File - RelativePath=".\include\libavutil\random.h" - > - </File> - <File - RelativePath=".\include\libavutil\rational.h" - > - </File> - <File - RelativePath=".\include\libavutil\sha1.h" - > - </File> - </Filter> - </Filter> - <File - RelativePath=".\avcodec-52.def" - > - </File> - <File - RelativePath=".\avformat-52.def" - > - </File> - <File - RelativePath=".\avutil-50.def" - > - </File> - <File - RelativePath=".\generate_libs.bat" - > - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/third_party/ffmpeg/generate_libs.bat b/third_party/ffmpeg/generate_libs.bat deleted file mode 100755 index 156ae17..0000000 --- a/third_party/ffmpeg/generate_libs.bat +++ /dev/null @@ -1,8 +0,0 @@ -@echo off - -setlocal -set OUTDIR=%1 - -lib /nologo /machine:X86 /def:avcodec-52.def /out:%OUTDIR%\lib\avcodec-52.lib -lib /nologo /machine:X86 /def:avformat-52.def /out:%OUTDIR%\lib\avformat-52.lib -lib /nologo /machine:X86 /def:avutil-50.def /out:%OUTDIR%\lib\avutil-50.lib diff --git a/third_party/ffmpeg/generate_libs.py b/third_party/ffmpeg/generate_libs.py new file mode 100644 index 0000000..9a8faeb --- /dev/null +++ b/third_party/ffmpeg/generate_libs.py @@ -0,0 +1,36 @@ +#!/usr/bin/python +# Generates MSVC import libraries from .def files. Assumes MSVC environment +# has been loaded. + +import optparse +import os +import subprocess + +def main(): + parser = optparse.OptionParser(usage='usage: %prog [options] input') + parser.add_option('-o', + '--output', + dest='output', + default=None, + help=('output location')) + (options, args) = parser.parse_args() + + if options.output == None: + parser.error('Output location not specified') + if len(args) == 0: + parser.error('No inputs specified') + + # Make sure output directory exists. + if not os.path.exists(options.output): + os.makedirs(options.output) + + # Run lib.exe on each input def file. + for input_path in args: + input_name = os.path.basename(input_path) + input_root = os.path.splitext(input_name)[0] + output_path = os.path.join(options.output, input_root + '.lib') + subprocess.call(['lib', '/nologo', '/machine:X86', '/def:' + input_path, + '/out:' + output_path]) + +if __name__ == '__main__': + main() diff --git a/third_party/ffmpeg/generate_libs.rules b/third_party/ffmpeg/generate_libs.rules deleted file mode 100644 index d096757..0000000 --- a/third_party/ffmpeg/generate_libs.rules +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<VisualStudioToolFile - Name="Generate FFmpeg import libraries" - Version="8.00" - > - <Rules> - <CustomBuildRule - Name="Generate FFmpeg import libraries" - CommandLine="generate_libs.bat $(OutDir)" - Outputs="$(OutDir)\lib\avcodec-52.lib" - FileExtensions="*.def" - ExecutionDescription="Generating FFmpeg import libraries..." - > - <Properties> - </Properties> - </CustomBuildRule> - </Rules> -</VisualStudioToolFile> |