Tommi | 74fc574 | 2020-04-27 08:43:06 | [diff] [blame] | 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 | |
| 11 | #ifndef VIDEO_VIDEO_STREAM_DECODER2_H_ |
| 12 | #define VIDEO_VIDEO_STREAM_DECODER2_H_ |
| 13 | |
| 14 | #include <list> |
| 15 | #include <map> |
| 16 | #include <memory> |
| 17 | #include <vector> |
| 18 | |
| 19 | #include "api/scoped_refptr.h" |
| 20 | #include "api/video/video_sink_interface.h" |
Evan Shrubsole | 09da10e | 2022-10-14 14:38:31 | [diff] [blame] | 21 | #include "api/video_codecs/video_decoder.h" |
Tommi | 74fc574 | 2020-04-27 08:43:06 | [diff] [blame] | 22 | #include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" |
| 23 | #include "modules/video_coding/include/video_coding_defines.h" |
Tommi | 74fc574 | 2020-04-27 08:43:06 | [diff] [blame] | 24 | #include "rtc_base/platform_thread.h" |
| 25 | |
| 26 | namespace webrtc { |
| 27 | |
| 28 | class VideoReceiver2; |
| 29 | |
| 30 | namespace internal { |
| 31 | |
| 32 | class ReceiveStatisticsProxy; |
| 33 | |
| 34 | class VideoStreamDecoder : public VCMReceiveCallback { |
| 35 | public: |
| 36 | VideoStreamDecoder( |
| 37 | VideoReceiver2* video_receiver, |
| 38 | ReceiveStatisticsProxy* receive_statistics_proxy, |
| 39 | rtc::VideoSinkInterface<VideoFrame>* incoming_video_stream); |
| 40 | ~VideoStreamDecoder() override; |
| 41 | |
| 42 | // Implements VCMReceiveCallback. |
| 43 | int32_t FrameToRender(VideoFrame& video_frame, |
| 44 | absl::optional<uint8_t> qp, |
Philipp Hancke | d970b09 | 2022-06-17 05:34:23 | [diff] [blame] | 45 | TimeDelta decode_time, |
Tommi | 74fc574 | 2020-04-27 08:43:06 | [diff] [blame] | 46 | VideoContentType content_type) override; |
| 47 | void OnDroppedFrames(uint32_t frames_dropped) override; |
| 48 | void OnIncomingPayloadType(int payload_type) override; |
Evan Shrubsole | 09da10e | 2022-10-14 14:38:31 | [diff] [blame] | 49 | void OnDecoderInfoChanged( |
| 50 | const VideoDecoder::DecoderInfo& decoder_info) override; |
Tommi | 74fc574 | 2020-04-27 08:43:06 | [diff] [blame] | 51 | |
| 52 | private: |
| 53 | VideoReceiver2* const video_receiver_; |
| 54 | ReceiveStatisticsProxy* const receive_stats_callback_; |
| 55 | rtc::VideoSinkInterface<VideoFrame>* const incoming_video_stream_; |
| 56 | }; |
| 57 | |
| 58 | } // namespace internal |
| 59 | } // namespace webrtc |
| 60 | |
| 61 | #endif // VIDEO_VIDEO_STREAM_DECODER2_H_ |