Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: services/media/framework_ffmpeg/ffmpeg_init.cc

Issue 1686363002: Motown: ffmpeg implementations of framework 'parts' (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Retype some const unique_ptr<T>& parameters to const T&. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698