video_stream_decoder.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2012 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_DECODER_H_
  11. #define VIDEO_VIDEO_STREAM_DECODER_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. #include "rtc_base/synchronization/mutex.h"
  22. namespace webrtc {
  23. class ReceiveStatisticsProxy;
  24. class VideoReceiver2;
  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. void RegisterReceiveStatisticsProxy(
  41. ReceiveStatisticsProxy* receive_statistics_proxy);
  42. private:
  43. // Used for all registered callbacks except rendering.
  44. Mutex mutex_;
  45. VideoReceiver2* const video_receiver_;
  46. ReceiveStatisticsProxy* const receive_stats_callback_;
  47. rtc::VideoSinkInterface<VideoFrame>* const incoming_video_stream_;
  48. };
  49. } // namespace webrtc
  50. #endif // VIDEO_VIDEO_STREAM_DECODER_H_