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_WEBM_WEBM_CLUSTER_PARSER_H_ | 5 #ifndef MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ |
6 #define MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ | 6 #define MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
15 #include "media/base/media_log.h" | 15 #include "media/base/media_log.h" |
| 16 #include "media/base/stream_parser.h" |
16 #include "media/base/stream_parser_buffer.h" | 17 #include "media/base/stream_parser_buffer.h" |
17 #include "media/formats/webm/webm_parser.h" | 18 #include "media/formats/webm/webm_parser.h" |
18 #include "media/formats/webm/webm_tracks_parser.h" | 19 #include "media/formats/webm/webm_tracks_parser.h" |
19 | 20 |
20 namespace media { | 21 namespace media { |
21 | 22 |
22 class MEDIA_EXPORT WebMClusterParser : public WebMParserClient { | 23 class MEDIA_EXPORT WebMClusterParser : public WebMParserClient { |
| 24 public: |
| 25 typedef StreamParser::TrackId TrackId; |
| 26 |
23 private: | 27 private: |
24 // Helper class that manages per-track state. | 28 // Helper class that manages per-track state. |
25 class Track { | 29 class Track { |
26 public: | 30 public: |
27 Track(int track_num, bool is_video); | 31 Track(int track_num, bool is_video); |
28 ~Track(); | 32 ~Track(); |
29 | 33 |
30 int track_num() const { return track_num_; } | 34 int track_num() const { return track_num_; } |
31 const std::deque<scoped_refptr<StreamParserBuffer> >& buffers() const { | 35 const std::deque<scoped_refptr<StreamParserBuffer> >& buffers() const { |
32 return buffers_; | 36 return buffers_; |
(...skipping 13 matching lines...) Expand all Loading... |
46 private: | 50 private: |
47 int track_num_; | 51 int track_num_; |
48 std::deque<scoped_refptr<StreamParserBuffer> > buffers_; | 52 std::deque<scoped_refptr<StreamParserBuffer> > buffers_; |
49 bool is_video_; | 53 bool is_video_; |
50 }; | 54 }; |
51 | 55 |
52 typedef std::map<int, Track> TextTrackMap; | 56 typedef std::map<int, Track> TextTrackMap; |
53 | 57 |
54 public: | 58 public: |
55 typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue; | 59 typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue; |
56 typedef std::map<int, const BufferQueue> TextBufferQueueMap; | 60 typedef std::map<TrackId, const BufferQueue> TextBufferQueueMap; |
57 | 61 |
58 WebMClusterParser(int64 timecode_scale, | 62 WebMClusterParser(int64 timecode_scale, |
59 int audio_track_num, | 63 int audio_track_num, |
60 int video_track_num, | 64 int video_track_num, |
61 const WebMTracksParser::TextTracks& text_tracks, | 65 const WebMTracksParser::TextTracks& text_tracks, |
62 const std::set<int64>& ignored_tracks, | 66 const std::set<int64>& ignored_tracks, |
63 const std::string& audio_encryption_key_id, | 67 const std::string& audio_encryption_key_id, |
64 const std::string& video_encryption_key_id, | 68 const std::string& video_encryption_key_id, |
65 const LogCB& log_cb); | 69 const LogCB& log_cb); |
66 virtual ~WebMClusterParser(); | 70 virtual ~WebMClusterParser(); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 TextBufferQueueMap text_buffers_map_; | 146 TextBufferQueueMap text_buffers_map_; |
143 | 147 |
144 LogCB log_cb_; | 148 LogCB log_cb_; |
145 | 149 |
146 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); | 150 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); |
147 }; | 151 }; |
148 | 152 |
149 } // namespace media | 153 } // namespace media |
150 | 154 |
151 #endif // MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ | 155 #endif // MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ |
OLD | NEW |