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

Unified Diff: remoting/protocol/video_reader.h

Issue 577473002: Simplify VideoReader and VideoWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/video_reader.h
diff --git a/remoting/protocol/video_reader.h b/remoting/protocol/video_reader.h
index 63582cf73813401fe7ef415a49c812c42c89801f..430a4ea2fff3d104a49de3ca3c7aeff31eeaec3e 100644
--- a/remoting/protocol/video_reader.h
+++ b/remoting/protocol/video_reader.h
@@ -2,44 +2,46 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// VideoReader is a generic interface used by ConnectionToHost to read
-// video stream. ProtobufVideoReader implements this interface for
-// protobuf video stream.
-
#ifndef REMOTING_PROTOCOL_VIDEO_READER_H_
#define REMOTING_PROTOCOL_VIDEO_READER_H_
-#include "base/callback.h"
-#include "base/memory/scoped_ptr.h"
-#include "remoting/protocol/video_stub.h"
+#include "base/compiler_specific.h"
+#include "remoting/proto/video.pb.h"
+#include "remoting/protocol/channel_dispatcher_base.h"
+#include "remoting/protocol/message_reader.h"
+
+namespace net {
+class StreamSocket;
+} // namespace net
namespace remoting {
namespace protocol {
+class StreamChannelFactory;
class Session;
-class SessionConfig;
+class VideoStub;
-class VideoReader {
+class VideoReader : public ChannelDispatcherBase {
public:
- // The callback is called when initialization is finished. The
- // parameter is set to true on success.
- typedef base::Callback<void(bool)> InitializedCallback;
-
+ VideoReader();
virtual ~VideoReader();
- static scoped_ptr<VideoReader> Create(const SessionConfig& config);
-
- // Initializies the reader. Doesn't take ownership of either |connection|
- // or |video_stub|.
- virtual void Init(Session* session,
- VideoStub* video_stub,
- const InitializedCallback& callback) = 0;
- virtual bool is_connected() = 0;
+ void set_video_stub(VideoStub* video_stub) { video_stub_ = video_stub; }
Wez 2014/09/16 23:10:07 Why does this need a setter rather than being a co
Sergey Ulanov 2014/09/17 21:52:06 This is consistent with other channel dispatchers.
Wez 2014/09/18 00:23:54 Acknowledged.
protected:
- VideoReader() { }
+ // ChannelDispatcherBase overrides.
+ virtual void OnInitialized() OVERRIDE;
private:
+ void OnNewData(scoped_ptr<VideoPacket> packet,
+ const base::Closure& done_task);
Wez 2014/09/16 23:10:06 OnVideoPacket?
Sergey Ulanov 2014/09/17 21:52:06 Done.
+
+ StreamChannelFactory* channel_factory_;
Wez 2014/09/16 23:10:06 This doesn't seem to be used?
Sergey Ulanov 2014/09/17 21:52:06 Done.
+ ProtobufMessageReader<VideoPacket> reader_;
Wez 2014/09/16 23:10:06 It ends up looking a little strange to have VideoR
Sergey Ulanov 2014/09/17 21:52:06 Renamed this class
+
+ // The stub that processes all received packets.
Wez 2014/09/16 23:10:06 Or "Interface to which VideoPackets are passed for
Sergey Ulanov 2014/09/17 21:52:06 Done.
+ VideoStub* video_stub_;
+
DISALLOW_COPY_AND_ASSIGN(VideoReader);
};

Powered by Google App Engine
This is Rietveld 408576698