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(const int stream_id, |
Alpha Left Google
2014/02/24 23:25:51
Is |stream_id| useful given there's already |is_au
imcheng
2014/02/25 08:10:18
Done and see other reply.
| |
62 void GetEventLogsAndReset(const EventLogsCallback& callback); | 64 const bool enable, |
65 const bool is_audio); | |
66 void GetEventLogsAndReset(const EventLogsCallback& callback, | |
67 const int stream_id); | |
63 | 68 |
64 protected: | 69 protected: |
65 // Callback with the result of the initialization. | 70 // Callback with the result of the initialization. |
66 // If this callback is called with STATUS_INITIALIZED it will report back | 71 // 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. | 72 // to the sinks that it's ready to accept incoming audio / video frames. |
68 void InitializationResult(media::cast::CastInitializationStatus result) const; | 73 void InitializationResult(media::cast::CastInitializationStatus result) const; |
69 | 74 |
70 private: | 75 private: |
71 // Start encoding threads and initialize the CastEnvironment. | 76 // Start encoding threads and initialize the CastEnvironment. |
72 void Initialize(); | 77 void Initialize(); |
(...skipping 10 matching lines...) Expand all Loading... | |
83 scoped_ptr<media::cast::CastSender> cast_sender_; | 88 scoped_ptr<media::cast::CastSender> cast_sender_; |
84 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_; | 89 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_; |
85 | 90 |
86 // Configuration for audio and video. | 91 // Configuration for audio and video. |
87 scoped_ptr<media::cast::AudioSenderConfig> audio_config_; | 92 scoped_ptr<media::cast::AudioSenderConfig> audio_config_; |
88 scoped_ptr<media::cast::VideoSenderConfig> video_config_; | 93 scoped_ptr<media::cast::VideoSenderConfig> video_config_; |
89 | 94 |
90 FrameInputAvailableCallback audio_frame_input_available_callback_; | 95 FrameInputAvailableCallback audio_frame_input_available_callback_; |
91 FrameInputAvailableCallback video_frame_input_available_callback_; | 96 FrameInputAvailableCallback video_frame_input_available_callback_; |
92 | 97 |
93 scoped_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber_; | |
94 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; | |
95 | |
96 net::IPEndPoint local_endpoint_; | 98 net::IPEndPoint local_endpoint_; |
97 net::IPEndPoint remote_endpoint_; | 99 net::IPEndPoint remote_endpoint_; |
98 bool transport_configured_; | 100 bool transport_configured_; |
99 | 101 |
102 typedef std::map<int, linked_ptr<media::cast::EncodingEventSubscriber> > | |
103 EventSubscriberMap; | |
104 EventSubscriberMap event_subscriber_map_; | |
105 | |
100 // Proxy to the IO message loop. | 106 // Proxy to the IO message loop. |
101 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 107 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
102 | 108 |
103 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); | 109 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
104 }; | 110 }; |
105 | 111 |
106 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 112 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
OLD | NEW |