| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TRANSPORT_TRANSPORT_VIDEO_SENDER_H_ | 5 #ifndef MEDIA_CAST_TRANSPORT_TRANSPORT_VIDEO_SENDER_H_ |
| 6 #define MEDIA_CAST_TRANSPORT_TRANSPORT_VIDEO_SENDER_H_ | 6 #define MEDIA_CAST_TRANSPORT_TRANSPORT_VIDEO_SENDER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 TransportVideoSender( | 30 TransportVideoSender( |
| 31 const CastTransportVideoConfig& config, | 31 const CastTransportVideoConfig& config, |
| 32 base::TickClock* clock, | 32 base::TickClock* clock, |
| 33 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, | 33 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, |
| 34 PacedSender* const paced_packet_sender); | 34 PacedSender* const paced_packet_sender); |
| 35 | 35 |
| 36 virtual ~TransportVideoSender(); | 36 virtual ~TransportVideoSender(); |
| 37 | 37 |
| 38 // Handles the encoded video frames to be processed. | 38 // Handles the encoded video frames to be processed. |
| 39 // Frames will be encrypted, packetized and transmitted to the network. | 39 // Frames will be encrypted, packetized and transmitted to the network. |
| 40 void InsertCodedVideoFrame(const EncodedVideoFrame* coded_frame, | 40 void SendFrame(const EncodedFrame& video_frame); |
| 41 const base::TimeTicks& capture_time); | |
| 42 | 41 |
| 43 // Retransmision request. | 42 // Retransmision request. |
| 44 void ResendPackets( | 43 void ResendPackets( |
| 45 const MissingFramesAndPacketsMap& missing_frames_and_packets); | 44 const MissingFramesAndPacketsMap& missing_frames_and_packets); |
| 46 | 45 |
| 47 size_t send_packet_count() const { return rtp_sender_.send_packet_count(); } | 46 size_t send_packet_count() const { return rtp_sender_.send_packet_count(); } |
| 48 size_t send_octet_count() const { return rtp_sender_.send_octet_count(); } | 47 size_t send_octet_count() const { return rtp_sender_.send_octet_count(); } |
| 49 uint32 ssrc() const { return rtp_sender_.ssrc(); } | 48 uint32 ssrc() const { return rtp_sender_.ssrc(); } |
| 50 bool initialized() const { return initialized_; } | 49 bool initialized() const { return initialized_; } |
| 51 | 50 |
| 52 private: | 51 private: |
| 53 // Caller must allocate the destination |encrypted_video_frame| the data | 52 // Caller must allocate the destination |encrypted_video_frame| the data |
| 54 // member will be resized to hold the encrypted size. | 53 // member will be resized to hold the encrypted size. |
| 55 bool EncryptVideoFrame(const EncodedVideoFrame& encoded_frame, | 54 bool EncryptVideoFrame(const EncodedFrame& encoded_frame, |
| 56 EncodedVideoFrame* encrypted_video_frame); | 55 EncodedFrame* encrypted_video_frame); |
| 57 | 56 |
| 58 const base::TimeDelta rtp_max_delay_; | 57 const base::TimeDelta rtp_max_delay_; |
| 59 TransportEncryptionHandler encryptor_; | 58 TransportEncryptionHandler encryptor_; |
| 60 RtpSender rtp_sender_; | 59 RtpSender rtp_sender_; |
| 61 bool initialized_; | 60 bool initialized_; |
| 62 | 61 |
| 63 DISALLOW_IMPLICIT_CONSTRUCTORS(TransportVideoSender); | 62 DISALLOW_IMPLICIT_CONSTRUCTORS(TransportVideoSender); |
| 64 }; | 63 }; |
| 65 | 64 |
| 66 } // namespace transport | 65 } // namespace transport |
| 67 } // namespace cast | 66 } // namespace cast |
| 68 } // namespace media | 67 } // namespace media |
| 69 | 68 |
| 70 #endif // MEDIA_CAST_TRANSPORT_TRANSPORT_VIDEO_SENDER_H_ | 69 #endif // MEDIA_CAST_TRANSPORT_TRANSPORT_VIDEO_SENDER_H_ |
| OLD | NEW |