2018-07-09 15:52:29 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018 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 MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_
|
|
|
|
|
#define MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_
|
|
|
|
|
|
2020-06-26 13:51:08 +02:00
|
|
|
#include <bitset>
|
2018-10-23 12:03:01 +02:00
|
|
|
#include <cstdint>
|
2024-08-29 13:00:40 +00:00
|
|
|
#include <optional>
|
2018-10-23 12:03:01 +02:00
|
|
|
|
2018-08-01 17:13:08 +02:00
|
|
|
#include "absl/container/inlined_vector.h"
|
2018-07-09 15:52:29 +02:00
|
|
|
#include "absl/types/variant.h"
|
2021-10-13 12:44:02 +02:00
|
|
|
#include "api/rtp_headers.h"
|
2020-01-30 16:28:53 +01:00
|
|
|
#include "api/transport/rtp/dependency_descriptor.h"
|
2018-12-03 14:18:53 +01:00
|
|
|
#include "api/video/color_space.h"
|
2018-11-20 11:06:58 +01:00
|
|
|
#include "api/video/video_codec_type.h"
|
2018-07-09 15:52:29 +02:00
|
|
|
#include "api/video/video_content_type.h"
|
2022-11-25 14:46:40 +01:00
|
|
|
#include "api/video/video_frame_metadata.h"
|
2019-04-24 09:41:16 +02:00
|
|
|
#include "api/video/video_frame_type.h"
|
2018-07-09 15:52:29 +02:00
|
|
|
#include "api/video/video_rotation.h"
|
|
|
|
|
#include "api/video/video_timing.h"
|
2024-09-03 13:23:33 +02:00
|
|
|
#include "common_video/frame_instrumentation_data.h"
|
2018-07-09 15:52:29 +02:00
|
|
|
#include "modules/video_coding/codecs/h264/include/h264_globals.h"
|
|
|
|
|
#include "modules/video_coding/codecs/vp8/include/vp8_globals.h"
|
|
|
|
|
#include "modules/video_coding/codecs/vp9/include/vp9_globals.h"
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
2020-01-28 18:36:57 +01:00
|
|
|
// Details passed in the rtp payload for legacy generic rtp packetizer.
|
|
|
|
|
// TODO(bugs.webrtc.org/9772): Deprecate in favor of passing generic video
|
|
|
|
|
// details in an rtp header extension.
|
|
|
|
|
struct RTPVideoHeaderLegacyGeneric {
|
|
|
|
|
uint16_t picture_id;
|
|
|
|
|
};
|
|
|
|
|
|
Reland "Remove RTPVideoHeader::vp8() accessors."
This reverts commit 1811c04f22a26da3ed2832373a5c92a9786420c3.
Reason for revert: Downstream projects fixed.
Original change's description:
> Revert "Remove RTPVideoHeader::vp8() accessors."
>
> This reverts commit af7afc66427b0e9109e7d492f2805d63d239b914.
>
> Reason for revert: Break downstream projects.
>
> Original change's description:
> > Remove RTPVideoHeader::vp8() accessors.
> >
> > Bug: none
> > Change-Id: Ia7d65148fb36a8f26647bee8a876ce7217ff8a68
> > Reviewed-on: https://webrtc-review.googlesource.com/93321
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#24626}
>
> TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com
>
> Change-Id: I3f7f19c0ea810c0fd988c59e6556bbea9b756b33
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: none
> Reviewed-on: https://webrtc-review.googlesource.com/98864
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24628}
TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com
Change-Id: I9246f36e638108ae4fc46c1ae4559c8205d50fc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://webrtc-review.googlesource.com/98841
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24629}
2018-09-07 13:03:55 +00:00
|
|
|
using RTPVideoTypeHeader = absl::variant<absl::monostate,
|
|
|
|
|
RTPVideoHeaderVP8,
|
|
|
|
|
RTPVideoHeaderVP9,
|
2020-01-28 18:36:57 +01:00
|
|
|
RTPVideoHeaderH264,
|
|
|
|
|
RTPVideoHeaderLegacyGeneric>;
|
2018-07-09 15:52:29 +02:00
|
|
|
|
|
|
|
|
struct RTPVideoHeader {
|
2018-08-27 14:33:18 +02:00
|
|
|
struct GenericDescriptorInfo {
|
|
|
|
|
GenericDescriptorInfo();
|
|
|
|
|
GenericDescriptorInfo(const GenericDescriptorInfo& other);
|
|
|
|
|
~GenericDescriptorInfo();
|
|
|
|
|
|
|
|
|
|
int64_t frame_id = 0;
|
|
|
|
|
int spatial_index = 0;
|
|
|
|
|
int temporal_index = 0;
|
2020-01-30 16:28:53 +01:00
|
|
|
absl::InlinedVector<DecodeTargetIndication, 10> decode_target_indications;
|
2018-08-27 14:33:18 +02:00
|
|
|
absl::InlinedVector<int64_t, 5> dependencies;
|
2020-05-14 16:35:23 +02:00
|
|
|
absl::InlinedVector<int, 4> chain_diffs;
|
2020-06-26 13:51:08 +02:00
|
|
|
std::bitset<32> active_decode_targets = ~uint32_t{0};
|
2018-08-27 14:33:18 +02:00
|
|
|
};
|
|
|
|
|
|
2023-01-11 15:55:53 +01:00
|
|
|
static RTPVideoHeader FromMetadata(const VideoFrameMetadata& metadata);
|
|
|
|
|
|
2018-07-09 15:52:29 +02:00
|
|
|
RTPVideoHeader();
|
|
|
|
|
RTPVideoHeader(const RTPVideoHeader& other);
|
|
|
|
|
|
2018-08-01 17:13:08 +02:00
|
|
|
~RTPVideoHeader();
|
|
|
|
|
|
2022-11-25 14:46:40 +01:00
|
|
|
// The subset of RTPVideoHeader that is exposed in the Insertable Streams API.
|
|
|
|
|
VideoFrameMetadata GetAsMetadata() const;
|
2023-01-11 15:55:53 +01:00
|
|
|
void SetFromMetadata(const VideoFrameMetadata& metadata);
|
2022-11-25 14:46:40 +01:00
|
|
|
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<GenericDescriptorInfo> generic;
|
2018-08-01 17:13:08 +02:00
|
|
|
|
2019-04-24 09:41:16 +02:00
|
|
|
VideoFrameType frame_type = VideoFrameType::kEmptyFrame;
|
2018-08-01 17:13:08 +02:00
|
|
|
uint16_t width = 0;
|
|
|
|
|
uint16_t height = 0;
|
|
|
|
|
VideoRotation rotation = VideoRotation::kVideoRotation_0;
|
|
|
|
|
VideoContentType content_type = VideoContentType::UNSPECIFIED;
|
|
|
|
|
bool is_first_packet_in_frame = false;
|
2018-09-13 11:07:48 +02:00
|
|
|
bool is_last_packet_in_frame = false;
|
2020-11-11 16:15:07 +01:00
|
|
|
bool is_last_frame_in_picture = true;
|
2018-08-01 17:13:08 +02:00
|
|
|
uint8_t simulcastIdx = 0;
|
2018-08-27 15:04:07 +02:00
|
|
|
VideoCodecType codec = VideoCodecType::kVideoCodecGeneric;
|
2018-08-01 17:13:08 +02:00
|
|
|
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<VideoPlayoutDelay> playout_delay;
|
2018-07-09 15:52:29 +02:00
|
|
|
VideoSendTiming video_timing;
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<ColorSpace> color_space;
|
2021-03-18 13:50:42 +01:00
|
|
|
// This field is meant for media quality testing purpose only. When enabled it
|
|
|
|
|
// carries the webrtc::VideoFrame id field from the sender to the receiver.
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<uint16_t> video_frame_tracking_id;
|
Reland "Remove RTPVideoHeader::vp8() accessors."
This reverts commit 1811c04f22a26da3ed2832373a5c92a9786420c3.
Reason for revert: Downstream projects fixed.
Original change's description:
> Revert "Remove RTPVideoHeader::vp8() accessors."
>
> This reverts commit af7afc66427b0e9109e7d492f2805d63d239b914.
>
> Reason for revert: Break downstream projects.
>
> Original change's description:
> > Remove RTPVideoHeader::vp8() accessors.
> >
> > Bug: none
> > Change-Id: Ia7d65148fb36a8f26647bee8a876ce7217ff8a68
> > Reviewed-on: https://webrtc-review.googlesource.com/93321
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#24626}
>
> TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com
>
> Change-Id: I3f7f19c0ea810c0fd988c59e6556bbea9b756b33
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: none
> Reviewed-on: https://webrtc-review.googlesource.com/98864
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24628}
TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com
Change-Id: I9246f36e638108ae4fc46c1ae4559c8205d50fc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://webrtc-review.googlesource.com/98841
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24629}
2018-09-07 13:03:55 +00:00
|
|
|
RTPVideoTypeHeader video_type_header;
|
2021-10-13 12:44:02 +02:00
|
|
|
|
|
|
|
|
// When provided, is sent as is as an RTP header extension according to
|
|
|
|
|
// http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time.
|
|
|
|
|
// Otherwise, it is derived from other relevant information.
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<AbsoluteCaptureTime> absolute_capture_time;
|
2024-09-03 13:23:33 +02:00
|
|
|
|
|
|
|
|
// Required for automatic corruption detection.
|
|
|
|
|
std::optional<
|
|
|
|
|
absl::variant<FrameInstrumentationSyncData, FrameInstrumentationData>>
|
|
|
|
|
frame_instrumentation_data;
|
2018-07-09 15:52:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
|
|
|
|
#endif // MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_
|