forked from wmcbrine/tivodecode-ng
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtivo_decoder_base.hxx
52 lines (39 loc) · 1.13 KB
/
tivo_decoder_base.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef TIVO_DECODER_HXX_
#define TIVO_DECODER_HXX_
#ifdef HAVE_CONFIG_H
#include "tdconfig.h"
#endif
#include <cstdio>
#include "tivo_parse.hxx"
#include "turing_stream.hxx"
#define LOOK_AHEAD(fh, bytes, n) do {\
int retval = fh->read((bytes) + looked_ahead, (n) - looked_ahead);\
if ( retval == 0 )\
{\
return 0; \
}\
else if ( retval != (n) - looked_ahead) { \
perror ("read"); \
return -1; \
} else { \
looked_ahead = (n); \
} \
} while (0)
/* All elements are in big-endian format and are packed */
class TiVoDecoder
{
public:
bool running;
bool isValid;
TuringState *pTuring;
HappyFile *pFileIn;
HappyFile *pFileOut;
int do_header(uint8_t *arg_0, int *block_no, int *arg_8,
int *crypted, int *arg_10, int *arg_14);
virtual bool process() = 0;
TiVoDecoder(TuringState *pTuringState, HappyFile *pInfile,
HappyFile *pOutfile);
virtual ~TiVoDecoder();
} __attribute__((packed));
#endif /* TIVO_DECODER_HXX_ */
/* vi:set ai ts=4 sw=4 expandtab: */