Chromium Code Reviews| Index: media/filters/h264_parser.h |
| diff --git a/media/filters/h264_parser.h b/media/filters/h264_parser.h |
| index 45020af61344b8228259bfc2a4868b1b7cfd8a9d..0da0bed7bcf7e63f049e8137957f87467fa5279f 100644 |
| --- a/media/filters/h264_parser.h |
| +++ b/media/filters/h264_parser.h |
| @@ -13,10 +13,13 @@ |
| #include "base/basictypes.h" |
| #include "media/base/media_export.h" |
| +#include "media/base/ranges.h" |
| #include "media/filters/h264_bit_reader.h" |
| namespace media { |
| +struct SubsampleEntry; |
| + |
| // For explanations of each struct and its members, see H.264 specification |
| // at http://www.itu.int/rec/T-REC-H.264. |
| struct MEDIA_EXPORT H264NALU { |
| @@ -337,7 +340,11 @@ class MEDIA_EXPORT H264Parser { |
| void Reset(); |
| // Set current stream pointer to |stream| of |stream_size| in bytes, |
| // |stream| owned by caller. |
| + // |subsamples| contains information about what parts of |stream| are |
| + // encrypted. |
| void SetStream(const uint8* stream, off_t stream_size); |
| + void SetStream(const uint8* stream, off_t stream_size, |
| + const std::vector<SubsampleEntry>& subsamples); |
|
xhwang
2014/07/10 06:23:01
nit: The style guide doesn't encourage function ov
xhwang
2014/07/10 06:23:01
nit: Add include for vector.
acolwell GONE FROM CHROMIUM
2014/07/15 22:10:44
Done.
acolwell GONE FROM CHROMIUM
2014/07/15 22:10:44
Done.
|
| // Read the stream to find the next NALU, identify it and return |
| // that information in |*nalu|. This advances the stream to the beginning |
| @@ -392,6 +399,11 @@ class MEDIA_EXPORT H264Parser { |
| // - the size in bytes of the start code is returned in |*start_code_size|. |
| bool LocateNALU(off_t* nalu_size, off_t* start_code_size); |
| + // Wrapper for FindStartCode() that skips over start codes that |
| + // may appear inside |encrypted_ranges_|. |
| + bool FindNextStartCode(const uint8* data, off_t data_size, |
|
xhwang
2014/07/10 06:23:01
It's not obvious to know the difference b/w FindSt
acolwell GONE FROM CHROMIUM
2014/07/15 22:10:44
Done.
|
| + off_t* offset, off_t* start_code_size); |
| + |
| // Exp-Golomb code parsing as specified in chapter 9.1 of the spec. |
| // Read one unsigned exp-Golomb code from the stream and return in |*val|. |
| Result ReadUE(int* val); |
| @@ -441,6 +453,8 @@ class MEDIA_EXPORT H264Parser { |
| SPSById active_SPSes_; |
| PPSById active_PPSes_; |
| + Ranges<const uint8*> encrypted_ranges_; |
|
xhwang
2014/07/10 06:23:01
Since this range is only used for searching for st
acolwell GONE FROM CHROMIUM
2014/07/15 22:10:44
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(H264Parser); |
| }; |