MythTV  master
Macros | Functions | Variables
vbi.cpp File Reference
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <cmath>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <linux/videodev2.h>
#include "captions/vbilut.h"
#include "vbi.h"
#include "vt.h"
Include dependency graph for vbi.cpp:

Go to the source code of this file.

Macros

#define FAC   (1<<16)
 
#define BTTV_VBISIZE   _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
 

Functions

static void error (const char *str,...)
 
static int chk_parity (uint8_t *p, int n)
 
static void out_of_sync (struct vbi *vbi)
 
static void vbi_send (struct vbi *vbi, int type, int i1, int i2, int i3, void *p1)
 
static void vbi_send_page (struct vbi *vbi, struct raw_page *rvtp, int page)
 
static void pll_add (struct vbi *vbi, int n, int err)
 
void vbi_pll_reset (struct vbi *vbi, int fine_tune)
 
static int vt_line (struct vbi *vbi, unsigned char *p)
 
static int vbi_line (struct vbi *vbi, const unsigned char *p)
 
void vbi_handler (struct vbi *vbi, [[maybe_unused]] int fd)
 
int vbi_add_handler (struct vbi *vbi, vbic_handler handler, void *data)
 
void vbi_del_handler (struct vbi *vbi, vbic_handler handler, void *data)
 
static int set_decode_parms (struct vbi *vbi, struct v4l2_vbi_format *p)
 
static int setup_dev ([[maybe_unused]] struct vbi *vbi)
 
struct vbivbi_open (const char *vbi_dev_name, [[maybe_unused]] struct cache *ca, int fine_tune, int big_buf)
 
void vbi_close (struct vbi *vbi)
 
struct vt_pagevbi_query_page ([[maybe_unused]] struct vbi *vbi, [[maybe_unused]] int pgno, [[maybe_unused]] int subno)
 
void vbi_reset (struct vbi *vbi)
 

Variables

static unsigned char * rawbuf = nullptr
 
static int rawbuf_size
 
static constexpr int8_t PLL_SAMPLES { 4 }
 
static constexpr int8_t PLL_ERROR { 4 }
 

Macro Definition Documentation

◆ FAC

#define FAC   (1<<16)

Definition at line 24 of file vbi.cpp.

◆ BTTV_VBISIZE

#define BTTV_VBISIZE   _IOR('v' , BASE_VIDIOCPRIVATE+8, int)

Definition at line 32 of file vbi.cpp.

Function Documentation

◆ error()

static void error ( const char *  str,
  ... 
)
static

Definition at line 36 of file vbi.cpp.

Referenced by MythVTBSurfaceInterop::Acquire(), MHIText::AddText(), HistogramAnalyzer::analyzeFrame(), TemplateMatcher::analyzeFrame(), TemplateFinder::analyzeFrame(), AudioConvertInternal::AudioConvertInternal(), avcodec_encode_audio(), nv_python_libs.common.common_api.Common::callCommandLine(), MythContextPrivate::ChooseBackend(), MythTerminal::Create(), ChannelScannerGUIScanPane::Create(), StandardSettingDialog::Create(), MythCodecContext::CreateDevice(), MHIBitmap::CreateFromMPEG(), MythInputDeviceHandler::customEvent(), MusicPlayer::customEvent(), AudioOutputUtil::DecodeAudio(), MHIDLA::DrawLineSub(), AudioOutputDigitalEncoder::Encode(), TemplateMatcher::finished(), ExternIO::Fork(), hardwareprofile.distros.mythtv_data.uuiddb._UuidDb::get_pub_uuid(), CardUtil::GetASIBufferSize(), CardUtil::GetASIDeviceNumber(), CardUtil::GetASIMode(), CardUtil::GetASINumBuffers(), MHIText::GetBounds(), MythAVFormatWriter::GetCodecTimeBase(), PGMConverter::getImage(), ChannelScannerCLI::HandleEvent(), ChannelScannerGUI::HandleEvent(), MythHTTPService::HTTPRequest(), GalleryThumbView::Import(), ChannelScannerCLI::InformUser(), ChannelScannerGUI::InformUser(), ChannelScannerWeb::InformUser(), AudioOutputDXPrivate::InitDirectSound(), MythHTTPS::InitSSLSocket(), XmlConfiguration::Load(), MythVideoProfile::LoadDB(), RecExtEspnDataSource::loadPage(), RecExtMlbDataSource::loadPage(), hardwareprofile.deleteProfile::main(), hardwareprofile.getLink::main(), hardwareprofile.sendProfile::main_request_new_public_uuid(), MHIContext::MHIContext(), MythVideoProfile::MythVideoProfile(), ASIStreamHandler::Open(), MythRAOPConnection::OpenAudioDevice(), AvFormatDecoder::OpenAVCodec(), AvFormatDecoder::OpenFile(), PaneError::PaneError(), pgm_read(), pgm_write(), hardwareprofile.sendProfile::present_and_require_confirmation(), ASIConfigurationGroup::probeCard(), MythUDPListener::Process(), UPNPSubscription::ProcessRequest(), AvFormatDecoder::ProcessVideoPacket(), MythContextPrivate::PromptForDatabaseParams(), RemoteFile::Read(), MetadataDownload::readNFO(), MythControls::ResolveConflict(), FillData::Run(), IPTVStreamHandler::run(), ScanMonitor::ScanErrored(), hardwareprofile.sendProfile::send_profile(), SendAppleEventToSystemProcess(), ZMServer::sendError(), SendMessage(), set_decode_parms(), CardUtil::SetASIMode(), OSD::SetRegions(), setup_dev(), setupTVs(), ShowNotification(), NetStream::slotFinished(), BackendSelection::TryDBfromURL(), HDHRStreamHandler::TunerGet(), HDHRStreamHandler::TunerSet(), TVRec::TuningFrequency(), MythContextPrivate::UPnPconnect(), vbi_open(), RemoteFile::Write(), MythAVFormatWriter::WriteAudioFrame(), NuppelVideoRecorder::WriteVideo(), and MythAVFormatWriter::WriteVideoFrame().

