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

Unified Diff: remoting/protocol/rtp_utils.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/rtp_reader.cc ('k') | remoting/protocol/rtp_video_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/rtp_utils.cc
diff --git a/remoting/protocol/rtp_utils.cc b/remoting/protocol/rtp_utils.cc
index df10af235c71d267d53051566df958d2779fd505..25cbefc9f3686ca0a0795f6d172b3b7649ff8fdd 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;
« no previous file with comments | « remoting/protocol/rtp_reader.cc ('k') | remoting/protocol/rtp_video_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698