Use opaque int as payload_type in MediaTransportInterface
Replaces enum VideoCodecType for video frames and uint8_t for audio frames. Also delete method MediaTransportVideoSinkInterface::OnKeyFrameRequested; it needs to be added as a send-side interface instead (for a later cl). Bug: webrtc:9719 Change-Id: I2cfdbacc267afc75c448512e2cc6de0ec9966a2d Reviewed-on: https://webrtc-review.googlesource.com/c/113180 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Bjorn Mellem <mellem@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25918}
This commit is contained in:
@ -28,6 +28,7 @@
|
||||
#include "api/rtcerror.h"
|
||||
#include "api/video/encoded_image.h"
|
||||
#include "rtc_base/copyonwritebuffer.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
#include "rtc_base/networkroute.h"
|
||||
|
||||
namespace rtc {
|
||||
@ -97,7 +98,7 @@ class MediaTransportEncodedAudioFrame final {
|
||||
// Opaque payload type. In RTP codepath payload type is stored in RTP
|
||||
// header. In other implementations it should be simply passed through the
|
||||
// wire -- it's needed for decoder.
|
||||
uint8_t payload_type,
|
||||
int payload_type,
|
||||
|
||||
// Vector with opaque encoded data.
|
||||
std::vector<uint8_t> encoded_data);
|
||||
@ -116,7 +117,7 @@ class MediaTransportEncodedAudioFrame final {
|
||||
int samples_per_channel() const { return samples_per_channel_; }
|
||||
int sequence_number() const { return sequence_number_; }
|
||||
|
||||
uint8_t payload_type() const { return payload_type_; }
|
||||
int payload_type() const { return payload_type_; }
|
||||
FrameType frame_type() const { return frame_type_; }
|
||||
|
||||
rtc::ArrayView<const uint8_t> encoded_data() const { return encoded_data_; }
|
||||
@ -132,9 +133,7 @@ class MediaTransportEncodedAudioFrame final {
|
||||
|
||||
FrameType frame_type_;
|
||||
|
||||
// TODO(sukhanov): Consider enumerating allowed encodings and store enum
|
||||
// instead of uint payload_type.
|
||||
uint8_t payload_type_;
|
||||
int payload_type_;
|
||||
|
||||
std::vector<uint8_t> encoded_data_;
|
||||
};
|
||||
@ -163,9 +162,15 @@ class MediaTransportAudioSinkInterface {
|
||||
// Represents encoded video frame, along with the codec information.
|
||||
class MediaTransportEncodedVideoFrame final {
|
||||
public:
|
||||
// TODO(bugs.webrtc.org/9719): Switch to payload_type
|
||||
RTC_DEPRECATED MediaTransportEncodedVideoFrame(
|
||||
int64_t frame_id,
|
||||
std::vector<int64_t> referenced_frame_ids,
|
||||
VideoCodecType codec_type,
|
||||
const webrtc::EncodedImage& encoded_image);
|
||||
MediaTransportEncodedVideoFrame(int64_t frame_id,
|
||||
std::vector<int64_t> referenced_frame_ids,
|
||||
VideoCodecType codec_type,
|
||||
int payload_type,
|
||||
const webrtc::EncodedImage& encoded_image);
|
||||
~MediaTransportEncodedVideoFrame();
|
||||
MediaTransportEncodedVideoFrame(const MediaTransportEncodedVideoFrame&);
|
||||
@ -175,7 +180,9 @@ class MediaTransportEncodedVideoFrame final {
|
||||
MediaTransportEncodedVideoFrame&& other);
|
||||
MediaTransportEncodedVideoFrame(MediaTransportEncodedVideoFrame&&);
|
||||
|
||||
VideoCodecType codec_type() const { return codec_type_; }
|
||||
// TODO(bugs.webrtc.org/9719): Switch to payload_type
|
||||
RTC_DEPRECATED VideoCodecType codec_type() const { return codec_type_; }
|
||||
int payload_type() const { return payload_type_; }
|
||||
const webrtc::EncodedImage& encoded_image() const { return encoded_image_; }
|
||||
|
||||
int64_t frame_id() const { return frame_id_; }
|
||||
@ -191,6 +198,7 @@ class MediaTransportEncodedVideoFrame final {
|
||||
MediaTransportEncodedVideoFrame();
|
||||
|
||||
VideoCodecType codec_type_;
|
||||
int payload_type_;
|
||||
|
||||
// The buffer is not owned by the encoded image. On the sender it means that
|
||||
// it will need to make a copy using the Retain() method, if it wants to
|
||||
@ -227,8 +235,8 @@ class MediaTransportVideoSinkInterface {
|
||||
virtual void OnData(uint64_t channel_id,
|
||||
MediaTransportEncodedVideoFrame frame) = 0;
|
||||
|
||||
// Called when the request for keyframe is received.
|
||||
virtual void OnKeyFrameRequested(uint64_t channel_id) = 0;
|
||||
// TODO(bugs.webrtc.org/9719): Belongs on send side, not receive side.
|
||||
RTC_DEPRECATED virtual void OnKeyFrameRequested(uint64_t channel_id) {}
|
||||
};
|
||||
|
||||
// State of the media transport. Media transport begins in the pending state.
|
||||
|
||||
Reference in New Issue
Block a user