This source file includes following definitions.
- OnInitialized
- ProcessAudioPacket
- Create
#include "remoting/protocol/audio_writer.h"
#include "base/bind.h"
#include "net/socket/stream_socket.h"
#include "remoting/base/constants.h"
#include "remoting/proto/audio.pb.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/session_config.h"
#include "remoting/protocol/util.h"
namespace remoting {
namespace protocol {
AudioWriter::AudioWriter()
: ChannelDispatcherBase(kAudioChannelName) {
}
AudioWriter::~AudioWriter() {
}
void AudioWriter::OnInitialized() {
buffered_writer_.Init(
channel(), BufferedSocketWriter::WriteFailedCallback());
}
void AudioWriter::ProcessAudioPacket(scoped_ptr<AudioPacket> packet,
const base::Closure& done) {
buffered_writer_.Write(SerializeAndFrameMessage(*packet), done);
}
scoped_ptr<AudioWriter> AudioWriter::Create(const SessionConfig& config) {
if (!config.is_audio_enabled())
return scoped_ptr<AudioWriter>();
return scoped_ptr<AudioWriter>(new AudioWriter());
}
}
}