summaryrefslogtreecommitdiffstats
path: root/media/webm/webm_info_parser.h
diff options
context:
space:
mode:
authoracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-29 16:37:46 +0000
committeracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-29 16:37:46 +0000
commit020fba32dc0e07d855d644bd575d88365b7e2deb (patch)
tree73cce4387cebbc4497b746f3641a60b66e0ff3be /media/webm/webm_info_parser.h
parent8914a69a5973071c57b47d4a0c6c43b7330ff9b1 (diff)
downloadchromium_src-020fba32dc0e07d855d644bd575d88365b7e2deb.zip
chromium_src-020fba32dc0e07d855d644bd575d88365b7e2deb.tar.gz
chromium_src-020fba32dc0e07d855d644bd575d88365b7e2deb.tar.bz2
Adding ChunkDemuxer implementation.
BUG=86536 TEST=ChunkDemuxerTest.* Review URL: http://codereview.chromium.org/7203002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90966 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/webm/webm_info_parser.h')
-rw-r--r--media/webm/webm_info_parser.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/media/webm/webm_info_parser.h b/media/webm/webm_info_parser.h
new file mode 100644
index 0000000..6391f8b
--- /dev/null
+++ b/media/webm/webm_info_parser.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_WEBM_WEBM_INFO_PARSER_H_
+#define MEDIA_WEBM_WEBM_INFO_PARSER_H_
+
+#include "media/webm/webm_parser.h"
+
+namespace media {
+
+// Parser for WebM Info element.
+class WebMInfoParser : public WebMParserClient {
+ public:
+ WebMInfoParser();
+ virtual ~WebMInfoParser();
+
+ // Parses a WebM Info element in |buf|.
+ //
+ // Returns the number of bytes parsed on success. Returns -1
+ // on error.
+ int Parse(const uint8* buf, int size);
+
+ int64 timecode_scale() const { return timecode_scale_; }
+ double duration() const { return duration_; }
+
+ private:
+ // WebMParserClient methods
+ virtual bool OnListStart(int id);
+ virtual bool OnListEnd(int id);
+ virtual bool OnUInt(int id, int64 val);
+ virtual bool OnFloat(int id, double val);
+ virtual bool OnBinary(int id, const uint8* data, int size);
+ virtual bool OnString(int id, const std::string& str);
+ virtual bool OnSimpleBlock(int track_num, int timecode, int flags,
+ const uint8* data, int size);
+
+ int64 timecode_scale_;
+ double duration_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebMInfoParser);
+};
+
+} // namespace media
+
+#endif // MEDIA_WEBM_WEBM_INFO_PARSER_H_