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

Side by Side Diff: media/filters/ffmpeg_glue.cc

Issue 1141703002: Chromium changes for static linking ffmpeg (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Roll DEPS to fix cros, rebase. Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « media/ffmpeg/ffmpeg_common_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/ffmpeg_glue.h" 5 #include "media/filters/ffmpeg_glue.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // FFmpeg must only be initialized once, so use a LazyInstance to ensure this. 89 // FFmpeg must only be initialized once, so use a LazyInstance to ensure this.
90 class FFmpegInitializer { 90 class FFmpegInitializer {
91 public: 91 public:
92 bool initialized() { return initialized_; } 92 bool initialized() { return initialized_; }
93 93
94 private: 94 private:
95 friend struct base::DefaultLazyInstanceTraits<FFmpegInitializer>; 95 friend struct base::DefaultLazyInstanceTraits<FFmpegInitializer>;
96 96
97 FFmpegInitializer() 97 FFmpegInitializer()
98 : initialized_(false) { 98 : initialized_(false) {
99 // Before doing anything disable logging as it interferes with layout tests.
100 av_log_set_level(AV_LOG_QUIET);
101
102 // Register our protocol glue code with FFmpeg. 99 // Register our protocol glue code with FFmpeg.
103 if (av_lockmgr_register(&LockManagerOperation) != 0) 100 if (av_lockmgr_register(&LockManagerOperation) != 0)
104 return; 101 return;
105 102
106 // Now register the rest of FFmpeg. 103 // Now register the rest of FFmpeg.
107 av_register_all(); 104 av_register_all();
108 105
109 initialized_ = true; 106 initialized_ = true;
110 } 107 }
111 108
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 avcodec_close(stream->codec); 211 avcodec_close(stream->codec);
215 } 212 }
216 } 213 }
217 } 214 }
218 215
219 avformat_close_input(&format_context_); 216 avformat_close_input(&format_context_);
220 av_free(avio_context_->buffer); 217 av_free(avio_context_->buffer);
221 } 218 }
222 219
223 } // namespace media 220 } // namespace media
OLDNEW
« no previous file with comments | « media/ffmpeg/ffmpeg_common_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698