Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / media / cast / cast_config.h
blob7172f6835cdbd514ce61d5e34682eed3eb903519
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 "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"
20 namespace media {
21 class VideoEncodeAccelerator;
23 namespace cast {
25 enum RtcpMode {
26 kRtcpCompound, // Compound RTCP mode is described by RFC 4585.
27 kRtcpReducedSize, // Reduced-size RTCP mode is described by RFC 5506.
30 struct AudioSenderConfig {
31 AudioSenderConfig();
33 // The sender ssrc is in rtp_config.ssrc.
34 uint32 incoming_feedback_ssrc;
36 int rtcp_interval;
37 std::string rtcp_c_name;
38 RtcpMode rtcp_mode;
40 transport::RtpConfig rtp_config;
42 bool use_external_encoder;
43 int frequency;
44 int channels;
45 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best).
46 transport::AudioCodec codec;
49 struct VideoSenderConfig {
50 VideoSenderConfig();
52 // The sender ssrc is in rtp_config.ssrc.
53 uint32 incoming_feedback_ssrc;
55 int rtcp_interval;
56 std::string rtcp_c_name;
57 RtcpMode rtcp_mode;
59 transport::RtpConfig rtp_config;
61 bool use_external_encoder;
62 int width; // Incoming frames will be scaled to this size.
63 int height;
65 float congestion_control_back_off;
66 int max_bitrate;
67 int min_bitrate;
68 int start_bitrate;
69 int max_qp;
70 int min_qp;
71 int max_frame_rate;
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();
80 uint32 feedback_ssrc;
81 uint32 incoming_ssrc;
83 int rtcp_interval;
84 std::string rtcp_c_name;
85 RtcpMode rtcp_mode;
87 // The time the receiver is prepared to wait for retransmissions.
88 int rtp_max_delay_ms;
89 int rtp_payload_type;
91 bool use_external_decoder;
92 int frequency;
93 int channels;
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;
106 int rtcp_interval;
107 std::string rtcp_c_name;
108 RtcpMode rtcp_mode;
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;
115 int max_frame_rate;
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;
145 } // namespace cast
146 } // namespace media
148 #endif // MEDIA_CAST_CAST_CONFIG_H_