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_SENDER_VIDEO_SENDER_H_ | 5 #ifndef MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
6 #define MEDIA_CAST_SENDER_VIDEO_SENDER_H_ | 6 #define MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
14 #include "base/time/tick_clock.h" | 14 #include "base/time/tick_clock.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "media/cast/cast_config.h" | 16 #include "media/cast/cast_config.h" |
17 #include "media/cast/cast_sender.h" | 17 #include "media/cast/cast_sender.h" |
| 18 #include "media/cast/common/rtp_time.h" |
18 #include "media/cast/sender/congestion_control.h" | 19 #include "media/cast/sender/congestion_control.h" |
19 #include "media/cast/sender/frame_sender.h" | 20 #include "media/cast/sender/frame_sender.h" |
20 | 21 |
21 namespace media { | 22 namespace media { |
22 | 23 |
23 class VideoFrame; | 24 class VideoFrame; |
24 | 25 |
25 namespace cast { | 26 namespace cast { |
26 | 27 |
27 class CastTransportSender; | 28 class CastTransportSender; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // a hardware-based encoder. | 84 // a hardware-based encoder. |
84 scoped_ptr<VideoEncoder> video_encoder_; | 85 scoped_ptr<VideoEncoder> video_encoder_; |
85 | 86 |
86 // The number of frames queued for encoding, but not yet sent. | 87 // The number of frames queued for encoding, but not yet sent. |
87 int frames_in_encoder_; | 88 int frames_in_encoder_; |
88 | 89 |
89 // The duration of video queued for encoding, but not yet sent. | 90 // The duration of video queued for encoding, but not yet sent. |
90 base::TimeDelta duration_in_encoder_; | 91 base::TimeDelta duration_in_encoder_; |
91 | 92 |
92 // The timestamp of the frame that was last enqueued in |video_encoder_|. | 93 // The timestamp of the frame that was last enqueued in |video_encoder_|. |
93 RtpTimestamp last_enqueued_frame_rtp_timestamp_; | 94 RtpTimeTicks last_enqueued_frame_rtp_timestamp_; |
94 base::TimeTicks last_enqueued_frame_reference_time_; | 95 base::TimeTicks last_enqueued_frame_reference_time_; |
95 | 96 |
96 // Remember what we set the bitrate to before, no need to set it again if | 97 // Remember what we set the bitrate to before, no need to set it again if |
97 // we get the same value. | 98 // we get the same value. |
98 int last_bitrate_; | 99 int last_bitrate_; |
99 | 100 |
100 PlayoutDelayChangeCB playout_delay_change_cb_; | 101 PlayoutDelayChangeCB playout_delay_change_cb_; |
101 | 102 |
102 // Indicates we are operating in a mode where the target playout latency is | 103 // Indicates we are operating in a mode where the target playout latency is |
103 // low for best user experience. When operating in low latency mode, we | 104 // low for best user experience. When operating in low latency mode, we |
104 // prefer dropping frames over increasing target playout time. | 105 // prefer dropping frames over increasing target playout time. |
105 bool low_latency_mode_; | 106 bool low_latency_mode_; |
106 | 107 |
107 // The video encoder's performance metrics as of the last call to | 108 // The video encoder's performance metrics as of the last call to |
108 // OnEncodedVideoFrame(). See header file comments for SenderEncodedFrame for | 109 // OnEncodedVideoFrame(). See header file comments for SenderEncodedFrame for |
109 // an explanation of these values. | 110 // an explanation of these values. |
110 double last_reported_deadline_utilization_; | 111 double last_reported_deadline_utilization_; |
111 double last_reported_lossy_utilization_; | 112 double last_reported_lossy_utilization_; |
112 | 113 |
113 // NOTE: Weak pointers must be invalidated before all other member variables. | 114 // NOTE: Weak pointers must be invalidated before all other member variables. |
114 base::WeakPtrFactory<VideoSender> weak_factory_; | 115 base::WeakPtrFactory<VideoSender> weak_factory_; |
115 | 116 |
116 DISALLOW_COPY_AND_ASSIGN(VideoSender); | 117 DISALLOW_COPY_AND_ASSIGN(VideoSender); |
117 }; | 118 }; |
118 | 119 |
119 } // namespace cast | 120 } // namespace cast |
120 } // namespace media | 121 } // namespace media |
121 | 122 |
122 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ | 123 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
OLD | NEW |