| 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))); |  | 
| 25 | 24 | 
| 26   MOCK_METHOD1(AVCodecFindDecoder, AVCodec*(enum CodecID id)); | 25   MOCK_METHOD1(AVCodecFindDecoder, AVCodec*(enum CodecID id)); | 
| 27   MOCK_METHOD2(AVCodecOpen, int(AVCodecContext* avctx, AVCodec* codec)); | 26   MOCK_METHOD2(AVCodecOpen, int(AVCodecContext* avctx, AVCodec* codec)); | 
| 28   MOCK_METHOD1(AVCodecClose, int(AVCodecContext* avctx)); | 27   MOCK_METHOD1(AVCodecClose, int(AVCodecContext* avctx)); | 
| 29   MOCK_METHOD2(AVCodecThreadInit, int(AVCodecContext* avctx, int threads)); | 28   MOCK_METHOD2(AVCodecThreadInit, int(AVCodecContext* avctx, int threads)); | 
| 30   MOCK_METHOD1(AVCodecFlushBuffers, void(AVCodecContext* avctx)); | 29   MOCK_METHOD1(AVCodecFlushBuffers, void(AVCodecContext* avctx)); | 
| 31   MOCK_METHOD0(AVCodecAllocFrame, AVFrame*()); | 30   MOCK_METHOD0(AVCodecAllocFrame, AVFrame*()); | 
| 32   MOCK_METHOD4(AVCodecDecodeVideo2, | 31   MOCK_METHOD4(AVCodecDecodeVideo2, | 
| 33                int(AVCodecContext* avctx, AVFrame* picture, | 32                int(AVCodecContext* avctx, AVFrame* picture, | 
| 34                    int* got_picture_ptr, AVPacket* avpkt)); | 33                    int* got_picture_ptr, AVPacket* avpkt)); | 
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 140     arg0->destruct(arg0); | 139     arg0->destruct(arg0); | 
| 141   } | 140   } | 
| 142 | 141 | 
| 143   // Decrement number of packets allocated. | 142   // Decrement number of packets allocated. | 
| 144   MockFFmpeg::get()->dec_outstanding_packets(); | 143   MockFFmpeg::get()->dec_outstanding_packets(); | 
| 145 } | 144 } | 
| 146 | 145 | 
| 147 }  // namespace media | 146 }  // namespace media | 
| 148 | 147 | 
| 149 #endif  // MEDIA_BASE_MOCK_FFMPEG_H_ | 148 #endif  // MEDIA_BASE_MOCK_FFMPEG_H_ | 
| OLD | NEW | 
|---|