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 // 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_TRANSPORT_RTP_SENDER_RTP_SENDER_H_ | 7 #ifndef MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_SENDER_H_ |
8 #define MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_SENDER_H_ | 8 #define MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_SENDER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // The video_frame objects ownership is handled by the main cast thread. | 51 // The video_frame objects ownership is handled by the main cast thread. |
52 void IncomingEncodedVideoFrame(const EncodedVideoFrame* video_frame, | 52 void IncomingEncodedVideoFrame(const EncodedVideoFrame* video_frame, |
53 const base::TimeTicks& capture_time); | 53 const base::TimeTicks& capture_time); |
54 | 54 |
55 // The audio_frame objects ownership is handled by the main cast thread. | 55 // The audio_frame objects ownership is handled by the main cast thread. |
56 void IncomingEncodedAudioFrame(const EncodedAudioFrame* audio_frame, | 56 void IncomingEncodedAudioFrame(const EncodedAudioFrame* audio_frame, |
57 const base::TimeTicks& recorded_time); | 57 const base::TimeTicks& recorded_time); |
58 | 58 |
59 void ResendPackets(const MissingFramesAndPacketsMap& missing_packets); | 59 void ResendPackets(const MissingFramesAndPacketsMap& missing_packets); |
60 | 60 |
61 // Set the callback on which RTP statistics data will be returned. Calling | 61 size_t send_packet_count() const { |
62 // this function would start a timer that would schedule the callback in | 62 return packetizer_ ? packetizer_->send_packet_count() : 0; |
63 // a constant interval. | 63 } |
64 void SubscribeRtpStatsCallback(const CastTransportRtpStatistics& callback); | 64 size_t send_octet_count() const { |
| 65 return packetizer_ ? packetizer_->send_octet_count() : 0; |
| 66 } |
| 67 uint32 ssrc() const { return config_.ssrc; } |
65 | 68 |
66 private: | 69 private: |
67 void ScheduleNextStatsReport(); | |
68 void RtpStatistics(); | |
69 void UpdateSequenceNumber(Packet* packet); | 70 void UpdateSequenceNumber(Packet* packet); |
70 | 71 |
71 base::TickClock* clock_; // Not owned by this class. | 72 base::TickClock* clock_; // Not owned by this class. |
72 RtpPacketizerConfig config_; | 73 RtpPacketizerConfig config_; |
73 scoped_ptr<RtpPacketizer> packetizer_; | 74 scoped_ptr<RtpPacketizer> packetizer_; |
74 scoped_ptr<PacketStorage> storage_; | 75 scoped_ptr<PacketStorage> storage_; |
75 PacedSender* const transport_; | 76 PacedSender* const transport_; |
76 CastTransportRtpStatistics stats_callback_; | |
77 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; | 77 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; |
78 | 78 |
79 // NOTE: Weak pointers must be invalidated before all other member variables. | 79 // NOTE: Weak pointers must be invalidated before all other member variables. |
80 base::WeakPtrFactory<RtpSender> weak_factory_; | 80 base::WeakPtrFactory<RtpSender> weak_factory_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(RtpSender); | 82 DISALLOW_COPY_AND_ASSIGN(RtpSender); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace transport | 85 } // namespace transport |
86 } // namespace cast | 86 } // namespace cast |
87 } // namespace media | 87 } // namespace media |
88 | 88 |
89 #endif // MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_SENDER_H_ | 89 #endif // MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_SENDER_H_ |
OLD | NEW |