mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00

This is a reland of commit 0e37f5ebd4
with backward compability added to allow downstream tests to migrate to the new signature.
Original change's description:
> Fix definition of keyframes decoded statistics
>
> which are defined to be measured after decoding, not before:
> https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-keyframesdecoded
>
> BUG=webrtc:14728
>
> Change-Id: I0a83dde278e1ebe8acf787bdac729af369a1ecf8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315520
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40545}
BUG=webrtc:14728
Change-Id: I4cf52bb22ba8244155b4fa8c367b9c0306a77590
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316120
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40553}
62 lines
2 KiB
C++
62 lines
2 KiB
C++
/*
|
|
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef VIDEO_VIDEO_STREAM_DECODER2_H_
|
|
#define VIDEO_VIDEO_STREAM_DECODER2_H_
|
|
|
|
#include <list>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "api/scoped_refptr.h"
|
|
#include "api/video/video_sink_interface.h"
|
|
#include "api/video_codecs/video_decoder.h"
|
|
#include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
|
#include "modules/video_coding/include/video_coding_defines.h"
|
|
#include "rtc_base/platform_thread.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class VideoReceiver2;
|
|
|
|
namespace internal {
|
|
|
|
class ReceiveStatisticsProxy;
|
|
|
|
class VideoStreamDecoder : public VCMReceiveCallback {
|
|
public:
|
|
VideoStreamDecoder(
|
|
VideoReceiver2* video_receiver,
|
|
ReceiveStatisticsProxy* receive_statistics_proxy,
|
|
rtc::VideoSinkInterface<VideoFrame>* incoming_video_stream);
|
|
~VideoStreamDecoder() override;
|
|
|
|
// Implements VCMReceiveCallback.
|
|
int32_t FrameToRender(VideoFrame& video_frame,
|
|
absl::optional<uint8_t> qp,
|
|
TimeDelta decode_time,
|
|
VideoContentType content_type,
|
|
VideoFrameType frame_type) override;
|
|
void OnDroppedFrames(uint32_t frames_dropped) override;
|
|
void OnIncomingPayloadType(int payload_type) override;
|
|
void OnDecoderInfoChanged(
|
|
const VideoDecoder::DecoderInfo& decoder_info) override;
|
|
|
|
private:
|
|
VideoReceiver2* const video_receiver_;
|
|
ReceiveStatisticsProxy* const receive_stats_callback_;
|
|
rtc::VideoSinkInterface<VideoFrame>* const incoming_video_stream_;
|
|
};
|
|
|
|
} // namespace internal
|
|
} // namespace webrtc
|
|
|
|
#endif // VIDEO_VIDEO_STREAM_DECODER2_H_
|