video_stream_decoder2.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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/critical_section.h"
  21. #include "rtc_base/platform_thread.h"
  22. namespace webrtc {
  23. class VideoReceiver2;
  24. namespace internal {
  25. class ReceiveStatisticsProxy;
  26. class VideoStreamDecoder : public VCMReceiveCallback {
  27. public:
  28. VideoStreamDecoder(
  29. VideoReceiver2* video_receiver,
  30. ReceiveStatisticsProxy* receive_statistics_proxy,
  31. rtc::VideoSinkInterface<VideoFrame>* incoming_video_stream);
  32. ~VideoStreamDecoder() override;
  33. // Implements VCMReceiveCallback.
  34. int32_t FrameToRender(VideoFrame& video_frame,
  35. absl::optional<uint8_t> qp,
  36. int32_t decode_time_ms,
  37. VideoContentType content_type) override;
  38. void OnDroppedFrames(uint32_t frames_dropped) override;
  39. void OnIncomingPayloadType(int payload_type) override;
  40. void OnDecoderImplementationName(const char* implementation_name) override;
  41. private:
  42. VideoReceiver2* const video_receiver_;
  43. ReceiveStatisticsProxy* const receive_stats_callback_;
  44. rtc::VideoSinkInterface<VideoFrame>* const incoming_video_stream_;
  45. };
  46. } // namespace internal
  47. } // namespace webrtc
  48. #endif // VIDEO_VIDEO_STREAM_DECODER2_H_