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

Side by Side Diff: remoting/protocol/protobuf_video_writer.h

Issue 10823323: Add support for multiplexed channels in remoting::protocol::Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ~ Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ 5 #ifndef REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_
6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ 6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "remoting/protocol/buffered_socket_writer.h" 13 #include "remoting/protocol/buffered_socket_writer.h"
14 #include "remoting/protocol/video_writer.h" 14 #include "remoting/protocol/video_writer.h"
15 15
16 namespace net { 16 namespace net {
17 class StreamSocket; 17 class StreamSocket;
18 } // namespace net 18 } // namespace net
19 19
20 namespace remoting { 20 namespace remoting {
21 namespace protocol { 21 namespace protocol {
22 22
23 class ChannelFactory;
23 class Session; 24 class Session;
24 25
25 class ProtobufVideoWriter : public VideoWriter { 26 class ProtobufVideoWriter : public VideoWriter {
26 public: 27 public:
27 ProtobufVideoWriter(); 28 ProtobufVideoWriter();
28 virtual ~ProtobufVideoWriter(); 29 virtual ~ProtobufVideoWriter();
29 30
30 // VideoWriter interface. 31 // VideoWriter interface.
31 virtual void Init(protocol::Session* session, 32 virtual void Init(protocol::Session* session,
32 const InitializedCallback& callback) OVERRIDE; 33 const InitializedCallback& callback) OVERRIDE;
33 virtual void Close() OVERRIDE; 34 virtual void Close() OVERRIDE;
34 virtual bool is_connected() OVERRIDE; 35 virtual bool is_connected() OVERRIDE;
35 36
36 // VideoStub interface. 37 // VideoStub interface.
37 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, 38 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
38 const base::Closure& done) OVERRIDE; 39 const base::Closure& done) OVERRIDE;
39 virtual int GetPendingVideoPackets() OVERRIDE; 40 virtual int GetPendingVideoPackets() OVERRIDE;
40 41
41 private: 42 private:
42 void OnChannelReady(scoped_ptr<net::StreamSocket> socket); 43 void OnChannelReady(scoped_ptr<net::StreamSocket> socket);
43 44
44 Session* session_; 45 ChannelFactory* channel_factory_;
Wez 2012/08/18 00:30:36 nit: Place near |channel_|?
Sergey Ulanov 2012/08/18 01:53:56 Done.
45 46
46 InitializedCallback initialized_callback_; 47 InitializedCallback initialized_callback_;
47 48
48 // TODO(sergeyu): Remove |channel_| and let |buffered_writer_| own it. 49 // TODO(sergeyu): Remove |channel_| and let |buffered_writer_| own it.
49 scoped_ptr<net::StreamSocket> channel_; 50 scoped_ptr<net::StreamSocket> channel_;
50 51
51 BufferedSocketWriter buffered_writer_; 52 BufferedSocketWriter buffered_writer_;
52 53
53 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoWriter); 54 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoWriter);
54 }; 55 };
55 56
56 } // namespace protocol 57 } // namespace protocol
57 } // namespace remoting 58 } // namespace remoting
58 59
59 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ 60 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698