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 <array>
24#include <cstdint>
25
26#include <QList>
27
29{
30 public:
31 VBI608Extractor() = default;
32
33 uint16_t GetCode1(void) const { return m_code[0]; }
34 uint16_t GetCode2(void) const { return m_code[1]; }
35
36 bool ExtractCC12(const unsigned char *buf, uint width);
37 bool ExtractCC34(const unsigned char *buf, uint width);
38
39 private:
40 bool FindClocks(const unsigned char *buf, uint width);
41
42 QList<uint> m_rawMinimas;
43 QList<uint> m_rawMaximas;
44 QList<float> m_maximas;
45 QList<float> m_minimas;
46 float m_start {0.0F};
47 float m_rate {0.0F};
48 std::array<uint16_t,2> m_code {UINT16_MAX, UINT16_MAX};
49};
50
51#endif // VBI_608_EXTRACTOR_H
bool ExtractCC34(const unsigned char *buf, uint width)
VBI608Extractor()=default
bool FindClocks(const unsigned char *buf, uint width)
std::array< uint16_t, 2 > m_code
QList< uint > m_rawMinimas
uint16_t GetCode1(void) const
QList< uint > m_rawMaximas
QList< float > m_maximas
QList< float > m_minimas
uint16_t GetCode2(void) const
bool ExtractCC12(const unsigned char *buf, uint width)
unsigned int uint
Definition: compat.h:60
unsigned short uint16_t
Definition: iso6937tables.h:3