| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * libjingle | |
| 3 * Copyright 2004 Google Inc. | |
| 4 * | |
| 5 * Redistribution and use in source and binary forms, with or without | |
| 6 * modification, are permitted provided that the following conditions are met: | |
| 7 * | |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | |
| 9 * this list of conditions and the following disclaimer. | |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | |
| 11 * this list of conditions and the following disclaimer in the documentation | |
| 12 * and/or other materials provided with the distribution. | |
| 13 * 3. The name of the author may not be used to endorse or promote products | |
| 14 * derived from this software without specific prior written permission. | |
| 15 * | |
| 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | |
| 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
| 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
| 19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
| 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
| 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
| 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
| 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
| 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 26 */ | |
| 27 | |
| 28 #ifndef TALK_MEDIA_BASE_NULLVIDEOFRAME_H_ | |
| 29 #define TALK_MEDIA_BASE_NULLVIDEOFRAME_H_ | |
| 30 | |
| 31 #include "talk/media/base/videoframe.h" | |
| 32 | |
| 33 namespace cricket { | |
| 34 | |
| 35 // Simple subclass for use in mocks. | |
| 36 class NullVideoFrame : public VideoFrame { | |
| 37 public: | |
| 38 virtual bool Reset(uint32 format, | |
| 39 int w, | |
| 40 int h, | |
| 41 int dw, | |
| 42 int dh, | |
| 43 uint8* sample, | |
| 44 size_t sample_size, | |
| 45 size_t pixel_width, | |
| 46 size_t pixel_height, | |
| 47 int64 elapsed_time, | |
| 48 int64 time_stamp, | |
| 49 webrtc::VideoRotation rotation, | |
| 50 bool apply_rotation) { | |
| 51 return false; | |
| 52 } | |
| 53 virtual bool InitToBlack(int w, int h, size_t pixel_width, | |
| 54 size_t pixel_height, int64 elapsed_time, | |
| 55 int64 time_stamp) { | |
| 56 return false; | |
| 57 } | |
| 58 virtual size_t GetWidth() const { return 0; } | |
| 59 virtual size_t GetHeight() const { return 0; } | |
| 60 virtual const uint8 *GetYPlane() const { return NULL; } | |
| 61 virtual const uint8 *GetUPlane() const { return NULL; } | |
| 62 virtual const uint8 *GetVPlane() const { return NULL; } | |
| 63 virtual uint8 *GetYPlane() { return NULL; } | |
| 64 virtual uint8 *GetUPlane() { return NULL; } | |
| 65 virtual uint8 *GetVPlane() { return NULL; } | |
| 66 virtual int32 GetYPitch() const { return 0; } | |
| 67 virtual int32 GetUPitch() const { return 0; } | |
| 68 virtual int32 GetVPitch() const { return 0; } | |
| 69 virtual void* GetNativeHandle() const { return NULL; } | |
| 70 | |
| 71 virtual size_t GetPixelWidth() const { return 1; } | |
| 72 virtual size_t GetPixelHeight() const { return 1; } | |
| 73 virtual int64 GetElapsedTime() const { return 0; } | |
| 74 virtual int64 GetTimeStamp() const { return 0; } | |
| 75 virtual void SetElapsedTime(int64 elapsed_time) {} | |
| 76 virtual void SetTimeStamp(int64 time_stamp) {} | |
| 77 virtual webrtc::VideoRotation GetVideoRotation() const { | |
| 78 return webrtc::kVideoRotation_0; | |
| 79 } | |
| 80 | |
| 81 virtual VideoFrame *Copy() const { return NULL; } | |
| 82 | |
| 83 virtual bool IsExclusive() const { return false; } | |
| 84 | |
| 85 virtual bool MakeExclusive() { return false; } | |
| 86 | |
| 87 virtual size_t CopyToBuffer(uint8 *buffer, size_t size) const { return 0; } | |
| 88 | |
| 89 virtual size_t ConvertToRgbBuffer(uint32 to_fourcc, uint8 *buffer, | |
| 90 size_t size, int stride_rgb) const { | |
| 91 return 0; | |
| 92 } | |
| 93 | |
| 94 virtual void StretchToPlanes( | |
| 95 uint8 *y, uint8 *u, uint8 *v, int32 pitchY, int32 pitchU, int32 pitchV, | |
| 96 size_t width, size_t height, bool interpolate, bool crop) const {} | |
| 97 | |
| 98 rtc::scoped_refptr<webrtc::VideoFrameBuffer> GetVideoFrameBuffer() const { | |
| 99 return NULL; | |
| 100 } | |
| 101 | |
| 102 virtual VideoFrame *CreateEmptyFrame(int w, int h, size_t pixel_width, | |
| 103 size_t pixel_height, int64 elapsed_time, | |
| 104 int64 time_stamp) const { | |
| 105 return NULL; | |
| 106 } | |
| 107 | |
| 108 virtual const VideoFrame* GetCopyWithRotationApplied() const { return NULL; } | |
| 109 }; | |
| 110 | |
| 111 } // namespace cricket | |
| 112 | |
| 113 #endif // TALK_MEDIA_BASE_NULLVIDEOFRAME_H_ | |
| OLD | NEW |