| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file contains an implementation of an H264 Annex-B video stream parser. | 5 // This file contains an implementation of an H264 Annex-B video stream parser. |
| 6 | 6 |
| 7 #ifndef MEDIA_FILTERS_H264_PARSER_H_ | 7 #ifndef MEDIA_FILTERS_H264_PARSER_H_ |
| 8 #define MEDIA_FILTERS_H264_PARSER_H_ | 8 #define MEDIA_FILTERS_H264_PARSER_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 #include <sys/types.h> | 12 #include <sys/types.h> |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> |
| 15 #include <vector> | 16 #include <vector> |
| 16 | 17 |
| 17 #include "base/macros.h" | 18 #include "base/macros.h" |
| 18 #include "base/optional.h" | 19 #include "base/optional.h" |
| 19 #include "media/base/media_export.h" | 20 #include "media/base/media_export.h" |
| 20 #include "media/base/ranges.h" | 21 #include "media/base/ranges.h" |
| 21 #include "media/base/video_codecs.h" | 22 #include "media/base/video_codecs.h" |
| 22 #include "media/filters/h264_bit_reader.h" | 23 #include "media/filters/h264_bit_reader.h" |
| 23 | 24 |
| 24 namespace gfx { | 25 namespace gfx { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 480 |
| 480 // Pointer to the current NALU in the stream. | 481 // Pointer to the current NALU in the stream. |
| 481 const uint8_t* stream_; | 482 const uint8_t* stream_; |
| 482 | 483 |
| 483 // Bytes left in the stream after the current NALU. | 484 // Bytes left in the stream after the current NALU. |
| 484 off_t bytes_left_; | 485 off_t bytes_left_; |
| 485 | 486 |
| 486 H264BitReader br_; | 487 H264BitReader br_; |
| 487 | 488 |
| 488 // PPSes and SPSes stored for future reference. | 489 // PPSes and SPSes stored for future reference. |
| 489 typedef std::map<int, H264SPS*> SPSById; | 490 std::map<int, std::unique_ptr<H264SPS>> active_SPSes_; |
| 490 typedef std::map<int, H264PPS*> PPSById; | 491 std::map<int, std::unique_ptr<H264PPS>> active_PPSes_; |
| 491 SPSById active_SPSes_; | |
| 492 PPSById active_PPSes_; | |
| 493 | 492 |
| 494 // Ranges of encrypted bytes in the buffer passed to | 493 // Ranges of encrypted bytes in the buffer passed to |
| 495 // SetEncryptedStream(). | 494 // SetEncryptedStream(). |
| 496 Ranges<const uint8_t*> encrypted_ranges_; | 495 Ranges<const uint8_t*> encrypted_ranges_; |
| 497 | 496 |
| 498 DISALLOW_COPY_AND_ASSIGN(H264Parser); | 497 DISALLOW_COPY_AND_ASSIGN(H264Parser); |
| 499 }; | 498 }; |
| 500 | 499 |
| 501 } // namespace media | 500 } // namespace media |
| 502 | 501 |
| 503 #endif // MEDIA_FILTERS_H264_PARSER_H_ | 502 #endif // MEDIA_FILTERS_H264_PARSER_H_ |
| OLD | NEW |