00001 /* 00002 VBI 608 Extractor, extracts CEA-608 VBI from a line of raw data. 00003 Copyright (C) 2010 Digital Nirvana, Inc. 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _VBI_608_EXTRACTOR_H_ 00021 #define _VBI_608_EXTRACTOR_H_ 00022 00023 #include <stdint.h> 00024 00025 #include <QList> 00026 00027 #include "frame.h" 00028 00029 class VBI608Extractor 00030 { 00031 public: 00032 VBI608Extractor(); 00033 00034 uint16_t GetCode1(void) const { return code[0]; } 00035 uint16_t GetCode2(void) const { return code[1]; } 00036 00037 bool ExtractCC(const VideoFrame*, uint max_lines = 4); 00038 bool ExtractCC12(const unsigned char *buf, uint width); 00039 bool ExtractCC34(const unsigned char *buf, uint width); 00040 00041 uint FillCCData(uint8_t cc_data[8]) const; 00042 00043 private: 00044 float GetClockStart(void) const { return start; } 00045 float GetClockRate(void) const { return rate; } 00046 bool FindClocks(const unsigned char *buf, uint width); 00047 00048 QList<uint> raw_minimas; 00049 QList<uint> raw_maximas; 00050 QList<float> maximas; 00051 QList<float> minimas; 00052 float start; 00053 float rate; 00054 uint16_t code[2]; 00055 }; 00056 00057 #endif // _VBI_608_EXTRACTOR_H_
1.6.3