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

Unified Diff: remoting/protocol/video_writer.cc

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_writer.cc
diff --git a/remoting/protocol/video_writer.cc b/remoting/protocol/video_writer.cc
index 736e8ec0ec1db4c44a8b7acd89ecac2aed2ede6e..72565150edec911d3a119f4afc4d4bd7a6f2f7ef 100644
--- a/remoting/protocol/video_writer.cc
+++ b/remoting/protocol/video_writer.cc
@@ -4,21 +4,32 @@
#include "remoting/protocol/video_writer.h"
-#include "remoting/protocol/session_config.h"
-#include "remoting/protocol/protobuf_video_writer.h"
+#include "base/bind.h"
+#include "net/socket/stream_socket.h"
Wez 2014/09/16 23:10:07 Is StreamSocket actually used here, or is the forw
Sergey Ulanov 2014/09/17 21:52:06 It's needed to upcast net::StreamSocket to net::So
Wez 2014/09/18 00:23:55 Acknowledged.
+#include "remoting/base/constants.h"
+#include "remoting/proto/video.pb.h"
+#include "remoting/protocol/message_serialization.h"
+#include "remoting/protocol/stream_channel_factory.h"
Wez 2014/09/16 23:10:07 Not used?
Sergey Ulanov 2014/09/17 21:52:06 Done.
namespace remoting {
namespace protocol {
-VideoWriter::~VideoWriter() { }
+VideoWriter::VideoWriter()
+ : ChannelDispatcherBase(kVideoChannelName) {
Wez 2014/09/16 23:10:07 Similar comment applies re channel name in VideoWr
Sergey Ulanov 2014/09/17 21:52:06 Renamed
+}
+
+VideoWriter::~VideoWriter() {
+}
+
+void VideoWriter::OnInitialized() {
+ // TODO(sergeyu): Provide WriteFailedCallback for the buffered writer.
Wez 2014/09/16 23:10:07 What will happen with it NULL like this? Crash?
Sergey Ulanov 2014/09/17 21:52:07 BufferedSocketWriter doesn't call it if it's NULL.
+ buffered_writer_.Init(
+ channel(), BufferedSocketWriter::WriteFailedCallback());
+}
-// static
-scoped_ptr<VideoWriter> VideoWriter::Create(const SessionConfig& config) {
- const ChannelConfig& video_config = config.video_config();
- if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) {
- return scoped_ptr<VideoWriter>(new ProtobufVideoWriter());
- }
- return scoped_ptr<VideoWriter>();
+void VideoWriter::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
+ const base::Closure& done) {
+ buffered_writer_.Write(SerializeAndFrameMessage(*packet), done);
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698