serviceWindowGenerationFromSRT.h 1.37 KB
#ifndef SERVICEWINDOWGENERATIONFROMSRT_H
#define	SERVICEWINDOWGENERATIONFROMSRT_H

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

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

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

private:
    pthread_mutex_t *mutex_serviceSRT;
    ExtratorSRT * extratorSRT;
    char* path_srt;
    bool finish_srt;
 
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);

	/* Destrutor */
    ~ServiceWindowGenerationFromSRT();
    
    virtual void notifySubtitle(unsigned char* subtitle, int64_t pts);
    virtual void notifyEnd(int sub_size);
    
    void notificaTradutor(unsigned char *legenda);

    bool finished();

    void notificaSincronizadorSemTradutor(unsigned char *legenda, int64_t pts);
    void initialize();
    void setPathSRT(char* path_srt);
    void Run();

};

#endif	/* SERVICEWINDOWGENERATIONFROMSRT_H */