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 26 matching lines...) Expand all Loading... | |
37 | 37 |
38 // This class hosts CastSender and connects it to audio/video frame input | 38 // This class hosts CastSender and connects it to audio/video frame input |
39 // and network socket. | 39 // and network socket. |
40 // This class is created on the render thread and destroyed on the IO | 40 // This class is created on the render thread and destroyed on the IO |
41 // thread. All methods are accessible only on the IO thread. | 41 // thread. All methods are accessible only on the IO thread. |
42 class CastSessionDelegate { | 42 class CastSessionDelegate { |
43 public: | 43 public: |
44 typedef base::Callback<void(const scoped_refptr<media::cast::FrameInput>&)> | 44 typedef base::Callback<void(const scoped_refptr<media::cast::FrameInput>&)> |
45 FrameInputAvailableCallback; | 45 FrameInputAvailableCallback; |
46 typedef base::Callback<void(scoped_ptr<std::string>)> EventLogsCallback; | 46 typedef base::Callback<void(scoped_ptr<std::string>)> EventLogsCallback; |
47 typedef base::Callback<void(scoped_ptr<std::string>)> StatsCallback; | |
47 | 48 |
48 CastSessionDelegate(); | 49 CastSessionDelegate(); |
49 virtual ~CastSessionDelegate(); | 50 virtual ~CastSessionDelegate(); |
50 | 51 |
51 // After calling StartAudio() or StartVideo() encoding of that media will | 52 // After calling StartAudio() or StartVideo() encoding of that media will |
52 // begin as soon as data is delivered to its sink, if the second method is | 53 // begin as soon as data is delivered to its sink, if the second method is |
53 // called the first media will be restarted. It is strongly recommended not to | 54 // called the first media will be restarted. It is strongly recommended not to |
54 // deliver any data between calling the two methods. | 55 // deliver any data between calling the two methods. |
55 // It's OK to call only one of the two methods. | 56 // It's OK to call only one of the two methods. |
56 void StartAudio(const media::cast::AudioSenderConfig& config, | 57 void StartAudio(const media::cast::AudioSenderConfig& config, |
57 const FrameInputAvailableCallback& callback); | 58 const FrameInputAvailableCallback& callback); |
58 void StartVideo(const media::cast::VideoSenderConfig& config, | 59 void StartVideo(const media::cast::VideoSenderConfig& config, |
59 const FrameInputAvailableCallback& callback); | 60 const FrameInputAvailableCallback& callback); |
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); |
62 | 63 |
63 void ToggleLogging(bool is_audio, bool enable); | 64 void ToggleLogging(bool is_audio, bool enable); |
64 void GetEventLogsAndReset(bool is_audio, const EventLogsCallback& callback); | 65 void GetEventLogsAndReset(bool is_audio, const EventLogsCallback& callback); |
66 void GetStatsAndReset(bool is_audio, const StatsCallback& callback); | |
Alpha Left Google
2014/03/03 07:11:39
Should be just GetStats.
imcheng
2014/03/04 02:06:24
See other comment.
| |
65 | 67 |
66 protected: | 68 protected: |
67 // Callback with the result of the initialization. | 69 // Callback with the result of the initialization. |
68 // If this callback is called with STATUS_INITIALIZED it will report back | 70 // If this callback is called with STATUS_INITIALIZED it will report back |
69 // to the sinks that it's ready to accept incoming audio / video frames. | 71 // to the sinks that it's ready to accept incoming audio / video frames. |
70 void InitializationResult(media::cast::CastInitializationStatus result) const; | 72 void InitializationResult(media::cast::CastInitializationStatus result) const; |
71 | 73 |
72 private: | 74 private: |
73 // Start encoding threads and initialize the CastEnvironment. | 75 // Start encoding threads and initialize the CastEnvironment. |
74 void Initialize(); | 76 void Initialize(); |
(...skipping 24 matching lines...) Expand all Loading... | |
99 scoped_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber_; | 101 scoped_ptr<media::cast::EncodingEventSubscriber> audio_event_subscriber_; |
100 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; | 102 scoped_ptr<media::cast::EncodingEventSubscriber> video_event_subscriber_; |
101 | 103 |
102 // Proxy to the IO message loop. | 104 // Proxy to the IO message loop. |
103 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 105 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
104 | 106 |
105 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); | 107 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); |
106 }; | 108 }; |
107 | 109 |
108 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ | 110 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ |
OLD | NEW |