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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/threading/non_thread_safe.h" | |
15 #include "base/time/tick_clock.h" | 14 #include "base/time/tick_clock.h" |
16 #include "base/time/time.h" | 15 #include "base/time/time.h" |
17 #include "media/cast/cast_config.h" | 16 #include "media/cast/cast_config.h" |
18 #include "media/cast/cast_sender.h" | 17 #include "media/cast/cast_sender.h" |
19 #include "media/cast/common/rtp_time.h" | 18 #include "media/cast/common/rtp_time.h" |
20 #include "media/cast/sender/congestion_control.h" | 19 #include "media/cast/sender/congestion_control.h" |
21 #include "media/cast/sender/frame_sender.h" | 20 #include "media/cast/sender/frame_sender.h" |
22 | 21 |
23 namespace media { | 22 namespace media { |
24 | 23 |
25 class VideoFrame; | 24 class VideoFrame; |
26 | 25 |
27 namespace cast { | 26 namespace cast { |
28 | 27 |
29 class CastTransport; | 28 class CastTransport; |
30 class VideoEncoder; | 29 class VideoEncoder; |
31 class VideoFrameFactory; | 30 class VideoFrameFactory; |
32 | 31 |
33 typedef base::Callback<void(base::TimeDelta)> PlayoutDelayChangeCB; | 32 typedef base::Callback<void(base::TimeDelta)> PlayoutDelayChangeCB; |
34 | 33 |
35 // Not thread safe. Only called from the main cast thread. | 34 // Not thread safe. Only called from the main cast thread. |
36 // This class owns all objects related to sending video, objects that create RTP | 35 // This class owns all objects related to sending video, objects that create RTP |
37 // packets, congestion control, video encoder, parsing and sending of | 36 // packets, congestion control, video encoder, parsing and sending of |
38 // RTCP packets. | 37 // RTCP packets. |
39 // Additionally it posts a bunch of delayed tasks to the main thread for various | 38 // Additionally it posts a bunch of delayed tasks to the main thread for various |
40 // timeouts. | 39 // timeouts. |
41 class VideoSender : public FrameSender, public base::NonThreadSafe { | 40 class VideoSender : public FrameSender { |
42 public: | 41 public: |
43 VideoSender(scoped_refptr<CastEnvironment> cast_environment, | 42 VideoSender(scoped_refptr<CastEnvironment> cast_environment, |
44 const FrameSenderConfig& video_config, | 43 const FrameSenderConfig& video_config, |
45 const StatusChangeCallback& status_change_cb, | 44 const StatusChangeCallback& status_change_cb, |
46 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, | 45 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, |
47 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb, | 46 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb, |
48 CastTransport* const transport_sender, | 47 CastTransport* const transport_sender, |
49 const PlayoutDelayChangeCB& playout_delay_change_cb); | 48 const PlayoutDelayChangeCB& playout_delay_change_cb); |
50 | 49 |
51 ~VideoSender() override; | 50 ~VideoSender() override; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // NOTE: Weak pointers must be invalidated before all other member variables. | 112 // NOTE: Weak pointers must be invalidated before all other member variables. |
114 base::WeakPtrFactory<VideoSender> weak_factory_; | 113 base::WeakPtrFactory<VideoSender> weak_factory_; |
115 | 114 |
116 DISALLOW_COPY_AND_ASSIGN(VideoSender); | 115 DISALLOW_COPY_AND_ASSIGN(VideoSender); |
117 }; | 116 }; |
118 | 117 |
119 } // namespace cast | 118 } // namespace cast |
120 } // namespace media | 119 } // namespace media |
121 | 120 |
122 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ | 121 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
OLD | NEW |