Index: webrtc/api/rtpparameters.cc |
diff --git a/webrtc/config.cc b/webrtc/api/rtpparameters.cc |
similarity index 52% |
rename from webrtc/config.cc |
rename to webrtc/api/rtpparameters.cc |
index 19a9a96079dc3b90b09cb12ac43fa916a7ccaf4b..29b14fb60a6206f847ffc852ebe398a67ff1ee8e 100644 |
--- a/webrtc/config.cc |
+++ b/webrtc/api/rtpparameters.cc |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
+ * Copyright (c) 2017 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 |
@@ -7,7 +7,7 @@ |
* in the file PATENTS. All contributing project authors may |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
-#include "webrtc/config.h" |
+#include "webrtc/api/rtpparameters.h" |
#include <algorithm> |
#include <sstream> |
@@ -16,27 +16,55 @@ |
#include "webrtc/rtc_base/checks.h" |
namespace webrtc { |
-std::string NackConfig::ToString() const { |
- std::stringstream ss; |
- ss << "{rtp_history_ms: " << rtp_history_ms; |
- ss << '}'; |
- return ss.str(); |
-} |
-std::string UlpfecConfig::ToString() const { |
- std::stringstream ss; |
- ss << "{ulpfec_payload_type: " << ulpfec_payload_type; |
- ss << ", red_payload_type: " << red_payload_type; |
- ss << ", red_rtx_payload_type: " << red_rtx_payload_type; |
- ss << '}'; |
- return ss.str(); |
-} |
- |
-bool UlpfecConfig::operator==(const UlpfecConfig& other) const { |
- return ulpfec_payload_type == other.ulpfec_payload_type && |
- red_payload_type == other.red_payload_type && |
- red_rtx_payload_type == other.red_rtx_payload_type; |
-} |
+RtcpFeedback::RtcpFeedback() {} |
+RtcpFeedback::RtcpFeedback(RtcpFeedbackType type) : type(type) {} |
+RtcpFeedback::RtcpFeedback(RtcpFeedbackType type, |
+ RtcpFeedbackMessageType message_type) |
+ : type(type), message_type(message_type) {} |
+RtcpFeedback::~RtcpFeedback() {} |
+ |
+RtpCodecCapability::RtpCodecCapability() {} |
+RtpCodecCapability::~RtpCodecCapability() {} |
+ |
+RtpHeaderExtensionCapability::RtpHeaderExtensionCapability() {} |
+RtpHeaderExtensionCapability::RtpHeaderExtensionCapability( |
+ const std::string& uri) |
+ : uri(uri) {} |
+RtpHeaderExtensionCapability::RtpHeaderExtensionCapability( |
+ const std::string& uri, |
+ int preferred_id) |
+ : uri(uri), preferred_id(preferred_id) {} |
+RtpHeaderExtensionCapability::~RtpHeaderExtensionCapability() {} |
+ |
+RtpExtension::RtpExtension() {} |
+RtpExtension::RtpExtension(const std::string& uri, int id) : uri(uri), id(id) {} |
+RtpExtension::RtpExtension(const std::string& uri, int id, bool encrypt) |
+ : uri(uri), id(id), encrypt(encrypt) {} |
+RtpExtension::~RtpExtension() {} |
+ |
+RtpFecParameters::RtpFecParameters() {} |
+RtpFecParameters::RtpFecParameters(FecMechanism mechanism) |
+ : mechanism(mechanism) {} |
+RtpFecParameters::RtpFecParameters(FecMechanism mechanism, uint32_t ssrc) |
+ : ssrc(ssrc), mechanism(mechanism) {} |
+RtpFecParameters::~RtpFecParameters() {} |
+ |
+RtpRtxParameters::RtpRtxParameters() {} |
+RtpRtxParameters::RtpRtxParameters(uint32_t ssrc) : ssrc(ssrc) {} |
+RtpRtxParameters::~RtpRtxParameters() {} |
+ |
+RtpEncodingParameters::RtpEncodingParameters() {} |
+RtpEncodingParameters::~RtpEncodingParameters() {} |
+ |
+RtpCodecParameters::RtpCodecParameters() {} |
+RtpCodecParameters::~RtpCodecParameters() {} |
+ |
+RtpCapabilities::RtpCapabilities() {} |
+RtpCapabilities::~RtpCapabilities() {} |
+ |
+RtpParameters::RtpParameters() {} |
+RtpParameters::~RtpParameters() {} |
std::string RtpExtension::ToString() const { |
std::stringstream ss; |
@@ -137,7 +165,7 @@ std::vector<RtpExtension> RtpExtension::FilterDuplicateNonEncrypted( |
const std::vector<RtpExtension>& extensions) { |
std::vector<RtpExtension> filtered; |
for (auto extension = extensions.begin(); extension != extensions.end(); |
- ++extension) { |
+ ++extension) { |
if (extension->encrypt) { |
filtered.push_back(*extension); |
continue; |
@@ -146,9 +174,9 @@ std::vector<RtpExtension> RtpExtension::FilterDuplicateNonEncrypted( |
// Only add non-encrypted extension if no encrypted with the same URI |
// is also present... |
if (std::find_if(extension + 1, extensions.end(), |
- [extension](const RtpExtension& check) { |
- return extension->uri == check.uri; |
- }) != extensions.end()) { |
+ [extension](const RtpExtension& check) { |
+ return extension->uri == check.uri; |
+ }) != extensions.end()) { |
continue; |
} |
@@ -159,125 +187,4 @@ std::vector<RtpExtension> RtpExtension::FilterDuplicateNonEncrypted( |
} |
return filtered; |
} |
- |
-VideoStream::VideoStream() |
- : width(0), |
- height(0), |
- max_framerate(-1), |
- min_bitrate_bps(-1), |
- target_bitrate_bps(-1), |
- max_bitrate_bps(-1), |
- max_qp(-1) {} |
- |
-VideoStream::~VideoStream() = default; |
- |
-std::string VideoStream::ToString() const { |
- std::stringstream ss; |
- ss << "{width: " << width; |
- ss << ", height: " << height; |
- ss << ", max_framerate: " << max_framerate; |
- ss << ", min_bitrate_bps:" << min_bitrate_bps; |
- ss << ", target_bitrate_bps:" << target_bitrate_bps; |
- ss << ", max_bitrate_bps:" << max_bitrate_bps; |
- ss << ", max_qp: " << max_qp; |
- |
- ss << ", temporal_layer_thresholds_bps: ["; |
- for (size_t i = 0; i < temporal_layer_thresholds_bps.size(); ++i) { |
- ss << temporal_layer_thresholds_bps[i]; |
- if (i != temporal_layer_thresholds_bps.size() - 1) |
- ss << ", "; |
- } |
- ss << ']'; |
- |
- ss << '}'; |
- return ss.str(); |
-} |
- |
-VideoEncoderConfig::VideoEncoderConfig() |
- : content_type(ContentType::kRealtimeVideo), |
- encoder_specific_settings(nullptr), |
- min_transmit_bitrate_bps(0), |
- max_bitrate_bps(0), |
- number_of_streams(0) {} |
- |
-VideoEncoderConfig::VideoEncoderConfig(VideoEncoderConfig&&) = default; |
- |
-VideoEncoderConfig::~VideoEncoderConfig() = default; |
- |
-std::string VideoEncoderConfig::ToString() const { |
- std::stringstream ss; |
- ss << "{content_type: "; |
- switch (content_type) { |
- case ContentType::kRealtimeVideo: |
- ss << "kRealtimeVideo"; |
- break; |
- case ContentType::kScreen: |
- ss << "kScreenshare"; |
- break; |
- } |
- ss << ", encoder_specific_settings: "; |
- ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL"); |
- |
- ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps; |
- ss << '}'; |
- return ss.str(); |
-} |
- |
-VideoEncoderConfig::VideoEncoderConfig(const VideoEncoderConfig&) = default; |
- |
-void VideoEncoderConfig::EncoderSpecificSettings::FillEncoderSpecificSettings( |
- VideoCodec* codec) const { |
- if (codec->codecType == kVideoCodecH264) { |
- FillVideoCodecH264(codec->H264()); |
- } else if (codec->codecType == kVideoCodecVP8) { |
- FillVideoCodecVp8(codec->VP8()); |
- } else if (codec->codecType == kVideoCodecVP9) { |
- FillVideoCodecVp9(codec->VP9()); |
- } else { |
- RTC_NOTREACHED() << "Encoder specifics set/used for unknown codec type."; |
- } |
-} |
- |
-void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecH264( |
- VideoCodecH264* h264_settings) const { |
- RTC_NOTREACHED(); |
-} |
- |
-void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecVp8( |
- VideoCodecVP8* vp8_settings) const { |
- RTC_NOTREACHED(); |
-} |
- |
-void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecVp9( |
- VideoCodecVP9* vp9_settings) const { |
- RTC_NOTREACHED(); |
-} |
- |
-VideoEncoderConfig::H264EncoderSpecificSettings::H264EncoderSpecificSettings( |
- const VideoCodecH264& specifics) |
- : specifics_(specifics) {} |
- |
-void VideoEncoderConfig::H264EncoderSpecificSettings::FillVideoCodecH264( |
- VideoCodecH264* h264_settings) const { |
- *h264_settings = specifics_; |
-} |
- |
-VideoEncoderConfig::Vp8EncoderSpecificSettings::Vp8EncoderSpecificSettings( |
- const VideoCodecVP8& specifics) |
- : specifics_(specifics) {} |
- |
-void VideoEncoderConfig::Vp8EncoderSpecificSettings::FillVideoCodecVp8( |
- VideoCodecVP8* vp8_settings) const { |
- *vp8_settings = specifics_; |
-} |
- |
-VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( |
- const VideoCodecVP9& specifics) |
- : specifics_(specifics) {} |
- |
-void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( |
- VideoCodecVP9* vp9_settings) const { |
- *vp9_settings = specifics_; |
-} |
- |
} // namespace webrtc |