Chromium Code Reviews| 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 #ifndef MEDIA_FILTERS_WEBM_PARSER_H_ | |
|
scherkus (not reviewing)
2011/06/22 17:31:09
nit: add space before
| |
| 5 #define MEDIA_FILTERS_WEBM_PARSER_H_ | |
| 6 | |
| 7 #include <string> | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 | |
| 11 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.
| |
| 12 | |
| 13 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
| |
| 14 const int kWebMIdAudio = 0xE1; | |
| 15 const int kWebMIdBitDepth = 0x6264; | |
| 16 const int kWebMIdBlock = 0xA1; | |
| 17 const int kWebMIdBlockGroup = 0xA0; | |
| 18 const int kWebMIdChannels = 0x9F; | |
| 19 const int kWebMIdCluster = 0x1f43b675; | |
| 20 const int kWebMIdCodecID = 0x86; | |
| 21 const int kWebMIdCodecName = 0x258688; | |
| 22 const int kWebMIdCodecPrivate = 0x63A2; | |
| 23 const int kWebMIdDateUTC = 0x4461; | |
| 24 const int kWebMIdDefaultDuration = 0x23E383; | |
| 25 const int kWebMIdDisplayHeight = 0x54BA; | |
| 26 const int kWebMIdDisplayUnit = 0x54B2; | |
| 27 const int kWebMIdDisplayWidth = 0x54B0; | |
| 28 const int kWebMIdDuration = 0x4489; | |
| 29 const int kWebMIdFlagDefault = 0x88; | |
| 30 const int kWebMIdFlagEnabled = 0xB9; | |
| 31 const int kWebMIdFlagForced = 0x55AA; | |
| 32 const int kWebMIdFlagInterlaced = 0x9A; | |
| 33 const int kWebMIdFlagLacing = 0x9C; | |
| 34 const int kWebMIdInfo = 0x1549A966; | |
| 35 const int kWebMIdLanguage = 0x22B59C; | |
| 36 const int kWebMIdMuxingApp = 0x4D80; | |
| 37 const int kWebMIdName = 0x536E; | |
| 38 const int kWebMIdOutputSamplingFrequency = 0x78B5; | |
| 39 const int kWebMIdPixelCropBottom = 0x54AA; | |
| 40 const int kWebMIdPixelCropLeft = 0x54CC; | |
| 41 const int kWebMIdPixelCropRight = 0x54DD; | |
| 42 const int kWebMIdPixelCropTop = 0x54BB; | |
| 43 const int kWebMIdPixelHeight = 0xBA; | |
| 44 const int kWebMIdPixelWidth = 0xB0; | |
| 45 const int kWebMIdSamplingFrequency = 0xB5; | |
| 46 const int kWebMIdSegmentUID = 0x73A4; | |
| 47 const int kWebMIdSimpleBlock = 0xA3; | |
| 48 const int kWebMIdStereoMode = 0x53B8; | |
| 49 const int kWebMIdTimecode = 0xE7; | |
| 50 const int kWebMIdTimecodeScale = 0x2AD7B1; | |
| 51 const int kWebMIdTitle = 0x7BA9; | |
| 52 const int kWebMIdTrackEntry = 0xAE; | |
| 53 const int kWebMIdTrackNumber = 0xD7; | |
| 54 const int kWebMIdTrackType = 0x83; | |
| 55 const int kWebMIdTrackUID = 0x73C5; | |
| 56 const int kWebMIdTracks = 0x1654AE6B; | |
| 57 const int kWebMIdVideo = 0xE0; | |
| 58 const int kWebMIdWritingApp = 0x5741; | |
| 59 | |
| 60 // Interface for receiving WebM parser events. | |
| 61 // | |
| 62 // Each method is called when an element of the specified type is parsed. | |
| 63 // The ID of the element that was parsed is given along with the value | |
| 64 // stored in the element. List elements generate calls at the start and | |
| 65 // 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.
| |
| 66 // to be valid for the life of that call. Once the call returns the pointer | |
| 67 // 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.
| |
| 68 // parsed data is valid. If false is returned then the parse is immediately | |
| 69 // terminated and an error is reported by the parser. | |
| 70 class WebMParserClient { | |
| 71 public: | |
| 72 virtual ~WebMParserClient(); | |
| 73 | |
| 74 virtual bool OnListStart(int id) = 0; | |
| 75 virtual bool OnListEnd(int id) = 0; | |
| 76 virtual bool OnUInt(int id, int64 val) = 0; | |
| 77 virtual bool OnFloat(int id, double val) = 0; | |
| 78 virtual bool OnBinary(int id, const uint8* data, int size) = 0; | |
| 79 virtual bool OnString(int id, const std::string& str) = 0; | |
| 80 virtual bool OnSimpleBlock(int track_num, int timecode, | |
| 81 int flags, | |
| 82 const uint8* data, int size) = 0; | |
| 83 }; | |
| 84 | |
| 85 // Parses a buffer that contains INFO & TRACKS elements. | |
| 86 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.
| |
| 87 const uint8* buf, int size); | |
| 88 | |
| 89 // Parses a buffer that contains a CLUSTER element. | |
| 90 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
| |
| 91 const uint8* buf, int size); | |
| 92 } // namespace media | |
| 93 | |
| 94 #endif // MEDIA_FILTERS_WEBM_PARSER_H_ | |
| OLD | NEW |