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

Side by Side Diff: media/base/bit_reader_h264.h

Issue 112343011: Split the bit reader functionalities from the byte stream provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test for the removal of the emulation prevention byte. Created 6 years, 12 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_BIT_READER_H264_H_
6 #define MEDIA_BASE_BIT_READER_H264_H_
7
8 #include <sys/types.h>
9
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "media/base/bit_reader_core.h"
13 #include "media/base/media_export.h"
14
15 namespace media {
16
17 class MEDIA_EXPORT BitReaderH264 {
acolwell GONE FROM CHROMIUM 2013/12/28 01:54:42 Why create this? I thought you'd just be moving co
damienv1 2013/12/28 04:02:23 I was planning to do another CL which: - remove th
18 public:
19 // Initialize the reader to start reading at |data|, |size| being size
20 // of |data| in bytes.
21 BitReaderH264(const uint8* data, off_t size);
22 ~BitReaderH264();
23
24 template<typename T> bool ReadBits(int num_bits, T *out) {
25 return bit_reader_core_.ReadBits(num_bits, out);
26 }
27
28 bool ReadFlag(bool* flag) {
29 return bit_reader_core_.ReadFlag(flag);
30 }
31
32 bool ReadUE(uint32* out) {
33 return bit_reader_core_.ReadUE(out);
34 }
35
36 bool SkipBits(int num_bits) {
37 return bit_reader_core_.SkipBits(num_bits);
38 }
39
40 int NumBitsLeft() const {
damienv1 2013/12/28 01:32:25 This method should not be exposed. This is confusi
damienv1 2013/12/28 02:26:17 Will do.
41 return bit_reader_core_.bits_available();
42 }
43
44 int GetBitCount() {
45 return bit_reader_core_.GetBitCount();
46 }
47
48 // See the definition of more_rbsp_data() in spec.
49 bool HasMoreRBSPData() {
50 return bit_reader_core_.HasMoreRBSPData();
51 }
52
53 private:
54 scoped_ptr<BitReaderCore::ByteStreamProvider> byte_stream_provider_;
acolwell GONE FROM CHROMIUM 2013/12/28 01:54:42 nit: Since this can't be changed and has the same
damienv1 2013/12/28 04:02:23 Done: now derives from ByteStreamProvider.
55
56 BitReaderCore bit_reader_core_;
57
58 DISALLOW_COPY_AND_ASSIGN(BitReaderH264);
59 };
60
61 } // namespace media
62
63 #endif // MEDIA_BASE_BIT_READER_H264_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698