diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-20 23:53:49 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-20 23:53:49 +0000 |
commit | aacbaac07bef57ef5ae79c2bb73cc493697523a3 (patch) | |
tree | 9b3b167c132d69268133c9a7cf845b2808e3b693 /remoting/protocol/rtp_writer.h | |
parent | 2d39c51b903086f01adf5470ee6725ced14df8ee (diff) | |
download | chromium_src-aacbaac07bef57ef5ae79c2bb73cc493697523a3.zip chromium_src-aacbaac07bef57ef5ae79c2bb73cc493697523a3.tar.gz chromium_src-aacbaac07bef57ef5ae79c2bb73cc493697523a3.tar.bz2 |
Simple RTP reader/writer.
This is an implementation of simple RTP reader and writer. It still lacks proper support of VP8 payload header. Will implement it in another CL.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/3829007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63294 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/rtp_writer.h')
-rw-r--r-- | remoting/protocol/rtp_writer.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/remoting/protocol/rtp_writer.h b/remoting/protocol/rtp_writer.h new file mode 100644 index 0000000..5ba7501 --- /dev/null +++ b/remoting/protocol/rtp_writer.h @@ -0,0 +1,40 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_PROTOCOL_RTP_WRITER_H_ +#define REMOTING_PROTOCOL_RTP_WRITER_H_ + +#include "net/socket/socket.h" +#include "remoting/protocol/buffered_socket_writer.h" + +namespace remoting { + +class RtpWriter { + public: + RtpWriter(); + virtual ~RtpWriter(); + + // Initializes the writer. Must be called on the thread the sockets belong + // to. + void Init(net::Socket* rtp_socket, net::Socket* rtcp_socket); + + void SendPacket(const char* buffer, int packet_size, + uint32 timestamp); + + // Stop writing and drop pending data. Must be called from the same thread as + // Init(). + void Close(); + + private: + net::Socket* rtp_socket_; + net::Socket* rtcp_socket_; + + uint32 last_packet_number_; + + scoped_refptr<BufferedDatagramWriter> buffered_rtp_writer_; +}; + +} // namespace remoting + +#endif // REMOTING_PROTOCOL_RTP_WRITER_H_ |