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 <set> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
15 #include "media/base/stream_parser.h" | 16 #include "media/base/stream_parser.h" |
16 #include "media/mp4/offset_byte_queue.h" | 17 #include "media/mp4/offset_byte_queue.h" |
17 #include "media/mp4/track_run_iterator.h" | 18 #include "media/mp4/track_run_iterator.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 namespace mp4 { | 21 namespace mp4 { |
21 | 22 |
22 struct Movie; | 23 struct Movie; |
23 class BoxReader; | 24 class BoxReader; |
24 | 25 |
25 class MEDIA_EXPORT MP4StreamParser : public StreamParser { | 26 class MEDIA_EXPORT MP4StreamParser : public StreamParser { |
26 public: | 27 public: |
27 MP4StreamParser(bool has_sbr); | 28 MP4StreamParser(const std::set<int>& audio_object_types, bool has_sbr); |
28 virtual ~MP4StreamParser(); | 29 virtual ~MP4StreamParser(); |
29 | 30 |
30 virtual void Init(const InitCB& init_cb, const NewConfigCB& config_cb, | 31 virtual void Init(const InitCB& init_cb, const NewConfigCB& config_cb, |
31 const NewBuffersCB& audio_cb, | 32 const NewBuffersCB& audio_cb, |
32 const NewBuffersCB& video_cb, | 33 const NewBuffersCB& video_cb, |
33 const NeedKeyCB& need_key_cb, | 34 const NeedKeyCB& need_key_cb, |
34 const NewMediaSegmentCB& new_segment_cb, | 35 const NewMediaSegmentCB& new_segment_cb, |
35 const base::Closure& end_of_segment_cb, | 36 const base::Closure& end_of_segment_cb, |
36 const LogCB& log_cb) OVERRIDE; | 37 const LogCB& log_cb) OVERRIDE; |
37 virtual void Flush() OVERRIDE; | 38 virtual void Flush() OVERRIDE; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Valid iff it is greater than the head of the queue. | 101 // Valid iff it is greater than the head of the queue. |
101 int64 mdat_tail_; | 102 int64 mdat_tail_; |
102 | 103 |
103 scoped_ptr<mp4::Movie> moov_; | 104 scoped_ptr<mp4::Movie> moov_; |
104 scoped_ptr<mp4::TrackRunIterator> runs_; | 105 scoped_ptr<mp4::TrackRunIterator> runs_; |
105 | 106 |
106 bool has_audio_; | 107 bool has_audio_; |
107 bool has_video_; | 108 bool has_video_; |
108 uint32 audio_track_id_; | 109 uint32 audio_track_id_; |
109 uint32 video_track_id_; | 110 uint32 video_track_id_; |
| 111 // The object types allowed for audio tracks. |
| 112 std::set<int> audio_object_types_; |
110 bool has_sbr_; | 113 bool has_sbr_; |
111 bool is_audio_track_encrypted_; | 114 bool is_audio_track_encrypted_; |
112 bool is_video_track_encrypted_; | 115 bool is_video_track_encrypted_; |
113 | 116 |
114 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser); | 117 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser); |
115 }; | 118 }; |
116 | 119 |
117 } // namespace mp4 | 120 } // namespace mp4 |
118 } // namespace media | 121 } // namespace media |
119 | 122 |
120 #endif // MEDIA_MP4_MP4_STREAM_PARSER_H_ | 123 #endif // MEDIA_MP4_MP4_STREAM_PARSER_H_ |
OLD | NEW |