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

Side by Side Diff: remoting/protocol/rtp_video_writer.cc

Issue 7218061: Close all writers before JingleSession is destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 9 years, 5 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/rtp_video_writer.h ('k') | remoting/protocol/rtp_video_writer_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/rtp_video_writer.h" 5 #include "remoting/protocol/rtp_video_writer.h"
6 6
7 #include "base/task.h" 7 #include "base/task.h"
8 #include "net/base/io_buffer.h" 8 #include "net/base/io_buffer.h"
9 #include "remoting/base/compound_buffer.h" 9 #include "remoting/base/compound_buffer.h"
10 #include "remoting/proto/video.pb.h" 10 #include "remoting/proto/video.pb.h"
11 #include "remoting/protocol/rtp_writer.h" 11 #include "remoting/protocol/rtp_writer.h"
12 #include "remoting/protocol/session.h" 12 #include "remoting/protocol/session.h"
13 13
14 namespace remoting { 14 namespace remoting {
15 namespace protocol { 15 namespace protocol {
16 16
17 namespace { 17 namespace {
18 const int kMtu = 1200; 18 const int kMtu = 1200;
19 } // namespace 19 } // namespace
20 20
21 RtpVideoWriter::RtpVideoWriter() { } 21 RtpVideoWriter::RtpVideoWriter() { }
22 22
23 RtpVideoWriter::~RtpVideoWriter() { } 23 RtpVideoWriter::~RtpVideoWriter() {
24 Close();
25 }
24 26
25 void RtpVideoWriter::Init(protocol::Session* session) { 27 void RtpVideoWriter::Init(protocol::Session* session) {
26 rtp_writer_.Init(session->video_rtp_channel()); 28 rtp_writer_.Init(session->video_rtp_channel());
27 } 29 }
28 30
31 void RtpVideoWriter::Close() {
32 rtp_writer_.Close();
33 }
34
29 void RtpVideoWriter::ProcessVideoPacket(const VideoPacket* packet, Task* done) { 35 void RtpVideoWriter::ProcessVideoPacket(const VideoPacket* packet, Task* done) {
30 CHECK(packet->format().encoding() == VideoPacketFormat::ENCODING_VP8) 36 CHECK(packet->format().encoding() == VideoPacketFormat::ENCODING_VP8)
31 << "Only VP8 is supported in RTP."; 37 << "Only VP8 is supported in RTP.";
32 38
33 CompoundBuffer payload; 39 CompoundBuffer payload;
34 // TODO(sergeyu): This copy would not be necessary CompoundBuffer was used 40 // TODO(sergeyu): This copy would not be necessary CompoundBuffer was used
35 // inside of VideoPacket. 41 // inside of VideoPacket.
36 payload.AppendCopyOf(packet->data().data(), packet->data().size()); 42 payload.AppendCopyOf(packet->data().data(), packet->data().size());
37 43
38 Vp8Descriptor vp8_desriptor; 44 Vp8Descriptor vp8_desriptor;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 done->Run(); 89 done->Run();
84 delete done; 90 delete done;
85 } 91 }
86 92
87 int RtpVideoWriter::GetPendingPackets() { 93 int RtpVideoWriter::GetPendingPackets() {
88 return rtp_writer_.GetPendingPackets(); 94 return rtp_writer_.GetPendingPackets();
89 } 95 }
90 96
91 } // namespace protocol 97 } // namespace protocol
92 } // namespace remoting 98 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/rtp_video_writer.h ('k') | remoting/protocol/rtp_video_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698