From aacbaac07bef57ef5ae79c2bb73cc493697523a3 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Wed, 20 Oct 2010 23:53:49 +0000 Subject: 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 --- remoting/protocol/rtp_utils.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 remoting/protocol/rtp_utils.h (limited to 'remoting/protocol/rtp_utils.h') diff --git a/remoting/protocol/rtp_utils.h b/remoting/protocol/rtp_utils.h new file mode 100644 index 0000000..43f6c66 --- /dev/null +++ b/remoting/protocol/rtp_utils.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_UTILS_H_ +#define REMOTING_PROTOCOL_RTP_UTILS_H_ + +#include "base/basictypes.h" + +namespace remoting { + +struct RtpHeader { + // RTP version is always set to 2. + // version = 2 + bool padding; + bool extension; + uint8 sources; + bool marker; + uint8 payload_type; + uint16 sequence_number; + uint32 timestamp; + uint32 sync_source_id; + uint32 source_id[15]; +}; + +// Returns size of RTP header for the specified number of sources. +int GetRtpHeaderSize(int sources); + +// Packs RTP header into the buffer. +void PackRtpHeader(uint8* buffer, int buffer_size, + const RtpHeader& header); + +// Unpacks RTP header and stores unpacked values in |header|. If the header +// is not valid returns -1, otherwise returns size of the header. +int UnpackRtpHeader(const uint8* buffer, int buffer_size, + RtpHeader* header); + +} // namespace remoting + +#endif // REMOTING_PROTOCOL_RTP_UTILS_H_ -- cgit v1.1