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

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

Issue 126843003: Revert of Cast:Adding cast_transport_config and cleaning up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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"
17 16
18 namespace media { 17 namespace media {
19 namespace cast { 18 namespace cast {
20 19
21 enum RtcpMode { 20 enum RtcpMode {
22 kRtcpCompound, // Compound RTCP mode is described by RFC 4585. 21 kRtcpCompound, // Compound RTCP mode is described by RFC 4585.
23 kRtcpReducedSize, // Reduced-size RTCP mode is described by RFC 5506. 22 kRtcpReducedSize, // Reduced-size RTCP mode is described by RFC 5506.
24 }; 23 };
25 24
25 enum VideoCodec {
26 kVp8,
27 kH264,
28 };
29
30 enum AudioCodec {
31 kOpus,
32 kPcm16,
33 kExternalAudio,
34 };
35
26 struct AudioSenderConfig { 36 struct AudioSenderConfig {
27 AudioSenderConfig(); 37 AudioSenderConfig();
28 38
29 uint32 sender_ssrc; 39 uint32 sender_ssrc;
30 uint32 incoming_feedback_ssrc; 40 uint32 incoming_feedback_ssrc;
31 41
32 int rtcp_interval; 42 int rtcp_interval;
33 std::string rtcp_c_name; 43 std::string rtcp_c_name;
34 RtcpMode rtcp_mode; 44 RtcpMode rtcp_mode;
35 45
36 int rtp_history_ms; // The time RTP packets are stored for retransmissions. 46 int rtp_history_ms; // The time RTP packets are stored for retransmissions.
37 int rtp_max_delay_ms; 47 int rtp_max_delay_ms;
38 int rtp_payload_type; 48 int rtp_payload_type;
39 49
40 bool use_external_encoder; 50 bool use_external_encoder;
41 int frequency; 51 int frequency;
42 int channels; 52 int channels;
43 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best). 53 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best).
44 transport::AudioCodec codec; 54 AudioCodec codec;
45 55
46 std::string aes_key; // Binary string of size kAesKeySize. 56 std::string aes_key; // Binary string of size kAesKeySize.
47 std::string aes_iv_mask; // Binary string of size kAesKeySize. 57 std::string aes_iv_mask; // Binary string of size kAesKeySize.
48 }; 58 };
49 59
50 struct VideoSenderConfig { 60 struct VideoSenderConfig {
51 VideoSenderConfig(); 61 VideoSenderConfig();
52 62
53 uint32 sender_ssrc; 63 uint32 sender_ssrc;
54 uint32 incoming_feedback_ssrc; 64 uint32 incoming_feedback_ssrc;
(...skipping 11 matching lines...) Expand all
66 int height; 76 int height;
67 77
68 float congestion_control_back_off; 78 float congestion_control_back_off;
69 int max_bitrate; 79 int max_bitrate;
70 int min_bitrate; 80 int min_bitrate;
71 int start_bitrate; 81 int start_bitrate;
72 int max_qp; 82 int max_qp;
73 int min_qp; 83 int min_qp;
74 int max_frame_rate; 84 int max_frame_rate;
75 int max_number_of_video_buffers_used; // Max value depend on codec. 85 int max_number_of_video_buffers_used; // Max value depend on codec.
76 transport::VideoCodec codec; 86 VideoCodec codec;
77 int number_of_cores; 87 int number_of_cores;
78 88
79 std::string aes_key; // Binary string of size kAesKeySize. 89 std::string aes_key; // Binary string of size kAesKeySize.
80 std::string aes_iv_mask; // Binary string of size kAesKeySize. 90 std::string aes_iv_mask; // Binary string of size kAesKeySize.
81 }; 91 };
82 92
83 struct AudioReceiverConfig { 93 struct AudioReceiverConfig {
84 AudioReceiverConfig(); 94 AudioReceiverConfig();
85 95
86 uint32 feedback_ssrc; 96 uint32 feedback_ssrc;
87 uint32 incoming_ssrc; 97 uint32 incoming_ssrc;
88 98
89 int rtcp_interval; 99 int rtcp_interval;
90 std::string rtcp_c_name; 100 std::string rtcp_c_name;
91 RtcpMode rtcp_mode; 101 RtcpMode rtcp_mode;
92 102
93 // The time the receiver is prepared to wait for retransmissions. 103 // The time the receiver is prepared to wait for retransmissions.
94 int rtp_max_delay_ms; 104 int rtp_max_delay_ms;
95 int rtp_payload_type; 105 int rtp_payload_type;
96 106
97 bool use_external_decoder; 107 bool use_external_decoder;
98 int frequency; 108 int frequency;
99 int channels; 109 int channels;
100 transport::AudioCodec codec; 110 AudioCodec codec;
101 111
102 std::string aes_key; // Binary string of size kAesKeySize. 112 std::string aes_key; // Binary string of size kAesKeySize.
103 std::string aes_iv_mask; // Binary string of size kAesKeySize. 113 std::string aes_iv_mask; // Binary string of size kAesKeySize.
104 }; 114 };
105 115
106 struct VideoReceiverConfig { 116 struct VideoReceiverConfig {
107 VideoReceiverConfig(); 117 VideoReceiverConfig();
108 118
109 uint32 feedback_ssrc; 119 uint32 feedback_ssrc;
110 uint32 incoming_ssrc; 120 uint32 incoming_ssrc;
111 121
112 int rtcp_interval; 122 int rtcp_interval;
113 std::string rtcp_c_name; 123 std::string rtcp_c_name;
114 RtcpMode rtcp_mode; 124 RtcpMode rtcp_mode;
115 125
116 // The time the receiver is prepared to wait for retransmissions. 126 // The time the receiver is prepared to wait for retransmissions.
117 int rtp_max_delay_ms; 127 int rtp_max_delay_ms;
118 int rtp_payload_type; 128 int rtp_payload_type;
119 129
120 bool use_external_decoder; 130 bool use_external_decoder;
121 int max_frame_rate; 131 int max_frame_rate;
122 132
123 // Some HW decoders can not run faster than the frame rate, preventing it 133 // Some HW decoders can not run faster than the frame rate, preventing it
124 // from catching up after a glitch. 134 // from catching up after a glitch.
125 bool decoder_faster_than_max_frame_rate; 135 bool decoder_faster_than_max_frame_rate;
126 transport::VideoCodec codec; 136 VideoCodec codec;
127 137
128 std::string aes_key; // Binary string of size kAesKeySize. 138 std::string aes_key; // Binary string of size kAesKeySize.
129 std::string aes_iv_mask; // Binary string of size kAesKeySize. 139 std::string aes_iv_mask; // Binary string of size kAesKeySize.
130 }; 140 };
131 141
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
132 // DEPRECATED: Do not use in new code. Please migrate existing code to use 153 // DEPRECATED: Do not use in new code. Please migrate existing code to use
133 // media::AudioBus. 154 // media::AudioBus.
134 struct PcmAudioFrame { 155 struct PcmAudioFrame {
135 PcmAudioFrame(); 156 PcmAudioFrame();
136 ~PcmAudioFrame(); 157 ~PcmAudioFrame();
137 158
138 int channels; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,... 159 int channels; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,...
139 int frequency; 160 int frequency;
140 std::vector<int16> samples; 161 std::vector<int16> samples;
141 }; 162 };
142 163
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
143 typedef std::vector<uint8> Packet; 177 typedef std::vector<uint8> Packet;
144 typedef std::vector<Packet> PacketList; 178 typedef std::vector<Packet> PacketList;
145 179
146 class PacketSender { 180 class PacketSender {
147 public: 181 public:
148 // All packets to be sent to the network will be delivered via these 182 // All packets to be sent to the network will be delivered via these
149 // functions. 183 // functions.
150 virtual bool SendPackets(const PacketList& packets) = 0; 184 virtual bool SendPackets(const PacketList& packets) = 0;
151 185
152 virtual bool SendPacket(const Packet& packet) = 0; 186 virtual bool SendPacket(const Packet& packet) = 0;
(...skipping 14 matching lines...) Expand all
167 virtual ~PacketReceiver() {} 201 virtual ~PacketReceiver() {}
168 202
169 private: 203 private:
170 friend class base::RefCountedThreadSafe<PacketReceiver>; 204 friend class base::RefCountedThreadSafe<PacketReceiver>;
171 }; 205 };
172 206
173 } // namespace cast 207 } // namespace cast
174 } // namespace media 208 } // namespace media
175 209
176 #endif // MEDIA_CAST_CAST_CONFIG_H_ 210 #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