OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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/base/mock_ffmpeg.h" | 5 #include "media/base/mock_ffmpeg.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/ffmpeg/ffmpeg_common.h" | 8 #include "media/ffmpeg/ffmpeg_common.h" |
9 | 9 |
10 using ::testing::_; | 10 using ::testing::_; |
(...skipping 74 matching lines...) Loading... |
85 } | 85 } |
86 | 86 |
87 int av_register_protocol(URLProtocol* protocol) { | 87 int av_register_protocol(URLProtocol* protocol) { |
88 return media::MockFFmpeg::get()->AVRegisterProtocol(protocol); | 88 return media::MockFFmpeg::get()->AVRegisterProtocol(protocol); |
89 } | 89 } |
90 | 90 |
91 void av_register_all() { | 91 void av_register_all() { |
92 media::MockFFmpeg::get()->AVRegisterAll(); | 92 media::MockFFmpeg::get()->AVRegisterAll(); |
93 } | 93 } |
94 | 94 |
| 95 int av_lockmgr_register(int (*cb)(void**, enum AVLockOp)) { |
| 96 media::MockFFmpeg* mock = media::MockFFmpeg::get(); |
| 97 // Here |mock| may be NULL when this function is called from ~FFmpegGlue(). |
| 98 if (mock != NULL) { |
| 99 return media::MockFFmpeg::get()->AVRegisterLockManager(cb); |
| 100 } else { |
| 101 return 0; |
| 102 } |
| 103 } |
| 104 |
95 AVCodec* avcodec_find_decoder(enum CodecID id) { | 105 AVCodec* avcodec_find_decoder(enum CodecID id) { |
96 return media::MockFFmpeg::get()->AVCodecFindDecoder(id); | 106 return media::MockFFmpeg::get()->AVCodecFindDecoder(id); |
97 } | 107 } |
98 | 108 |
99 int avcodec_open(AVCodecContext* avctx, AVCodec* codec) { | 109 int avcodec_open(AVCodecContext* avctx, AVCodec* codec) { |
100 return media::MockFFmpeg::get()->AVCodecOpen(avctx, codec); | 110 return media::MockFFmpeg::get()->AVCodecOpen(avctx, codec); |
101 } | 111 } |
102 | 112 |
103 int avcodec_close(AVCodecContext* avctx) { | 113 int avcodec_close(AVCodecContext* avctx) { |
104 return media::MockFFmpeg::get()->AVCodecClose(avctx); | 114 return media::MockFFmpeg::get()->AVCodecClose(avctx); |
(...skipping 100 matching lines...) Loading... |
205 media::MockFFmpeg::get()->AVLogSetLevel(level); | 215 media::MockFFmpeg::get()->AVLogSetLevel(level); |
206 } | 216 } |
207 | 217 |
208 void av_destruct_packet(AVPacket *pkt) { | 218 void av_destruct_packet(AVPacket *pkt) { |
209 media::MockFFmpeg::get()->AVDestructPacket(pkt); | 219 media::MockFFmpeg::get()->AVDestructPacket(pkt); |
210 } | 220 } |
211 | 221 |
212 } // extern "C" | 222 } // extern "C" |
213 | 223 |
214 } // namespace media | 224 } // namespace media |
OLD | NEW |