OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef MEDIA_BASE_MOCK_FFMPEG_H_ | 5 #ifndef MEDIA_BASE_MOCK_FFMPEG_H_ |
6 #define MEDIA_BASE_MOCK_FFMPEG_H_ | 6 #define MEDIA_BASE_MOCK_FFMPEG_H_ |
7 | 7 |
8 // TODO(scherkus): See if we can remove ffmpeg_common from this file. | 8 // TODO(scherkus): See if we can remove ffmpeg_common from this file. |
9 #include "media/ffmpeg/ffmpeg_common.h" | 9 #include "media/ffmpeg/ffmpeg_common.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 | 13 |
14 class MockFFmpeg { | 14 class MockFFmpeg { |
15 public: | 15 public: |
16 MockFFmpeg(); | 16 MockFFmpeg(); |
17 virtual ~MockFFmpeg(); | 17 virtual ~MockFFmpeg(); |
18 | 18 |
19 // TODO(ajwong): Organize this class, and make sure that all mock entrypoints | 19 // TODO(ajwong): Organize this class, and make sure that all mock entrypoints |
20 // are still used. | 20 // are still used. |
21 MOCK_METHOD0(AVCodecInit, void()); | 21 MOCK_METHOD0(AVCodecInit, void()); |
22 MOCK_METHOD1(AVRegisterProtocol, int(URLProtocol* protocol)); | 22 MOCK_METHOD1(AVRegisterProtocol, int(URLProtocol* protocol)); |
23 MOCK_METHOD0(AVRegisterAll, void()); | 23 MOCK_METHOD0(AVRegisterAll, void()); |
| 24 MOCK_METHOD1(AVRegisterLockManager, int(int (*cb)(void**, enum AVLockOp))); |
24 | 25 |
25 MOCK_METHOD1(AVCodecFindDecoder, AVCodec*(enum CodecID id)); | 26 MOCK_METHOD1(AVCodecFindDecoder, AVCodec*(enum CodecID id)); |
26 MOCK_METHOD2(AVCodecOpen, int(AVCodecContext* avctx, AVCodec* codec)); | 27 MOCK_METHOD2(AVCodecOpen, int(AVCodecContext* avctx, AVCodec* codec)); |
27 MOCK_METHOD1(AVCodecClose, int(AVCodecContext* avctx)); | 28 MOCK_METHOD1(AVCodecClose, int(AVCodecContext* avctx)); |
28 MOCK_METHOD2(AVCodecThreadInit, int(AVCodecContext* avctx, int threads)); | 29 MOCK_METHOD2(AVCodecThreadInit, int(AVCodecContext* avctx, int threads)); |
29 MOCK_METHOD1(AVCodecFlushBuffers, void(AVCodecContext* avctx)); | 30 MOCK_METHOD1(AVCodecFlushBuffers, void(AVCodecContext* avctx)); |
30 MOCK_METHOD0(AVCodecAllocFrame, AVFrame*()); | 31 MOCK_METHOD0(AVCodecAllocFrame, AVFrame*()); |
31 MOCK_METHOD4(AVCodecDecodeVideo2, | 32 MOCK_METHOD4(AVCodecDecodeVideo2, |
32 int(AVCodecContext* avctx, AVFrame* picture, | 33 int(AVCodecContext* avctx, AVFrame* picture, |
33 int* got_picture_ptr, AVPacket* avpkt)); | 34 int* got_picture_ptr, AVPacket* avpkt)); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 arg0->destruct(arg0); | 140 arg0->destruct(arg0); |
140 } | 141 } |
141 | 142 |
142 // Decrement number of packets allocated. | 143 // Decrement number of packets allocated. |
143 MockFFmpeg::get()->dec_outstanding_packets(); | 144 MockFFmpeg::get()->dec_outstanding_packets(); |
144 } | 145 } |
145 | 146 |
146 } // namespace media | 147 } // namespace media |
147 | 148 |
148 #endif // MEDIA_BASE_MOCK_FFMPEG_H_ | 149 #endif // MEDIA_BASE_MOCK_FFMPEG_H_ |
OLD | NEW |