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

Unified Diff: webrtc/modules/rtp_rtcp/source/byte_io.h

Issue 3014463002: Break rtp_rtcp_format out of rtp_rtcp, to resolve circular dependencies (Closed)
Patch Set: include stddef for size_t Created 3 years, 3 months 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
Index: webrtc/modules/rtp_rtcp/source/byte_io.h
diff --git a/webrtc/modules/rtp_rtcp/source/byte_io.h b/webrtc/modules/rtp_rtcp/source/byte_io.h
index 1724bb0a2e5951fb29472049f535be627cf0835b..cd2a2bea542a4807c9161a37a4616c3458f1b333 100644
--- a/webrtc/modules/rtp_rtcp/source/byte_io.h
+++ b/webrtc/modules/rtp_rtcp/source/byte_io.h
@@ -36,9 +36,10 @@
// it easy for the compiler to completely inline the reading/writing.
-#include <limits>
+#include <stddef.h>
eladalon 2017/09/12 14:45:07 By the way, for my information, don't we prefer to
danilchap 2017/09/12 15:17:18 I've reverted this file alltogether, but generally
eladalon 2017/09/12 15:25:24 Acknowledged.
+#include <stdint.h>
-#include "webrtc/typedefs.h"
+#include <limits>
namespace webrtc {
@@ -403,6 +404,12 @@ class ByteWriter<T, 8, false> {
}
};
+// Round up to the nearest size that is a multiple of 4.
+inline size_t Word32Align(size_t size) {
+ // Same as increment by 3 and clear last two bits.
+ return (size + 3) & ~0x3;
eladalon 2017/09/12 14:45:07 Is this the safest way to do this? 1. There are so
danilchap 2017/09/12 15:17:17 2. Moved inside rtp_header_extension_map where siz
+}
+
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_BYTE_IO_H_

Powered by Google App Engine
This is Rietveld 408576698