Index: services/media/framework_ffmpeg/ffmpeg_init.cc |
diff --git a/services/media/framework_ffmpeg/ffmpeg_init.cc b/services/media/framework_ffmpeg/ffmpeg_init.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..318d901e3294d037606435c985cb498e761023fa |
--- /dev/null |
+++ b/services/media/framework_ffmpeg/ffmpeg_init.cc |
@@ -0,0 +1,23 @@ |
+// Copyright 2016 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. |
+ |
+#include "services/media/framework_ffmpeg/ffmpeg_init.h" |
+ |
+extern "C" { |
+#include "third_party/ffmpeg/libavformat/avformat.h" |
+} |
+ |
+namespace mojo { |
+namespace media { |
+ |
+void InitFfmpeg() { |
+ static bool initialized_ = false; |
johngro
2016/03/01 01:31:39
While idempotent in a purely single threaded world
dalesat
2016/03/01 20:43:02
Added a lock.
|
+ if (!initialized_) { |
+ initialized_ = true; |
+ av_register_all(); |
+ } |
+} |
+ |
+} // namespace media |
+} // namespace mojo |