Chromium Code Reviews| Index: chrome/renderer/media/cast_receiver_session.h |
| diff --git a/chrome/renderer/media/cast_receiver_session.h b/chrome/renderer/media/cast_receiver_session.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fdc0e4e3b662b73cbca039d8490eab009bf66d84 |
| --- /dev/null |
| +++ b/chrome/renderer/media/cast_receiver_session.h |
| @@ -0,0 +1,77 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ |
| +#define CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "chrome/renderer/media/cast_receiver_session_delegate.h" |
| + |
| +namespace blink { |
| +class WebMediaStream; |
| +} |
| + |
| +namespace media { |
| +class VideoCaptureFormat; |
| +} |
| + |
| +namespace net { |
| +class IPEndPoint; |
| +} |
| + |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} |
| + |
| +class CastReceiverSession : public base::RefCounted<CastReceiverSession> { |
|
Alpha Left Google
2015/02/04 03:07:52
I think this is a render thread object. Please doc
hubbe
2015/02/05 20:23:00
Done.
|
| + public: |
| + CastReceiverSession(); |
| + |
| + typedef base::Callback<void(const blink::WebMediaStream)> StartCB; |
| + |
| + // Note that the cast receiver will start responding to |
| + // incoming streams immediately, buffering input until |
|
Alpha Left Google
2015/02/04 03:07:52
This will be more clear if it reads incoming packe
hubbe
2015/02/05 20:23:00
Done.
|
| + // StartAudio/StartVideo is called. |
| + // Five first parameters are passed to cast receiver. |
| + // |start_callback| is called when initialization is done. |
| + void Start(const media::cast::FrameReceiverConfig& audio_config, |
| + const media::cast::FrameReceiverConfig& video_config, |
| + const net::IPEndPoint& local_endpoint, |
| + const net::IPEndPoint& remote_endpoint, |
| + scoped_ptr<base::DictionaryValue> options, |
| + const media::VideoCaptureFormat& capture_format, |
| + const StartCB& start_callback); |
| + |
| + private: |
| + // friend class CastStreamingVideoSource; |
| + friend class CastVideoCapturerSource; |
| + friend class CastStreamingAudioCaptureSource; |
| + friend class base::RefCounted<CastReceiverSession>; |
| + ~CastReceiverSession(); |
|
Alpha Left Google
2015/02/04 03:07:52
virtual.
hubbe
2015/02/05 20:23:00
Done.
|
| + void StartAudio(CastReceiverSessionDelegate::AudioCB audio_callback); |
| + // Stop Audio callbacks and signal |event| when we know |
| + // that there will be no more callbacks. |
| + void StopAudio(base::WaitableEvent* event); |
|
Alpha Left Google
2015/02/04 03:07:52
Blocking is bad, particularly on render thread.
hubbe
2015/02/05 20:23:00
It doesn't block. The caller may block waiting for
|
| + |
| + void StartVideo(content::VideoCaptureDeliverFrameCB frame_callback); |
| + // Stop Video callbacks and signal |event| when we know |
| + // that there will be no more callbacks. |
| + void StopVideo(base::WaitableEvent* event); |
|
Alpha Left Google
2015/02/04 03:07:52
Same here. Blocking is bad.
hubbe
2015/02/05 20:23:00
Hmm, I might be able to change this.
I just did it
|
| + |
| + const media::VideoCaptureFormat& format() { |
| + return format_; |
| + } |
| + |
| + const media::cast::FrameReceiverConfig audio_config_; |
| + const media::cast::FrameReceiverConfig video_config_; |
| + scoped_ptr<CastReceiverSessionDelegate> delegate_; |
| + const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| + media::VideoCaptureFormat format_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CastReceiverSession); |
| +}; |
| + |
| +#endif // CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_ |