1 /* 2 * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "api/video/video_frame_metadata.h" 12 13 namespace webrtc { 14 15 VideoFrameMetadata::VideoFrameMetadata() = default; 16 GetFrameType() const17VideoFrameType VideoFrameMetadata::GetFrameType() const { 18 return frame_type_; 19 } 20 SetFrameType(VideoFrameType frame_type)21void VideoFrameMetadata::SetFrameType(VideoFrameType frame_type) { 22 frame_type_ = frame_type; 23 } 24 GetWidth() const25uint16_t VideoFrameMetadata::GetWidth() const { 26 return width_; 27 } 28 SetWidth(uint16_t width)29void VideoFrameMetadata::SetWidth(uint16_t width) { 30 width_ = width; 31 } 32 GetHeight() const33uint16_t VideoFrameMetadata::GetHeight() const { 34 return height_; 35 } 36 SetHeight(uint16_t height)37void VideoFrameMetadata::SetHeight(uint16_t height) { 38 height_ = height; 39 } 40 GetRotation() const41VideoRotation VideoFrameMetadata::GetRotation() const { 42 return rotation_; 43 } 44 SetRotation(VideoRotation rotation)45void VideoFrameMetadata::SetRotation(VideoRotation rotation) { 46 rotation_ = rotation; 47 } 48 GetContentType() const49VideoContentType VideoFrameMetadata::GetContentType() const { 50 return content_type_; 51 } 52 SetContentType(VideoContentType content_type)53void VideoFrameMetadata::SetContentType(VideoContentType content_type) { 54 content_type_ = content_type; 55 } 56 GetFrameId() const57absl::optional<int64_t> VideoFrameMetadata::GetFrameId() const { 58 return frame_id_; 59 } 60 SetFrameId(absl::optional<int64_t> frame_id)61void VideoFrameMetadata::SetFrameId(absl::optional<int64_t> frame_id) { 62 frame_id_ = frame_id; 63 } 64 GetSpatialIndex() const65int VideoFrameMetadata::GetSpatialIndex() const { 66 return spatial_index_; 67 } 68 SetSpatialIndex(int spatial_index)69void VideoFrameMetadata::SetSpatialIndex(int spatial_index) { 70 spatial_index_ = spatial_index; 71 } 72 GetTemporalIndex() const73int VideoFrameMetadata::GetTemporalIndex() const { 74 return temporal_index_; 75 } 76 SetTemporalIndex(int temporal_index)77void VideoFrameMetadata::SetTemporalIndex(int temporal_index) { 78 temporal_index_ = temporal_index; 79 } 80 GetFrameDependencies() const81rtc::ArrayView<const int64_t> VideoFrameMetadata::GetFrameDependencies() const { 82 return frame_dependencies_; 83 } 84 SetFrameDependencies(rtc::ArrayView<const int64_t> frame_dependencies)85void VideoFrameMetadata::SetFrameDependencies( 86 rtc::ArrayView<const int64_t> frame_dependencies) { 87 frame_dependencies_.assign(frame_dependencies.begin(), 88 frame_dependencies.end()); 89 } 90 91 rtc::ArrayView<const DecodeTargetIndication> GetDecodeTargetIndications() const92VideoFrameMetadata::GetDecodeTargetIndications() const { 93 return decode_target_indications_; 94 } 95 SetDecodeTargetIndications(rtc::ArrayView<const DecodeTargetIndication> decode_target_indications)96void VideoFrameMetadata::SetDecodeTargetIndications( 97 rtc::ArrayView<const DecodeTargetIndication> decode_target_indications) { 98 decode_target_indications_.assign(decode_target_indications.begin(), 99 decode_target_indications.end()); 100 } 101 GetIsLastFrameInPicture() const102bool VideoFrameMetadata::GetIsLastFrameInPicture() const { 103 return is_last_frame_in_picture_; 104 } 105 SetIsLastFrameInPicture(bool is_last_frame_in_picture)106void VideoFrameMetadata::SetIsLastFrameInPicture( 107 bool is_last_frame_in_picture) { 108 is_last_frame_in_picture_ = is_last_frame_in_picture; 109 } 110 GetSimulcastIdx() const111uint8_t VideoFrameMetadata::GetSimulcastIdx() const { 112 return simulcast_idx_; 113 } 114 SetSimulcastIdx(uint8_t simulcast_idx)115void VideoFrameMetadata::SetSimulcastIdx(uint8_t simulcast_idx) { 116 simulcast_idx_ = simulcast_idx; 117 } 118 GetCodec() const119VideoCodecType VideoFrameMetadata::GetCodec() const { 120 return codec_; 121 } 122 SetCodec(VideoCodecType codec)123void VideoFrameMetadata::SetCodec(VideoCodecType codec) { 124 codec_ = codec; 125 } 126 127 } // namespace webrtc 128