diff options
Diffstat (limited to 'chromium/third_party/ffmpeg/BUILD.gn')
-rwxr-xr-x | chromium/third_party/ffmpeg/BUILD.gn | 65 |
1 files changed, 58 insertions, 7 deletions
diff --git a/chromium/third_party/ffmpeg/BUILD.gn b/chromium/third_party/ffmpeg/BUILD.gn index 6ebb34b68d4..2cfb22008cf 100755 --- a/chromium/third_party/ffmpeg/BUILD.gn +++ b/chromium/third_party/ffmpeg/BUILD.gn @@ -152,9 +152,15 @@ config("ffmpegsumo_warnings") { buildflag_header("ffmpeg_features") { header = "ffmpeg_features.h" - flags = [ - "USE_SYSTEM_FFMPEG=false", - ] + if (use_system_ffmpeg) { + flags = [ + "USE_SYSTEM_FFMPEG=true", + ] + } else { + flags = [ + "USE_SYSTEM_FFMPEG=false", + ] + } } if (is_component_ffmpeg) { @@ -407,6 +413,48 @@ target(link_target_type, "ffmpeg_internal") { } } +if (use_system_ffmpeg) { + import("//build/config/linux/pkg_config.gni") + import("//build/shim_headers.gni") + + pkg_config("system_ffmpeg") { + packages = [ + "libavcodec", + "libavformat", + "libavutil", + ] + } + + shim_headers("libavcodec_shim") { + root_path = "libavcodec" + prefix = "libavcodec/" + headers = [ + "avcodec.h", + ] + } + + shim_headers("libavformat_shim") { + root_path = "libavformat" + prefix = "libavformat/" + headers = [ + "avformat.h", + "avio.h", + ] + } + + shim_headers("libavutil_shim") { + root_path = "libavutil" + prefix = "libavutil/" + headers = [ + "avutil.h", + "imgutils.h", + "log.h", + "mathematics.h", + "opt.h", + ] + } +} + if (is_component_ffmpeg) { shared_library("ffmpeg") { if (is_android) { @@ -437,9 +485,12 @@ if (is_component_ffmpeg) { } } else { source_set("ffmpeg") { - public_configs = [ ":ffmpeg_dependent_config" ] - deps = [ - ":ffmpeg_internal", - ] + if (use_system_ffmpeg) { + public_configs = [ ":system_ffmpeg" ] + deps = [ ":libavcodec_shim", ":libavformat_shim", ":libavutil_shim" ] + } else { + public_configs = [ ":ffmpeg_dependent_config" ] + deps = [ ":ffmpeg_internal" ] + } } } |