Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: chrome/renderer/media/cast_receiver_session.h

Issue 883293005: Cast: Basic cast_receiver API for chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_
6 #define CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "chrome/renderer/media/cast_receiver_session_delegate.h"
11
12 namespace blink {
13 class WebMediaStream;
14 }
15
16 namespace media {
17 class VideoCaptureFormat;
18 }
19
20 namespace net {
21 class IPEndPoint;
22 }
23
24
25 namespace base {
26 class DictionaryValue;
27 }
28
29 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.
30 public:
31 CastReceiverSession();
32
33 typedef base::Callback<void(const blink::WebMediaStream)> StartCB;
34
35 // Note that the cast receiver will start responding to
36 // 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.
37 // StartAudio/StartVideo is called.
38 // Five first parameters are passed to cast receiver.
39 // |start_callback| is called when initialization is done.
40 void Start(const media::cast::FrameReceiverConfig& audio_config,
41 const media::cast::FrameReceiverConfig& video_config,
42 const net::IPEndPoint& local_endpoint,
43 const net::IPEndPoint& remote_endpoint,
44 scoped_ptr<base::DictionaryValue> options,
45 const media::VideoCaptureFormat& capture_format,
46 const StartCB& start_callback);
47
48 private:
49 // friend class CastStreamingVideoSource;
50 friend class CastVideoCapturerSource;
51 friend class CastStreamingAudioCaptureSource;
52 friend class base::RefCounted<CastReceiverSession>;
53 ~CastReceiverSession();
Alpha Left Google 2015/02/04 03:07:52 virtual.
hubbe 2015/02/05 20:23:00 Done.
54 void StartAudio(CastReceiverSessionDelegate::AudioCB audio_callback);
55 // Stop Audio callbacks and signal |event| when we know
56 // that there will be no more callbacks.
57 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
58
59 void StartVideo(content::VideoCaptureDeliverFrameCB frame_callback);
60 // Stop Video callbacks and signal |event| when we know
61 // that there will be no more callbacks.
62 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
63
64 const media::VideoCaptureFormat& format() {
65 return format_;
66 }
67
68 const media::cast::FrameReceiverConfig audio_config_;
69 const media::cast::FrameReceiverConfig video_config_;
70 scoped_ptr<CastReceiverSessionDelegate> delegate_;
71 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
72 media::VideoCaptureFormat format_;
73
74 DISALLOW_COPY_AND_ASSIGN(CastReceiverSession);
75 };
76
77 #endif // CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698