| 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 // This file contains the interface to the cast RTP sender. | 5 // This file contains the interface to the cast RTP sender. |
| 6 | 6 |
| 7 #ifndef MEDIA_CAST_NET_RTP_RTP_SENDER_H_ | 7 #ifndef MEDIA_CAST_NET_RTP_RTP_SENDER_H_ |
| 8 #define MEDIA_CAST_NET_RTP_RTP_SENDER_H_ | 8 #define MEDIA_CAST_NET_RTP_RTP_SENDER_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // This must be called before sending any frames. Returns false if | 41 // This must be called before sending any frames. Returns false if |
| 42 // configuration is invalid. | 42 // configuration is invalid. |
| 43 bool Initialize(const CastTransportRtpConfig& config); | 43 bool Initialize(const CastTransportRtpConfig& config); |
| 44 | 44 |
| 45 void SendFrame(const EncodedFrame& frame); | 45 void SendFrame(const EncodedFrame& frame); |
| 46 | 46 |
| 47 void ResendPackets(const MissingFramesAndPacketsMap& missing_packets, | 47 void ResendPackets(const MissingFramesAndPacketsMap& missing_packets, |
| 48 bool cancel_rtx_if_not_in_list, | 48 bool cancel_rtx_if_not_in_list, |
| 49 base::TimeDelta dedupe_window); | 49 base::TimeDelta dedupe_window); |
| 50 | 50 |
| 51 void CancelSendingFrames(const std::set<uint32>& frame_ids); |
| 52 |
| 53 void ResendFrameForKickstart(uint32 frame_id, base::TimeDelta dedupe_window); |
| 54 |
| 51 size_t send_packet_count() const { | 55 size_t send_packet_count() const { |
| 52 return packetizer_ ? packetizer_->send_packet_count() : 0; | 56 return packetizer_ ? packetizer_->send_packet_count() : 0; |
| 53 } | 57 } |
| 54 size_t send_octet_count() const { | 58 size_t send_octet_count() const { |
| 55 return packetizer_ ? packetizer_->send_octet_count() : 0; | 59 return packetizer_ ? packetizer_->send_octet_count() : 0; |
| 56 } | 60 } |
| 57 uint32 ssrc() const { return config_.ssrc; } | 61 uint32 ssrc() const { return config_.ssrc; } |
| 58 | 62 |
| 59 private: | 63 private: |
| 60 void UpdateSequenceNumber(Packet* packet); | 64 void UpdateSequenceNumber(Packet* packet); |
| 61 | 65 |
| 62 base::TickClock* clock_; // Not owned by this class. | 66 base::TickClock* clock_; // Not owned by this class. |
| 63 RtpPacketizerConfig config_; | 67 RtpPacketizerConfig config_; |
| 64 scoped_ptr<RtpPacketizer> packetizer_; | 68 scoped_ptr<RtpPacketizer> packetizer_; |
| 65 scoped_ptr<PacketStorage> storage_; | 69 scoped_ptr<PacketStorage> storage_; |
| 66 PacedSender* const transport_; | 70 PacedSender* const transport_; |
| 67 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; | 71 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; |
| 68 | 72 |
| 69 // NOTE: Weak pointers must be invalidated before all other member variables. | 73 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 70 base::WeakPtrFactory<RtpSender> weak_factory_; | 74 base::WeakPtrFactory<RtpSender> weak_factory_; |
| 71 | 75 |
| 72 DISALLOW_COPY_AND_ASSIGN(RtpSender); | 76 DISALLOW_COPY_AND_ASSIGN(RtpSender); |
| 73 }; | 77 }; |
| 74 | 78 |
| 75 } // namespace cast | 79 } // namespace cast |
| 76 } // namespace media | 80 } // namespace media |
| 77 | 81 |
| 78 #endif // MEDIA_CAST_NET_RTP_SENDER_RTP_SENDER_H_ | 82 #endif // MEDIA_CAST_NET_RTP_SENDER_RTP_SENDER_H_ |
| OLD | NEW |