diff --git a/main.cpp b/main.cpp index b46992d..4f6dcd5 100644 --- a/main.cpp +++ b/main.cpp @@ -95,8 +95,8 @@ int main(int argc, char* argv[]) { serviceREC(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8]); break; case 3: - printf("[INFO] Serviço em manutenção!!!\n"); - exit(0); + //printf("[INFO] Serviço em manutenção!!!\n"); + //exit(0); if(argc < 5){ serviceHelp(3); hasInvalid(); @@ -108,8 +108,6 @@ int main(int argc, char* argv[]) { serviceText(argv[1], argv[2], argv[3], argv[4], argv[5]); break; case 4: - printf("[INFO] Serviço em manutenção!!!\n"); - exit(0); if(argc < 5){ serviceHelp(4); hasInvalid(); @@ -219,7 +217,6 @@ void serviceText(char* service, char* path_text, char* transparency, char* id, c } void serviceOnlySRT(char* service, char* path_file, char* transparency, char* id, char* client_type){ - ServiceWindowGenerationFromSRT * service_srt; service_srt = new ServiceWindowGenerationFromSRT(path_file, (int) atoi(transparency), id, client_type, (int) atoi(service)); try{ diff --git a/servico/src/serviceWindowGeneration.cpp b/servico/src/serviceWindowGeneration.cpp index cff36ab..ca81211 100644 --- a/servico/src/serviceWindowGeneration.cpp +++ b/servico/src/serviceWindowGeneration.cpp @@ -87,15 +87,17 @@ void ServiceWindowGeneration::setPathLibras() { strcpy(final_path, PATH_CONTENTS); strcat(final_path, "libras.ts"); } - + this->path_libras = final_path; //DDPRINTF("Path TS File: %s\n", this->path_libras); } void ServiceWindowGeneration::setSizeOfSubtitles(int sub_size) { numero_legendas = sub_size; - if (legendas_enviadas >= numero_legendas) + if (legendas_enviadas >= numero_legendas){ sincronizador->stop(); + } + } void ServiceWindowGeneration::adicionaPTS(int64_t pts) { @@ -150,7 +152,7 @@ void ServiceWindowGeneration::initialize() { } else { tradutor->addListener(this); } - + if(this->transparency == 0) { //pega dicionario com BackGround opaco sincronizador = new Synchronizer(BASEDIR, EXTENSAO_DICIONARIO, this->path_libras, this->transparency); @@ -165,13 +167,13 @@ void ServiceWindowGeneration::initialize() { uint64_t pcr_base = (uint64_t) 1000; //FIXME: macro sincronizador->setPCRBase(pcr_base); } - sincronizador->addListener(this); sincronizador->Start(); } /* Método utilizado pelo Tradutor para notificar o texto traduzido. */ void ServiceWindowGeneration::notifyTranslation(vector * glosas) { + if (serviceType != SERVICE_TYPE_TEXT) { for (int i = 0; i < glosas->size(); i++) { std::locale loc; @@ -266,7 +268,6 @@ void ServiceWindowGeneration::createThumbnail(){ .append(PATH_API).append(getUserId()); }else{ try{ - cout << "entrei" << endl; char* pPath = new char[256]; pPath = reader->getAttributeValue("STORAGE"); command.append(pPath).append("/").append(getUserId()).append(".mp4"); diff --git a/servico/src/serviceWindowGenerationFromSRT.cpp b/servico/src/serviceWindowGenerationFromSRT.cpp index 7acb9f9..b934928 100644 --- a/servico/src/serviceWindowGenerationFromSRT.cpp +++ b/servico/src/serviceWindowGenerationFromSRT.cpp @@ -5,16 +5,6 @@ ServiceWindowGenerationFromSRT::ServiceWindowGenerationFromSRT(char* path_video, char* path_srt, int sublanguage, int position, int size, int transparency, char* id, char* client_type, int serviceType) { - // cout << "video: " << path_video << endl; - // cout << "srt: " << path_srt << endl; - // cout << "language: " << sublanguage << endl; - // cout << "position: " << position << endl; - // cout << "size: " << size << endl; - // cout << "transparency: " << transparency << endl; - // cout << "id: " << id << endl; - // cout << "serviceType: " << serviceType << endl; - //cout << "client_type: " << client_type << endl; - extrator_factory = new ExtratorFactory(); setPathInput(path_video); setPathSRT(path_srt); @@ -30,8 +20,9 @@ ServiceWindowGenerationFromSRT::ServiceWindowGenerationFromSRT(char* path_video, } //Construtor Service 4 -ServiceWindowGenerationFromSRT::ServiceWindowGenerationFromSRT(char* path_srt, int transparency, char* id, char* client_type, int _serviceType) { - extrator_factory = new ExtratorFactory(); +ServiceWindowGenerationFromSRT::ServiceWindowGenerationFromSRT(char* path_srt, int transparency, char* id, char* client_type, int serviceType) { + + extrator_factory = new ExtratorFactory(); setPathInput(path_srt); setClientType(client_type); setTransparency(transparency); diff --git a/synchronizer/src/synchronizer.cpp b/synchronizer/src/synchronizer.cpp index 04a8d9a..1978f28 100644 --- a/synchronizer/src/synchronizer.cpp +++ b/synchronizer/src/synchronizer.cpp @@ -480,10 +480,11 @@ void Synchronizer::Run() { int bufferSize = 7 * 188; char * buff = new char[bufferSize]; - char * arquivo; + char * arquivo; - while (videos->size() == 0) + while (videos->size() == 0){ usleep(50000); //50ms + } if(this->transparency == 0) arquivo = VIDEO_PADRAO; @@ -501,7 +502,7 @@ void Synchronizer::Run() { int videos_processed = 0; - int desc_out = -1; + int desc_out = -1; while (videos_processed <= count_tasks || service_running) { cnt = read(filefd, buff, bufferSize); diff --git a/tradutor/src/tradutorPortGlosa.cpp b/tradutor/src/tradutorPortGlosa.cpp index ce11535..1d3699e 100644 --- a/tradutor/src/tradutorPortGlosa.cpp +++ b/tradutor/src/tradutorPortGlosa.cpp @@ -72,6 +72,7 @@ namespace Tradutor { } void TradutorPortGlosa::traduz(unsigned char * texto) { + vector * vGlosa = portuguesToGlosaVector((const char *)texto); if (vGlosa->size() > 0) notifyListeners(vGlosa); @@ -89,13 +90,10 @@ namespace Tradutor { vector * TradutorPortGlosa::portuguesToGlosaVector(const char * input) { char * sGlosa; vector * vGlosa; - // Faz a tradução de portugues para glosa sGlosa = pyTradutor->convertStringToGlosa(input); - // Cria vetor de string contendo os tokens da glosa já traduzidos vGlosa = portuguesToGlosaVectorSplit(sGlosa); - return vGlosa; } -- libgit2 0.21.2