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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "base/time/default_tick_clock.h" | 14 #include "base/time/default_tick_clock.h" |
15 #include "media/cast/cast_config.h" | 15 #include "media/cast/cast_config.h" |
16 #include "media/cast/cast_sender.h" | 16 #include "media/cast/cast_sender.h" |
| 17 #include "media/cast/logging/logging_defines.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class MessageLoopProxy; | 20 class MessageLoopProxy; |
20 } // namespace base | 21 } // namespace base |
21 | 22 |
22 namespace media { | 23 namespace media { |
23 class VideoFrame; | 24 class VideoFrame; |
24 | 25 |
25 namespace cast { | 26 namespace cast { |
26 class CastEnvironment; | 27 class CastEnvironment; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void GetEventLogsAndReset(const EventLogsCallback& callback); | 63 void GetEventLogsAndReset(const EventLogsCallback& callback); |
63 | 64 |
64 protected: | 65 protected: |
65 // Callback with the result of the initialization. | 66 // Callback with the result of the initialization. |
66 // If this callback is called with STATUS_INITIALIZED it will report back | 67 // 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. | 68 // to the sinks that it's ready to accept incoming audio / video frames. |
68 void InitializationResult(media::cast::CastInitializationStatus result) const; | 69 void InitializationResult(media::cast::CastInitializationStatus result) const; |
69 | 70 |
70 private: | 71 private: |
71 // Start encoding threads and initialize the CastEnvironment. | 72 // Start encoding threads and initialize the CastEnvironment. |
72 void Initialize(); | 73 void Initialize(const media::cast::CastLoggingConfig& logging_config); |
73 | 74 |
74 // Configure CastSender. It is ready to accept audio / video frames after | 75 // Configure CastSender. It is ready to accept audio / video frames after |
75 // receiving a successful call to InitializationResult. | 76 // receiving a successful call to InitializationResult. |
76 void StartSendingInternal(); | 77 void StartSendingInternal(); |
77 | 78 |
78 void StatusNotificationCB( | 79 void StatusNotificationCB( |
79 media::cast::transport::CastTransportStatus status); | 80 media::cast::transport::CastTransportStatus status); |
80 | 81 |
| 82 // Adds logs collected from transport on browser side. |
| 83 void LogRawEvents(const std::vector<media::cast::PacketEvent>& packet_events); |
| 84 |
81 base::ThreadChecker thread_checker_; | 85 base::ThreadChecker thread_checker_; |
82 scoped_refptr<media::cast::CastEnvironment> cast_environment_; | 86 scoped_refptr<media::cast::CastEnvironment> cast_environment_; |
83 scoped_ptr<media::cast::CastSender> cast_sender_; | 87 scoped_ptr<media::cast::CastSender> cast_sender_; |
84 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_; | 88 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_; |
85 | 89 |
86 // Configuration for audio and video. | 90 // Configuration for audio and video. |
87 scoped_ptr<media::cast::AudioSenderConfig> audio_config_; | 91 scoped_ptr<media::cast::AudioSenderConfig> audio_config_; |
88 scoped_ptr<media::cast::VideoSenderConfig> video_config_; | 92 scoped_ptr<media::cast::VideoSenderConfig> video_config_; |
89 | 93 |
90 FrameInputAvailableCallback audio_frame_input_available_callback_; | 94 FrameInputAvailableCallback audio_frame_input_available_callback_; |
91 FrameInputAvailableCallback video_frame_input_available_callback_; | 95 FrameInputAvailableCallback video_frame_input_available_callback_; |
92 | 96 |
93 scoped_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber_; | 97 scoped_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber_; |
94 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; | 98 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; |
95 | 99 |
96 net::IPEndPoint local_endpoint_; | 100 net::IPEndPoint local_endpoint_; |
97 net::IPEndPoint remote_endpoint_; | 101 net::IPEndPoint remote_endpoint_; |
98 bool transport_configured_; | 102 bool transport_configured_; |
99 | 103 |
100 // Proxy to the IO message loop. | 104 // Proxy to the IO message loop. |
101 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 105 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
102 | 106 |
103 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); | 107 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
104 }; | 108 }; |
105 | 109 |
106 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 110 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
OLD | NEW |