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 DictionaryValue; | 24 class DictionaryValue; |
24 class MessageLoopProxy; | 25 class MessageLoopProxy; |
25 } // namespace base | 26 } // namespace base |
26 | 27 |
27 namespace media { | 28 namespace media { |
28 class VideoFrame; | 29 class VideoFrame; |
29 | 30 |
30 namespace cast { | 31 namespace cast { |
31 class CastEnvironment; | 32 class CastEnvironment; |
32 class EncodingEventSubscriber; | 33 class EncodingEventSubscriber; |
33 class FrameInput; | 34 class FrameInput; |
34 | 35 |
35 namespace transport { | 36 namespace transport { |
36 class CastTransportSender; | 37 class CastTransportSender; |
37 } // namespace transport | 38 } // namespace transport |
38 } // namespace cast | 39 } // namespace cast |
39 } // namespace media | 40 } // namespace media |
40 | 41 |
41 // This class hosts CastSender and connects it to audio/video frame input | 42 // This class hosts CastSender and connects it to audio/video frame input |
42 // and network socket. | 43 // and network socket. |
43 // This class is created on the render thread and destroyed on the IO | 44 // This class is created on the render thread and destroyed on the IO |
44 // thread. All methods are accessible only on the IO thread. | 45 // thread. All methods are accessible only on the IO thread. |
45 class CastSessionDelegate { | 46 class CastSessionDelegate { |
46 public: | 47 public: |
47 typedef base::Callback<void(const scoped_refptr< | 48 typedef base::Callback<void(const scoped_refptr< |
48 media::cast::AudioFrameInput>&)> AudioFrameInputAvailableCallback; | 49 media::cast::AudioFrameInput>&)> AudioFrameInputAvailableCallback; |
49 typedef base::Callback<void(const scoped_refptr< | 50 typedef base::Callback<void(const scoped_refptr< |
50 media::cast::VideoFrameInput>&)> VideoFrameInputAvailableCallback; | 51 media::cast::VideoFrameInput>&)> VideoFrameInputAvailableCallback; |
51 typedef base::Callback<void(scoped_ptr<std::string>)> EventLogsCallback; | 52 typedef base::Callback<void(scoped_ptr<base::BinaryValue>)> EventLogsCallback; |
52 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> StatsCallback; | 53 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> StatsCallback; |
53 | 54 |
54 CastSessionDelegate(); | 55 CastSessionDelegate(); |
55 virtual ~CastSessionDelegate(); | 56 virtual ~CastSessionDelegate(); |
56 | 57 |
57 // This will start the session by configuring and creating the Cast transport | 58 // This will start the session by configuring and creating the Cast transport |
58 // and the Cast sender. | 59 // and the Cast sender. |
59 // Must be called before initialization of audio or video. | 60 // Must be called before initialization of audio or video. |
60 void StartUDP(const net::IPEndPoint& local_endpoint, | 61 void StartUDP(const net::IPEndPoint& local_endpoint, |
61 const net::IPEndPoint& remote_endpoint); | 62 const net::IPEndPoint& remote_endpoint); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; | 101 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; |
101 | 102 |
102 // Proxy to the IO message loop. | 103 // Proxy to the IO message loop. |
103 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 104 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
104 base::WeakPtrFactory<CastSessionDelegate> weak_factory_; | 105 base::WeakPtrFactory<CastSessionDelegate> weak_factory_; |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); | 107 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
107 }; | 108 }; |
108 | 109 |
109 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 110 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
OLD | NEW |