Index: chrome/renderer/media/cast_rtp_stream.h |
diff --git a/chrome/renderer/media/cast_rtp_stream.h b/chrome/renderer/media/cast_rtp_stream.h |
index 01c3da8e0e815f2c40ccda6885ef18ca236e96bd..456463e86f6504fe5416792905d35456d852a187 100644 |
--- a/chrome/renderer/media/cast_rtp_stream.h |
+++ b/chrome/renderer/media/cast_rtp_stream.h |
@@ -26,6 +26,86 @@ |
class CastSession; |
class CastVideoSink; |
+// A key value pair structure for codec specific parameters. |
+struct CastCodecSpecificParams { |
+ std::string key; |
+ std::string value; |
+ |
+ CastCodecSpecificParams(); |
+ ~CastCodecSpecificParams(); |
+}; |
+ |
+// Defines the basic properties of a payload supported by cast transport. |
+struct CastRtpPayloadParams { |
+ // RTP specific field that identifies the content type. |
+ media::cast::RtpPayloadType payload_type = |
+ media::cast::RtpPayloadType::VIDEO_VP8; |
+ |
+ // Maximum latency in milliseconds. Implemetation tries to keep latency |
+ // under this threshold. |
+ int max_latency_ms = media::cast::kDefaultRtpMaxDelayMs; |
+ |
+ // Minimum latency. |
+ // Default value (0) means use max_latency_ms. |
+ int min_latency_ms = 0; |
+ |
+ // Starting latency on animated content. |
+ // Default value (0) means use max_latency_ms. |
+ int animated_latency_ms = 0; |
+ |
+ // RTP specific field to identify a stream. |
+ int ssrc = 1; |
+ |
+ // RTP specific field to idenfity the feedback stream. |
+ int feedback_ssrc = 2; |
+ |
+ // Update frequency of payload sample. |
+ int clock_rate = media::cast::kVideoFrequency; |
+ |
+ // Maximum bitrate in kilobits per second. |
+ int max_bitrate = media::cast::kDefaultMaxVideoKbps; |
+ |
+ // Minimum bitrate in kilobits per second. |
+ int min_bitrate = media::cast::kDefaultMinVideoKbps; |
+ |
+ // Number of audio channels. |
+ int channels = 1; |
+ |
+ // The maximum frame rate. |
+ double max_frame_rate = media::cast::kDefaultMaxFrameRate; |
+ |
+ // Name of the codec used. |
+ std::string codec_name; |
+ |
+ // AES encryption key. |
+ std::string aes_key; |
+ |
+ // AES encryption IV mask. |
+ std::string aes_iv_mask; |
+ |
+ // List of codec specific parameters. |
+ std::vector<CastCodecSpecificParams> codec_specific_params; |
+ |
+ CastRtpPayloadParams(); |
+ CastRtpPayloadParams(const CastRtpPayloadParams& other); |
+ ~CastRtpPayloadParams(); |
+}; |
+ |
+// Defines the parameters of a RTP stream. |
+struct CastRtpParams { |
+ explicit CastRtpParams(const CastRtpPayloadParams& payload_params); |
+ |
+ // Payload parameters. |
+ CastRtpPayloadParams payload; |
+ |
+ // Names of supported RTCP features. |
+ std::vector<std::string> rtcp_features; |
+ |
+ CastRtpParams(); |
+ CastRtpParams(const CastRtpParams& other); |
+ ~CastRtpParams(); |
+}; |
+ |
// This object represents a RTP stream that encodes and optionally |
// encrypt audio or video data from a WebMediaStreamTrack. |
// Note that this object does not actually output packets. It allows |
@@ -35,23 +115,22 @@ |
public: |
typedef base::Callback<void(const std::string&)> ErrorCallback; |
- static bool IsHardwareVP8EncodingSupported(); |
- |
- static bool IsHardwareH264EncodingSupported(); |
- |
CastRtpStream(const blink::WebMediaStreamTrack& track, |
const scoped_refptr<CastSession>& session); |
~CastRtpStream(); |
// Return parameters currently supported by this stream. |
- std::vector<media::cast::FrameSenderConfig> GetSupportedConfigs(); |
+ std::vector<CastRtpParams> GetSupportedParams(); |
+ |
+ // Return parameters set to this stream. |
+ CastRtpParams GetParams(); |
// Begin encoding of media stream and then submit the encoded streams |
// to underlying transport. |
// When the stream is started |start_callback| is called. |
// When the stream is stopped |stop_callback| is called. |
// When there is an error |error_callback| is called with a message. |
- void Start(const media::cast::FrameSenderConfig& config, |
+ void Start(const CastRtpParams& params, |
const base::Closure& start_callback, |
const base::Closure& stop_callback, |
const ErrorCallback& error_callback); |
@@ -84,6 +163,7 @@ |
const scoped_refptr<CastSession> cast_session_; |
std::unique_ptr<CastAudioSink> audio_sink_; |
std::unique_ptr<CastVideoSink> video_sink_; |
+ CastRtpParams params_; |
base::Closure stop_callback_; |
ErrorCallback error_callback_; |