[Linux] Show preview contents for minimized windows
[chromium-blink-merge.git] / media / cast / cast_config.h
blob3a27702dd5cb6362dc4f9375894b20178f4f2e81
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 "base/time/time.h"
18 #include "media/cast/cast_defines.h"
19 #include "media/cast/net/cast_transport_config.h"
21 namespace media {
22 class VideoEncodeAccelerator;
24 namespace cast {
26 // TODO(miu): Merge AudioSenderConfig and VideoSenderConfig and make their
27 // naming/documentation consistent with FrameReceiverConfig.
28 struct AudioSenderConfig {
29 AudioSenderConfig();
30 ~AudioSenderConfig();
32 // Identifier referring to the sender, used by the receiver.
33 uint32 ssrc;
35 // The receiver's SSRC identifier.
36 uint32 incoming_feedback_ssrc;
38 int rtcp_interval;
40 // The total amount of time between a frame's capture/recording on the sender
41 // and its playback on the receiver (i.e., shown to a user). This is fixed as
42 // a value large enough to give the system sufficient time to encode,
43 // transmit/retransmit, receive, decode, and render; given its run-time
44 // environment (sender/receiver hardware performance, network conditions,
45 // etc.).
46 base::TimeDelta target_playout_delay;
48 // RTP payload type enum: Specifies the type/encoding of frame data.
49 int rtp_payload_type;
51 bool use_external_encoder;
52 int frequency;
53 int channels;
54 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best).
55 Codec codec;
57 // The AES crypto key and initialization vector. Each of these strings
58 // contains the data in binary form, of size kAesKeySize. If they are empty
59 // strings, crypto is not being used.
60 std::string aes_key;
61 std::string aes_iv_mask;
64 struct VideoSenderConfig {
65 VideoSenderConfig();
66 ~VideoSenderConfig();
68 // Identifier referring to the sender, used by the receiver.
69 uint32 ssrc;
71 // The receiver's SSRC identifier.
72 uint32 incoming_feedback_ssrc; // TODO(miu): Rename to receiver_ssrc.
74 int rtcp_interval;
76 // The total amount of time between a frame's capture/recording on the sender
77 // and its playback on the receiver (i.e., shown to a user). This is fixed as
78 // a value large enough to give the system sufficient time to encode,
79 // transmit/retransmit, receive, decode, and render; given its run-time
80 // environment (sender/receiver hardware performance, network conditions,
81 // etc.).
82 base::TimeDelta target_playout_delay;
84 // RTP payload type enum: Specifies the type/encoding of frame data.
85 int rtp_payload_type;
87 bool use_external_encoder;
88 int width; // Incoming frames will be scaled to this size.
89 int height;
91 float congestion_control_back_off;
92 int max_bitrate;
93 int min_bitrate;
94 int start_bitrate;
95 int max_qp;
96 int min_qp;
97 int max_frame_rate; // TODO(miu): Should be double, not int.
98 int max_number_of_video_buffers_used; // Max value depend on codec.
99 Codec codec;
100 int number_of_encode_threads;
102 // The AES crypto key and initialization vector. Each of these strings
103 // contains the data in binary form, of size kAesKeySize. If they are empty
104 // strings, crypto is not being used.
105 std::string aes_key;
106 std::string aes_iv_mask;
109 // TODO(miu): Naming and minor type changes are badly needed in a later CL.
110 struct FrameReceiverConfig {
111 FrameReceiverConfig();
112 ~FrameReceiverConfig();
114 // The receiver's SSRC identifier.
115 uint32 feedback_ssrc; // TODO(miu): Rename to receiver_ssrc for clarity.
117 // The sender's SSRC identifier.
118 uint32 incoming_ssrc; // TODO(miu): Rename to sender_ssrc for clarity.
120 // Mean interval (in milliseconds) between RTCP reports.
121 // TODO(miu): Remove this since it's never not kDefaultRtcpIntervalMs.
122 int rtcp_interval;
124 // The total amount of time between a frame's capture/recording on the sender
125 // and its playback on the receiver (i.e., shown to a user). This is fixed as
126 // a value large enough to give the system sufficient time to encode,
127 // transmit/retransmit, receive, decode, and render; given its run-time
128 // environment (sender/receiver hardware performance, network conditions,
129 // etc.).
130 int rtp_max_delay_ms; // TODO(miu): Change to TimeDelta target_playout_delay.
132 // RTP payload type enum: Specifies the type/encoding of frame data.
133 int rtp_payload_type;
135 // RTP timebase: The number of RTP units advanced per one second. For audio,
136 // this is the sampling rate. For video, by convention, this is 90 kHz.
137 int frequency; // TODO(miu): Rename to rtp_timebase for clarity.
139 // Number of channels. For audio, this is normally 2. For video, this must
140 // be 1 as Cast does not have support for stereoscopic video.
141 int channels;
143 // The target frame rate. For audio, this is normally 100 (i.e., frames have
144 // a duration of 10ms each). For video, this is normally 30, but any frame
145 // rate is supported.
146 int max_frame_rate; // TODO(miu): Rename to target_frame_rate.
148 // Codec used for the compression of signal data.
149 // TODO(miu): Merge the AudioCodec and VideoCodec enums into one so this union
150 // is not necessary.
151 Codec codec;
153 // The AES crypto key and initialization vector. Each of these strings
154 // contains the data in binary form, of size kAesKeySize. If they are empty
155 // strings, crypto is not being used.
156 std::string aes_key;
157 std::string aes_iv_mask;
160 // Import from media::cast.
162 typedef Packet Packet;
163 typedef PacketList PacketList;
165 typedef base::Callback<void(CastInitializationStatus)>
166 CastInitializationCallback;
168 typedef base::Callback<void(scoped_refptr<base::SingleThreadTaskRunner>,
169 scoped_ptr<media::VideoEncodeAccelerator>)>
170 ReceiveVideoEncodeAcceleratorCallback;
171 typedef base::Callback<void(const ReceiveVideoEncodeAcceleratorCallback&)>
172 CreateVideoEncodeAcceleratorCallback;
174 typedef base::Callback<void(scoped_ptr<base::SharedMemory>)>
175 ReceiveVideoEncodeMemoryCallback;
176 typedef base::Callback<void(size_t size,
177 const ReceiveVideoEncodeMemoryCallback&)>
178 CreateVideoEncodeMemoryCallback;
180 } // namespace cast
181 } // namespace media
183 #endif // MEDIA_CAST_CAST_CONFIG_H_