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

Unified Diff: media/base/bit_reader.cc

Issue 1517473002: Support HLS MPEG2 TS with SAMPLE-AES encryption. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@encryption_scheme
Patch Set: tidying up prior to review Created 5 years 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: media/base/bit_reader.cc
diff --git a/media/base/bit_reader.cc b/media/base/bit_reader.cc
index c0d30d66fdd5d0deca5f446b25bd7e812cfbbd46..48ec5833b2ce8d084cf93aa8fa3d670ccbaf79d7 100644
--- a/media/base/bit_reader.cc
+++ b/media/base/bit_reader.cc
@@ -31,4 +31,15 @@ int BitReader::GetBytes(int max_nbytes, const uint8** out) {
return nbytes;
}
+bool BitReader::ReadString(int num_bits, std::string* str) {
ddorwin 2015/12/10 20:10:58 nit: move above previous function.
dougsteed 2015/12/14 22:51:46 Done.
+ int num_bytes = num_bits / 8;
+ DCHECK_EQ(num_bits % 8, 0);
+ str->resize(num_bytes);
+ char* ptr = &str->front();
+ while (num_bytes--)
+ if (!ReadBits(8, ptr++))
+ return false;
+ return true;
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698