From 96c7c6e5c22390aab79908e47e6b57acfe107ea5 Mon Sep 17 00:00:00 2001 From: Wesnydy Ribeiro Date: Sun, 26 Apr 2015 16:29:01 -0300 Subject: [PATCH] Remoção do componente MonitorPCR(Ajuste) --- monitorPCR/src/include/listenerMonitorPCRBase.h | 21 --------------------- monitorPCR/src/include/monitor_pcr.h | 56 -------------------------------------------------------- monitorPCR/src/monitor_pcr.cpp | 71 ----------------------------------------------------------------------- 3 files changed, 0 insertions(+), 148 deletions(-) delete mode 100644 monitorPCR/src/include/listenerMonitorPCRBase.h delete mode 100644 monitorPCR/src/include/monitor_pcr.h delete mode 100644 monitorPCR/src/monitor_pcr.cpp diff --git a/monitorPCR/src/include/listenerMonitorPCRBase.h b/monitorPCR/src/include/listenerMonitorPCRBase.h deleted file mode 100644 index 2d0d7e6..0000000 --- a/monitorPCR/src/include/listenerMonitorPCRBase.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * File: listenerMonitorPCRBase.h - * Author: leonardo - * - * Created on 18 de Fevereiro de 2012, 20:46 - */ - -#ifndef LISTENERMONITORPCRBASE_H -#define LISTENERMONITORPCRBASE_H - -#include - -class ListenerMonitorPCRBase { - -public: - virtual void notifyPCRBase(uint64_t pcrbase) = 0; - -}; - -#endif /* LISTENERMONITORPCRBASE_H */ - diff --git a/monitorPCR/src/include/monitor_pcr.h b/monitorPCR/src/include/monitor_pcr.h deleted file mode 100644 index 8cf85d0..0000000 --- a/monitorPCR/src/include/monitor_pcr.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * File: monitor_pcr.h - * Author: leonardo - * - * Created on 17 de Fevereiro de 2012, 17:36 - */ - -#ifndef MONITOR_PCR_H -#define MONITOR_PCR_H - -#include -#include -#include -#include -#include -#include "listenerInput.h" -#include "listenerMonitorPCRBase.h" -#include "dprintf.h" - -#define PCRBASE_PADRAO 1000000 - -using namespace std; - -class MonitorPCR: public ListenerInput { - - public: - - char* extvideo; - - MonitorPCR(); - ~MonitorPCR(); - - void addListenerPCRBase(ListenerMonitorPCRBase * listener); - void notifyListenersWithPCRBase(uint64_t pcrbase); - uint64_t getPCRBase(); - void notifyInput(unsigned char* packet); - - /** - * Informa para o monitor o formato do vídeo que está sendo manipulado. - * Caso seja qualquer outro diferente de Transport Stream (TS), os componentes - * observadores devem receber a notificação de um valor de PCR padrão. - */ - void setFormatVideo(char* format); - - private: - - void readPCRBase(unsigned char* packet); - - list *listeners; - uint64_t pcr_base; - bool find; - -}; - -#endif /* MONITOR_PCR_H */ - diff --git a/monitorPCR/src/monitor_pcr.cpp b/monitorPCR/src/monitor_pcr.cpp deleted file mode 100644 index e05cd3f..0000000 --- a/monitorPCR/src/monitor_pcr.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "monitor_pcr.h" - -MonitorPCR::MonitorPCR(){ - pcr_base = 0; - find = false; - extvideo = (char*) ""; - listeners = new list(); - DPRINTF("Done!\n"); -} - - -MonitorPCR::~MonitorPCR(){ - DDDPRINTF("Monitor PCR finalized!\n"); -} - - -uint64_t MonitorPCR::getPCRBase(){ - return pcr_base; -} - - -void MonitorPCR::setFormatVideo(char* format) { - extvideo = format; -} - - -void MonitorPCR::notifyInput(unsigned char* packet) { - - if (!find) { // verifica se o PCRBase já foi encontrado - *extvideo = tolower(*extvideo); - if (strcmp(extvideo, (char*) "ts") == 0) { // se for TS procura nos pacotes - readPCRBase(packet); - } else { // outros formatos de vídeo, define o PCR padrão = 1000000 - notifyListenersWithPCRBase((uint64_t) PCRBASE_PADRAO); - find = true; - } - } - -} - - -void MonitorPCR::readPCRBase(unsigned char* packet){ - - if (packet[0] == 0x47 && !find){ - if((((packet[1] & 0x1F) << 8) | packet[2]) != 0xFF) { - int adaptation_field_control = ((packet[3] & 0x30) >> 4); - if (adaptation_field_control == 2 || adaptation_field_control == 3) { - int adaptation_field_length = packet[4]; - if (adaptation_field_length > 0) { - if (((packet[5] & 0x10) >> 4) == 1) { - uint64_t program_clock_reference_base = (uint64_t) packet[6] << 25 | packet[7] << 17 | packet[8] << 9 - | packet[9] << 1 | (packet[10] & 0x80) >> 7; - notifyListenersWithPCRBase(program_clock_reference_base); - find = true; - } - } - } - } - } - -} - -void MonitorPCR::addListenerPCRBase(ListenerMonitorPCRBase * listener){ - this->listeners->push_back(listener); -} - -void MonitorPCR::notifyListenersWithPCRBase(uint64_t pcrbase){ - for(list::iterator it = this->listeners->begin(); it != this->listeners->end(); it++){ - (*it)->notifyPCRBase(pcrbase); - } -} -- libgit2 0.21.2