◆ chk_parity()

static int chk_parity ( uint8_t *  p,
int  n 
)
static

Definition at line 48 of file vbi.cpp.

Referenced by vt_line().

◆ out_of_sync()

static void out_of_sync ( struct vbi vbi)
static

Definition at line 63 of file vbi.cpp.

Referenced by vbi_handler(), and vbi_open().

◆ vbi_send()

static void vbi_send ( struct vbi vbi,
int  type,
int  i1,
int  i2,
int  i3,
void *  p1 
)
static

Definition at line 76 of file vbi.cpp.

Referenced by vbi_query_page(), vbi_reset(), vbi_send_page(), and vt_line().

◆ vbi_send_page()

static void vbi_send_page ( struct vbi vbi,
struct raw_page rvtp,
int  page 
)
static

Definition at line 96 of file vbi.cpp.

Referenced by vt_line().

◆ pll_add()

static void pll_add ( struct vbi vbi,
int  n,
int  err 
)
static

Definition at line 122 of file vbi.cpp.

Referenced by vbi_line(), and vt_line().

◆ vbi_pll_reset()

void vbi_pll_reset ( struct vbi vbi,
int  fine_tune 
)

Definition at line 158 of file vbi.cpp.

Referenced by vbi_open().

◆ vt_line()

static int vt_line ( struct vbi vbi,
unsigned char *  p 
)
static

Definition at line 180 of file vbi.cpp.

Referenced by vbi_line().

◆ vbi_line()

static int vbi_line ( struct vbi vbi,
const unsigned char *  p 
)
static

Definition at line 331 of file vbi.cpp.

Referenced by vbi_handler().

◆ vbi_handler()

void vbi_handler ( struct vbi vbi,
[[maybe_unused] ] int  fd 
)

Definition at line 413 of file vbi.cpp.

Referenced by V4LRecorder::RunVBIDevice().

◆ vbi_add_handler()

int vbi_add_handler ( struct vbi vbi,
vbic_handler  handler,
void *  data 
)

Definition at line 454 of file vbi.cpp.

Referenced by V4LRecorder::OpenVBIDevice().

◆ vbi_del_handler()

void vbi_del_handler ( struct vbi vbi,
vbic_handler  handler,
void *  data 
)

Definition at line 471 of file vbi.cpp.

Referenced by V4LRecorder::CloseVBIDevice().

◆ set_decode_parms()

static int set_decode_parms ( struct vbi vbi,
struct v4l2_vbi_format *  p 
)
static

Definition at line 490 of file vbi.cpp.

Referenced by setup_dev().

◆ setup_dev()

static int setup_dev ( [[maybe_unused] ] struct vbi vbi)
static

Definition at line 546 of file vbi.cpp.

Referenced by vbi_open().

◆ vbi_open()

struct vbi* vbi_open ( const char *  vbi_dev_name,
[[maybe_unused] ] struct cache *  ca,
int  fine_tune,
int  big_buf 
)

Definition at line 589 of file vbi.cpp.

Referenced by V4LRecorder::OpenVBIDevice().

◆ vbi_close()

void vbi_close ( struct vbi vbi)

Definition at line 642 of file vbi.cpp.

Referenced by V4LRecorder::CloseVBIDevice().

◆ vbi_query_page()

struct vt_page* vbi_query_page ( [[maybe_unused] ] struct vbi vbi,
[[maybe_unused] ] int  pgno,
[[maybe_unused] ] int  subno 
)

Definition at line 653 of file vbi.cpp.

◆ vbi_reset()

void vbi_reset ( struct vbi vbi)

Definition at line 676 of file vbi.cpp.

Referenced by vbi_handler().

Variable Documentation

◆ rawbuf

unsigned char* rawbuf = nullptr
static

Definition at line 26 of file vbi.cpp.

Referenced by setup_dev(), and vbi_handler().

◆ rawbuf_size

int rawbuf_size
static

Definition at line 28 of file vbi.cpp.

Referenced by setup_dev().

◆ PLL_SAMPLES

constexpr int8_t PLL_SAMPLES { 4 }
staticconstexpr

Definition at line 117 of file vbi.cpp.

Referenced by pll_add().

◆ PLL_ERROR

constexpr int8_t PLL_ERROR { 4 }
staticconstexpr

Definition at line 118 of file vbi.cpp.

Referenced by pll_add().