| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MP4_MP4_STREAM_PARSER_H_ | 5 #ifndef MEDIA_MP4_MP4_STREAM_PARSER_H_ |
| 6 #define MEDIA_MP4_MP4_STREAM_PARSER_H_ | 6 #define MEDIA_MP4_MP4_STREAM_PARSER_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 11 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 13 #include "media/base/stream_parser.h" | 15 #include "media/base/stream_parser.h" |
| 14 #include "media/mp4/offset_byte_queue.h" | 16 #include "media/mp4/offset_byte_queue.h" |
| 15 #include "media/mp4/track_run_iterator.h" | 17 #include "media/mp4/track_run_iterator.h" |
| 16 | 18 |
| 17 namespace media { | 19 namespace media { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 38 kWaitingForInit, | 40 kWaitingForInit, |
| 39 kParsingBoxes, | 41 kParsingBoxes, |
| 40 kEmittingSamples, | 42 kEmittingSamples, |
| 41 kError | 43 kError |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 bool ParseBox(bool* err); | 46 bool ParseBox(bool* err); |
| 45 bool ParseMoov(mp4::BoxReader* reader); | 47 bool ParseMoov(mp4::BoxReader* reader); |
| 46 bool ParseMoof(mp4::BoxReader* reader); | 48 bool ParseMoof(mp4::BoxReader* reader); |
| 47 | 49 |
| 50 bool EmitKeyNeeded(const TrackEncryption& track_encryption); |
| 51 |
| 48 bool ReadMDATsUntil(const int64 tgt_tail); | 52 bool ReadMDATsUntil(const int64 tgt_tail); |
| 49 | 53 |
| 50 void ChangeState(State new_state); | 54 void ChangeState(State new_state); |
| 51 | 55 |
| 52 bool EmitConfigs(); | 56 bool EmitConfigs(); |
| 57 bool PrepareAVCBuffer(const AVCDecoderConfigurationRecord& avc_config, |
| 58 std::vector<uint8>* frame_buf, |
| 59 std::vector<SubsampleEntry>* subsamples) const; |
| 53 bool EnqueueSample(BufferQueue* audio_buffers, | 60 bool EnqueueSample(BufferQueue* audio_buffers, |
| 54 BufferQueue* video_buffers, | 61 BufferQueue* video_buffers, |
| 55 bool* err); | 62 bool* err); |
| 56 bool SendAndFlushSamples(BufferQueue* audio_buffers, | 63 bool SendAndFlushSamples(BufferQueue* audio_buffers, |
| 57 BufferQueue* video_buffers); | 64 BufferQueue* video_buffers); |
| 58 | 65 |
| 59 State state_; | 66 State state_; |
| 60 InitCB init_cb_; | 67 InitCB init_cb_; |
| 61 NewConfigCB config_cb_; | 68 NewConfigCB config_cb_; |
| 62 NewBuffersCB audio_cb_; | 69 NewBuffersCB audio_cb_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 85 uint32 video_track_id_; | 92 uint32 video_track_id_; |
| 86 bool has_sbr_; | 93 bool has_sbr_; |
| 87 | 94 |
| 88 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser); | 95 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser); |
| 89 }; | 96 }; |
| 90 | 97 |
| 91 } // namespace mp4 | 98 } // namespace mp4 |
| 92 } // namespace media | 99 } // namespace media |
| 93 | 100 |
| 94 #endif // MEDIA_MP4_MP4_STREAM_PARSER_H_ | 101 #endif // MEDIA_MP4_MP4_STREAM_PARSER_H_ |
| OLD | NEW |