summaryrefslogtreecommitdiff
path: root/global.h
blob: 23f7a1a92329b84590dd7d6ebdb6abd6107aacc4 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
 * global.h: A program for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 */

#ifndef __global_h_
#define __global_h_

#include <time.h>

#ifndef uchar
typedef unsigned char uchar;
#endif

#define MA_I_TYPE 1
#define MA_P_TYPE 2
#define MA_B_TYPE 3
#define MA_D_TYPE 4
#define MA_SI_TYPE 5
#define MA_SP_TYPE 6
#define MA_BI_TYPE 7

#define MT_COMMON        0x10
#define MT_ASPECTCHANGE  0x20
#define MT_CHANNELCHANGE 0x30
#define MT_CHANNELSTART  0x30
#define MT_CHANNELSTOP   0x31
#define MT_LOGOSTART     0x40
#define MT_LOGOSTOP      0x41
#define MT_BORDERSTART   0x50
#define MT_BORDERSTOP    0x51
#define MT_SILENCECHANGE 0x60
#define MT_ALL           0xFF

typedef struct MarkAdMark
{
    int Type;
    int Position;
    char *Comment;
} MarkAdMark;

typedef struct MarkAdAspectRatio
{
    int Num;
    int Den;
} MarkAdAspectRatio;

#define MARKAD_PIDTYPE_VIDEO_H262 0x10
#define MARKAD_PIDTYPE_VIDEO_H264 0x11
#define MARKAD_PIDTYPE_AUDIO_AC3  0x20
#define MARKAD_PIDTYPE_AUDIO_MP2  0x21

typedef struct MarkAdPid
{
    int Num;
    int Type;
} MarkAdPid;

typedef struct MarkAdContext
{
    char *LogoDir; // Logo Directory, default /var/lib/markad

    struct StandAlone
    {
        int LogoExtraction;
        int LogoWidth;
        int LogoHeight;
        bool ASD;
    } StandAlone;

    struct General
    {
        char *ChannelID;
        MarkAdPid VPid;
        MarkAdPid APid;
        MarkAdPid DPid;
    } General;

    struct Video
    {
        struct Options
        {
            bool IgnoreAspectRatio;
        } Options;

        struct Info
        {
            int Width;  // width of pic
            int Height; // height of pic
            int Pict_Type; // picture type (I,P,B,S,SI,SP,BI)
            MarkAdAspectRatio AspectRatio;
            double FramesPerSecond;
            bool Interlaced;
        } Info;

        struct Data
        {
            bool Valid; // flag, if true data is valid
            uchar *Plane[4];  // picture planes (YUV420)
            int PlaneLinesize[4]; // size int bytes of each picture plane line
        } Data;
    } Video;

    struct Audio
    {
        struct Options
        {
            bool AudioSilenceDetection;
        } Options;

        struct Info
        {
            int Channels; // number of audio channels
            int SampleRate;
        } Info;
        struct Data
        {
            bool Valid;
            short *SampleBuf;
            int SampleBufLen;
        } Data;
    } Audio;

} MarkAdContext;

#endif