summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/audio_reader.h
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-18 04:17:23 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-18 04:17:23 +0000
commit3e9187d08a26fb43a360a468c18b670bae2dd3b0 (patch)
tree7e3f0071f447b2ef76c2e6d11c08a9bc25e90911 /remoting/protocol/audio_reader.h
parent2c539b896f7cd8e1ff6a1209418a5c7d15b3b6bc (diff)
downloadchromium_src-3e9187d08a26fb43a360a468c18b670bae2dd3b0.zip
chromium_src-3e9187d08a26fb43a360a468c18b670bae2dd3b0.tar.gz
chromium_src-3e9187d08a26fb43a360a468c18b670bae2dd3b0.tar.bz2
Add support for multiplexed channels in remoting::protocol::Session interface.
Now the Session interface has two methods that return channel factories - one for regular channels and one for multiplexed channels. Also refactored AudioReader and AudioWriter to inherit from ChannelDispatcherBase. BUG=137135 Review URL: https://chromiumcodereview.appspot.com/10823323 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/audio_reader.h')
-rw-r--r--remoting/protocol/audio_reader.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/remoting/protocol/audio_reader.h b/remoting/protocol/audio_reader.h
index 2d708db..fe7b806 100644
--- a/remoting/protocol/audio_reader.h
+++ b/remoting/protocol/audio_reader.h
@@ -10,6 +10,7 @@
#include "remoting/proto/audio.pb.h"
#include "remoting/protocol/audio_stub.h"
#include "remoting/protocol/message_reader.h"
+#include "remoting/protocol/channel_dispatcher_base.h"
namespace net {
class StreamSocket;
@@ -21,38 +22,25 @@ namespace protocol {
class Session;
class SessionConfig;
-class AudioReader {
+class AudioReader : public ChannelDispatcherBase {
public:
- // The callback is called when initialization is finished. The
- // parameter is set to true on success.
- typedef base::Callback<void(bool)> InitializedCallback;
+ static scoped_ptr<AudioReader> Create(const SessionConfig& config);
virtual ~AudioReader();
- static scoped_ptr<AudioReader> Create(const SessionConfig& config);
+ void set_audio_stub(AudioStub* audio_stub) { audio_stub_ = audio_stub; }
- // Initializies the reader.
- void Init(Session* session,
- AudioStub* audio_stub,
- const InitializedCallback& callback);
- bool is_connected();
+ protected:
+ virtual void OnInitialized() OVERRIDE;
private:
explicit AudioReader(AudioPacket::Encoding encoding);
- void OnChannelReady(scoped_ptr<net::StreamSocket> socket);
void OnNewData(scoped_ptr<AudioPacket> packet,
const base::Closure& done_task);
- Session* session_;
-
- InitializedCallback initialized_callback_;
-
AudioPacket::Encoding encoding_;
- // TODO(sergeyu): Remove |channel_| and let |reader_| own it.
- scoped_ptr<net::StreamSocket> channel_;
-
ProtobufMessageReader<AudioPacket> reader_;
// The stub that processes all received packets.