Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Unified Diff: media/webm/webm_info_parser.h

Issue 7203002: Adding ChunkDemuxer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit tests and nits Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/webm/webm_constants.h ('k') | media/webm/webm_info_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/webm/webm_info_parser.h
diff --git a/media/webm/webm_info_parser.h b/media/webm/webm_info_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..6391f8b9892f80349396e5498a287386c8be31ec
--- /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_
« no previous file with comments | « media/webm/webm_constants.h ('k') | media/webm/webm_info_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698