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 CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
6 #define CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
17 #include "base/time/default_tick_clock.h" | 17 #include "base/time/default_tick_clock.h" |
18 #include "media/cast/cast_config.h" | 18 #include "media/cast/cast_config.h" |
19 #include "media/cast/cast_sender.h" | 19 #include "media/cast/cast_sender.h" |
20 #include "media/cast/logging/logging_defines.h" | 20 #include "media/cast/logging/logging_defines.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class BinaryValue; | 23 class BinaryValue; |
24 class DictionaryValue; | 24 class DictionaryValue; |
25 class MessageLoopProxy; | 25 class SingleThreadTaskRunner; |
26 } // namespace base | 26 } // namespace base |
27 | 27 |
28 namespace media { | 28 namespace media { |
29 class VideoFrame; | 29 class VideoFrame; |
30 | 30 |
31 namespace cast { | 31 namespace cast { |
32 class CastEnvironment; | 32 class CastEnvironment; |
33 class FrameInput; | 33 class FrameInput; |
34 class RawEventSubscriberBundle; | 34 class RawEventSubscriberBundle; |
35 | 35 |
(...skipping 28 matching lines...) Expand all Loading... |
64 virtual void ReceivePacket(scoped_ptr<media::cast::Packet> packet) = 0; | 64 virtual void ReceivePacket(scoped_ptr<media::cast::Packet> packet) = 0; |
65 virtual void LogRawEvents( | 65 virtual void LogRawEvents( |
66 const std::vector<media::cast::PacketEvent>& packet_events, | 66 const std::vector<media::cast::PacketEvent>& packet_events, |
67 const std::vector<media::cast::FrameEvent>& frame_events) = 0; | 67 const std::vector<media::cast::FrameEvent>& frame_events) = 0; |
68 | 68 |
69 base::ThreadChecker thread_checker_; | 69 base::ThreadChecker thread_checker_; |
70 scoped_refptr<media::cast::CastEnvironment> cast_environment_; | 70 scoped_refptr<media::cast::CastEnvironment> cast_environment_; |
71 scoped_ptr<media::cast::CastTransportSender> cast_transport_; | 71 scoped_ptr<media::cast::CastTransportSender> cast_transport_; |
72 | 72 |
73 // Proxy to the IO message loop. | 73 // Proxy to the IO message loop. |
74 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 74 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
75 base::WeakPtrFactory<CastSessionDelegateBase> weak_factory_; | 75 base::WeakPtrFactory<CastSessionDelegateBase> weak_factory_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegateBase); | 77 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegateBase); |
78 }; | 78 }; |
79 | 79 |
80 // This class hosts CastSender and connects it to audio/video frame input | 80 // This class hosts CastSender and connects it to audio/video frame input |
81 // and network socket. | 81 // and network socket. |
82 // This class is created on the render thread and destroyed on the IO | 82 // This class is created on the render thread and destroyed on the IO |
83 // thread. All methods are accessible only on the IO thread. | 83 // thread. All methods are accessible only on the IO thread. |
84 class CastSessionDelegate : public CastSessionDelegateBase { | 84 class CastSessionDelegate : public CastSessionDelegateBase { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 VideoFrameInputAvailableCallback video_frame_input_available_callback_; | 147 VideoFrameInputAvailableCallback video_frame_input_available_callback_; |
148 | 148 |
149 scoped_ptr<media::cast::RawEventSubscriberBundle> event_subscribers_; | 149 scoped_ptr<media::cast::RawEventSubscriberBundle> event_subscribers_; |
150 | 150 |
151 base::WeakPtrFactory<CastSessionDelegate> weak_factory_; | 151 base::WeakPtrFactory<CastSessionDelegate> weak_factory_; |
152 | 152 |
153 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); | 153 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
154 }; | 154 }; |
155 | 155 |
156 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 156 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
OLD | NEW |