frame_utils.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
  3. *
  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
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef TEST_FRAME_UTILS_H_
  11. #define TEST_FRAME_UTILS_H_
  12. #include <stdint.h>
  13. #include "api/scoped_refptr.h"
  14. namespace webrtc {
  15. class I420Buffer;
  16. class VideoFrame;
  17. class VideoFrameBuffer;
  18. namespace test {
  19. bool EqualPlane(const uint8_t* data1,
  20. const uint8_t* data2,
  21. int stride1,
  22. int stride2,
  23. int width,
  24. int height);
  25. static inline bool EqualPlane(const uint8_t* data1,
  26. const uint8_t* data2,
  27. int stride,
  28. int width,
  29. int height) {
  30. return EqualPlane(data1, data2, stride, stride, width, height);
  31. }
  32. bool FramesEqual(const webrtc::VideoFrame& f1, const webrtc::VideoFrame& f2);
  33. bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1,
  34. const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2);
  35. rtc::scoped_refptr<I420Buffer> ReadI420Buffer(int width, int height, FILE*);
  36. } // namespace test
  37. } // namespace webrtc
  38. #endif // TEST_FRAME_UTILS_H_