OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ |
6 #define CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... | |
31 struct CastRtpPayloadParams { | 31 struct CastRtpPayloadParams { |
32 // RTP specific field that identifies the content type. | 32 // RTP specific field that identifies the content type. |
33 int payload_type; | 33 int payload_type; |
34 | 34 |
35 // RTP specific field to identify a stream. | 35 // RTP specific field to identify a stream. |
36 int ssrc; | 36 int ssrc; |
37 | 37 |
38 // Update frequency of payload sample. | 38 // Update frequency of payload sample. |
39 int clock_rate; | 39 int clock_rate; |
40 | 40 |
41 // Uncompressed bitrate. | 41 // Maximum bitrate. |
42 int bitrate; | 42 int max_bitrate; |
43 | |
44 // Minimum bitrate. | |
45 int min_bitrate; | |
43 | 46 |
44 // Number of audio channels. | 47 // Number of audio channels. |
45 int channels; | 48 int channels; |
46 | 49 |
47 // Width and height of the video content. | 50 // Width and height of the video content. |
48 int width; | 51 int width; |
49 int height; | 52 int height; |
50 | 53 |
51 // Name of the codec used. | 54 // Name of the codec used. |
52 std::string codec_name; | 55 std::string codec_name; |
53 | 56 |
54 // List of codec specific parameters. | 57 // List of codec specific parameters. |
55 std::vector<CastCodecSpecificParams> codec_specific_params; | 58 std::vector<CastCodecSpecificParams> codec_specific_params; |
56 | 59 |
57 CastRtpPayloadParams(); | 60 CastRtpPayloadParams(); |
58 ~CastRtpPayloadParams(); | 61 ~CastRtpPayloadParams(); |
59 }; | 62 }; |
60 | 63 |
61 // Defines the capabilities of the transport. | 64 // Defines the capabilities of the transport. |
62 struct CastRtpCaps { | 65 struct CastRtpCaps { |
63 // Defines a list of supported payloads. | 66 // Defines a list of supported payloads. |
64 std::vector<CastRtpPayloadParams> payloads; | 67 std::vector<CastRtpPayloadParams> payloads; |
65 | 68 |
66 // Names of supported RTCP features. | 69 // Names of supported RTCP features. |
67 std::vector<std::string> rtcp_features; | 70 std::vector<std::string> rtcp_features; |
68 | 71 |
69 // Names of supported FEC (Forward Error Correction) mechanisms. | 72 // Names of supported FEC (Forward Error Correction) mechanisms. |
70 std::vector<std::string> fec_mechanism; | 73 std::vector<std::string> fec_mechanisms; |
71 | 74 |
72 CastRtpCaps(); | 75 CastRtpCaps(); |
73 ~CastRtpCaps(); | 76 ~CastRtpCaps(); |
74 }; | 77 }; |
75 | 78 |
76 typedef CastRtpCaps CastRtpParams; | 79 typedef CastRtpCaps CastRtpParams; |
justinlin
2013/11/01 16:08:21
q: so CastRtpCaps == CastRtpParams?
Alpha Left Google
2013/11/01 22:27:47
Yes they are the same thing.
| |
77 | 80 |
78 // This class takes input from audio and/or video WebMediaStreamTracks | 81 // This class takes input from audio and/or video WebMediaStreamTracks |
79 // and then send the encoded streams to the underlying transport, | 82 // and then send the encoded streams to the underlying transport, |
80 // e.g. a UDP transport. It also allows configuration of the encoded | 83 // e.g. a UDP transport. It also allows configuration of the encoded |
81 // stream. | 84 // stream. |
82 class CastSendTransport { | 85 class CastSendTransport { |
83 public: | 86 public: |
84 explicit CastSendTransport(CastUdpTransport* udp_transport); | 87 explicit CastSendTransport(CastUdpTransport* udp_transport); |
85 ~CastSendTransport(); | 88 ~CastSendTransport(); |
86 | 89 |
87 // Return capabilities currently spported by this transport. | 90 // Return capabilities currently spported by this transport. |
justinlin
2013/11/01 16:08:21
typo here
| |
88 CastRtpCaps GetCaps(); | 91 CastRtpCaps GetCaps(); |
89 | 92 |
90 // Return parameters set to this transport. | 93 // Return parameters set to this transport. |
91 CastRtpParams GetParams(); | 94 CastRtpParams GetParams(); |
92 | 95 |
93 // Return the best parameters given the capabilities of remote peer. | 96 // Return the best parameters given the capabilities of remote peer. |
94 CastRtpParams CreateParams(const CastRtpCaps& remote_caps); | 97 CastRtpParams CreateParams(const CastRtpCaps& remote_caps); |
95 | 98 |
96 // Begin encoding of media stream and then submit the encoded streams | 99 // Begin encoding of media stream and then submit the encoded streams |
97 // to underlying transport. | 100 // to underlying transport. |
98 void Start(const CastRtpParams& params); | 101 void Start(const CastRtpParams& params); |
99 | 102 |
100 // Stop encoding. | 103 // Stop encoding. |
101 void Stop(); | 104 void Stop(); |
102 | 105 |
103 private: | 106 private: |
104 const scoped_refptr<CastSession> cast_session_; | 107 const scoped_refptr<CastSession> cast_session_; |
105 | 108 |
106 DISALLOW_COPY_AND_ASSIGN(CastSendTransport); | 109 DISALLOW_COPY_AND_ASSIGN(CastSendTransport); |
107 }; | 110 }; |
108 | 111 |
109 #endif // CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ | 112 #endif // CHROME_RENDERER_MEDIA_CAST_SEND_TRANSPORT_H_ |
OLD | NEW |