Added functions to control the VideoStreamDecoder playout delay.
Bug: none Change-Id: I1ee311df9b18acaf0c7230bb2ad9cc88f996bb1a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140103 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28168}
This commit is contained in:
@ -167,6 +167,7 @@ rtc_source_set("video_stream_decoder") {
|
||||
":encoded_frame",
|
||||
":video_frame",
|
||||
"../task_queue",
|
||||
"../units:time_delta",
|
||||
"../video_codecs:video_codecs_api",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "api/units/time_delta.h"
|
||||
#include "api/video/encoded_frame.h"
|
||||
#include "api/video/video_frame.h"
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
@ -44,6 +45,9 @@ class VideoStreamDecoderInterface {
|
||||
virtual ~VideoStreamDecoderInterface() = default;
|
||||
|
||||
virtual void OnFrame(std::unique_ptr<video_coding::EncodedFrame> frame) = 0;
|
||||
|
||||
virtual void SetMinPlayoutDelay(TimeDelta min_delay) = 0;
|
||||
virtual void SetMaxPlayoutDelay(TimeDelta max_delay) = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -80,6 +80,14 @@ void VideoStreamDecoderImpl::OnFrame(
|
||||
}
|
||||
}
|
||||
|
||||
void VideoStreamDecoderImpl::SetMinPlayoutDelay(TimeDelta min_delay) {
|
||||
timing_.set_min_playout_delay(min_delay.ms());
|
||||
}
|
||||
|
||||
void VideoStreamDecoderImpl::SetMaxPlayoutDelay(TimeDelta max_delay) {
|
||||
timing_.set_max_playout_delay(max_delay.ms());
|
||||
}
|
||||
|
||||
VideoDecoder* VideoStreamDecoderImpl::GetDecoder(int payload_type) {
|
||||
if (current_payload_type_ == payload_type) {
|
||||
RTC_DCHECK(decoder_);
|
||||
|
@ -39,6 +39,9 @@ class VideoStreamDecoderImpl : public VideoStreamDecoderInterface,
|
||||
|
||||
void OnFrame(std::unique_ptr<video_coding::EncodedFrame> frame) override;
|
||||
|
||||
void SetMinPlayoutDelay(TimeDelta min_delay) override;
|
||||
void SetMaxPlayoutDelay(TimeDelta max_delay) override;
|
||||
|
||||
private:
|
||||
enum DecodeResult {
|
||||
kOk,
|
||||
|
Reference in New Issue
Block a user