mock_video_codec_interface.h revision a4407329d4e16eab3d2e87cde0824188c06acb5a
135a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org/* 2ce33035deee98c6cfdd121fc2dbb0b9e0767d1bapwestin@webrtc.org * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 335a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org * 435a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org * Use of this source code is governed by a BSD-style license 535a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org * that can be found in the LICENSE file in the root of the source 635a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org * tree. An additional intellectual property rights grant can be found 735a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org * in the file PATENTS. All contributing project authors may 835a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org * be found in the AUTHORS file in the root of the source tree. 935a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org */ 105b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org 115b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_MOCK_VIDEO_CODEC_INTERFACE_H_ 125b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org#define WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_MOCK_VIDEO_CODEC_INTERFACE_H_ 1335a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org 1435a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org#include <string> 1535a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org 16a4407329d4e16eab3d2e87cde0824188c06acb5apbos@webrtc.org#include "testing/gmock/include/gmock/gmock.h" 17a4407329d4e16eab3d2e87cde0824188c06acb5apbos@webrtc.org#include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h" 18a4407329d4e16eab3d2e87cde0824188c06acb5apbos@webrtc.org#include "webrtc/typedefs.h" 1935a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org 2035a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.orgnamespace webrtc { 2135a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org 225b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.orgclass MockEncodedImageCallback : public EncodedImageCallback { 235b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org public: 24034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD3(Encoded, int32_t(EncodedImage& encodedImage, 25034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org const CodecSpecificInfo* codecSpecificInfo, 26034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org const RTPFragmentationHeader* fragmentation)); 275b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org}; 285b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org 2935a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.orgclass MockVideoEncoder : public VideoEncoder { 3035a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org public: 31034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_CONST_METHOD2(Version, int32_t(int8_t *version, int32_t length)); 32034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD3(InitEncode, int32_t(const VideoCodec* codecSettings, 33034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t numberOfCores, 34034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org uint32_t maxPayloadSize)); 35034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD3(Encode, int32_t(const I420VideoFrame& inputImage, 36034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org const CodecSpecificInfo* codecSpecificInfo, 37034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org const std::vector<VideoFrameType>* frame_types)); 3835a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org MOCK_METHOD1(RegisterEncodeCompleteCallback, 39034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t(EncodedImageCallback* callback)); 40034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD0(Release, int32_t()); 41034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD0(Reset, int32_t()); 42034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int rtt)); 43034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD2(SetRates, int32_t(uint32_t newBitRate, uint32_t frameRate)); 44034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD1(SetPeriodicKeyFrames, int32_t(bool enable)); 4535a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org MOCK_METHOD2(CodecConfigParameters, 46034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t(uint8_t* /*buffer*/, int32_t)); 4735a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org}; 4835a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org 495b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.orgclass MockDecodedImageCallback : public DecodedImageCallback { 505b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org public: 515b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org MOCK_METHOD1(Decoded, 52034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t(I420VideoFrame& decodedImage)); 535b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org MOCK_METHOD1(ReceivedDecodedReferenceFrame, 54034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t(const uint64_t pictureId)); 555b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org MOCK_METHOD1(ReceivedDecodedFrame, 56034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t(const uint64_t pictureId)); 575b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org}; 585b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org 5935a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.orgclass MockVideoDecoder : public VideoDecoder { 6035a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org public: 61034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD2(InitDecode, int32_t(const VideoCodec* codecSettings, 62034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t numberOfCores)); 63034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD5(Decode, int32_t(const EncodedImage& inputImage, 64034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org bool missingFrames, 65034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org const RTPFragmentationHeader* fragmentation, 66034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org const CodecSpecificInfo* codecSpecificInfo, 67034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int64_t renderTimeMs)); 6835a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org MOCK_METHOD1(RegisterDecodeCompleteCallback, 69034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t(DecodedImageCallback* callback)); 70034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD0(Release, int32_t()); 71034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org MOCK_METHOD0(Reset, int32_t()); 7235a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org MOCK_METHOD2(SetCodecConfigParameters, 73034f004a4fd07b04fc23cd8579b53616f98133a4pbos@webrtc.org int32_t(const uint8_t* /*buffer*/, int32_t)); 74d292b9c9da179eca5f12f2b052dd56843add6768kjellander@webrtc.org MOCK_METHOD0(Copy, VideoDecoder*()); 7535a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org}; 7635a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org 7735a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org} // namespace webrtc 7835a1756502707ffd88069b9ccdc97a80c68c9812kjellander@webrtc.org 795b97b1216fbb8061216d4075d46596fc38d9cff4kjellander@webrtc.org#endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_MOCK_VIDEO_CODEC_INTERFACE_H_ 80