Unwrap the presentation timestamp before calling aom_codec_encode in LibaomAv1Encoder.
Bug: webrtc:14673 Change-Id: I0358fed5ac0839994482c5fb049c13e442f82c82 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283701 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38657}
This commit is contained in:
@ -32,6 +32,7 @@
|
||||
#include "modules/video_coding/svc/scalable_video_controller_no_layering.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/numerics/sequence_number_util.h"
|
||||
#include "third_party/libaom/source/libaom/aom/aom_codec.h"
|
||||
#include "third_party/libaom/source/libaom/aom/aom_encoder.h"
|
||||
#include "third_party/libaom/source/libaom/aom/aomcx.h"
|
||||
@ -117,6 +118,7 @@ class LibaomAv1Encoder final : public VideoEncoder {
|
||||
aom_codec_ctx_t ctx_;
|
||||
aom_codec_enc_cfg_t cfg_;
|
||||
EncodedImageCallback* encoded_image_callback_;
|
||||
SeqNumUnwrapper<uint32_t> rtp_timestamp_unwrapper_;
|
||||
};
|
||||
|
||||
int32_t VerifyCodecSettings(const VideoCodec& codec_settings) {
|
||||
@ -636,9 +638,11 @@ int32_t LibaomAv1Encoder::Encode(
|
||||
layer_frame->TemporalId() > 0 ? 1 : 0);
|
||||
}
|
||||
|
||||
// Encode a frame.
|
||||
aom_codec_err_t ret = aom_codec_encode(&ctx_, frame_for_encode_,
|
||||
frame.timestamp(), duration, flags);
|
||||
// Encode a frame. The presentation timestamp `pts` should never wrap, hence
|
||||
// the unwrapping.
|
||||
aom_codec_err_t ret = aom_codec_encode(
|
||||
&ctx_, frame_for_encode_,
|
||||
rtp_timestamp_unwrapper_.Unwrap(frame.timestamp()), duration, flags);
|
||||
if (ret != AOM_CODEC_OK) {
|
||||
RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::Encode returned " << ret
|
||||
<< " on aom_codec_encode.";
|
||||
|
||||
Reference in New Issue
Block a user