| 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 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 create_vea_cb, | 79 create_vea_cb, |
| 80 const media::cast::CreateVideoEncodeMemoryCallback& | 80 const media::cast::CreateVideoEncodeMemoryCallback& |
| 81 create_video_encode_mem_cb); | 81 create_video_encode_mem_cb); |
| 82 | 82 |
| 83 void ToggleLogging(bool is_audio, bool enable); | 83 void ToggleLogging(bool is_audio, bool enable); |
| 84 void GetEventLogsAndReset(bool is_audio, | 84 void GetEventLogsAndReset(bool is_audio, |
| 85 const std::string& extra_data, const EventLogsCallback& callback); | 85 const std::string& extra_data, const EventLogsCallback& callback); |
| 86 void GetStatsAndReset(bool is_audio, const StatsCallback& callback); | 86 void GetStatsAndReset(bool is_audio, const StatsCallback& callback); |
| 87 | 87 |
| 88 protected: | 88 protected: |
| 89 // Callback with the result of the initialization. | 89 // Called to report back operational status changes. The first time this is |
| 90 // If this callback is called with STATUS_INITIALIZED it will report back | 90 // called with STATUS_INITIALIZED will result in running the "frame input |
| 91 // to the sinks that it's ready to accept incoming audio / video frames. | 91 // available" callback, to indicate the session is ready to accept incoming |
| 92 void InitializationResultCB( | 92 // audio/video frames. If this is called with an error that has halted the |
| 93 // session, the |error_callback| provided to StartXXX() will be run. This |
| 94 // method may be called multiple times during the session to indicate codec |
| 95 // re-initializations are taking place and/or runtime errors have occurred. |
| 96 void OnOperationalStatusChange( |
| 97 bool is_for_audio, |
| 93 const ErrorCallback& error_callback, | 98 const ErrorCallback& error_callback, |
| 94 media::cast::CastInitializationStatus result) const; | 99 media::cast::OperationalStatus result); |
| 95 | 100 |
| 96 private: | 101 private: |
| 97 void StatusNotificationCB( | 102 void StatusNotificationCB( |
| 98 media::cast::CastTransportStatus status); | 103 media::cast::CastTransportStatus status); |
| 99 | 104 |
| 100 // Adds logs collected from transport on browser side. | 105 // Adds logs collected from transport on browser side. |
| 101 void LogRawEvents(const std::vector<media::cast::PacketEvent>& packet_events, | 106 void LogRawEvents(const std::vector<media::cast::PacketEvent>& packet_events, |
| 102 const std::vector<media::cast::FrameEvent>& frame_events); | 107 const std::vector<media::cast::FrameEvent>& frame_events); |
| 103 | 108 |
| 104 base::ThreadChecker thread_checker_; | 109 base::ThreadChecker thread_checker_; |
| 105 scoped_refptr<media::cast::CastEnvironment> cast_environment_; | 110 scoped_refptr<media::cast::CastEnvironment> cast_environment_; |
| 106 scoped_ptr<media::cast::CastSender> cast_sender_; | 111 scoped_ptr<media::cast::CastSender> cast_sender_; |
| 107 scoped_ptr<media::cast::CastTransportSender> cast_transport_; | 112 scoped_ptr<media::cast::CastTransportSender> cast_transport_; |
| 108 | 113 |
| 109 AudioFrameInputAvailableCallback audio_frame_input_available_callback_; | 114 AudioFrameInputAvailableCallback audio_frame_input_available_callback_; |
| 110 VideoFrameInputAvailableCallback video_frame_input_available_callback_; | 115 VideoFrameInputAvailableCallback video_frame_input_available_callback_; |
| 111 | 116 |
| 112 scoped_ptr<media::cast::RawEventSubscriberBundle> event_subscribers_; | 117 scoped_ptr<media::cast::RawEventSubscriberBundle> event_subscribers_; |
| 113 | 118 |
| 114 // Proxy to the IO message loop. | 119 // Proxy to the IO message loop. |
| 115 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 120 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 116 base::WeakPtrFactory<CastSessionDelegate> weak_factory_; | 121 base::WeakPtrFactory<CastSessionDelegate> weak_factory_; |
| 117 | 122 |
| 118 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); | 123 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
| 119 }; | 124 }; |
| 120 | 125 |
| 121 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 126 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
| OLD | NEW |