fake_frame_source.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2018 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 MEDIA_BASE_FAKE_FRAME_SOURCE_H_
  11. #define MEDIA_BASE_FAKE_FRAME_SOURCE_H_
  12. #include "api/video/video_frame.h"
  13. #include "rtc_base/time_utils.h"
  14. namespace cricket {
  15. class FakeFrameSource {
  16. public:
  17. FakeFrameSource(int width,
  18. int height,
  19. int interval_us,
  20. int64_t timestamp_offset_us);
  21. FakeFrameSource(int width, int height, int interval_us);
  22. webrtc::VideoRotation GetRotation() const;
  23. void SetRotation(webrtc::VideoRotation rotation);
  24. webrtc::VideoFrame GetFrame();
  25. webrtc::VideoFrame GetFrameRotationApplied();
  26. // Override configuration.
  27. webrtc::VideoFrame GetFrame(int width,
  28. int height,
  29. webrtc::VideoRotation rotation,
  30. int interval_us);
  31. private:
  32. const int width_;
  33. const int height_;
  34. const int interval_us_;
  35. webrtc::VideoRotation rotation_ = webrtc::kVideoRotation_0;
  36. int64_t next_timestamp_us_;
  37. };
  38. } // namespace cricket
  39. #endif // MEDIA_BASE_FAKE_FRAME_SOURCE_H_