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_WEBM_WEBM_TRACKS_PARSER_H_ | 5 #ifndef MEDIA_WEBM_WEBM_TRACKS_PARSER_H_ |
6 #define MEDIA_WEBM_WEBM_TRACKS_PARSER_H_ | 6 #define MEDIA_WEBM_WEBM_TRACKS_PARSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "media/base/media_log.h" |
12 #include "media/webm/webm_content_encodings_client.h" | 13 #include "media/webm/webm_content_encodings_client.h" |
13 #include "media/webm/webm_parser.h" | 14 #include "media/webm/webm_parser.h" |
14 | 15 |
15 namespace media { | 16 namespace media { |
16 | 17 |
17 // Parser for WebM Tracks element. | 18 // Parser for WebM Tracks element. |
18 class WebMTracksParser : public WebMParserClient { | 19 class WebMTracksParser : public WebMParserClient { |
19 public: | 20 public: |
20 explicit WebMTracksParser(); | 21 explicit WebMTracksParser(const LogCB& log_cb); |
21 virtual ~WebMTracksParser(); | 22 virtual ~WebMTracksParser(); |
22 | 23 |
23 // Parses a WebM Tracks element in |buf|. | 24 // Parses a WebM Tracks element in |buf|. |
24 // | 25 // |
25 // Returns -1 if the parse fails. | 26 // Returns -1 if the parse fails. |
26 // Returns 0 if more data is needed. | 27 // Returns 0 if more data is needed. |
27 // Returns the number of bytes parsed on success. | 28 // Returns the number of bytes parsed on success. |
28 int Parse(const uint8* buf, int size); | 29 int Parse(const uint8* buf, int size); |
29 | 30 |
30 int64 audio_track_num() const { return audio_track_num_; } | 31 int64 audio_track_num() const { return audio_track_num_; } |
(...skipping 15 matching lines...) Expand all Loading... |
46 virtual bool OnString(int id, const std::string& str) OVERRIDE; | 47 virtual bool OnString(int id, const std::string& str) OVERRIDE; |
47 | 48 |
48 int64 track_type_; | 49 int64 track_type_; |
49 int64 track_num_; | 50 int64 track_num_; |
50 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_; | 51 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_; |
51 | 52 |
52 int64 audio_track_num_; | 53 int64 audio_track_num_; |
53 int64 video_track_num_; | 54 int64 video_track_num_; |
54 std::string audio_encryption_key_id_; | 55 std::string audio_encryption_key_id_; |
55 std::string video_encryption_key_id_; | 56 std::string video_encryption_key_id_; |
| 57 LogCB log_cb_; |
56 | 58 |
57 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser); | 59 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser); |
58 }; | 60 }; |
59 | 61 |
60 } // namespace media | 62 } // namespace media |
61 | 63 |
62 #endif // MEDIA_WEBM_WEBM_TRACKS_PARSER_H_ | 64 #endif // MEDIA_WEBM_WEBM_TRACKS_PARSER_H_ |
OLD | NEW |