#include "video/frame_encode_metadata_writer.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "common_video/h264/sps_vui_rewriter.h"
#include "modules/include/module_common_types_public.h"
#include "modules/video_coding/include/video_coding_defines.h"
#include "modules/video_coding/svc/create_scalability_structure.h"
#include "rtc_base/logging.h"
#include "rtc_base/time_utils.h"
namespace webrtc {
namespace {
const int kMessagesThrottlingThreshold = …;
const int kThrottleRatio = …;
class EncodedImageBufferWrapper : public EncodedImageBufferInterface { … };
}
FrameEncodeMetadataWriter::TimingFramesLayerInfo::TimingFramesLayerInfo() =
default;
FrameEncodeMetadataWriter::TimingFramesLayerInfo::~TimingFramesLayerInfo() =
default;
FrameEncodeMetadataWriter::FrameEncodeMetadataWriter(
EncodedImageCallback* frame_drop_callback)
: … { … }
FrameEncodeMetadataWriter::~FrameEncodeMetadataWriter() { … }
void FrameEncodeMetadataWriter::OnEncoderInit(const VideoCodec& codec) { … }
void FrameEncodeMetadataWriter::OnSetRates(
const VideoBitrateAllocation& bitrate_allocation,
uint32_t framerate_fps) { … }
void FrameEncodeMetadataWriter::OnEncodeStarted(const VideoFrame& frame) { … }
void FrameEncodeMetadataWriter::FillMetadataAndTimingInfo(
size_t simulcast_svc_idx,
EncodedImage* encoded_image) { … }
void FrameEncodeMetadataWriter::UpdateBitstream(
const CodecSpecificInfo* codec_specific_info,
EncodedImage* encoded_image) { … }
void FrameEncodeMetadataWriter::Reset() { … }
absl::optional<int64_t>
FrameEncodeMetadataWriter::ExtractEncodeStartTimeAndFillMetadata(
size_t simulcast_svc_idx,
EncodedImage* encoded_image) { … }
}