In preparation of adding RTPVideoHeader::SetFromMetadata() method, the VideoFrameMetadata construct-from-RTPVideoHeader is replaced by RTPVideoHeader::GetAsMetadata(). This serves two purposes: 1. Having "GetAs" and "SetFrom" in the same file reduces the risk of these two methods getting out of sync as we expand its usage. 2. This is necessary to avoid a circular dependency that would otherwise be introduced by RTPVideoHeader::SetFromMetadata(). Bug: webrtc:14709 Change-Id: I127b3d15f9a8c6af210449a5a50d414c9ba79930 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285080 Reviewed-by: Tony Herre <herre@google.com> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38735}
67 lines
2.1 KiB
C++
67 lines
2.1 KiB
C++
/*
|
|
* Copyright 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 API_VIDEO_VIDEO_FRAME_METADATA_H_
|
|
#define API_VIDEO_VIDEO_FRAME_METADATA_H_
|
|
|
|
#include <cstdint>
|
|
|
|
#include "absl/container/inlined_vector.h"
|
|
#include "absl/types/optional.h"
|
|
#include "api/array_view.h"
|
|
#include "api/transport/rtp/dependency_descriptor.h"
|
|
#include "rtc_base/system/rtc_export.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// A subset of metadata from the RTP video header, exposed in insertable streams
|
|
// API.
|
|
class RTC_EXPORT VideoFrameMetadata {
|
|
public:
|
|
VideoFrameMetadata();
|
|
VideoFrameMetadata(const VideoFrameMetadata&) = default;
|
|
VideoFrameMetadata& operator=(const VideoFrameMetadata&) = default;
|
|
|
|
uint16_t GetWidth() const;
|
|
void SetWidth(uint16_t width);
|
|
|
|
uint16_t GetHeight() const;
|
|
void SetHeight(uint16_t height);
|
|
|
|
absl::optional<int64_t> GetFrameId() const;
|
|
void SetFrameId(absl::optional<int64_t> frame_id);
|
|
|
|
int GetSpatialIndex() const;
|
|
void SetSpatialIndex(int spatial_index);
|
|
|
|
int GetTemporalIndex() const;
|
|
void SetTemporalIndex(int temporal_index);
|
|
|
|
rtc::ArrayView<const int64_t> GetFrameDependencies() const;
|
|
void SetFrameDependencies(rtc::ArrayView<const int64_t> frame_dependencies);
|
|
|
|
rtc::ArrayView<const DecodeTargetIndication> GetDecodeTargetIndications()
|
|
const;
|
|
void SetDecodeTargetIndications(
|
|
rtc::ArrayView<const DecodeTargetIndication> decode_target_indications);
|
|
|
|
private:
|
|
int16_t width_ = 0;
|
|
int16_t height_ = 0;
|
|
absl::optional<int64_t> frame_id_;
|
|
int spatial_index_ = 0;
|
|
int temporal_index_ = 0;
|
|
absl::InlinedVector<int64_t, 5> frame_dependencies_;
|
|
absl::InlinedVector<DecodeTargetIndication, 10> decode_target_indications_;
|
|
};
|
|
} // namespace webrtc
|
|
|
|
#endif // API_VIDEO_VIDEO_FRAME_METADATA_H_
|