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

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

Issue 9827006: Refactor VideoStub interface to accept ownership of video packets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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_READER_H_ 5 #ifndef REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_
6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ 6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "remoting/proto/video.pb.h" 9 #include "remoting/proto/video.pb.h"
10 #include "remoting/protocol/message_reader.h" 10 #include "remoting/protocol/message_reader.h"
(...skipping 14 matching lines...) Expand all
25 virtual ~ProtobufVideoReader(); 25 virtual ~ProtobufVideoReader();
26 26
27 // VideoReader interface. 27 // VideoReader interface.
28 virtual void Init(protocol::Session* session, 28 virtual void Init(protocol::Session* session,
29 VideoStub* video_stub, 29 VideoStub* video_stub,
30 const InitializedCallback& callback) OVERRIDE; 30 const InitializedCallback& callback) OVERRIDE;
31 virtual bool is_connected() OVERRIDE; 31 virtual bool is_connected() OVERRIDE;
32 32
33 private: 33 private:
34 void OnChannelReady(scoped_ptr<net::StreamSocket> socket); 34 void OnChannelReady(scoped_ptr<net::StreamSocket> socket);
35 void OnNewData(VideoPacket* packet, const base::Closure& done_task); 35 void OnNewData(scoped_ptr<VideoPacket> packet,
36 const base::Closure& done_task);
36 37
37 Session* session_; 38 Session* session_;
38 39
39 InitializedCallback initialized_callback_; 40 InitializedCallback initialized_callback_;
40 41
41 VideoPacketFormat::Encoding encoding_; 42 VideoPacketFormat::Encoding encoding_;
42 43
43 // TODO(sergeyu): Remove |channel_| and let |reader_| own it. 44 // TODO(sergeyu): Remove |channel_| and let |reader_| own it.
44 scoped_ptr<net::StreamSocket> channel_; 45 scoped_ptr<net::StreamSocket> channel_;
45 46
46 ProtobufMessageReader<VideoPacket> reader_; 47 ProtobufMessageReader<VideoPacket> reader_;
47 48
48 // The stub that processes all received packets. 49 // The stub that processes all received packets.
49 VideoStub* video_stub_; 50 VideoStub* video_stub_;
50 51
51 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoReader); 52 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoReader);
52 }; 53 };
53 54
54 } // namespace protocol 55 } // namespace protocol
55 } // namespace remoting 56 } // namespace remoting
56 57
57 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_ 58 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_READER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/message_reader_unittest.cc ('k') | remoting/protocol/protobuf_video_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698