summaryrefslogtreecommitdiff
blob: cf82dd1bb40983f29d5ef93f9f4e0ce1118db2a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- a/media/ffmpeg/ffmpeg_common.h.orig	2017-04-07 18:17:22.623538889 +0000
+++ b/media/ffmpeg/ffmpeg_common.h	2017-04-07 18:18:16.780656283 +0000
@@ -23,10 +23,12 @@
 
 // Include FFmpeg header files.
 extern "C" {
+#if !defined(USE_SYSTEM_FFMPEG)
 // Disable deprecated features which result in spammy compile warnings.  This
 // list of defines must mirror those in the 'defines' section of FFmpeg's
 // BUILD.gn file or the headers below will generate different structures!
 #define FF_API_CONVERGENCE_DURATION 0
+#endif  // !defined(USE_SYSTEM_FFMPEG)
 // Upstream libavcodec/utils.c still uses the deprecated
 // av_dup_packet(), causing deprecation warnings.
 // The normal fix for such things is to disable the feature as below,
@@ -40,7 +42,9 @@
 MSVC_PUSH_DISABLE_WARNING(4244);
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
+#if !defined(USE_SYSTEM_FFMPEG)
 #include <libavformat/internal.h>
+#endif  // !defined(USE_SYSTEM_FFMPEG)
 #include <libavformat/avio.h>
 #include <libavutil/avutil.h>
 #include <libavutil/imgutils.h>
--- a/media/filters/ffmpeg_demuxer.cc.orig	2017-04-07 18:15:14.776901183 +0000
+++ b/media/filters/ffmpeg_demuxer.cc	2017-04-07 18:15:54.813727201 +0000
@@ -1223,6 +1223,7 @@
   // If no estimate is found, the stream entry will be kInfiniteDuration.
   std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
                                                     kInfiniteDuration);
+#if !defined(USE_SYSTEM_FFMPEG)
   const AVFormatInternal* internal = format_context->internal;
   if (internal && internal->packet_buffer &&
       format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
@@ -1246,6 +1247,7 @@
       packet_buffer = packet_buffer->next;
     }
   }
+#endif  // !defined(USE_SYSTEM_FFMPEG)
 
   std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
 
--- a/build/linux/unbundle/ffmpeg.gn.orig	2017-04-07 18:18:55.793461226 +0000
+++ b/build/linux/unbundle/ffmpeg.gn	2017-04-07 18:20:13.883072465 +0000
@@ -13,6 +13,10 @@
   ]
 }
 
+config("using_system_ffmpeg") {
+  defines = [ "USE_SYSTEM_FFMPEG=1" ]
+}
+
 shim_headers("ffmpeg_shim") {
   root_path = "."
   headers = [
@@ -26,5 +30,8 @@
   deps = [
     ":ffmpeg_shim",
   ]
-  public_configs = [ ":system_ffmpeg" ]
+  public_configs = [
+    ":system_ffmpeg",
+    ":using_system_ffmpeg",
+  ]
 }