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

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

Issue 138753004: Cast: IPC glue between cast library transport and encoders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added rtp statistics callbacks Created 6 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
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 MessageLoopProxy; 17 class MessageLoopProxy;
18 } // namespace base 18 } // namespace base
19 19
20 namespace media { 20 namespace media {
21 class VideoFrame; 21 class VideoFrame;
22 namespace cast { 22 namespace cast {
23 class FrameInput; 23 class FrameInput;
24 struct AudioSenderConfig; 24 struct AudioSenderConfig;
25 struct VideoSenderConfig; 25 struct VideoSenderConfig;
26 } // namespace cast 26 } // namespace cast
27 } // namespace media 27 } // namespace media
28 28
29 namespace content{ 29 namespace content{
scherkus (not reviewing) 2014/02/07 00:11:06 space before {
hubbe 2014/02/07 00:52:22 Done.
30 class P2PSocketClient; 30 class P2PSocketClient;
31 } // namespace content 31 } // namespace content
32 32
33 class CastSessionDelegate; 33 class CastSessionDelegate;
34 34
35 namespace cast{
scherkus (not reviewing) 2014/02/07 00:11:06 space before {
hubbe 2014/02/07 00:52:22 Done.
36 class CastIPCDispatcher;
37 };
scherkus (not reviewing) 2014/02/07 00:11:06 don't need ;
hubbe 2014/02/07 00:52:22 Done.
38
35 // This class represents a Cast session and allows the session to be 39 // This class represents a Cast session and allows the session to be
36 // configured on the main thread. Actual work is forwarded to 40 // configured on the main thread. Actual work is forwarded to
37 // CastSessionDelegate on the IO thread. 41 // CastSessionDelegate on the IO thread.
38 class CastSession : public base::RefCounted<CastSession> { 42 class CastSession : public base::RefCounted<CastSession> {
39 public: 43 public:
40 typedef 44 typedef
41 base::Callback<void(const scoped_refptr<media::cast::FrameInput>&)> 45 base::Callback<void(const scoped_refptr<media::cast::FrameInput>&)>
42 FrameInputAvailableCallback; 46 FrameInputAvailableCallback;
43 typedef base::Callback<void(const std::vector<char>&)> SendPacketCallback; 47 typedef base::Callback<void(const std::vector<char>&)> SendPacketCallback;
44 48
45 CastSession(); 49 CastSession();
46 50
47 // Start encoding of audio and video using the provided configuration. 51 // Start encoding of audio and video using the provided configuration.
48 // 52 //
49 // When Cast sender is started and ready to be used 53 // When Cast sender is started and ready to be used
50 // media::cast::FrameInput will be given through the callback. The 54 // media::cast::FrameInput will be given through the callback. The
51 // callback will be made on the main thread. 55 // callback will be made on the main thread.
52 void StartAudio(const media::cast::AudioSenderConfig& config, 56 void StartAudio(const media::cast::AudioSenderConfig& config,
53 const FrameInputAvailableCallback& callback); 57 const FrameInputAvailableCallback& callback);
54 void StartVideo(const media::cast::VideoSenderConfig& config, 58 void StartVideo(const media::cast::VideoSenderConfig& config,
55 const FrameInputAvailableCallback& callback); 59 const FrameInputAvailableCallback& callback);
60 void StartUDP(const net::IPEndPoint& local_endpoint,
61 const net::IPEndPoint& remote_endpoint);
56 62
57 private: 63 private:
58 friend class base::RefCounted<CastSession>; 64 friend class base::RefCounted<CastSession>;
59 virtual ~CastSession(); 65 virtual ~CastSession();
60 66
61 // This member should never be dereferenced on the main thread. 67 // This member should never be dereferenced on the main thread.
62 // CastSessionDelegate lives only on the IO thread. It is always 68 // CastSessionDelegate lives only on the IO thread. It is always
63 // safe to post task on the IO thread to access CastSessionDelegate 69 // safe to post task on the IO thread to access CastSessionDelegate
64 // because it is owned by this object. 70 // because it is owned by this object.
65 scoped_ptr<CastSessionDelegate> delegate_; 71 scoped_ptr<CastSessionDelegate> delegate_;
66 72
67 // Proxy to the IO message loop. 73 // Proxy to the IO message loop.
68 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; 74 const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
69 75
70 DISALLOW_COPY_AND_ASSIGN(CastSession); 76 DISALLOW_COPY_AND_ASSIGN(CastSession);
71 }; 77 };
72 78
73 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_H_ 79 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698