video_stream_decoder2.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2020 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 VIDEO_VIDEO_STREAM_DECODER2_H_
  11. #define VIDEO_VIDEO_STREAM_DECODER2_H_
  12. #include <list>
  13. #include <map>
  14. #include <memory>
  15. #include <vector>
  16. #include "api/scoped_refptr.h"
  17. #include "api/video/video_sink_interface.h"
  18. #include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
  19. #include "modules/video_coding/include/video_coding_defines.h"
  20. #include "rtc_base/platform_thread.h"
  21. namespace webrtc {
  22. class VideoReceiver2;
  23. namespace internal {
  24. class ReceiveStatisticsProxy;
  25. class VideoStreamDecoder : public VCMReceiveCallback {
  26. public:
  27. VideoStreamDecoder(
  28. VideoReceiver2* video_receiver,
  29. ReceiveStatisticsProxy* receive_statistics_proxy,
  30. rtc::VideoSinkInterface<VideoFrame>* incoming_video_stream);
  31. ~VideoStreamDecoder() override;
  32. // Implements VCMReceiveCallback.
  33. int32_t FrameToRender(VideoFrame& video_frame,
  34. absl::optional<uint8_t> qp,
  35. int32_t decode_time_ms,
  36. VideoContentType content_type) override;
  37. void OnDroppedFrames(uint32_t frames_dropped) override;
  38. void OnIncomingPayloadType(int payload_type) override;
  39. void OnDecoderImplementationName(const char* implementation_name) override;
  40. private:
  41. VideoReceiver2* const video_receiver_;
  42. ReceiveStatisticsProxy* const receive_stats_callback_;
  43. rtc::VideoSinkInterface<VideoFrame>* const incoming_video_stream_;
  44. };
  45. } // namespace internal
  46. } // namespace webrtc
  47. #endif // VIDEO_VIDEO_STREAM_DECODER2_H_