OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_WEBM_WEBM_INFO_PARSER_H_ |
| 6 #define MEDIA_WEBM_WEBM_INFO_PARSER_H_ |
| 7 |
| 8 #include "media/webm/webm_parser.h" |
| 9 |
| 10 namespace media { |
| 11 |
| 12 // Parser for WebM Info element. |
| 13 class WebMInfoParser : public WebMParserClient { |
| 14 public: |
| 15 WebMInfoParser(); |
| 16 virtual ~WebMInfoParser(); |
| 17 |
| 18 // Parses a WebM Info element in |buf|. |
| 19 // |
| 20 // Returns the number of bytes parsed on success. Returns -1 |
| 21 // on error. |
| 22 int Parse(const uint8* buf, int size); |
| 23 |
| 24 int64 timecode_scale() const { return timecode_scale_; } |
| 25 double duration() const { return duration_; } |
| 26 |
| 27 private: |
| 28 // WebMParserClient methods |
| 29 virtual bool OnListStart(int id); |
| 30 virtual bool OnListEnd(int id); |
| 31 virtual bool OnUInt(int id, int64 val); |
| 32 virtual bool OnFloat(int id, double val); |
| 33 virtual bool OnBinary(int id, const uint8* data, int size); |
| 34 virtual bool OnString(int id, const std::string& str); |
| 35 virtual bool OnSimpleBlock(int track_num, int timecode, int flags, |
| 36 const uint8* data, int size); |
| 37 |
| 38 int64 timecode_scale_; |
| 39 double duration_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(WebMInfoParser); |
| 42 }; |
| 43 |
| 44 } // namespace media |
| 45 |
| 46 #endif // MEDIA_WEBM_WEBM_INFO_PARSER_H_ |
OLD | NEW |