Mixer.h
3.23 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/**
* \file Mixer.h
*
* \author Eduardo
* \date 17/01/2012
*/
#ifndef MIXER_H
#define MIXER_H
#include "string.h"
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string>
#include <fstream>
#include "logging.h"
//SL Video Position
#define TOP_LEFT 1
#define TOP_RIGHT 2
#define BOTTOM_RIGHT 3
#define BOTTOM_LEFT 4
//SL Video Size
#define SMALL 1
#define MEDIUM 2
#define LARGE 3
//SL Video Width
#define SMALL_HEIGHT 324 //0,3*1080 se fosse full hd
#define MEDIUM_HEIGHT 432 //0,4*1080
#define LARGE_HEIGHT 540 //0.5*1080
#define MAX_SIZE_PATH 256
using namespace std;
using namespace util;
/** \brief Classe que implementa o mixer de vídeo.
*
* \headerfile mixer/src/include/Mixer.h
*/
class Mixer {
public:
/** Construtor.
*
* \param mainVideo O vídeo principal.
* \param secondaryVideo O vídeo secundário.
*/
Mixer(string,string);
/** Construtor */
Mixer();
/** Destrutor */
virtual ~Mixer();
/** Ajusta o FPS do vídeo principal para 45 se preciso. */
void adjustVideosFps();
/** Realiza a Mixagem do vídeo original com o vídeo de LIBRAS. */
void mixVideos();
/** Seta o tamanho do vídeo de LIBRAS. */
void setSize(int);
/** Seta o path do vídeo principal. */
void setMainVideo(string);
/** Retorna o path do vídeo principal.
*
* \return Path do vídeo principal.
*/
string getMainVideo();
/** Seta o path do vídeo secundario. */
void setSecondaryVideo(string);
/** Retorna o path do vídeo secundário.
*
* \return Path do vídeo secundário.
*/
string getSecondaryVideo();
/** Seta a posição do vídeo secundário em relação ao vídeo principal. */
void setPositionSecondaryVideo(int);
/** Retorna a posição do vídeo secundário em relação ao vídeo principal.
*
* \return A posição do vídeo.
*/
int getPositionSecondaryVideo();
/** Seta a transparência do vídeo secundário. */
void setTransparency(int);
/** Retorna a Transparência do vídeo secundário.
*
* \return A transparência do vídeo.
*/
int getTransparency();
/** seta o número de threads utilizadas na mixagem. */
void setNumThreads(string);
/** Retorna o número de threads utilizadas na mixagem.
*
* \return O número de threads.
*/
string getNumThreads();
/** Inicializa o processo de mixagem.
*
* \param mainVideo O vídeo princial.
* \param slVideo O vídeo secundário.
*/
void initialize(string mainVideo, string slVideo, int, int, int, char*, char*, char*);
/** Seta o path do vídeo mixado */
void setPathFinal();
private:
struct fpsAndLine {
string line;
double fps;
string possibleProgramID;
};
void readFileFPS(fpsAndLine [], int *);
void convertMainVideoFPS(fpsAndLine [], int *);
void convertSecondaryVideoFPS(double);
string mainVideo, secondaryVideo, temporaryTextFile, numThreads, pathFinal, user_id, nameOfMainVideo;
char* contents;
char* uploads;
int positionSecondaryVideo;
double widthSecondaryVideo, heightSecondaryVideo;
int transparency;
};
#endif /* MIXER_H */