summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/rtp_utils.cc
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 04:17:09 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 04:17:09 +0000
commit14fd1a60acdd439f80bdfc0aeb86761ba649db79 (patch)
tree5bfbcefbd8776ca6a4d810a75601d8bf62d91a7c /remoting/protocol/rtp_utils.cc
parent07f1ceeabc0cf63ed8d7ae7aa8d1ff04dda02584 (diff)
downloadchromium_src-14fd1a60acdd439f80bdfc0aeb86761ba649db79.zip
chromium_src-14fd1a60acdd439f80bdfc0aeb86761ba649db79.tar.gz
chromium_src-14fd1a60acdd439f80bdfc0aeb86761ba649db79.tar.bz2
Add VideoReader and VideoWriter interfaces.
Implemented VideoReader and VideoWriter for RTP and Protobuf. BUG=53986 TEST=None Review URL: http://codereview.chromium.org/4229003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64878 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/rtp_utils.cc')
-rw-r--r--remoting/protocol/rtp_utils.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/remoting/protocol/rtp_utils.cc b/remoting/protocol/rtp_utils.cc
index df10af2..25cbefc 100644
--- a/remoting/protocol/rtp_utils.cc
+++ b/remoting/protocol/rtp_utils.cc
@@ -48,13 +48,10 @@ void PackRtpHeader(uint8* buffer, int buffer_size,
}
static inline uint8 ExtractBits(uint8 byte, int bits_count, int shift) {
- return (byte >> shift) && ((1 << bits_count) - 1);
+ return (byte >> shift) & ((1 << bits_count) - 1);
}
int UnpackRtpHeader(const uint8* buffer, int buffer_size, RtpHeader* header) {
- DCHECK_LT(header->sources, 1 << 4);
- DCHECK_LT(header->payload_type, 1 << 7);
-
if (buffer_size < kRtpBaseHeaderSize) {
return -1;
}
@@ -69,13 +66,13 @@ int UnpackRtpHeader(const uint8* buffer, int buffer_size, RtpHeader* header) {
header->sources = ExtractBits(buffer[0], 4, 0);
header->marker = ExtractBits(buffer[1], 1, 7) != 0;
- header->sources = ExtractBits(buffer[1], 7, 0);
+ header->payload_type = ExtractBits(buffer[1], 7, 0);
header->sequence_number = GetBE16(buffer + 2);
header->timestamp = GetBE32(buffer + 4);
header->sync_source_id = GetBE32(buffer + 8);
- DCHECK_LE(header->sources, 16);
+ DCHECK_LT(header->sources, 16);
if (buffer_size < GetRtpHeaderSize(header->sources)) {
return -1;