]> git.vomp.tv Git - vompclient.git/blob - demuxervdr.h
Demuxer frame counting: first step
[vompclient.git] / demuxervdr.h
1 /*
2     Copyright 2005-2006 Mark Calderbank
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef DEMUXERVDR_H
22 #define DEMUXERVDR_H
23
24 #include <deque>
25 #include "demuxer.h"
26 #include "defines.h"
27
28 class DemuxerVDR : public Demuxer
29 {
30   class PESPacketVDR : public PESPacket
31   {
32     void parseDetails();    
33   };
34   friend class PESPacketVDR;
35     
36   public:
37     DemuxerVDR();
38     void flush();
39     int scan(UCHAR* buf, int len);
40     int findVideoPTS(UCHAR* buf, int len, ULLONG* dest);
41 #ifndef NEW_DEMUXER
42     int put(UCHAR* buf, int len);
43 #else
44     int put(UCHAR* buf, int len,ULLONG cur_pos);
45 #endif
46     void setFrameNum(ULONG frame);
47
48   private:
49     int state;
50     bool submitting;
51     int packetLength;
52     PESPacketVDR packet;
53
54     ULONG frameNumber;
55     bool frameCounting;
56     typedef struct { ULLONG pts; ULONG frame; } PTSMapEntry;
57     std::deque<PTSMapEntry> PTSMap;
58 };
59
60 #endif