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

Unified Diff: remoting/protocol/protobuf_audio_writer.cc

Issue 10535153: Added files for audio writers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed a small style issue 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/protobuf_audio_writer.cc
diff --git a/remoting/protocol/protobuf_video_writer.cc b/remoting/protocol/protobuf_audio_writer.cc
similarity index 61%
copy from remoting/protocol/protobuf_video_writer.cc
copy to remoting/protocol/protobuf_audio_writer.cc
index a0ca271d21ec3383ee2f2698a7c892fcce8dca2b..a277a01a656bda8e22ba6b1f2f3ccff26fec58f4 100644
--- a/remoting/protocol/protobuf_video_writer.cc
+++ b/remoting/protocol/protobuf_audio_writer.cc
@@ -2,37 +2,37 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/protocol/protobuf_video_writer.h"
+#include "remoting/protocol/protobuf_audio_writer.h"
#include "base/bind.h"
#include "net/socket/stream_socket.h"
#include "remoting/base/constants.h"
-#include "remoting/proto/video.pb.h"
+#include "remoting/proto/audio.pb.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/util.h"
namespace remoting {
namespace protocol {
-ProtobufVideoWriter::ProtobufVideoWriter()
+ProtobufAudioWriter::ProtobufAudioWriter()
: session_(NULL) {
}
-ProtobufVideoWriter::~ProtobufVideoWriter() {
+ProtobufAudioWriter::~ProtobufAudioWriter() {
Close();
}
-void ProtobufVideoWriter::Init(protocol::Session* session,
+void ProtobufAudioWriter::Init(protocol::Session* session,
const InitializedCallback& callback) {
session_ = session;
initialized_callback_ = callback;
session_->CreateStreamChannel(
- kVideoChannelName,
- base::Bind(&ProtobufVideoWriter::OnChannelReady, base::Unretained(this)));
+ kAudioChannelName,
+ base::Bind(&ProtobufAudioWriter::OnChannelReady, base::Unretained(this)));
}
-void ProtobufVideoWriter::OnChannelReady(scoped_ptr<net::StreamSocket> socket) {
+void ProtobufAudioWriter::OnChannelReady(scoped_ptr<net::StreamSocket> socket) {
if (!socket.get()) {
initialized_callback_.Run(false);
return;
@@ -40,34 +40,30 @@ void ProtobufVideoWriter::OnChannelReady(scoped_ptr<net::StreamSocket> socket) {
DCHECK(!channel_.get());
channel_ = socket.Pass();
- // TODO(sergeyu): Provide WriteFailedCallback for the buffered writer.
+ // TODO(kxing): Provide WriteFailedCallback for the buffered writer.
buffered_writer_.Init(
channel_.get(), BufferedSocketWriter::WriteFailedCallback());
initialized_callback_.Run(true);
}
-void ProtobufVideoWriter::Close() {
+void ProtobufAudioWriter::Close() {
buffered_writer_.Close();
channel_.reset();
if (session_) {
- session_->CancelChannelCreation(kVideoChannelName);
+ session_->CancelChannelCreation(kAudioChannelName);
session_ = NULL;
}
}
-bool ProtobufVideoWriter::is_connected() {
+bool ProtobufAudioWriter::is_connected() {
return channel_.get() != NULL;
}
-void ProtobufVideoWriter::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
+void ProtobufAudioWriter::ProcessAudioPacket(scoped_ptr<AudioPacket> packet,
const base::Closure& done) {
buffered_writer_.Write(SerializeAndFrameMessage(*packet), done);
}
-int ProtobufVideoWriter::GetPendingPackets() {
- return buffered_writer_.GetBufferChunks();
-}
-
} // namespace protocol
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698