OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RECEIVER_SESSION_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ |
6 #define CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "chrome/renderer/media/cast_receiver_session_delegate.h" | 10 #include "chrome/renderer/media/cast_receiver_session_delegate.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Five first parameters are passed to cast receiver. | 42 // Five first parameters are passed to cast receiver. |
43 // |start_callback| is called when initialization is done. | 43 // |start_callback| is called when initialization is done. |
44 // TODO(hubbe): Currently the audio component of the returned media | 44 // TODO(hubbe): Currently the audio component of the returned media |
45 // stream only the exact format that the sender is sending us. | 45 // stream only the exact format that the sender is sending us. |
46 void Start(const media::cast::FrameReceiverConfig& audio_config, | 46 void Start(const media::cast::FrameReceiverConfig& audio_config, |
47 const media::cast::FrameReceiverConfig& video_config, | 47 const media::cast::FrameReceiverConfig& video_config, |
48 const net::IPEndPoint& local_endpoint, | 48 const net::IPEndPoint& local_endpoint, |
49 const net::IPEndPoint& remote_endpoint, | 49 const net::IPEndPoint& remote_endpoint, |
50 scoped_ptr<base::DictionaryValue> options, | 50 scoped_ptr<base::DictionaryValue> options, |
51 const media::VideoCaptureFormat& capture_format, | 51 const media::VideoCaptureFormat& capture_format, |
52 const StartCB& start_callback); | 52 const StartCB& start_callback, |
| 53 const CastReceiverSessionDelegate::ErrorCallback& error_callback); |
53 | 54 |
54 private: | 55 private: |
55 class VideoCapturerSource; | 56 class VideoCapturerSource; |
56 class AudioCapturerSource; | 57 class AudioCapturerSource; |
57 friend class base::RefCounted<CastReceiverSession>; | 58 friend class base::RefCounted<CastReceiverSession>; |
58 virtual ~CastReceiverSession(); | 59 virtual ~CastReceiverSession(); |
59 void StartAudio(scoped_refptr<CastReceiverAudioValve> audio_valve); | 60 void StartAudio(scoped_refptr<CastReceiverAudioValve> audio_valve); |
60 | 61 |
61 void StartVideo(content::VideoCaptureDeliverFrameCB frame_callback); | 62 void StartVideo(content::VideoCaptureDeliverFrameCB frame_callback); |
62 // Stop Video callbacks. | 63 // Stop Video callbacks. |
63 // Note that this returns immediately, but callbacks do not stop immediately. | 64 // Note that this returns immediately, but callbacks do not stop immediately. |
64 void StopVideo(); | 65 void StopVideo(); |
65 | 66 |
66 media::cast::FrameReceiverConfig audio_config_; | 67 media::cast::FrameReceiverConfig audio_config_; |
67 media::cast::FrameReceiverConfig video_config_; | 68 media::cast::FrameReceiverConfig video_config_; |
68 scoped_ptr<CastReceiverSessionDelegate> delegate_; | 69 scoped_ptr<CastReceiverSessionDelegate> delegate_; |
69 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 70 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
70 media::VideoCaptureFormat format_; | 71 media::VideoCaptureFormat format_; |
71 | 72 |
72 DISALLOW_COPY_AND_ASSIGN(CastReceiverSession); | 73 DISALLOW_COPY_AND_ASSIGN(CastReceiverSession); |
73 }; | 74 }; |
74 | 75 |
75 #endif // CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ | 76 #endif // CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ |
OLD | NEW |