Chromium Code Reviews| 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 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_ | 5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_ |
| 6 #define MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_ | 6 #define MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | |
| 11 #include <utility> | 10 #include <utility> |
| 12 | 11 |
| 13 #include "base/callback.h" | 12 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" | 14 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 18 #include "media/base/media_export.h" | 17 #include "media/base/media_export.h" |
| 19 #include "media/base/video_decoder_config.h" | 18 #include "media/base/video_decoder_config.h" |
| 20 #include "media/formats/mp2t/es_adapter_video.h" | 19 #include "media/formats/mp2t/es_adapter_video.h" |
| 21 #include "media/formats/mp2t/es_parser.h" | 20 #include "media/formats/mp2t/es_parser.h" |
| 22 | 21 |
| 23 namespace media { | 22 namespace media { |
| 23 class EncryptionScheme; | |
| 24 class H264Parser; | 24 class H264Parser; |
| 25 struct H264SPS; | 25 struct H264SPS; |
| 26 class OffsetByteQueue; | 26 class OffsetByteQueue; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace media { | 29 namespace media { |
| 30 namespace mp2t { | 30 namespace mp2t { |
| 31 | 31 |
| 32 // A few remarks: | 32 // A few remarks: |
| 33 // - In this h264 parser, frame splitting is based on AUD nals. | 33 // - In this h264 parser, frame splitting is based on AUD nals. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 63 | 63 |
| 64 // Emit a frame whose position in the ES queue starts at |access_unit_pos|. | 64 // Emit a frame whose position in the ES queue starts at |access_unit_pos|. |
| 65 // Returns true if successful, false if no PTS is available for the frame. | 65 // Returns true if successful, false if no PTS is available for the frame. |
| 66 bool EmitFrame(int64_t access_unit_pos, | 66 bool EmitFrame(int64_t access_unit_pos, |
| 67 int access_unit_size, | 67 int access_unit_size, |
| 68 bool is_key_frame, | 68 bool is_key_frame, |
| 69 int pps_id); | 69 int pps_id); |
| 70 | 70 |
| 71 // Update the video decoder config based on an H264 SPS. | 71 // Update the video decoder config based on an H264 SPS. |
| 72 // Return true if successful. | 72 // Return true if successful. |
| 73 bool UpdateVideoDecoderConfig(const H264SPS* sps); | 73 bool UpdateVideoDecoderConfig(const H264SPS* sps, |
|
ddorwin
2016/03/01 02:17:42
This should probably be passed by const ref. (Shou
| |
| 74 const EncryptionScheme& scheme); | |
| 74 | 75 |
| 75 EsAdapterVideo es_adapter_; | 76 EsAdapterVideo es_adapter_; |
| 76 | 77 |
| 77 // H264 parser state. | 78 // H264 parser state. |
| 78 // - |current_access_unit_pos_| is pointing to an annexB syncword | 79 // - |current_access_unit_pos_| is pointing to an annexB syncword |
| 79 // representing the first NALU of an H264 access unit. | 80 // representing the first NALU of an H264 access unit. |
| 80 scoped_ptr<H264Parser> h264_parser_; | 81 scoped_ptr<H264Parser> h264_parser_; |
| 81 int64_t current_access_unit_pos_; | 82 int64_t current_access_unit_pos_; |
| 82 int64_t next_access_unit_pos_; | 83 int64_t next_access_unit_pos_; |
| 83 | 84 |
| 84 // Last video decoder config. | 85 // Last video decoder config. |
| 85 VideoDecoderConfig last_video_decoder_config_; | 86 VideoDecoderConfig last_video_decoder_config_; |
| 86 | 87 |
| 87 DISALLOW_COPY_AND_ASSIGN(EsParserH264); | 88 DISALLOW_COPY_AND_ASSIGN(EsParserH264); |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace mp2t | 91 } // namespace mp2t |
| 91 } // namespace media | 92 } // namespace media |
| 92 | 93 |
| 93 #endif | 94 #endif |
| OLD | NEW |