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 "base/memory/shared_memory.h"
16 #include "base/single_thread_task_runner.h"
17 #include "media/cast/cast_defines.h"
18 #include "media/cast/transport/cast_transport_config.h"
21 class VideoEncodeAccelerator
;
26 kRtcpCompound
, // Compound RTCP mode is described by RFC 4585.
27 kRtcpReducedSize
, // Reduced-size RTCP mode is described by RFC 5506.
30 struct AudioSenderConfig
{
33 // The sender ssrc is in rtp_config.ssrc.
34 uint32 incoming_feedback_ssrc
;
37 std::string rtcp_c_name
;
40 transport::RtpConfig rtp_config
;
42 bool use_external_encoder
;
45 int bitrate
; // Set to <= 0 for "auto variable bitrate" (libopus knows best).
46 transport::AudioCodec codec
;
49 struct VideoSenderConfig
{
52 // The sender ssrc is in rtp_config.ssrc.
53 uint32 incoming_feedback_ssrc
;
56 std::string rtcp_c_name
;
59 transport::RtpConfig rtp_config
;
61 bool use_external_encoder
;
62 int width
; // Incoming frames will be scaled to this size.
65 float congestion_control_back_off
;
72 int max_number_of_video_buffers_used
; // Max value depend on codec.
73 transport::VideoCodec codec
;
74 int number_of_encode_threads
;
77 struct AudioReceiverConfig
{
78 AudioReceiverConfig();
84 std::string rtcp_c_name
;
87 // The time the receiver is prepared to wait for retransmissions.
91 bool use_external_decoder
;
94 transport::AudioCodec codec
;
96 std::string aes_key
; // Binary string of size kAesKeySize.
97 std::string aes_iv_mask
; // Binary string of size kAesKeySize.
100 struct VideoReceiverConfig
{
101 VideoReceiverConfig();
103 uint32 feedback_ssrc
;
104 uint32 incoming_ssrc
;
107 std::string rtcp_c_name
;
110 // The time the receiver is prepared to wait for retransmissions.
111 int rtp_max_delay_ms
;
112 int rtp_payload_type
;
114 bool use_external_decoder
;
117 // Some HW decoders can not run faster than the frame rate, preventing it
118 // from catching up after a glitch.
119 bool decoder_faster_than_max_frame_rate
;
120 transport::VideoCodec codec
;
122 std::string aes_key
; // Binary string of size kAesKeySize.
123 std::string aes_iv_mask
; // Binary string of size kAesKeySize.
126 // import from media::cast::transport
127 typedef transport::Packet Packet
;
128 typedef transport::PacketList PacketList
;
130 typedef base::Callback
<void(CastInitializationStatus
)>
131 CastInitializationCallback
;
133 typedef base::Callback
<void(scoped_refptr
<base::SingleThreadTaskRunner
>,
134 scoped_ptr
<media::VideoEncodeAccelerator
>)>
135 ReceiveVideoEncodeAcceleratorCallback
;
136 typedef base::Callback
<void(const ReceiveVideoEncodeAcceleratorCallback
&)>
137 CreateVideoEncodeAcceleratorCallback
;
139 typedef base::Callback
<void(scoped_ptr
<base::SharedMemory
>)>
140 ReceiveVideoEncodeMemoryCallback
;
141 typedef base::Callback
<void(size_t size
,
142 const ReceiveVideoEncodeMemoryCallback
&)>
143 CreateVideoEncodeMemoryCallback
;
148 #endif // MEDIA_CAST_CAST_CONFIG_H_