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_
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"
22 kRtcpCompound
, // Compound RTCP mode is described by RFC 4585.
23 kRtcpReducedSize
, // Reduced-size RTCP mode is described by RFC 5506.
26 struct AudioSenderConfig
{
30 uint32 incoming_feedback_ssrc
;
33 std::string rtcp_c_name
;
36 transport::RtpConfig rtp_config
;
38 bool use_external_encoder
;
41 int bitrate
; // Set to <= 0 for "auto variable bitrate" (libopus knows best).
42 transport::AudioCodec codec
;
45 struct VideoSenderConfig
{
49 uint32 incoming_feedback_ssrc
;
52 std::string rtcp_c_name
;
55 transport::RtpConfig rtp_config
;
57 bool use_external_encoder
;
58 int width
; // Incoming frames will be scaled to this size.
61 float congestion_control_back_off
;
68 int max_number_of_video_buffers_used
; // Max value depend on codec.
69 transport::VideoCodec codec
;
73 struct AudioReceiverConfig
{
74 AudioReceiverConfig();
80 std::string rtcp_c_name
;
83 // The time the receiver is prepared to wait for retransmissions.
87 bool use_external_decoder
;
90 transport::AudioCodec codec
;
92 std::string aes_key
; // Binary string of size kAesKeySize.
93 std::string aes_iv_mask
; // Binary string of size kAesKeySize.
96 struct VideoReceiverConfig
{
97 VideoReceiverConfig();
100 uint32 incoming_ssrc
;
103 std::string rtcp_c_name
;
106 // The time the receiver is prepared to wait for retransmissions.
107 int rtp_max_delay_ms
;
108 int rtp_payload_type
;
110 bool use_external_decoder
;
113 // Some HW decoders can not run faster than the frame rate, preventing it
114 // from catching up after a glitch.
115 bool decoder_faster_than_max_frame_rate
;
116 transport::VideoCodec codec
;
118 std::string aes_key
; // Binary string of size kAesKeySize.
119 std::string aes_iv_mask
; // Binary string of size kAesKeySize.
122 // DEPRECATED: Do not use in new code. Please migrate existing code to use
124 struct PcmAudioFrame
{
128 int channels
; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,...
130 std::vector
<int16
> samples
;
133 // import from media::cast::transport
134 typedef transport::Packet Packet
;
135 typedef transport::PacketList PacketList
;
137 enum CastInitializationStatus
{
139 STATUS_INVALID_CAST_ENVIRONMENT
,
140 STATUS_INVALID_CRYPTO_CONFIGURATION
,
141 STATUS_UNSUPPORTED_AUDIO_CODEC
,
142 STATUS_INVALID_AUDIO_CONFIGURATION
,
143 STATUS_INVALID_VIDEO_CONFIGURATION
,
144 STATUS_GPU_ACCELERATION_NOT_SUPPORTED
,
145 STATUS_GPU_ACCELERATION_ERROR
,
148 typedef base::Callback
<void(CastInitializationStatus
)>
149 CastInitializationCallback
;
154 #endif // MEDIA_CAST_CAST_CONFIG_H_