Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: media/cast/cast_config.h

Issue 109413004: Cast:Adding cast_transport_config and cleaning up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/cast/audio_sender/audio_sender_unittest.cc ('k') | media/cast/cast_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 MEDIA_CAST_CAST_CONFIG_H_ 5 #ifndef MEDIA_CAST_CAST_CONFIG_H_
6 #define MEDIA_CAST_CAST_CONFIG_H_ 6 #define MEDIA_CAST_CAST_CONFIG_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "media/cast/cast_defines.h" 15 #include "media/cast/cast_defines.h"
16 #include "media/cast/transport/cast_transport_config.h"
16 17
17 namespace media { 18 namespace media {
18 namespace cast { 19 namespace cast {
19 20
20 enum RtcpMode { 21 enum RtcpMode {
21 kRtcpCompound, // Compound RTCP mode is described by RFC 4585. 22 kRtcpCompound, // Compound RTCP mode is described by RFC 4585.
22 kRtcpReducedSize, // Reduced-size RTCP mode is described by RFC 5506. 23 kRtcpReducedSize, // Reduced-size RTCP mode is described by RFC 5506.
23 }; 24 };
24 25
25 enum VideoCodec {
26 kVp8,
27 kH264,
28 };
29
30 enum AudioCodec {
31 kOpus,
32 kPcm16,
33 kExternalAudio,
34 };
35
36 struct AudioSenderConfig { 26 struct AudioSenderConfig {
37 AudioSenderConfig(); 27 AudioSenderConfig();
38 28
39 uint32 sender_ssrc; 29 uint32 sender_ssrc;
40 uint32 incoming_feedback_ssrc; 30 uint32 incoming_feedback_ssrc;
41 31
42 int rtcp_interval; 32 int rtcp_interval;
43 std::string rtcp_c_name; 33 std::string rtcp_c_name;
44 RtcpMode rtcp_mode; 34 RtcpMode rtcp_mode;
45 35
46 int rtp_history_ms; // The time RTP packets are stored for retransmissions. 36 int rtp_history_ms; // The time RTP packets are stored for retransmissions.
47 int rtp_max_delay_ms; 37 int rtp_max_delay_ms;
48 int rtp_payload_type; 38 int rtp_payload_type;
49 39
50 bool use_external_encoder; 40 bool use_external_encoder;
51 int frequency; 41 int frequency;
52 int channels; 42 int channels;
53 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best). 43 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best).
54 AudioCodec codec; 44 transport::AudioCodec codec;
55 45
56 std::string aes_key; // Binary string of size kAesKeySize. 46 std::string aes_key; // Binary string of size kAesKeySize.
57 std::string aes_iv_mask; // Binary string of size kAesKeySize. 47 std::string aes_iv_mask; // Binary string of size kAesKeySize.
58 }; 48 };
59 49
60 struct VideoSenderConfig { 50 struct VideoSenderConfig {
61 VideoSenderConfig(); 51 VideoSenderConfig();
62 52
63 uint32 sender_ssrc; 53 uint32 sender_ssrc;
64 uint32 incoming_feedback_ssrc; 54 uint32 incoming_feedback_ssrc;
(...skipping 11 matching lines...) Expand all
76 int height; 66 int height;
77 67
78 float congestion_control_back_off; 68 float congestion_control_back_off;
79 int max_bitrate; 69 int max_bitrate;
80 int min_bitrate; 70 int min_bitrate;
81 int start_bitrate; 71 int start_bitrate;
82 int max_qp; 72 int max_qp;
83 int min_qp; 73 int min_qp;
84 int max_frame_rate; 74 int max_frame_rate;
85 int max_number_of_video_buffers_used; // Max value depend on codec. 75 int max_number_of_video_buffers_used; // Max value depend on codec.
86 VideoCodec codec; 76 transport::VideoCodec codec;
87 int number_of_cores; 77 int number_of_cores;
88 78
89 std::string aes_key; // Binary string of size kAesKeySize. 79 std::string aes_key; // Binary string of size kAesKeySize.
90 std::string aes_iv_mask; // Binary string of size kAesKeySize. 80 std::string aes_iv_mask; // Binary string of size kAesKeySize.
91 }; 81 };
92 82
93 struct AudioReceiverConfig { 83 struct AudioReceiverConfig {
94 AudioReceiverConfig(); 84 AudioReceiverConfig();
95 85
96 uint32 feedback_ssrc; 86 uint32 feedback_ssrc;
97 uint32 incoming_ssrc; 87 uint32 incoming_ssrc;
98 88
99 int rtcp_interval; 89 int rtcp_interval;
100 std::string rtcp_c_name; 90 std::string rtcp_c_name;
101 RtcpMode rtcp_mode; 91 RtcpMode rtcp_mode;
102 92
103 // The time the receiver is prepared to wait for retransmissions. 93 // The time the receiver is prepared to wait for retransmissions.
104 int rtp_max_delay_ms; 94 int rtp_max_delay_ms;
105 int rtp_payload_type; 95 int rtp_payload_type;
106 96
107 bool use_external_decoder; 97 bool use_external_decoder;
108 int frequency; 98 int frequency;
109 int channels; 99 int channels;
110 AudioCodec codec; 100 transport::AudioCodec codec;
111 101
112 std::string aes_key; // Binary string of size kAesKeySize. 102 std::string aes_key; // Binary string of size kAesKeySize.
113 std::string aes_iv_mask; // Binary string of size kAesKeySize. 103 std::string aes_iv_mask; // Binary string of size kAesKeySize.
114 }; 104 };
115 105
116 struct VideoReceiverConfig { 106 struct VideoReceiverConfig {
117 VideoReceiverConfig(); 107 VideoReceiverConfig();
118 108
119 uint32 feedback_ssrc; 109 uint32 feedback_ssrc;
120 uint32 incoming_ssrc; 110 uint32 incoming_ssrc;
121 111
122 int rtcp_interval; 112 int rtcp_interval;
123 std::string rtcp_c_name; 113 std::string rtcp_c_name;
124 RtcpMode rtcp_mode; 114 RtcpMode rtcp_mode;
125 115
126 // The time the receiver is prepared to wait for retransmissions. 116 // The time the receiver is prepared to wait for retransmissions.
127 int rtp_max_delay_ms; 117 int rtp_max_delay_ms;
128 int rtp_payload_type; 118 int rtp_payload_type;
129 119
130 bool use_external_decoder; 120 bool use_external_decoder;
131 int max_frame_rate; 121 int max_frame_rate;
132 122
133 // Some HW decoders can not run faster than the frame rate, preventing it 123 // Some HW decoders can not run faster than the frame rate, preventing it
134 // from catching up after a glitch. 124 // from catching up after a glitch.
135 bool decoder_faster_than_max_frame_rate; 125 bool decoder_faster_than_max_frame_rate;
136 VideoCodec codec; 126 transport::VideoCodec codec;
137 127
138 std::string aes_key; // Binary string of size kAesKeySize. 128 std::string aes_key; // Binary string of size kAesKeySize.
139 std::string aes_iv_mask; // Binary string of size kAesKeySize. 129 std::string aes_iv_mask; // Binary string of size kAesKeySize.
140 }; 130 };
141 131
142 struct EncodedVideoFrame {
143 EncodedVideoFrame();
144 ~EncodedVideoFrame();
145
146 VideoCodec codec;
147 bool key_frame;
148 uint32 frame_id;
149 uint32 last_referenced_frame_id;
150 std::string data;
151 };
152
153 // DEPRECATED: Do not use in new code. Please migrate existing code to use 132 // DEPRECATED: Do not use in new code. Please migrate existing code to use
154 // media::AudioBus. 133 // media::AudioBus.
155 struct PcmAudioFrame { 134 struct PcmAudioFrame {
156 PcmAudioFrame(); 135 PcmAudioFrame();
157 ~PcmAudioFrame(); 136 ~PcmAudioFrame();
158 137
159 int channels; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,... 138 int channels; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,...
160 int frequency; 139 int frequency;
161 std::vector<int16> samples; 140 std::vector<int16> samples;
162 }; 141 };
163 142
164 struct EncodedAudioFrame {
165 EncodedAudioFrame();
166 ~EncodedAudioFrame();
167
168 AudioCodec codec;
169 uint32 frame_id; // Needed to release the frame.
170 int samples; // Needed send side to advance the RTP timestamp.
171 // Not used receive side.
172 // Support for max sampling rate of 48KHz, 2 channels, 100 ms duration.
173 static const int kMaxNumberOfSamples = 48 * 2 * 100;
174 std::string data;
175 };
176
177 typedef std::vector<uint8> Packet; 143 typedef std::vector<uint8> Packet;
178 typedef std::vector<Packet> PacketList; 144 typedef std::vector<Packet> PacketList;
179 145
180 class PacketSender { 146 class PacketSender {
181 public: 147 public:
182 // All packets to be sent to the network will be delivered via these 148 // All packets to be sent to the network will be delivered via these
183 // functions. 149 // functions.
184 virtual bool SendPackets(const PacketList& packets) = 0; 150 virtual bool SendPackets(const PacketList& packets) = 0;
185 151
186 virtual bool SendPacket(const Packet& packet) = 0; 152 virtual bool SendPacket(const Packet& packet) = 0;
(...skipping 14 matching lines...) Expand all
201 virtual ~PacketReceiver() {} 167 virtual ~PacketReceiver() {}
202 168
203 private: 169 private:
204 friend class base::RefCountedThreadSafe<PacketReceiver>; 170 friend class base::RefCountedThreadSafe<PacketReceiver>;
205 }; 171 };
206 172
207 } // namespace cast 173 } // namespace cast
208 } // namespace media 174 } // namespace media
209 175
210 #endif // MEDIA_CAST_CAST_CONFIG_H_ 176 #endif // MEDIA_CAST_CAST_CONFIG_H_
OLDNEW
« no previous file with comments | « media/cast/audio_sender/audio_sender_unittest.cc ('k') | media/cast/cast_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698