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

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

Issue 4229003: Add VideoReader and VideoWriter interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month 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/protobuf_video_writer.cc ('k') | remoting/protocol/rtp_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
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 #ifndef REMOTING_PROTOCOL_RTP_READER_H_ 5 #ifndef REMOTING_PROTOCOL_RTP_READER_H_
6 #define REMOTING_PROTOCOL_RTP_READER_H_ 6 #define REMOTING_PROTOCOL_RTP_READER_H_
7 7
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "remoting/protocol/rtp_utils.h" 9 #include "remoting/protocol/rtp_utils.h"
10 #include "remoting/protocol/socket_reader_base.h" 10 #include "remoting/protocol/socket_reader_base.h"
(...skipping 10 matching lines...) Expand all
21 int payload_size; 21 int payload_size;
22 }; 22 };
23 23
24 class RtpReader : public SocketReaderBase { 24 class RtpReader : public SocketReaderBase {
25 public: 25 public:
26 RtpReader(); 26 RtpReader();
27 ~RtpReader(); 27 ~RtpReader();
28 28
29 // The OnMessageCallback is called whenever a new message is received. 29 // The OnMessageCallback is called whenever a new message is received.
30 // Ownership of the message is passed the callback. 30 // Ownership of the message is passed the callback.
31 typedef Callback1<RtpPacket*>::Type OnMessageCallback; 31 typedef Callback1<const RtpPacket&>::Type OnMessageCallback;
32 32
33 // Initialize the reader and start reading. Must be called on the thread 33 // Initialize the reader and start reading. Must be called on the thread
34 // |socket| belongs to. The callback will be called when a new message is 34 // |socket| belongs to. The callback will be called when a new message is
35 // received. RtpReader owns |on_message_callback|, doesn't own 35 // received. RtpReader owns |on_message_callback|, doesn't own
36 // |socket|. 36 // |socket|.
37 void Init(net::Socket* socket, OnMessageCallback* on_message_callback); 37 void Init(net::Socket* socket, OnMessageCallback* on_message_callback);
38 38
39 protected: 39 protected:
40 virtual void OnDataReceived(net::IOBuffer* buffer, int data_size); 40 virtual void OnDataReceived(net::IOBuffer* buffer, int data_size);
41 41
42 private: 42 private:
43 scoped_ptr<OnMessageCallback> on_message_callback_; 43 scoped_ptr<OnMessageCallback> on_message_callback_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(RtpReader); 45 DISALLOW_COPY_AND_ASSIGN(RtpReader);
46 }; 46 };
47 47
48 } // namespace remoting 48 } // namespace remoting
49 49
50 50
51 #endif // REMOTING_PROTOCOL_RTP_READER_H_ 51 #endif // REMOTING_PROTOCOL_RTP_READER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/protobuf_video_writer.cc ('k') | remoting/protocol/rtp_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698