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/aac.h" | 16 #include "media/mp4/aac.h" |
15 #include "media/mp4/offset_byte_queue.h" | 17 #include "media/mp4/offset_byte_queue.h" |
16 #include "media/mp4/track_run_iterator.h" | 18 #include "media/mp4/track_run_iterator.h" |
17 | 19 |
(...skipping 21 matching lines...) Expand all Loading... | |
39 kWaitingForInit, | 41 kWaitingForInit, |
40 kParsingBoxes, | 42 kParsingBoxes, |
41 kEmittingSamples, | 43 kEmittingSamples, |
42 kError | 44 kError |
43 }; | 45 }; |
44 | 46 |
45 bool ParseBox(bool* err); | 47 bool ParseBox(bool* err); |
46 bool ParseMoov(mp4::BoxReader* reader); | 48 bool ParseMoov(mp4::BoxReader* reader); |
47 bool ParseMoof(mp4::BoxReader* reader); | 49 bool ParseMoof(mp4::BoxReader* reader); |
48 | 50 |
51 bool EmitKeyNeeded(const TrackEncryption& track_encryption); | |
52 | |
49 bool ReadMDATsUntil(const int64 tgt_tail); | 53 bool ReadMDATsUntil(const int64 tgt_tail); |
50 | 54 |
51 void ChangeState(State new_state); | 55 void ChangeState(State new_state); |
52 | 56 |
53 bool EmitConfigs(); | 57 bool EmitConfigs(); |
58 bool PrepareAVCBuffer(std::vector<uint8>* frame_buf, | |
59 std::vector<SubsampleEntry>* subsamples); | |
54 bool EnqueueSample(BufferQueue* audio_buffers, | 60 bool EnqueueSample(BufferQueue* audio_buffers, |
55 BufferQueue* video_buffers, | 61 BufferQueue* video_buffers, |
56 bool* err); | 62 bool* err); |
57 bool SendAndFlushSamples(BufferQueue* audio_buffers, | 63 bool SendAndFlushSamples(BufferQueue* audio_buffers, |
58 BufferQueue* video_buffers); | 64 BufferQueue* video_buffers); |
59 | 65 |
60 State state_; | 66 State state_; |
61 InitCB init_cb_; | 67 InitCB init_cb_; |
62 NewConfigCB config_cb_; | 68 NewConfigCB config_cb_; |
63 NewBuffersCB audio_cb_; | 69 NewBuffersCB audio_cb_; |
(...skipping 15 matching lines...) Expand all Loading... | |
79 | 85 |
80 mp4::TrackRunIterator runs_; | 86 mp4::TrackRunIterator runs_; |
81 | 87 |
82 scoped_ptr<mp4::Movie> moov_; | 88 scoped_ptr<mp4::Movie> moov_; |
83 | 89 |
84 bool has_audio_; | 90 bool has_audio_; |
85 bool has_video_; | 91 bool has_video_; |
86 uint32 audio_track_id_; | 92 uint32 audio_track_id_; |
87 uint32 video_track_id_; | 93 uint32 video_track_id_; |
88 | 94 |
89 // We keep them around to avoid having to go digging through the moov with | 95 // We keep them around to avoid having to go digging through the moov with |
ddorwin
2012/07/17 01:14:21
s/them/these/
strobe_
2012/07/19 02:43:35
Rebased away.
| |
90 // every frame. | 96 // every frame. |
91 AAC aac_; | 97 AAC aac_; |
92 uint8 size_of_nalu_length_; | 98 uint8 size_of_nalu_length_; |
93 | 99 |
94 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser); | 100 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser); |
95 }; | 101 }; |
96 | 102 |
97 } // namespace mp4 | 103 } // namespace mp4 |
98 } // namespace media | 104 } // namespace media |
99 | 105 |
100 #endif // MEDIA_MP4_MP4_STREAM_PARSER_H_ | 106 #endif // MEDIA_MP4_MP4_STREAM_PARSER_H_ |
OLD | NEW |