MythTV  master
vbi608extractor.h
Go to the documentation of this file.
1 /*
2  VBI 608 Extractor, extracts CEA-608 VBI from a line of raw data.
3  Copyright (C) 2010 Digital Nirvana, Inc.
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  as published by the Free Software Foundation; either version 2
8  of the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _VBI_608_EXTRACTOR_H_
21 #define _VBI_608_EXTRACTOR_H_
22 
23 #include <cstdint>
24 
25 #include <QList>
26 
27 #include "mythframe.h"
28 
30 {
31  public:
33 
34  uint16_t GetCode1(void) const { return m_code[0]; }
35  uint16_t GetCode2(void) const { return m_code[1]; }
36 
37  bool ExtractCC(const VideoFrame*, uint max_lines = 4);
38  bool ExtractCC12(const unsigned char *buf, uint width);
39  bool ExtractCC34(const unsigned char *buf, uint width);
40 
41  uint FillCCData(uint8_t cc_data[8]) const;
42 
43  private:
44  float GetClockStart(void) const { return m_start; }
45  float GetClockRate(void) const { return m_rate; }
46  bool FindClocks(const unsigned char *buf, uint width);
47 
48  QList<uint> m_rawMinimas;
49  QList<uint> m_rawMaximas;
50  QList<float> m_maximas;
51  QList<float> m_minimas;
52  float m_start {0.0F};
53  float m_rate {0.0F};
55 };
56 
57 #endif // _VBI_608_EXTRACTOR_H_
uint16_t m_code[2]
unsigned int uint
Definition: compat.h:140
uint FillCCData(uint8_t cc_data[8]) const
uint16_t GetCode1(void) const
bool ExtractCC(const VideoFrame *, uint max_lines=4)
QList< uint > m_rawMinimas
float GetClockStart(void) const
unsigned short uint16_t
Definition: iso6937tables.h:1
float GetClockRate(void) const
bool ExtractCC12(const unsigned char *buf, uint width)
uint16_t GetCode2(void) const
QList< uint > m_rawMaximas
bool ExtractCC34(const unsigned char *buf, uint width)
bool FindClocks(const unsigned char *buf, uint width)
QList< float > m_maximas
QList< float > m_minimas