OSDN Git Service

implement exec() in TsRemux class in Form1.cc
[tsremuxcpp/developing01.git] / src / Mkv.h
1 #ifndef TSREMUXCPP_MKV_H_
2 #define TSREMUXCPP_MKV_H_
3
4 #include "Utils.h"
5 #include "define_temporary.h"
6 #include "define_backgroundworker.h"
7
8 namespace TsRemux {
9
10 enum LacingType {
11     NoLacing = 0,
12     XiphLacing,
13     FixedSizeLacing,
14     EbmLacing
15 };
16
17 class EbmlElement {
18  public:
19   static boost::shared_ptr<EbmlElement> ParseEbml(Stream fs);
20   Int64 GetId(void);
21   void SetId(Int64 id);
22   Int64 GetSize(void);
23   void SetSize(Int64 size);
24   Int64 GetPos(void);
25   void SetPos(Int64 pos);
26   boost::shared_ptr<Stream> GetStream(void);
27   void SetStream(boost::shared_ptr<Stream> fs);
28   Stream DataStream;
29   boost::shared_ptr<EbmlElement> Children;
30   static byte VintLength(char vint);
31   static Int64 VintToInt64(Stream fs);
32  protected:
33   Int64 id;
34   Int64 size;
35   Int64 pos;
36   boost::shared_ptr<Stream> fs;
37   EbmlElement(Int64 id, Int64 size, Int64 pos, boost::shared_ptr<Stream> fs);
38 };
39
40 struct TrackInfo {
41  public:
42   TrackInfo(ushort pid, std::string codec, pByte data, EbmlElement& info);
43   ushort pid;
44   std::string codec;
45   pByte data;
46   EbmlElement info;
47 };
48
49 class MkvPesFile {
50  public:
51   MkvPesFile(BackgroundWorker& bw);
52   DTCP_Descriptor DtcpInfo;
53   boost::shared_array<PesPacket> GetNextPesPackets(void);
54   void Seek(Int32 pcr);
55  protected:
56   void GetInitialValues(void);
57  private:
58   SortedList<Int64, EbmlElement> Clusters;
59   Int32 CuurentIndex;
60   Dictionary<ushort, TrackInfo> TrackList;
61   UInt64 GetClusterClock(EbmlElement cluster);
62   PesPacket BuildAc3Pes(Int64 timestamp, pByte data, ushort pid);
63   PesPacket BuildMpeg2Pes(Int64 timestamp, pByte data, ushort pid);
64   PesPacket BuildAvcPes(Int64 timestamp, pByte data, ushort pid);
65   PesPacket BuildVc1Pes(Int64 timestamp, pByte data, ushort pid);
66   void GetTimeStamps(void);
67 };
68 }
69 #endif
70