| 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_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_SESSION_H_ |
| 6 #define CHROME_RENDERER_MEDIA_CAST_SESSION_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_SESSION_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "net/base/ip_endpoint.h" | 14 #include "net/base/ip_endpoint.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class BinaryValue; |
| 17 class DictionaryValue; | 18 class DictionaryValue; |
| 18 class MessageLoopProxy; | 19 class MessageLoopProxy; |
| 19 } // namespace base | 20 } // namespace base |
| 20 | 21 |
| 21 namespace media { | 22 namespace media { |
| 22 class VideoFrame; | 23 class VideoFrame; |
| 23 namespace cast { | 24 namespace cast { |
| 24 class AudioFrameInput; | 25 class AudioFrameInput; |
| 25 class VideoFrameInput; | 26 class VideoFrameInput; |
| 26 struct AudioSenderConfig; | 27 struct AudioSenderConfig; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 // This class represents a Cast session and allows the session to be | 38 // This class represents a Cast session and allows the session to be |
| 38 // configured on the main thread. Actual work is forwarded to | 39 // configured on the main thread. Actual work is forwarded to |
| 39 // CastSessionDelegate on the IO thread. | 40 // CastSessionDelegate on the IO thread. |
| 40 class CastSession : public base::RefCounted<CastSession> { | 41 class CastSession : public base::RefCounted<CastSession> { |
| 41 public: | 42 public: |
| 42 typedef base::Callback<void(const scoped_refptr< | 43 typedef base::Callback<void(const scoped_refptr< |
| 43 media::cast::AudioFrameInput>&)> AudioFrameInputAvailableCallback; | 44 media::cast::AudioFrameInput>&)> AudioFrameInputAvailableCallback; |
| 44 typedef base::Callback<void(const scoped_refptr< | 45 typedef base::Callback<void(const scoped_refptr< |
| 45 media::cast::VideoFrameInput>&)> VideoFrameInputAvailableCallback; | 46 media::cast::VideoFrameInput>&)> VideoFrameInputAvailableCallback; |
| 46 typedef base::Callback<void(const std::vector<char>&)> SendPacketCallback; | 47 typedef base::Callback<void(const std::vector<char>&)> SendPacketCallback; |
| 47 typedef base::Callback<void(scoped_ptr<std::string>)> EventLogsCallback; | 48 typedef base::Callback<void(scoped_ptr<base::BinaryValue>)> EventLogsCallback; |
| 48 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> StatsCallback; | 49 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> StatsCallback; |
| 49 | 50 |
| 50 CastSession(); | 51 CastSession(); |
| 51 | 52 |
| 52 // Start encoding of audio and video using the provided configuration. | 53 // Start encoding of audio and video using the provided configuration. |
| 53 // | 54 // |
| 54 // When Cast sender is started and ready to be used | 55 // When Cast sender is started and ready to be used |
| 55 // media::cast::FrameInput will be given through the callback. The | 56 // media::cast::FrameInput will be given through the callback. The |
| 56 // callback will be made on the main thread. | 57 // callback will be made on the main thread. |
| 57 void StartAudio(const media::cast::AudioSenderConfig& config, | 58 void StartAudio(const media::cast::AudioSenderConfig& config, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 // because it is owned by this object. | 86 // because it is owned by this object. |
| 86 scoped_ptr<CastSessionDelegate> delegate_; | 87 scoped_ptr<CastSessionDelegate> delegate_; |
| 87 | 88 |
| 88 // Proxy to the IO message loop. | 89 // Proxy to the IO message loop. |
| 89 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 90 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(CastSession); | 92 DISALLOW_COPY_AND_ASSIGN(CastSession); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_H_ | 95 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_H_ |
| OLD | NEW |