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
28#include "mythframe.h"
29
30using cc608_data = std::array<uint8_t,8>;
31
33{
34 public:
35 VBI608Extractor() = default;
36
37 uint16_t GetCode1(void) const { return m_code[0]; }
38 uint16_t GetCode2(void) const { return m_code[1]; }
39
40 bool ExtractCC(const MythVideoFrame *picframe, uint max_lines = 4);
41 bool ExtractCC12(const unsigned char *buf, uint width);
42 bool ExtractCC34(const unsigned char *buf, uint width);
43
44 uint FillCCData(cc608_data &cc_data) const;
45
46 private:
47 float GetClockStart(void) const { return m_start; }
48 float GetClockRate(void) const { return m_rate; }
49 bool FindClocks(const unsigned char *buf, uint width);
50
51 QList<uint> m_rawMinimas;
52 QList<uint> m_rawMaximas;
53 QList<float> m_maximas;
54 QList<float> m_minimas;
55 float m_start {0.0F};
56 float m_rate {0.0F};
57 std::array<uint16_t,2> m_code {UINT16_MAX, UINT16_MAX};
58};
59
60#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
bool ExtractCC(const MythVideoFrame *picframe, uint max_lines=4)
QList< uint > m_rawMaximas
uint FillCCData(cc608_data &cc_data) const
float GetClockRate(void) const
QList< float > m_maximas
QList< float > m_minimas
uint16_t GetCode2(void) const
float GetClockStart(void) const
bool ExtractCC12(const unsigned char *buf, uint width)
unsigned int uint
Definition: freesurround.h:24
unsigned short uint16_t
Definition: iso6937tables.h:3
std::array< uint8_t, 8 > cc608_data