wheee!
[asdcplib.git] / Index.h
1 //
2 //
3 //
4
5 #ifndef _INDEX_H_
6 #define _INDEX_H_
7
8 #include "MXF.h"
9
10 namespace ASDCP
11 {
12   namespace MXF
13     {
14       //
15       class IndexTableSegment : public InterchangeObject
16         {
17           ASDCP_NO_COPY_CONSTRUCT(IndexTableSegment);
18
19         public:
20           //
21           class DeltaEntry
22             {
23             public:
24               i8_t    PosTableIndex;
25               ui8_t   Slice;
26               ui32_t  ElementData;
27
28               Result_t ReadFrom(ASDCP::MemIOReader& Reader);
29               Result_t WriteTo(ASDCP::MemIOWriter& Writer);
30               inline const char* ToString(char* str_buf) const;
31             };
32
33           //
34           class IndexEntry
35             {
36             public:
37               i8_t            TemporalOffset;
38               i8_t            KeyFrameOffset;
39               ui8_t           Flags;
40               ui64_t          StreamOffset;
41               std::list<ui32_t>  SliceOffset;
42               Array<Rational> PosTable;
43
44               Result_t ReadFrom(ASDCP::MemIOReader& Reader);
45               Result_t WriteTo(ASDCP::MemIOWriter& Writer);
46               inline const char* ToString(char* str_buf) const;
47             };
48
49           Rational    IndexEditRate;
50           ui64_t      IndexStartPosition;
51           ui64_t      IndexDuration;
52           ui32_t      EditUnitByteCount;
53           ui32_t      IndexSID;
54           ui32_t      BodySID;
55           ui8_t       SliceCount;
56           ui8_t       PosTableCount;
57           Batch<DeltaEntry> DeltaEntryArray;
58           Batch<IndexEntry> IndexEntryArray;
59
60           IndexTableSegment();
61           virtual ~IndexTableSegment();
62           virtual Result_t InitFromBuffer(const byte_t* p, ui32_t l);
63           virtual Result_t WriteToBuffer(ASDCP::FrameBuffer& Buffer);
64           virtual void     Dump(FILE* = 0);
65         };
66
67     } // namespace MXF
68 } // namespace ASDCP
69
70
71 #endif // _INDEX_H_
72
73 //
74 // end MXF.h
75 //