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

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

Issue 10556020: Cleaned up the reader and writer create methods to return scoped_ptr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unnecessary code Created 8 years, 6 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
« no previous file with comments | « remoting/protocol/video_reader.cc ('k') | remoting/protocol/video_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // VideoWriter is a generic interface used by ConnectionToClient to 5 // VideoWriter is a generic interface used by ConnectionToClient to
6 // write into the video stream. ProtobufVideoWriter implements this 6 // write into the video stream. ProtobufVideoWriter implements this
7 // interface for protobuf video streams. 7 // interface for protobuf video streams.
8 8
9 #ifndef REMOTING_PROTOCOL_VIDEO_WRITER_H_ 9 #ifndef REMOTING_PROTOCOL_VIDEO_WRITER_H_
10 #define REMOTING_PROTOCOL_VIDEO_WRITER_H_ 10 #define REMOTING_PROTOCOL_VIDEO_WRITER_H_
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "remoting/protocol/video_stub.h" 14 #include "remoting/protocol/video_stub.h"
15 15
16 namespace remoting { 16 namespace remoting {
17 namespace protocol { 17 namespace protocol {
18 18
19 class Session; 19 class Session;
20 class SessionConfig; 20 class SessionConfig;
21 21
22 class VideoWriter : public VideoStub { 22 class VideoWriter : public VideoStub {
23 public: 23 public:
24 virtual ~VideoWriter(); 24 virtual ~VideoWriter();
25 25
26 // The callback is called when initialization is finished. The 26 // The callback is called when initialization is finished. The
27 // parameter is set to true on success. 27 // parameter is set to true on success.
28 typedef base::Callback<void(bool)> InitializedCallback; 28 typedef base::Callback<void(bool)> InitializedCallback;
29 29
30 static VideoWriter* Create(const SessionConfig& config); 30 static scoped_ptr<VideoWriter> Create(const SessionConfig& config);
31 31
32 // Initializes the writer. 32 // Initializes the writer.
33 virtual void Init(Session* session, const InitializedCallback& callback) = 0; 33 virtual void Init(Session* session, const InitializedCallback& callback) = 0;
34 34
35 // Stops writing. Must be called on the network thread before this 35 // Stops writing. Must be called on the network thread before this
36 // object is destroyed. 36 // object is destroyed.
37 virtual void Close() = 0; 37 virtual void Close() = 0;
38 38
39 // Returns true if the channel is connected. 39 // Returns true if the channel is connected.
40 virtual bool is_connected() = 0; 40 virtual bool is_connected() = 0;
41 41
42 protected: 42 protected:
43 VideoWriter() { } 43 VideoWriter() { }
44 44
45 private: 45 private:
46 DISALLOW_COPY_AND_ASSIGN(VideoWriter); 46 DISALLOW_COPY_AND_ASSIGN(VideoWriter);
47 }; 47 };
48 48
49 } // namespace protocol 49 } // namespace protocol
50 } // namespace remoting 50 } // namespace remoting
51 51
52 #endif // REMOTING_PROTOCOL_VIDEO_WRITER_H_ 52 #endif // REMOTING_PROTOCOL_VIDEO_WRITER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/video_reader.cc ('k') | remoting/protocol/video_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698