3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / plugins / asf_reader / ASFIndex.h
blob9ce69af98d3fadb49b91b768a2c3f4482bb5a8e8
1 /*
2 * Copyright (c) 2009, David McPaul
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
23 * OF THE POSSIBILITY OF SUCH DAMAGE.
25 #ifndef _ASF_INDEX_H
26 #define _ASF_INDEX_H
28 #include <SupportDefs.h>
30 #include <vector>
32 class IndexEntry {
33 public:
34 IndexEntry() {frameNo = 0;noPayloads=0;dataSize=0;pts=0;keyFrame=false;};
36 uint32 frameNo; // frame_no or sample_no
37 uint8 noPayloads; // The number of payloads that make up this frame
38 uint32 dataSize; // The size of the data available
39 bigtime_t pts; // Presentation Time Stamp for this frame
40 bool keyFrame; // Is this a keyframe.
41 uint8 id; // The id for this Entry
43 void Clear();
44 void AddPayload(uint32 pdataSize);
47 class StreamEntry {
48 public:
49 uint16 streamIndex;
51 StreamEntry();
52 ~StreamEntry();
54 IndexEntry GetIndex(uint32 frameNo);
55 bool HasIndex(uint32 frameNo);
56 IndexEntry GetIndex(bigtime_t pts);
57 bool HasIndex(bigtime_t pts);
59 bigtime_t getMaxPTS() {return maxPTS;};
60 uint32 getFrameCount() {return frameCount;};
61 bigtime_t getDuration() {return duration;};
62 void setDuration(bigtime_t pduration);
64 void AddPayload(uint32 id, bool keyFrame, bigtime_t pts, uint32 dataSize, bool isLast);
66 private:
67 std::vector<IndexEntry> index;
69 IndexEntry indexEntry;
70 uint32 lastID;
71 uint32 frameCount;
72 bigtime_t maxPTS;
73 bigtime_t duration;
76 #endif