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 <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/linked_ptr.h" |
11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
12 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
13 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
14 #include "base/time/default_tick_clock.h" | 16 #include "base/time/default_tick_clock.h" |
15 #include "media/cast/cast_config.h" | 17 #include "media/cast/cast_config.h" |
16 #include "media/cast/cast_sender.h" | 18 #include "media/cast/cast_sender.h" |
17 | 19 |
18 namespace base { | 20 namespace base { |
19 class MessageLoopProxy; | 21 class MessageLoopProxy; |
20 } // namespace base | 22 } // namespace base |
(...skipping 30 matching lines...) Expand all Loading... |
51 // called the first media will be restarted. It is strongly recommended not to | 53 // called the first media will be restarted. It is strongly recommended not to |
52 // deliver any data between calling the two methods. | 54 // deliver any data between calling the two methods. |
53 // It's OK to call only one of the two methods. | 55 // It's OK to call only one of the two methods. |
54 void StartAudio(const media::cast::AudioSenderConfig& config, | 56 void StartAudio(const media::cast::AudioSenderConfig& config, |
55 const FrameInputAvailableCallback& callback); | 57 const FrameInputAvailableCallback& callback); |
56 void StartVideo(const media::cast::VideoSenderConfig& config, | 58 void StartVideo(const media::cast::VideoSenderConfig& config, |
57 const FrameInputAvailableCallback& callback); | 59 const FrameInputAvailableCallback& callback); |
58 void StartUDP(const net::IPEndPoint& local_endpoint, | 60 void StartUDP(const net::IPEndPoint& local_endpoint, |
59 const net::IPEndPoint& remote_endpoint); | 61 const net::IPEndPoint& remote_endpoint); |
60 | 62 |
61 // Returns raw event logs in serialized format since last call. | 63 void ToggleLogging(bool is_audio, bool enable); |
62 void GetEventLogsAndReset(const EventLogsCallback& callback); | 64 void GetEventLogsAndReset(bool is_audio, const EventLogsCallback& callback); |
63 | 65 |
64 protected: | 66 protected: |
65 // Callback with the result of the initialization. | 67 // Callback with the result of the initialization. |
66 // If this callback is called with STATUS_INITIALIZED it will report back | 68 // If this callback is called with STATUS_INITIALIZED it will report back |
67 // to the sinks that it's ready to accept incoming audio / video frames. | 69 // to the sinks that it's ready to accept incoming audio / video frames. |
68 void InitializationResult(media::cast::CastInitializationStatus result) const; | 70 void InitializationResult(media::cast::CastInitializationStatus result) const; |
69 | 71 |
70 private: | 72 private: |
71 // Start encoding threads and initialize the CastEnvironment. | 73 // Start encoding threads and initialize the CastEnvironment. |
72 void Initialize(); | 74 void Initialize(); |
(...skipping 10 matching lines...) Expand all Loading... |
83 scoped_ptr<media::cast::CastSender> cast_sender_; | 85 scoped_ptr<media::cast::CastSender> cast_sender_; |
84 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_; | 86 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_; |
85 | 87 |
86 // Configuration for audio and video. | 88 // Configuration for audio and video. |
87 scoped_ptr<media::cast::AudioSenderConfig> audio_config_; | 89 scoped_ptr<media::cast::AudioSenderConfig> audio_config_; |
88 scoped_ptr<media::cast::VideoSenderConfig> video_config_; | 90 scoped_ptr<media::cast::VideoSenderConfig> video_config_; |
89 | 91 |
90 FrameInputAvailableCallback audio_frame_input_available_callback_; | 92 FrameInputAvailableCallback audio_frame_input_available_callback_; |
91 FrameInputAvailableCallback video_frame_input_available_callback_; | 93 FrameInputAvailableCallback video_frame_input_available_callback_; |
92 | 94 |
93 scoped_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber_; | |
94 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; | |
95 | |
96 net::IPEndPoint local_endpoint_; | 95 net::IPEndPoint local_endpoint_; |
97 net::IPEndPoint remote_endpoint_; | 96 net::IPEndPoint remote_endpoint_; |
98 bool transport_configured_; | 97 bool transport_configured_; |
99 | 98 |
| 99 scoped_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber_; |
| 100 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; |
| 101 |
100 // Proxy to the IO message loop. | 102 // Proxy to the IO message loop. |
101 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 103 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
102 | 104 |
103 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); | 105 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
104 }; | 106 }; |
105 | 107 |
106 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 108 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
OLD | NEW |