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