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

Side by Side Diff: remoting/protocol/audio_reader.h

Issue 10562007: Added files for audio readers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed style nits 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/protocol/audio_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_PROTOCOL_AUDIO_READER_H_
6 #define REMOTING_PROTOCOL_AUDIO_READER_H_
7
8 #include "base/callback.h"
9 #include "base/compiler_specific.h"
10 #include "remoting/proto/audio.pb.h"
11 #include "remoting/protocol/audio_stub.h"
12 #include "remoting/protocol/message_reader.h"
13
14 namespace net {
15 class StreamSocket;
16 } // namespace net
17
18 namespace remoting {
19 namespace protocol {
20
21 class Session;
22 class SessionConfig;
23
24 class AudioReader {
25 public:
26 // The callback is called when initialization is finished. The
27 // parameter is set to true on success.
28 typedef base::Callback<void(bool)> InitializedCallback;
29
30 explicit AudioReader(AudioPacket::Encoding encoding);
Sergey Ulanov 2012/06/15 19:54:41 Since this is called from Create, this constructor
kxing 2012/06/15 20:03:06 Done.
31
32 virtual ~AudioReader();
33
34 // Initializies the reader.
35 void Init(Session* session,
36 AudioStub* audio_stub,
37 const InitializedCallback& callback);
38 bool is_connected();
39
40 static AudioReader* Create(const SessionConfig& config);
Sergey Ulanov 2012/06/15 19:54:41 Move this between the destructor and Init().
Sergey Ulanov 2012/06/15 19:54:41 Since this passes ownership, use scoped_ptr<AudioR
kxing 2012/06/15 20:03:06 Done.
kxing 2012/06/15 20:03:06 Done.
41
42 private:
43 void OnChannelReady(scoped_ptr<net::StreamSocket> socket);
44 void OnNewData(scoped_ptr<AudioPacket> packet,
45 const base::Closure& done_task);
46
47 Session* session_;
48
49 InitializedCallback initialized_callback_;
50
51 AudioPacket::Encoding encoding_;
52
53 // TODO(sergeyu): Remove |channel_| and let |reader_| own it.
54 scoped_ptr<net::StreamSocket> channel_;
55
56 ProtobufMessageReader<AudioPacket> reader_;
57
58 // The stub that processes all received packets.
59 AudioStub* audio_stub_;
60
61 DISALLOW_COPY_AND_ASSIGN(AudioReader);
62 };
63
64 } // namespace protocol
65 } // namespace remoting
66
67 #endif // REMOTING_PROTOCOL_AUDIO_READER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/protocol/audio_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698