-
Notifications
You must be signed in to change notification settings - Fork 2
/
constants.h
82 lines (71 loc) · 1.54 KB
/
constants.h
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
#ifndef CONSTANTS
#define CONSTANTS
#define ALIGNMENT 32
#define MAX_BUFFER 100
#define MAX_CHAR 50
#define NUM_ROWS 2
#define NUM_THREADS 3
#define NUM_CHANNELS 3
#define TIME_CODE_LENGTH 11
#define MATCH_EXPR "[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9] --> [0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]"
#define CHAR_X 8
#define CHAR_Y 8
#define R 0
#define G 1
#define B 2
#include "Lib/ascii_art.h"
#include <stdatomic.h>
#include <stdio.h>
#include <unistd.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavutil/imgutils.h>
#include <pthread.h>
#include <sys/time.h>
#include <ncurses.h>
#include <stdio.h>
#include <regex.h>
#include <math.h>
struct videoStream {
double fps;
double srcFps;
int width;
int scr_width;
int height;
int scr_height;
int scale;
double time;
double realTime;
int frameCount;
char* subFile;
double* subTimes;
char subs[2][MAX_CHAR];
int subPos;
int fpPos;
atomic_int bufferLength;
pthread_mutex_t mutex;
atomic_bool bufferEnd;
};
struct vBuffer {
uint8_t *frame;
struct vBuffer *next;
double timestamp;
};
struct vStreamArgs {
char *file;
struct vBuffer *buffer;
};
struct playback {
atomic_bool pause;
atomic_bool fast_forward;
atomic_bool cease_execution;
};
extern struct videoStream vStream;
extern struct timespec wait;
extern struct playback controls;
extern FILE* subFile;
extern regex_t matchTime;
extern int debug;
extern int skew;
#endif