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

Unified Diff: media/base/mock_ffmpeg.cc

Issue 126160: Moving MockFFmpeg to its own file and some media.gyp cleanup. (Closed)
Patch Set: Not ready for mac and linux yet Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/mock_ffmpeg.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mock_ffmpeg.cc
diff --git a/media/base/mock_ffmpeg.cc b/media/base/mock_ffmpeg.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4e9fc03d8627d1c81146ca49c94334dfcae4a66e
--- /dev/null
+++ b/media/base/mock_ffmpeg.cc
@@ -0,0 +1,60 @@
+// Copyright (c) 2009 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 "media/base/mock_ffmpeg.h"
+
+#include "base/logging.h"
+#include "media/filters/ffmpeg_common.h"
+
+namespace media {
+
+MockFFmpeg* MockFFmpeg::instance_ = NULL;
+
+// static
+void MockFFmpeg::set(MockFFmpeg* instance) {
+ instance_ = instance;
+}
+
+// static
+MockFFmpeg* MockFFmpeg::get() {
+ return instance_;
+}
+
+// FFmpeg stubs that delegate to the FFmpegMock instance.
+extern "C" {
+
+AVCodec* avcodec_find_decoder(enum CodecID id) {
+ return media::MockFFmpeg::get()->AVCodecFindDecoder(id);
+}
+
+int avcodec_open(AVCodecContext* avctx, AVCodec* codec) {
+ return media::MockFFmpeg::get()->AVCodecOpen(avctx, codec);
+}
+
+int avcodec_thread_init(AVCodecContext* avctx, int threads) {
+ return media::MockFFmpeg::get()->AVCodecThreadInit(avctx, threads);
+}
+
+void avcodec_flush_buffers(AVCodecContext* avctx) {
+ NOTREACHED();
+}
+
+AVFrame* avcodec_alloc_frame() {
+ NOTREACHED();
+ return NULL;
+}
+
+int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture,
+ int* got_picture_ptr, AVPacket* avpkt) {
+ NOTREACHED();
+ return 0;
+}
+
+void av_init_packet(AVPacket* pkt) {
+ NOTREACHED();
+}
+
+} // extern "C"
+
+} // namespace media
« no previous file with comments | « media/base/mock_ffmpeg.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698