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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 uint8 frame_id; // Needed to release the frame. Not used send side. | 169 uint8 frame_id; // Needed to release the frame. Not used send side. |
170 int samples; // Needed send side to advance the RTP timestamp. | 170 int samples; // Needed send side to advance the RTP timestamp. |
171 // Not used receive side. | 171 // Not used receive side. |
172 std::vector<uint8> data; | 172 std::vector<uint8> data; |
173 }; | 173 }; |
174 | 174 |
175 class PacketSender { | 175 class PacketSender { |
176 public: | 176 public: |
177 // All packets to be sent to the network will be delivered via this function. | 177 // All packets to be sent to the network will be delivered via this function. |
178 virtual bool SendPacket(const uint8* packet, int length) = 0; | 178 virtual bool SendPacket(const uint8* packet, int length) = 0; |
179 virtual bool SendPacket(const std::vector<uint8>& packet); | |
180 | 179 |
181 virtual ~PacketSender() {} | 180 virtual ~PacketSender() {} |
182 }; | 181 }; |
183 | 182 |
184 class PacketReceiver : public base::RefCountedThreadSafe<PacketReceiver> { | 183 class PacketReceiver : public base::RefCountedThreadSafe<PacketReceiver> { |
185 public: | 184 public: |
186 // All packets received from the network should be delivered via this | 185 // All packets received from the network should be delivered via this |
187 // function. | 186 // function. |
188 virtual void ReceivedPacket(const uint8* packet, int length, | 187 virtual void ReceivedPacket(const uint8* packet, int length, |
189 const base::Closure callback) = 0; | 188 const base::Closure callback) = 0; |
190 | 189 |
191 protected: | |
192 virtual ~PacketReceiver() {} | 190 virtual ~PacketReceiver() {} |
193 | |
194 private: | |
195 friend class base::RefCountedThreadSafe<PacketReceiver>; | |
196 }; | 191 }; |
197 | 192 |
198 class VideoEncoderController { | 193 class VideoEncoderController { |
199 public: | 194 public: |
200 // Inform the encoder about the new target bit rate. | 195 // Inform the encoder about the new target bit rate. |
201 virtual void SetBitRate(int new_bit_rate) = 0; | 196 virtual void SetBitRate(int new_bit_rate) = 0; |
202 | 197 |
203 // Inform the encoder to not encode the next frame. | 198 // Inform the encoder to not encode the next frame. |
204 // Note: this setting is sticky and should last until called with false. | 199 // Note: this setting is sticky and should last until called with false. |
205 virtual void SkipNextFrame(bool skip_next_frame) = 0; | 200 virtual void SkipNextFrame(bool skip_next_frame) = 0; |
206 | 201 |
207 // Inform the encoder to encode the next frame as a key frame. | 202 // Inform the encoder to encode the next frame as a key frame. |
208 virtual void GenerateKeyFrame() = 0; | 203 virtual void GenerateKeyFrame() = 0; |
209 | 204 |
210 // Inform the encoder to only reference frames older or equal to frame_id; | 205 // Inform the encoder to only reference frames older or equal to frame_id; |
211 virtual void LatestFrameIdToReference(uint8 frame_id) = 0; | 206 virtual void LatestFrameIdToReference(uint8 frame_id) = 0; |
212 | 207 |
213 // Query the codec about how many frames it has skipped due to slow ACK. | 208 // Query the codec about how many frames it has skipped due to slow ACK. |
214 virtual int NumberOfSkippedFrames() const = 0; | 209 virtual int NumberOfSkippedFrames() const = 0; |
215 | 210 |
216 protected: | 211 protected: |
217 virtual ~VideoEncoderController() {} | 212 virtual ~VideoEncoderController() {} |
218 }; | 213 }; |
219 | 214 |
220 } // namespace cast | 215 } // namespace cast |
221 } // namespace media | 216 } // namespace media |
222 | 217 |
223 #endif // MEDIA_CAST_CAST_CONFIG_H_ | 218 #endif // MEDIA_CAST_CAST_CONFIG_H_ |
OLD | NEW |