OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_INCLUDE_MOCK_MOCK_VIDEO_CODEC_INTERFACE_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_MOCK_VIDEO_CODEC_INTER
FACE_H_ |
12 #define WEBRTC_MODULES_VIDEO_CODING_INCLUDE_MOCK_MOCK_VIDEO_CODEC_INTERFACE_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_MOCK_VIDEO_CODEC_INTER
FACE_H_ |
13 | 13 |
14 #pragma message("WARNING: video_coding/codecs/interface is DEPRECATED; use video
_coding/include") | 14 #pragma message("WARNING: video_coding/codecs/interface is DEPRECATED; " |
15 | 15 "use video_coding/include") |
16 #include <string> | 16 #include <string> |
| 17 #include <vector> |
17 | 18 |
18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 20 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
20 #include "webrtc/typedefs.h" | 21 #include "webrtc/typedefs.h" |
21 | 22 |
22 namespace webrtc { | 23 namespace webrtc { |
23 | 24 |
24 class MockEncodedImageCallback : public EncodedImageCallback { | 25 class MockEncodedImageCallback : public EncodedImageCallback { |
25 public: | 26 public: |
26 MOCK_METHOD3(Encoded, int32_t(const EncodedImage& encodedImage, | 27 MOCK_METHOD3(Encoded, |
27 const CodecSpecificInfo* codecSpecificInfo, | 28 int32_t(const EncodedImage& encodedImage, |
28 const RTPFragmentationHeader* fragmentation)); | 29 const CodecSpecificInfo* codecSpecificInfo, |
| 30 const RTPFragmentationHeader* fragmentation)); |
29 }; | 31 }; |
30 | 32 |
31 class MockVideoEncoder : public VideoEncoder { | 33 class MockVideoEncoder : public VideoEncoder { |
32 public: | 34 public: |
33 MOCK_CONST_METHOD2(Version, int32_t(int8_t *version, int32_t length)); | 35 MOCK_CONST_METHOD2(Version, int32_t(int8_t* version, int32_t length)); |
34 MOCK_METHOD3(InitEncode, int32_t(const VideoCodec* codecSettings, | 36 MOCK_METHOD3(InitEncode, |
35 int32_t numberOfCores, | 37 int32_t(const VideoCodec* codecSettings, |
36 size_t maxPayloadSize)); | 38 int32_t numberOfCores, |
| 39 size_t maxPayloadSize)); |
37 MOCK_METHOD3(Encode, | 40 MOCK_METHOD3(Encode, |
38 int32_t(const VideoFrame& inputImage, | 41 int32_t(const VideoFrame& inputImage, |
39 const CodecSpecificInfo* codecSpecificInfo, | 42 const CodecSpecificInfo* codecSpecificInfo, |
40 const std::vector<FrameType>* frame_types)); | 43 const std::vector<FrameType>* frame_types)); |
41 MOCK_METHOD1(RegisterEncodeCompleteCallback, | 44 MOCK_METHOD1(RegisterEncodeCompleteCallback, |
42 int32_t(EncodedImageCallback* callback)); | 45 int32_t(EncodedImageCallback* callback)); |
43 MOCK_METHOD0(Release, int32_t()); | 46 MOCK_METHOD0(Release, int32_t()); |
44 MOCK_METHOD0(Reset, int32_t()); | 47 MOCK_METHOD0(Reset, int32_t()); |
45 MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt)); | 48 MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt)); |
46 MOCK_METHOD2(SetRates, int32_t(uint32_t newBitRate, uint32_t frameRate)); | 49 MOCK_METHOD2(SetRates, int32_t(uint32_t newBitRate, uint32_t frameRate)); |
47 MOCK_METHOD1(SetPeriodicKeyFrames, int32_t(bool enable)); | 50 MOCK_METHOD1(SetPeriodicKeyFrames, int32_t(bool enable)); |
48 }; | 51 }; |
49 | 52 |
50 class MockDecodedImageCallback : public DecodedImageCallback { | 53 class MockDecodedImageCallback : public DecodedImageCallback { |
51 public: | 54 public: |
52 MOCK_METHOD1(Decoded, int32_t(VideoFrame& decodedImage)); | 55 MOCK_METHOD1(Decoded, int32_t(const VideoFrame& decodedImage)); |
53 MOCK_METHOD2(Decoded, int32_t(VideoFrame& decodedImage, | 56 MOCK_METHOD2(Decoded, |
54 int64_t decode_time_ms)); | 57 int32_t(const VideoFrame& decodedImage, int64_t decode_time_ms)); |
55 MOCK_METHOD1(ReceivedDecodedReferenceFrame, | 58 MOCK_METHOD1(ReceivedDecodedReferenceFrame, |
56 int32_t(const uint64_t pictureId)); | 59 int32_t(const uint64_t pictureId)); |
57 MOCK_METHOD1(ReceivedDecodedFrame, | 60 MOCK_METHOD1(ReceivedDecodedFrame, int32_t(const uint64_t pictureId)); |
58 int32_t(const uint64_t pictureId)); | |
59 }; | 61 }; |
60 | 62 |
61 class MockVideoDecoder : public VideoDecoder { | 63 class MockVideoDecoder : public VideoDecoder { |
62 public: | 64 public: |
63 MOCK_METHOD2(InitDecode, int32_t(const VideoCodec* codecSettings, | 65 MOCK_METHOD2(InitDecode, |
64 int32_t numberOfCores)); | 66 int32_t(const VideoCodec* codecSettings, int32_t numberOfCores)); |
65 MOCK_METHOD5(Decode, int32_t(const EncodedImage& inputImage, | 67 MOCK_METHOD5(Decode, |
66 bool missingFrames, | 68 int32_t(const EncodedImage& inputImage, |
67 const RTPFragmentationHeader* fragmentation, | 69 bool missingFrames, |
68 const CodecSpecificInfo* codecSpecificInfo, | 70 const RTPFragmentationHeader* fragmentation, |
69 int64_t renderTimeMs)); | 71 const CodecSpecificInfo* codecSpecificInfo, |
| 72 int64_t renderTimeMs)); |
70 MOCK_METHOD1(RegisterDecodeCompleteCallback, | 73 MOCK_METHOD1(RegisterDecodeCompleteCallback, |
71 int32_t(DecodedImageCallback* callback)); | 74 int32_t(DecodedImageCallback* callback)); |
72 MOCK_METHOD0(Release, int32_t()); | 75 MOCK_METHOD0(Release, int32_t()); |
73 MOCK_METHOD0(Reset, int32_t()); | 76 MOCK_METHOD0(Reset, int32_t()); |
74 MOCK_METHOD0(Copy, VideoDecoder*()); | 77 MOCK_METHOD0(Copy, VideoDecoder*()); |
75 }; | 78 }; |
76 | 79 |
77 } // namespace webrtc | 80 } // namespace webrtc |
78 | 81 |
79 #endif // WEBRTC_MODULES_VIDEO_CODING_INCLUDE_MOCK_MOCK_VIDEO_CODEC_INTERFACE_H
_ | 82 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_MOCK_VIDEO_CODEC_IN
TERFACE_H_ |
OLD | NEW |