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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Parses a WebM Tracks element in |buf|. | 24 // Parses a WebM Tracks element in |buf|. |
25 // | 25 // |
26 // Returns -1 if the parse fails. | 26 // Returns -1 if the parse fails. |
27 // Returns 0 if more data is needed. | 27 // Returns 0 if more data is needed. |
28 // Returns the number of bytes parsed on success. | 28 // Returns the number of bytes parsed on success. |
29 int Parse(const uint8* buf, int size); | 29 int Parse(const uint8* buf, int size); |
30 | 30 |
31 int64 audio_track_num() const { return audio_track_num_; } | 31 int64 audio_track_num() const { return audio_track_num_; } |
32 int64 video_track_num() const { return video_track_num_; } | 32 int64 video_track_num() const { return video_track_num_; } |
33 | 33 |
| 34 const std::string& audio_encryption_key_id() const; |
34 const std::string& video_encryption_key_id() const; | 35 const std::string& video_encryption_key_id() const; |
35 | 36 |
36 private: | 37 private: |
37 // WebMParserClient methods | 38 // WebMParserClient methods |
38 virtual WebMParserClient* OnListStart(int id) OVERRIDE; | 39 virtual WebMParserClient* OnListStart(int id) OVERRIDE; |
39 virtual bool OnListEnd(int id) OVERRIDE; | 40 virtual bool OnListEnd(int id) OVERRIDE; |
40 virtual bool OnUInt(int id, int64 val) OVERRIDE; | 41 virtual bool OnUInt(int id, int64 val) OVERRIDE; |
41 virtual bool OnFloat(int id, double val) OVERRIDE; | 42 virtual bool OnFloat(int id, double val) OVERRIDE; |
42 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; | 43 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; |
43 virtual bool OnString(int id, const std::string& str) OVERRIDE; | 44 virtual bool OnString(int id, const std::string& str) OVERRIDE; |
44 | 45 |
45 int64 track_type_; | 46 int64 track_type_; |
46 int64 track_num_; | 47 int64 track_num_; |
47 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_; | 48 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_; |
48 | 49 |
49 int64 audio_track_num_; | 50 int64 audio_track_num_; |
50 scoped_ptr<WebMContentEncodingsClient> audio_content_encodings_client_; | 51 scoped_ptr<WebMContentEncodingsClient> audio_content_encodings_client_; |
51 | 52 |
52 int64 video_track_num_; | 53 int64 video_track_num_; |
53 scoped_ptr<WebMContentEncodingsClient> video_content_encodings_client_; | 54 scoped_ptr<WebMContentEncodingsClient> video_content_encodings_client_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser); | 56 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser); |
56 }; | 57 }; |
57 | 58 |
58 } // namespace media | 59 } // namespace media |
59 | 60 |
60 #endif // MEDIA_WEBM_WEBM_TRACKS_PARSER_H_ | 61 #endif // MEDIA_WEBM_WEBM_TRACKS_PARSER_H_ |
OLD | NEW |