Commit dcc05fb376b1045cdc278c6354ec5b4c84e6da2a

Authored by Wesnydy Ribeiro
1 parent 08d369fe
Exists in master and in 1 other branch devel

Remove o componente input

input/src/include/inputException.h
... ... @@ -1,26 +0,0 @@
1   -/***************************************************************************
2   - * Universidade Federal da Paraíba *
3   - * Copyright (C) 2014 by Laboratório de Aplicações de Vídeo Digital *
4   - * *
5   - * Centro de Informática - UFPB - Campus I *
6   - * João Pessoa - PB - Brasil *
7   - * *
8   - * Author: Erickson Silva (erickson.silva@lavid.ufpb.br) *
9   - * *
10   - **************************************************************************/
11   -
12   - #ifndef INPUTEXCEPTION_H
13   - #define INPUTEXCEPTION_H
14   -
15   - #include <lavidlib/base/RuntimeException.h>
16   -
17   - using namespace lavidlib;
18   -
19   - class InputException : public RuntimeException {
20   - public:
21   - InputException(const std::string message);
22   - InputException(const char* message);
23   - };
24   -
25   -
26   - #endif /* INPUTEXCEPTION_H */
27 0 \ No newline at end of file
input/src/include/inputFile.h
... ... @@ -1,46 +0,0 @@
1   -/*
2   - * File: fileInput.h
3   - * Author: leonardo
4   - *
5   - * Created on 6 de Janeiro de 2012, 11:11
6   - */
7   -
8   -#ifndef INPUTFILE_H
9   -#define INPUTFILE_H
10   -
11   -#include <stdio.h>
12   -#include <list>
13   -#include <stdlib.h>
14   -#include <fstream>
15   -#include <string.h>
16   -#include "logging.h"
17   -#include "listenerInput.h"
18   -#include "inputException.h"
19   -
20   -#define MAX_SIZE_PACKET 188
21   -
22   -using namespace std;
23   -using namespace util;
24   -
25   -class InputFile {
26   -
27   -public:
28   - InputFile(char* path);
29   - ~InputFile();
30   - void initialize();
31   - void addListener(ListenerInput* listener);
32   - void removeListener(ListenerInput* listener);
33   - void notifyListeners(unsigned char* pack);
34   - bool isFinished();
35   -
36   - //void notificaQuantidadeGlosas(int quantidade);
37   -
38   -private:
39   - list<ListenerInput*> *listeners;
40   - char *path;
41   - bool finish;
42   -
43   -};
44   -
45   -#endif /* INPUTFILE_H */
46   -
input/src/include/listenerInput.h
... ... @@ -1,19 +0,0 @@
1   -/*
2   - * File: ouvinteInput.h
3   - * Author: derzu
4   - *
5   - * Created on 8 de Fevereiro de 2010, 18:19
6   - */
7   -
8   -#ifndef _LISTENERINPUT_H
9   -#define _LISTENERINPUT_H
10   -
11   -class ListenerInput {
12   -public:
13   - virtual void notifyInput(unsigned char *pack)=0;
14   - //virtual void finalizouInput()=0;
15   -
16   -};
17   -
18   -#endif /* _LISTENERINPUT_H */
19   -
input/src/inputException.cpp
... ... @@ -1,20 +0,0 @@
1   -/***************************************************************************
2   - * Universidade Federal da Paraíba *
3   - * Copyright (C) 2014 by Laboratório de Aplicações de Vídeo Digital *
4   - * *
5   - * Centro de Informática - UFPB - Campus I *
6   - * João Pessoa - PB - Brasil *
7   - * *
8   - * Author: Erickson Silva (erickson.silva@lavid.ufpb.br) *
9   - * *
10   - **************************************************************************/
11   -
12   - #include "inputException.h"
13   -
14   - InputException::InputException(const std::string message)
15   - : RuntimeException(message)
16   - { /* TODO */ }
17   - InputException::InputException(const char* message)
18   - : RuntimeException(message)
19   - { /* TODO */ }
20   -
21 0 \ No newline at end of file
input/src/inputFile.cpp
... ... @@ -1,59 +0,0 @@
1   -
2   -#include "inputFile.h"
3   -
4   -InputFile::InputFile(char* path) {
5   - this->path = path;
6   - this->listeners = new list<ListenerInput*>();
7   - finish = false;
8   - PRINTL(util::_DEBUG, "Done!\n");
9   -}
10   -
11   -InputFile::~InputFile(){
12   - listeners->clear();
13   - delete listeners;
14   - PRINTL(util::_DEBUG, "Input finalized!\n");
15   -}
16   -
17   -void InputFile::initialize(){
18   - ifstream filein(path, ifstream::binary);
19   -
20   - if (strstr(path, ".ts") != NULL) {
21   - if (filein.is_open()) {
22   - char buffer [MAX_SIZE_PACKET];
23   - PRINTL(util::_INFO, "Lendo arquivo...\n");
24   - while (!filein.eof()) {
25   - filein.read(buffer, MAX_SIZE_PACKET);
26   - unsigned char* packet = (unsigned char*) buffer;
27   - notifyListeners(packet);
28   - }
29   - printf("\n");
30   - filein.close();
31   - //finished = true;
32   - } else {
33   - finish = true;
34   - Logging::instance()->writeLog("inputFile.cpp <Error>: Arquivo de vídeo não encontrado.");
35   - throw InputException("Falha ao abrir o arquivo de vídeo! Verifique se o mesmo existe.");
36   - }
37   - }
38   - finish = true;
39   -
40   -}
41   -
42   -bool InputFile::isFinished(){
43   - return this->finish;
44   -}
45   -
46   -void InputFile::addListener(ListenerInput* listener){
47   - this->listeners->push_back(listener);
48   -}
49   -
50   -void InputFile::removeListener(ListenerInput* listener) {
51   - this->listeners->remove(listener);
52   -}
53   -
54   -void InputFile::notifyListeners(unsigned char* pack){
55   - for(list<ListenerInput*>::iterator it = this->listeners->begin(); it != this->listeners->end(); it++){
56   - (*it)->notifyInput(pack);
57   - }
58   -}
59   -