mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-14 06:10:40 +01:00

This change is part of the implementation of the Insertable Streams Web API: https://github.com/alvestrand/webrtc-media-streams/blob/master/explainer.md Design doc for WebRTC library changes: http://doc/1eiLkjNUkRy2FssCPLUp6eH08BZuXXoHfbbBP1ZN7EVk Bug: webrtc:11380 Change-Id: I491ecefc60d184b75128799274c7d7efcf907d2a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169128 Reviewed-by: Magnus Flodman <mflodman@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30666}
55 lines
1.7 KiB
C++
55 lines
1.7 KiB
C++
/*
|
|
* Copyright (c) 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.
|
|
*/
|
|
|
|
#include "modules/rtp_rtcp/source/transformable_encoded_frame.h"
|
|
|
|
namespace webrtc {
|
|
|
|
TransformableEncodedFrame::TransformableEncodedFrame(
|
|
rtc::scoped_refptr<EncodedImageBufferInterface> encoded_data,
|
|
const RTPVideoHeader& video_header,
|
|
int payload_type,
|
|
absl::optional<VideoCodecType> codec_type,
|
|
uint32_t rtp_timestamp,
|
|
int64_t capture_time_ms,
|
|
const RTPFragmentationHeader* fragmentation,
|
|
absl::optional<int64_t> expected_retransmission_time_ms)
|
|
: video_header_(video_header),
|
|
codec_type_(codec_type),
|
|
expected_retransmission_time_ms_(expected_retransmission_time_ms) {
|
|
SetEncodedData(encoded_data);
|
|
_payloadType = payload_type;
|
|
SetTimestamp(rtp_timestamp);
|
|
capture_time_ms_ = capture_time_ms;
|
|
if (fragmentation) {
|
|
fragmentation_header_ = std::make_unique<RTPFragmentationHeader>();
|
|
fragmentation_header_->CopyFrom(*fragmentation);
|
|
}
|
|
}
|
|
|
|
TransformableEncodedFrame::~TransformableEncodedFrame() = default;
|
|
|
|
const RTPVideoHeader& TransformableEncodedFrame::video_header() const {
|
|
return video_header_;
|
|
}
|
|
|
|
absl::optional<VideoCodecType> TransformableEncodedFrame::codec_type() const {
|
|
return codec_type_;
|
|
}
|
|
|
|
int64_t TransformableEncodedFrame::ReceivedTime() const {
|
|
return 0;
|
|
}
|
|
|
|
int64_t TransformableEncodedFrame::RenderTime() const {
|
|
return _renderTimeMs;
|
|
}
|
|
|
|
} // namespace webrtc
|