Chromium Code Reviews| Index: media/filters/webm_parser.h |
| diff --git a/media/filters/webm_parser.h b/media/filters/webm_parser.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..19b3f8764d80657931aff874a5fda9f2d034ea47 |
| --- /dev/null |
| +++ b/media/filters/webm_parser.h |
| @@ -0,0 +1,94 @@ |
| +// 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_FILTERS_WEBM_PARSER_H_ |
|
scherkus (not reviewing)
2011/06/22 17:31:09
nit: add space before
|
| +#define MEDIA_FILTERS_WEBM_PARSER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| + |
| +namespace media { |
|
scherkus (not reviewing)
2011/06/22 17:31:09
I don't see any reason why this needs to be inside
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
Done. Moved to webm folder.
|
| + |
| +const int kWebMIdAspectRatioType = 0x54B3; |
|
scherkus (not reviewing)
2011/06/22 17:31:09
typically initialize these in .cc
would it make s
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
Done. Moved to webm_constants.h
|
| +const int kWebMIdAudio = 0xE1; |
| +const int kWebMIdBitDepth = 0x6264; |
| +const int kWebMIdBlock = 0xA1; |
| +const int kWebMIdBlockGroup = 0xA0; |
| +const int kWebMIdChannels = 0x9F; |
| +const int kWebMIdCluster = 0x1f43b675; |
| +const int kWebMIdCodecID = 0x86; |
| +const int kWebMIdCodecName = 0x258688; |
| +const int kWebMIdCodecPrivate = 0x63A2; |
| +const int kWebMIdDateUTC = 0x4461; |
| +const int kWebMIdDefaultDuration = 0x23E383; |
| +const int kWebMIdDisplayHeight = 0x54BA; |
| +const int kWebMIdDisplayUnit = 0x54B2; |
| +const int kWebMIdDisplayWidth = 0x54B0; |
| +const int kWebMIdDuration = 0x4489; |
| +const int kWebMIdFlagDefault = 0x88; |
| +const int kWebMIdFlagEnabled = 0xB9; |
| +const int kWebMIdFlagForced = 0x55AA; |
| +const int kWebMIdFlagInterlaced = 0x9A; |
| +const int kWebMIdFlagLacing = 0x9C; |
| +const int kWebMIdInfo = 0x1549A966; |
| +const int kWebMIdLanguage = 0x22B59C; |
| +const int kWebMIdMuxingApp = 0x4D80; |
| +const int kWebMIdName = 0x536E; |
| +const int kWebMIdOutputSamplingFrequency = 0x78B5; |
| +const int kWebMIdPixelCropBottom = 0x54AA; |
| +const int kWebMIdPixelCropLeft = 0x54CC; |
| +const int kWebMIdPixelCropRight = 0x54DD; |
| +const int kWebMIdPixelCropTop = 0x54BB; |
| +const int kWebMIdPixelHeight = 0xBA; |
| +const int kWebMIdPixelWidth = 0xB0; |
| +const int kWebMIdSamplingFrequency = 0xB5; |
| +const int kWebMIdSegmentUID = 0x73A4; |
| +const int kWebMIdSimpleBlock = 0xA3; |
| +const int kWebMIdStereoMode = 0x53B8; |
| +const int kWebMIdTimecode = 0xE7; |
| +const int kWebMIdTimecodeScale = 0x2AD7B1; |
| +const int kWebMIdTitle = 0x7BA9; |
| +const int kWebMIdTrackEntry = 0xAE; |
| +const int kWebMIdTrackNumber = 0xD7; |
| +const int kWebMIdTrackType = 0x83; |
| +const int kWebMIdTrackUID = 0x73C5; |
| +const int kWebMIdTracks = 0x1654AE6B; |
| +const int kWebMIdVideo = 0xE0; |
| +const int kWebMIdWritingApp = 0x5741; |
| + |
| +// Interface for receiving WebM parser events. |
| +// |
| +// Each method is called when an element of the specified type is parsed. |
| +// The ID of the element that was parsed is given along with the value |
| +// stored in the element. List elements generate calls at the start and |
| +// end of the list. Any pointers passed to these methods are only guarenteed |
|
scherkus (not reviewing)
2011/06/22 17:31:09
guaranteed
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
Done.
|
| +// to be valid for the life of that call. Once the call returns the pointer |
| +// may become invalid. Each method returns a bool that indicates whether the |
|
scherkus (not reviewing)
2011/06/22 17:31:09
nit: previous sentence says pointers are only guar
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
Done.
|
| +// parsed data is valid. If false is returned then the parse is immediately |
| +// terminated and an error is reported by the parser. |
| +class WebMParserClient { |
| + public: |
| + virtual ~WebMParserClient(); |
| + |
| + virtual bool OnListStart(int id) = 0; |
| + virtual bool OnListEnd(int id) = 0; |
| + virtual bool OnUInt(int id, int64 val) = 0; |
| + virtual bool OnFloat(int id, double val) = 0; |
| + virtual bool OnBinary(int id, const uint8* data, int size) = 0; |
| + virtual bool OnString(int id, const std::string& str) = 0; |
| + virtual bool OnSimpleBlock(int track_num, int timecode, |
| + int flags, |
| + const uint8* data, int size) = 0; |
| +}; |
| + |
| +// Parses a buffer that contains INFO & TRACKS elements. |
| +int webm_parse_headers(WebMParserClient* client, |
|
scherkus (not reviewing)
2011/06/22 17:31:09
this looks like a non-trivial method -- Perhaps Pa
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
Done.
|
| + const uint8* buf, int size); |
| + |
| +// Parses a buffer that contains a CLUSTER element. |
| +int webm_parse_cluster(WebMParserClient* client, |
|
scherkus (not reviewing)
2011/06/22 17:31:09
docs for these methods?
I notice they return -1 -
acolwell GONE FROM CHROMIUM
2011/06/23 16:51:28
I've added comments to explain the return value. T
|
| + const uint8* buf, int size); |
| +} // namespace media |
| + |
| +#endif // MEDIA_FILTERS_WEBM_PARSER_H_ |