OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "media/base/mock_ffmpeg.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "media/filters/ffmpeg_common.h" |
| 9 |
| 10 namespace media { |
| 11 |
| 12 MockFFmpeg* MockFFmpeg::instance_ = NULL; |
| 13 |
| 14 // static |
| 15 void MockFFmpeg::set(MockFFmpeg* instance) { |
| 16 instance_ = instance; |
| 17 } |
| 18 |
| 19 // static |
| 20 MockFFmpeg* MockFFmpeg::get() { |
| 21 return instance_; |
| 22 } |
| 23 |
| 24 // FFmpeg stubs that delegate to the FFmpegMock instance. |
| 25 extern "C" { |
| 26 |
| 27 AVCodec* avcodec_find_decoder(enum CodecID id) { |
| 28 return media::MockFFmpeg::get()->AVCodecFindDecoder(id); |
| 29 } |
| 30 |
| 31 int avcodec_open(AVCodecContext* avctx, AVCodec* codec) { |
| 32 return media::MockFFmpeg::get()->AVCodecOpen(avctx, codec); |
| 33 } |
| 34 |
| 35 int avcodec_thread_init(AVCodecContext* avctx, int threads) { |
| 36 return media::MockFFmpeg::get()->AVCodecThreadInit(avctx, threads); |
| 37 } |
| 38 |
| 39 void avcodec_flush_buffers(AVCodecContext* avctx) { |
| 40 NOTREACHED(); |
| 41 } |
| 42 |
| 43 AVFrame* avcodec_alloc_frame() { |
| 44 NOTREACHED(); |
| 45 return NULL; |
| 46 } |
| 47 |
| 48 int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture, |
| 49 int* got_picture_ptr, AVPacket* avpkt) { |
| 50 NOTREACHED(); |
| 51 return 0; |
| 52 } |
| 53 |
| 54 void av_init_packet(AVPacket* pkt) { |
| 55 NOTREACHED(); |
| 56 } |
| 57 |
| 58 } // extern "C" |
| 59 |
| 60 } // namespace media |
OLD | NEW |