Add explicit |forceOnlineSignin| to user pod status
[chromium-blink-merge.git] / media / cast / cast_config.h
blob5f952dbf740957906204db2f9dea6eab2482014c
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_CAST_CAST_CONFIG_H_
6 #define MEDIA_CAST_CAST_CONFIG_H_
8 #include <list>
9 #include <string>
10 #include <vector>
12 #include "base/basictypes.h"
13 #include "base/callback.h"
14 #include "base/memory/ref_counted.h"
15 #include "media/cast/cast_defines.h"
16 #include "media/cast/transport/cast_transport_config.h"
18 namespace media {
19 namespace cast {
21 enum RtcpMode {
22 kRtcpCompound, // Compound RTCP mode is described by RFC 4585.
23 kRtcpReducedSize, // Reduced-size RTCP mode is described by RFC 5506.
26 struct AudioSenderConfig {
27 AudioSenderConfig();
29 uint32 sender_ssrc;
30 uint32 incoming_feedback_ssrc;
32 int rtcp_interval;
33 std::string rtcp_c_name;
34 RtcpMode rtcp_mode;
36 int rtp_history_ms; // The time RTP packets are stored for retransmissions.
37 int rtp_max_delay_ms;
38 int rtp_payload_type;
40 bool use_external_encoder;
41 int frequency;
42 int channels;
43 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best).
44 transport::AudioCodec codec;
46 std::string aes_key; // Binary string of size kAesKeySize.
47 std::string aes_iv_mask; // Binary string of size kAesKeySize.
50 struct VideoSenderConfig {
51 VideoSenderConfig();
53 uint32 sender_ssrc;
54 uint32 incoming_feedback_ssrc;
56 int rtcp_interval;
57 std::string rtcp_c_name;
58 RtcpMode rtcp_mode;
60 int rtp_history_ms; // The time RTP packets are stored for retransmissions.
61 int rtp_max_delay_ms;
62 int rtp_payload_type;
64 bool use_external_encoder;
65 int width; // Incoming frames will be scaled to this size.
66 int height;
68 float congestion_control_back_off;
69 int max_bitrate;
70 int min_bitrate;
71 int start_bitrate;
72 int max_qp;
73 int min_qp;
74 int max_frame_rate;
75 int max_number_of_video_buffers_used; // Max value depend on codec.
76 transport::VideoCodec codec;
77 int number_of_cores;
79 std::string aes_key; // Binary string of size kAesKeySize.
80 std::string aes_iv_mask; // Binary string of size kAesKeySize.
83 struct AudioReceiverConfig {
84 AudioReceiverConfig();
86 uint32 feedback_ssrc;
87 uint32 incoming_ssrc;
89 int rtcp_interval;
90 std::string rtcp_c_name;
91 RtcpMode rtcp_mode;
93 // The time the receiver is prepared to wait for retransmissions.
94 int rtp_max_delay_ms;
95 int rtp_payload_type;
97 bool use_external_decoder;
98 int frequency;
99 int channels;
100 transport::AudioCodec codec;
102 std::string aes_key; // Binary string of size kAesKeySize.
103 std::string aes_iv_mask; // Binary string of size kAesKeySize.
106 struct VideoReceiverConfig {
107 VideoReceiverConfig();
109 uint32 feedback_ssrc;
110 uint32 incoming_ssrc;
112 int rtcp_interval;
113 std::string rtcp_c_name;
114 RtcpMode rtcp_mode;
116 // The time the receiver is prepared to wait for retransmissions.
117 int rtp_max_delay_ms;
118 int rtp_payload_type;
120 bool use_external_decoder;
121 int max_frame_rate;
123 // Some HW decoders can not run faster than the frame rate, preventing it
124 // from catching up after a glitch.
125 bool decoder_faster_than_max_frame_rate;
126 transport::VideoCodec codec;
128 std::string aes_key; // Binary string of size kAesKeySize.
129 std::string aes_iv_mask; // Binary string of size kAesKeySize.
132 // DEPRECATED: Do not use in new code. Please migrate existing code to use
133 // media::AudioBus.
134 struct PcmAudioFrame {
135 PcmAudioFrame();
136 ~PcmAudioFrame();
138 int channels; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,...
139 int frequency;
140 std::vector<int16> samples;
143 typedef std::vector<uint8> Packet;
144 typedef std::vector<Packet> PacketList;
146 class PacketSender {
147 public:
148 // All packets to be sent to the network will be delivered via these
149 // functions.
150 virtual bool SendPackets(const PacketList& packets) = 0;
152 virtual bool SendPacket(const Packet& packet) = 0;
154 virtual ~PacketSender() {}
157 class PacketReceiver : public base::RefCountedThreadSafe<PacketReceiver> {
158 public:
159 // All packets received from the network should be delivered via this
160 // function.
161 virtual void ReceivedPacket(const uint8* packet, size_t length,
162 const base::Closure callback) = 0;
164 static void DeletePacket(const uint8* packet);
166 protected:
167 virtual ~PacketReceiver() {}
169 private:
170 friend class base::RefCountedThreadSafe<PacketReceiver>;
173 } // namespace cast
174 } // namespace media
176 #endif // MEDIA_CAST_CAST_CONFIG_H_