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

Unified Diff: media/filters/h264_bit_reader.cc

Issue 119153002: Move H264Parser and H264BitReader to media/filters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « media/filters/h264_bit_reader.h ('k') | media/filters/h264_bit_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/h264_bit_reader.cc
diff --git a/content/common/gpu/media/h264_bit_reader.cc b/media/filters/h264_bit_reader.cc
similarity index 87%
rename from content/common/gpu/media/h264_bit_reader.cc
rename to media/filters/h264_bit_reader.cc
index dbeb4db23f4d4f4c1e7606e1757c456ce8eb77a0..f47c2797b13376135ebc83cd614635cbb684a245 100644
--- a/content/common/gpu/media/h264_bit_reader.cc
+++ b/media/filters/h264_bit_reader.cc
@@ -2,16 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/gpu/media/h264_bit_reader.h"
#include "base/logging.h"
+#include "media/filters/h264_bit_reader.h"
-namespace content {
+namespace media {
H264BitReader::H264BitReader()
- : data_(NULL), bytes_left_(0), curr_byte_(0),
- num_remaining_bits_in_curr_byte_(0), prev_two_bytes_(0),
- emulation_prevention_bytes_(0) {
-}
+ : data_(NULL),
+ bytes_left_(0),
+ curr_byte_(0),
+ num_remaining_bits_in_curr_byte_(0),
+ prev_two_bytes_(0),
+ emulation_prevention_bytes_(0) {}
H264BitReader::~H264BitReader() {}
@@ -62,7 +64,7 @@ bool H264BitReader::UpdateCurrByte() {
// Read |num_bits| (1 to 31 inclusive) from the stream and return them
// in |out|, with first bit in the stream as MSB in |out| at position
// (|num_bits| - 1).
-bool H264BitReader::ReadBits(int num_bits, int *out) {
+bool H264BitReader::ReadBits(int num_bits, int* out) {
int bits_left = num_bits;
*out = 0;
DCHECK(num_bits <= 31);
@@ -91,7 +93,7 @@ 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())
- return false;
+ return false;
// On last byte?
if (bytes_left_)
@@ -104,9 +106,8 @@ bool H264BitReader::HasMoreRBSPData() {
((1 << (num_remaining_bits_in_curr_byte_ - 1)) - 1)) != 0;
}
-size_t H264BitReader::NumEmulationPreventionBytesRead()
-{
+size_t H264BitReader::NumEmulationPreventionBytesRead() {
return emulation_prevention_bytes_;
}
-} // namespace content
+} // namespace media
« no previous file with comments | « media/filters/h264_bit_reader.h ('k') | media/filters/h264_bit_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698