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

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

Issue 4925001: Packetizer/Depacketizer for RTP. (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 | « no previous file | remoting/protocol/rtp_reader.cc » ('j') | remoting/protocol/rtp_utils.h » ('J')
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/base/compound_buffer.h" 9 #include "remoting/base/compound_buffer.h"
10 #include "remoting/protocol/rtp_utils.h" 10 #include "remoting/protocol/rtp_utils.h"
11 #include "remoting/protocol/socket_reader_base.h" 11 #include "remoting/protocol/socket_reader_base.h"
12 12
13 namespace remoting { 13 namespace remoting {
14 namespace protocol { 14 namespace protocol {
15 15
16 class RtpPacket { 16 class RtpPacket {
17 public: 17 public:
18 RtpPacket(); 18 RtpPacket();
19 ~RtpPacket(); 19 ~RtpPacket();
20 20
21 const RtpHeader& header() const { return header_; } 21 const RtpHeader& header() const { return header_; }
22 RtpHeader* mutable_header() { return &header_; } 22 RtpHeader* mutable_header() { return &header_; }
23
24 const Vp8Descriptor& vp8_descriptor() const { return vp8_descriptor_; }
25 Vp8Descriptor* mutable_vp8_descriptor() { return &vp8_descriptor_; }
26
23 const CompoundBuffer& payload() const { return payload_; } 27 const CompoundBuffer& payload() const { return payload_; }
24 CompoundBuffer* mutable_payload() { return &payload_; } 28 CompoundBuffer* mutable_payload() { return &payload_; }
25 29
26 private: 30 private:
27 RtpHeader header_; 31 RtpHeader header_;
28 CompoundBuffer payload_; 32 CompoundBuffer payload_;
33 Vp8Descriptor vp8_descriptor_;
29 }; 34 };
30 35
31 class RtpReader : public SocketReaderBase { 36 class RtpReader : public SocketReaderBase {
32 public: 37 public:
33 RtpReader(); 38 RtpReader();
34 ~RtpReader(); 39 ~RtpReader();
35 40
36 // The OnMessageCallback is called whenever a new message is received. 41 // The OnMessageCallback is called whenever a new message is received.
37 // Ownership of the message is passed the callback. 42 // Ownership of the message is passed the callback.
38 typedef Callback1<const RtpPacket&>::Type OnMessageCallback; 43 typedef Callback1<RtpPacket*>::Type OnMessageCallback;
Alpha Left Google 2010/11/15 23:46:35 why this is changed to non-const?
Sergey Ulanov 2010/11/16 00:22:55 Changed back to const.
39 44
40 // Initialize the reader and start reading. Must be called on the thread 45 // Initialize the reader and start reading. Must be called on the thread
41 // |socket| belongs to. The callback will be called when a new message is 46 // |socket| belongs to. The callback will be called when a new message is
42 // received. RtpReader owns |on_message_callback|, doesn't own 47 // received. RtpReader owns |on_message_callback|, doesn't own
43 // |socket|. 48 // |socket|.
44 void Init(net::Socket* socket, OnMessageCallback* on_message_callback); 49 void Init(net::Socket* socket, OnMessageCallback* on_message_callback);
45 50
46 protected: 51 protected:
47 virtual void OnDataReceived(net::IOBuffer* buffer, int data_size); 52 virtual void OnDataReceived(net::IOBuffer* buffer, int data_size);
48 53
49 private: 54 private:
50 scoped_ptr<OnMessageCallback> on_message_callback_; 55 scoped_ptr<OnMessageCallback> on_message_callback_;
51 56
52 DISALLOW_COPY_AND_ASSIGN(RtpReader); 57 DISALLOW_COPY_AND_ASSIGN(RtpReader);
53 }; 58 };
54 59
55 } // namespace protocol 60 } // namespace protocol
56 } // namespace remoting 61 } // namespace remoting
57 62
58 63
59 #endif // REMOTING_PROTOCOL_RTP_READER_H_ 64 #endif // REMOTING_PROTOCOL_RTP_READER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/protocol/rtp_reader.cc » ('j') | remoting/protocol/rtp_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698