| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CAST_CAST_CONFIG_H_ | 5 #ifndef MEDIA_CAST_CAST_CONFIG_H_ |
| 6 #define MEDIA_CAST_CAST_CONFIG_H_ | 6 #define MEDIA_CAST_CAST_CONFIG_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 int rtp_history_ms; // The time RTP packets are stored for retransmissions. | 47 int rtp_history_ms; // The time RTP packets are stored for retransmissions. |
| 48 int rtp_max_delay_ms; | 48 int rtp_max_delay_ms; |
| 49 int rtp_payload_type; | 49 int rtp_payload_type; |
| 50 | 50 |
| 51 bool use_external_encoder; | 51 bool use_external_encoder; |
| 52 int frequency; | 52 int frequency; |
| 53 int channels; | 53 int channels; |
| 54 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best). | 54 int bitrate; // Set to <= 0 for "auto variable bitrate" (libopus knows best). |
| 55 AudioCodec codec; | 55 AudioCodec codec; |
| 56 |
| 57 std::string aes_key; // Binary string of size kAesKeySize. |
| 58 std::string aes_iv_mask; // Binary string of size kAesKeySize. |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 struct VideoSenderConfig { | 61 struct VideoSenderConfig { |
| 59 VideoSenderConfig(); | 62 VideoSenderConfig(); |
| 60 | 63 |
| 61 uint32 sender_ssrc; | 64 uint32 sender_ssrc; |
| 62 uint32 incoming_feedback_ssrc; | 65 uint32 incoming_feedback_ssrc; |
| 63 | 66 |
| 64 int rtcp_interval; | 67 int rtcp_interval; |
| 65 std::string rtcp_c_name; | 68 std::string rtcp_c_name; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 76 float congestion_control_back_off; | 79 float congestion_control_back_off; |
| 77 int max_bitrate; | 80 int max_bitrate; |
| 78 int min_bitrate; | 81 int min_bitrate; |
| 79 int start_bitrate; | 82 int start_bitrate; |
| 80 int max_qp; | 83 int max_qp; |
| 81 int min_qp; | 84 int min_qp; |
| 82 int max_frame_rate; | 85 int max_frame_rate; |
| 83 int max_number_of_video_buffers_used; // Max value depend on codec. | 86 int max_number_of_video_buffers_used; // Max value depend on codec. |
| 84 VideoCodec codec; | 87 VideoCodec codec; |
| 85 int number_of_cores; | 88 int number_of_cores; |
| 89 |
| 90 std::string aes_key; // Binary string of size kAesKeySize. |
| 91 std::string aes_iv_mask; // Binary string of size kAesKeySize. |
| 86 }; | 92 }; |
| 87 | 93 |
| 88 struct AudioReceiverConfig { | 94 struct AudioReceiverConfig { |
| 89 AudioReceiverConfig(); | 95 AudioReceiverConfig(); |
| 90 | 96 |
| 91 uint32 feedback_ssrc; | 97 uint32 feedback_ssrc; |
| 92 uint32 incoming_ssrc; | 98 uint32 incoming_ssrc; |
| 93 | 99 |
| 94 int rtcp_interval; | 100 int rtcp_interval; |
| 95 std::string rtcp_c_name; | 101 std::string rtcp_c_name; |
| 96 RtcpMode rtcp_mode; | 102 RtcpMode rtcp_mode; |
| 97 | 103 |
| 98 // The time the receiver is prepared to wait for retransmissions. | 104 // The time the receiver is prepared to wait for retransmissions. |
| 99 int rtp_max_delay_ms; | 105 int rtp_max_delay_ms; |
| 100 int rtp_payload_type; | 106 int rtp_payload_type; |
| 101 | 107 |
| 102 bool use_external_decoder; | 108 bool use_external_decoder; |
| 103 int frequency; | 109 int frequency; |
| 104 int channels; | 110 int channels; |
| 105 AudioCodec codec; | 111 AudioCodec codec; |
| 112 |
| 113 std::string aes_key; // Binary string of size kAesKeySize. |
| 114 std::string aes_iv_mask; // Binary string of size kAesKeySize. |
| 106 }; | 115 }; |
| 107 | 116 |
| 108 struct VideoReceiverConfig { | 117 struct VideoReceiverConfig { |
| 109 VideoReceiverConfig(); | 118 VideoReceiverConfig(); |
| 110 | 119 |
| 111 uint32 feedback_ssrc; | 120 uint32 feedback_ssrc; |
| 112 uint32 incoming_ssrc; | 121 uint32 incoming_ssrc; |
| 113 | 122 |
| 114 int rtcp_interval; | 123 int rtcp_interval; |
| 115 std::string rtcp_c_name; | 124 std::string rtcp_c_name; |
| 116 RtcpMode rtcp_mode; | 125 RtcpMode rtcp_mode; |
| 117 | 126 |
| 118 // The time the receiver is prepared to wait for retransmissions. | 127 // The time the receiver is prepared to wait for retransmissions. |
| 119 int rtp_max_delay_ms; | 128 int rtp_max_delay_ms; |
| 120 int rtp_payload_type; | 129 int rtp_payload_type; |
| 121 | 130 |
| 122 bool use_external_decoder; | 131 bool use_external_decoder; |
| 123 int max_frame_rate; | 132 int max_frame_rate; |
| 124 | 133 |
| 125 // Some HW decoders can not run faster than the frame rate, preventing it | 134 // Some HW decoders can not run faster than the frame rate, preventing it |
| 126 // from catching up after a glitch. | 135 // from catching up after a glitch. |
| 127 bool decoder_faster_than_max_frame_rate; | 136 bool decoder_faster_than_max_frame_rate; |
| 128 VideoCodec codec; | 137 VideoCodec codec; |
| 138 |
| 139 std::string aes_key; // Binary string of size kAesKeySize. |
| 140 std::string aes_iv_mask; // Binary string of size kAesKeySize. |
| 129 }; | 141 }; |
| 130 | 142 |
| 131 // DEPRECATED: Do not use in new code. Please migrate existing code to use | 143 // DEPRECATED: Do not use in new code. Please migrate existing code to use |
| 132 // media::VideoFrame. | 144 // media::VideoFrame. |
| 133 struct I420VideoPlane { | 145 struct I420VideoPlane { |
| 134 int stride; | 146 int stride; |
| 135 int length; | 147 int length; |
| 136 uint8* data; | 148 uint8* data; |
| 137 }; | 149 }; |
| 138 | 150 |
| 139 // DEPRECATED: Do not use in new code. Please migrate existing code to use | 151 // DEPRECATED: Do not use in new code. Please migrate existing code to use |
| 140 // media::VideoFrame. | 152 // media::VideoFrame. |
| 141 struct I420VideoFrame { | 153 struct I420VideoFrame { |
| 142 int width; | 154 int width; |
| 143 int height; | 155 int height; |
| 144 I420VideoPlane y_plane; | 156 I420VideoPlane y_plane; |
| 145 I420VideoPlane u_plane; | 157 I420VideoPlane u_plane; |
| 146 I420VideoPlane v_plane; | 158 I420VideoPlane v_plane; |
| 147 }; | 159 }; |
| 148 | 160 |
| 149 struct EncodedVideoFrame { | 161 struct EncodedVideoFrame { |
| 150 EncodedVideoFrame(); | 162 EncodedVideoFrame(); |
| 151 ~EncodedVideoFrame(); | 163 ~EncodedVideoFrame(); |
| 152 | 164 |
| 153 VideoCodec codec; | 165 VideoCodec codec; |
| 154 bool key_frame; | 166 bool key_frame; |
| 155 uint32 frame_id; | 167 uint32 frame_id; |
| 156 uint32 last_referenced_frame_id; | 168 uint32 last_referenced_frame_id; |
| 157 std::vector<uint8> data; | 169 std::string data; |
| 158 }; | 170 }; |
| 159 | 171 |
| 160 // DEPRECATED: Do not use in new code. Please migrate existing code to use | 172 // DEPRECATED: Do not use in new code. Please migrate existing code to use |
| 161 // media::AudioBus. | 173 // media::AudioBus. |
| 162 struct PcmAudioFrame { | 174 struct PcmAudioFrame { |
| 163 PcmAudioFrame(); | 175 PcmAudioFrame(); |
| 164 ~PcmAudioFrame(); | 176 ~PcmAudioFrame(); |
| 165 | 177 |
| 166 int channels; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,... | 178 int channels; // Samples in interleaved stereo format. L0, R0, L1 ,R1 ,... |
| 167 int frequency; | 179 int frequency; |
| 168 std::vector<int16> samples; | 180 std::vector<int16> samples; |
| 169 }; | 181 }; |
| 170 | 182 |
| 171 struct EncodedAudioFrame { | 183 struct EncodedAudioFrame { |
| 172 EncodedAudioFrame(); | 184 EncodedAudioFrame(); |
| 173 ~EncodedAudioFrame(); | 185 ~EncodedAudioFrame(); |
| 174 | 186 |
| 175 AudioCodec codec; | 187 AudioCodec codec; |
| 176 uint32 frame_id; // Needed to release the frame. | 188 uint32 frame_id; // Needed to release the frame. |
| 177 int samples; // Needed send side to advance the RTP timestamp. | 189 int samples; // Needed send side to advance the RTP timestamp. |
| 178 // Not used receive side. | 190 // Not used receive side. |
| 179 std::vector<uint8> data; | |
| 180 | |
| 181 // Support for max sampling rate of 48KHz, 2 channels, 100 ms duration. | 191 // Support for max sampling rate of 48KHz, 2 channels, 100 ms duration. |
| 182 static const int kMaxNumberOfSamples = 48 * 2 * 100; | 192 static const int kMaxNumberOfSamples = 48 * 2 * 100; |
| 193 std::string data; |
| 183 }; | 194 }; |
| 184 | 195 |
| 185 typedef std::vector<uint8> Packet; | 196 typedef std::vector<uint8> Packet; |
| 186 typedef std::vector<Packet> PacketList; | 197 typedef std::vector<Packet> PacketList; |
| 187 | 198 |
| 188 class PacketSender { | 199 class PacketSender { |
| 189 public: | 200 public: |
| 190 // All packets to be sent to the network will be delivered via these | 201 // All packets to be sent to the network will be delivered via these |
| 191 // functions. | 202 // functions. |
| 192 virtual bool SendPackets(const PacketList& packets) = 0; | 203 virtual bool SendPackets(const PacketList& packets) = 0; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 virtual int NumberOfSkippedFrames() const = 0; | 242 virtual int NumberOfSkippedFrames() const = 0; |
| 232 | 243 |
| 233 protected: | 244 protected: |
| 234 virtual ~VideoEncoderController() {} | 245 virtual ~VideoEncoderController() {} |
| 235 }; | 246 }; |
| 236 | 247 |
| 237 } // namespace cast | 248 } // namespace cast |
| 238 } // namespace media | 249 } // namespace media |
| 239 | 250 |
| 240 #endif // MEDIA_CAST_CAST_CONFIG_H_ | 251 #endif // MEDIA_CAST_CAST_CONFIG_H_ |
| OLD | NEW |