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_VIDEO_SENDER_VIDEO_SENDER_H_ | 5 #ifndef MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_ |
6 #define MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_ | 6 #define MEDIA_CAST_VIDEO_SENDER_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // The video_frame must be valid until the closure callback is called. | 52 // The video_frame must be valid until the closure callback is called. |
53 // The closure callback is called from the video encoder thread as soon as | 53 // The closure callback is called from the video encoder thread as soon as |
54 // the encoder is done with the frame; it does not mean that the encoded frame | 54 // the encoder is done with the frame; it does not mean that the encoded frame |
55 // has been sent out. | 55 // has been sent out. |
56 void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, | 56 void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, |
57 const base::TimeTicks& capture_time); | 57 const base::TimeTicks& capture_time); |
58 | 58 |
59 // Only called from the main cast thread. | 59 // Only called from the main cast thread. |
60 void IncomingRtcpPacket(scoped_ptr<Packet> packet); | 60 void IncomingRtcpPacket(scoped_ptr<Packet> packet); |
61 | 61 |
62 // Store rtp stats computed at the Cast transport sender. | |
63 void StoreStatistics(const transport::RtcpSenderInfo& sender_info, | |
64 base::TimeTicks time_sent, | |
65 uint32 rtp_timestamp); | |
66 | |
67 protected: | 62 protected: |
68 // Protected for testability. | 63 // Protected for testability. |
69 void OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback); | 64 void OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback); |
70 | 65 |
71 private: | 66 private: |
72 friend class LocalRtcpVideoSenderFeedback; | 67 friend class LocalRtcpVideoSenderFeedback; |
73 | 68 |
74 // Schedule when we should send the next RTPC report, | 69 // Schedule when we should send the next RTPC report, |
75 // via a PostDelayedTask to the main cast thread. | 70 // via a PostDelayedTask to the main cast thread. |
76 void ScheduleNextRtcpReport(); | 71 void ScheduleNextRtcpReport(); |
(...skipping 26 matching lines...) Expand all Loading... |
103 void InitializeTimers(); | 98 void InitializeTimers(); |
104 | 99 |
105 void UpdateBitrate(int32 new_bitrate); | 100 void UpdateBitrate(int32 new_bitrate); |
106 | 101 |
107 base::TimeDelta rtp_max_delay_; | 102 base::TimeDelta rtp_max_delay_; |
108 const int max_frame_rate_; | 103 const int max_frame_rate_; |
109 | 104 |
110 scoped_refptr<CastEnvironment> cast_environment_; | 105 scoped_refptr<CastEnvironment> cast_environment_; |
111 transport::CastTransportSender* const transport_sender_; | 106 transport::CastTransportSender* const transport_sender_; |
112 | 107 |
113 RtpSenderStatistics rtp_stats_; | 108 RtpTimestampHelper rtp_timestamp_helper_; |
114 scoped_ptr<LocalRtcpVideoSenderFeedback> rtcp_feedback_; | 109 scoped_ptr<LocalRtcpVideoSenderFeedback> rtcp_feedback_; |
115 scoped_ptr<VideoEncoder> video_encoder_; | 110 scoped_ptr<VideoEncoder> video_encoder_; |
116 scoped_ptr<Rtcp> rtcp_; | 111 scoped_ptr<Rtcp> rtcp_; |
117 uint8 max_unacked_frames_; | 112 uint8 max_unacked_frames_; |
118 int last_acked_frame_id_; | 113 int last_acked_frame_id_; |
119 int last_sent_frame_id_; | 114 int last_sent_frame_id_; |
120 int frames_in_encoder_; | 115 int frames_in_encoder_; |
121 int duplicate_ack_; | 116 int duplicate_ack_; |
122 base::TimeTicks last_send_time_; | 117 base::TimeTicks last_send_time_; |
123 base::TimeTicks last_checked_skip_count_time_; | 118 base::TimeTicks last_checked_skip_count_time_; |
(...skipping 20 matching lines...) Expand all Loading... |
144 // NOTE: Weak pointers must be invalidated before all other member variables. | 139 // NOTE: Weak pointers must be invalidated before all other member variables. |
145 base::WeakPtrFactory<VideoSender> weak_factory_; | 140 base::WeakPtrFactory<VideoSender> weak_factory_; |
146 | 141 |
147 DISALLOW_COPY_AND_ASSIGN(VideoSender); | 142 DISALLOW_COPY_AND_ASSIGN(VideoSender); |
148 }; | 143 }; |
149 | 144 |
150 } // namespace cast | 145 } // namespace cast |
151 } // namespace media | 146 } // namespace media |
152 | 147 |
153 #endif // MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_ | 148 #endif // MEDIA_CAST_VIDEO_SENDER_VIDEO_SENDER_H_ |
OLD | NEW |