| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 MOCK_METHOD2(AVNewPacket, int(AVPacket* packet, int size)); | 58 MOCK_METHOD2(AVNewPacket, int(AVPacket* packet, int size)); |
| 59 MOCK_METHOD1(AVFreePacket, void(AVPacket* packet)); | 59 MOCK_METHOD1(AVFreePacket, void(AVPacket* packet)); |
| 60 MOCK_METHOD1(AVFree, void(void* ptr)); | 60 MOCK_METHOD1(AVFree, void(void* ptr)); |
| 61 MOCK_METHOD1(AVDupPacket, int(AVPacket* packet)); | 61 MOCK_METHOD1(AVDupPacket, int(AVPacket* packet)); |
| 62 | 62 |
| 63 MOCK_METHOD1(AVLogSetLevel, void(int level)); | 63 MOCK_METHOD1(AVLogSetLevel, void(int level)); |
| 64 | 64 |
| 65 // Used for verifying check points during tests. | 65 // Used for verifying check points during tests. |
| 66 MOCK_METHOD1(CheckPoint, void(int id)); | 66 MOCK_METHOD1(CheckPoint, void(int id)); |
| 67 | 67 |
| 68 // Setter/getter for the global instance of MockFFmpeg. | 68 // Returns the current MockFFmpeg instance. |
| 69 static void set(MockFFmpeg* instance); | |
| 70 static MockFFmpeg* get(); | 69 static MockFFmpeg* get(); |
| 71 | 70 |
| 72 // Returns the URLProtocol registered by the FFmpegGlue singleton. | 71 // Returns the URLProtocol registered by the FFmpegGlue singleton. |
| 73 static URLProtocol* protocol(); | 72 static URLProtocol* protocol(); |
| 74 | 73 |
| 75 // AVPacket destructor for packets allocated by av_new_packet(). | 74 // AVPacket destructor for packets allocated by av_new_packet(). |
| 76 static void DestructPacket(AVPacket* packet); | 75 static void DestructPacket(AVPacket* packet); |
| 77 | 76 |
| 78 // Modifies the number of outstanding packets. | 77 // Modifies the number of outstanding packets. |
| 79 void inc_outstanding_packets(); | 78 void inc_outstanding_packets(); |
| (...skipping 60 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 |