You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. #ifndef TALK_MEDIA_BASE_NULLVIDEOFRAME_H_
  28. #define TALK_MEDIA_BASE_NULLVIDEOFRAME_H_
  29. #include "talk/media/base/videoframe.h"
  30. namespace cricket {
  31. // Simple subclass for use in mocks.
  32. class NullVideoFrame : public VideoFrame {
  33. public:
  34. virtual bool Reset(uint32 format, int w, int h, int dw, int dh,
  35. uint8* sample, size_t sample_size,
  36. size_t pixel_width, size_t pixel_height,
  37. int64 elapsed_time, int64 time_stamp, int rotation) {
  38. return false;
  39. }
  40. virtual size_t GetWidth() const { return 0; }
  41. virtual size_t GetHeight() const { return 0; }
  42. virtual const uint8 *GetYPlane() const { return NULL; }
  43. virtual const uint8 *GetUPlane() const { return NULL; }
  44. virtual const uint8 *GetVPlane() const { return NULL; }
  45. virtual uint8 *GetYPlane() { return NULL; }
  46. virtual uint8 *GetUPlane() { return NULL; }
  47. virtual uint8 *GetVPlane() { return NULL; }
  48. virtual int32 GetYPitch() const { return 0; }
  49. virtual int32 GetUPitch() const { return 0; }
  50. virtual int32 GetVPitch() const { return 0; }
  51. virtual size_t GetPixelWidth() const { return 1; }
  52. virtual size_t GetPixelHeight() const { return 1; }
  53. virtual int64 GetElapsedTime() const { return 0; }
  54. virtual int64 GetTimeStamp() const { return 0; }
  55. virtual void SetElapsedTime(int64 elapsed_time) {}
  56. virtual void SetTimeStamp(int64 time_stamp) {}
  57. virtual int GetRotation() const { return 0; }
  58. virtual VideoFrame *Copy() const {
  59. return NULL;
  60. }
  61. virtual bool MakeExclusive() {
  62. return false;
  63. }
  64. virtual size_t CopyToBuffer(uint8 *buffer, size_t size) const {
  65. return 0;
  66. }
  67. virtual size_t ConvertToRgbBuffer(uint32 to_fourcc, uint8 *buffer,
  68. size_t size, int stride_rgb) const {
  69. return 0;
  70. }
  71. virtual void StretchToPlanes(uint8 *y, uint8 *u, uint8 *v,
  72. int32 pitchY, int32 pitchU, int32 pitchV,
  73. size_t width, size_t height,
  74. bool interpolate, bool crop) const {
  75. }
  76. virtual VideoFrame* CreateEmptyFrame(int w, int h,
  77. size_t pixel_width, size_t pixel_height,
  78. int64 elapsed_time,
  79. int64 time_stamp) const {
  80. return NULL;
  81. }
  82. };
  83. } // namespace cricket
  84. #endif // TALK_MEDIA_BASE_NULLVIDEOFRAME_H_