serviceWindowGenerationFromSRT.h 1.3 KB
#ifndef SERVICEWINDOWGENERATIONFROMSRT_H
#define	SERVICEWINDOWGENERATIONFROMSRT_H

#include "serviceWindowGeneration.h"
#include <pthread.h>
#include "inputFile.h"
#include "extratorFactory.h"
#include "listenerSRT.h"
#include "stdint.h"
#include <vector>
#include "jthread.h"

#define SRT 1

using namespace std;
using namespace jthread;
using namespace Util;

class ServiceWindowGenerationFromSRT : public ServiceWindowGeneration, public ListenerSRT, public Thread {

private:
    pthread_mutex_t *mutex_serviceSRT;
    ExtratorFactory *extrator_factory;
    ExtratorSRT * extratorSRT;
    char* path_srt;
    bool finish;
 
public:

	/* Construtor 1 - legenda e vídeo */
    ServiceWindowGenerationFromSRT(char* path_video, char* path_srt, int sublanguage, 
		int position, int size, int transparency, char* id, int _serviceType);
	/* Construtor 2 - só legenda */
    ServiceWindowGenerationFromSRT(char* path_srt, int transparency, char* id, int _serviceType);
    ~ServiceWindowGenerationFromSRT();
    
    virtual void notifySubtitle(unsigned char* subtitle, int64_t pts);
    virtual void notifyEnd(int sub_size);
    void notifyTranslator(unsigned char* subtitle);

    void initialize();
    bool isFinished();
    void Run();

    void setPathSRT(char* path_srt);
    
};

#endif	/* SERVICEWINDOWGENERATIONFROMSRT_H */