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

Unified Diff: content/common/gpu/media/h264_bit_reader.cc

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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: content/common/gpu/media/h264_bit_reader.cc
diff --git a/content/common/gpu/media/h264_bit_reader.cc b/content/common/gpu/media/h264_bit_reader.cc
index b8d00e174a33ef36461c82dfc34b4046dc3f6fd5..22528a98fa01f7f9c22dec2c2d997b030619d947 100644
--- a/content/common/gpu/media/h264_bit_reader.cc
+++ b/content/common/gpu/media/h264_bit_reader.cc
@@ -42,4 +42,24 @@ void H264BitReader::UpdateCurrByte() {
}
}
+bool H264BitReader::HasMoreRBSPData() {
+ // Make sure we have more bits, if we are at 0 bits in current byte
+ // and updating current byte fails, we don't have more data anyway.
+ if (num_remaining_bits_in_curr_byte_ == 0) {
+ UpdateCurrByte();
+ if (num_remaining_bits_in_curr_byte_ == 0)
+ return false;
+ }
+
+ // Not on last byte?
+ if (bytes_left_)
+ return true;
+
+ // Last byte, look for stop bit;
+ // We have more RBSP data if the last non-zero bit we find is not the
+ // first available bit.
+ return (curr_byte_ &
+ ((1 << (num_remaining_bits_in_curr_byte_ - 1)) - 1)) != 0;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698