OLD | NEW |
---|---|
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 #include "remoting/protocol/video_writer.h" | 5 #include "remoting/protocol/video_writer.h" |
6 | 6 |
7 #include "remoting/protocol/session_config.h" | 7 #include "base/bind.h" |
8 #include "remoting/protocol/protobuf_video_writer.h" | 8 #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.
| |
9 #include "remoting/base/constants.h" | |
10 #include "remoting/proto/video.pb.h" | |
11 #include "remoting/protocol/message_serialization.h" | |
12 #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.
| |
9 | 13 |
10 namespace remoting { | 14 namespace remoting { |
11 namespace protocol { | 15 namespace protocol { |
12 | 16 |
13 VideoWriter::~VideoWriter() { } | 17 VideoWriter::VideoWriter() |
18 : 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
| |
19 } | |
14 | 20 |
15 // static | 21 VideoWriter::~VideoWriter() { |
16 scoped_ptr<VideoWriter> VideoWriter::Create(const SessionConfig& config) { | 22 } |
17 const ChannelConfig& video_config = config.video_config(); | 23 |
18 if (video_config.transport == ChannelConfig::TRANSPORT_STREAM) { | 24 void VideoWriter::OnInitialized() { |
19 return scoped_ptr<VideoWriter>(new ProtobufVideoWriter()); | 25 // 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.
| |
20 } | 26 buffered_writer_.Init( |
21 return scoped_ptr<VideoWriter>(); | 27 channel(), BufferedSocketWriter::WriteFailedCallback()); |
28 } | |
29 | |
30 void VideoWriter::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | |
31 const base::Closure& done) { | |
32 buffered_writer_.Write(SerializeAndFrameMessage(*packet), done); | |
22 } | 33 } |
23 | 34 |
24 } // namespace protocol | 35 } // namespace protocol |
25 } // namespace remoting | 36 } // namespace remoting |
OLD | NEW |