AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
NTV2CCGrabber Class Reference

I can decode captions from frames captured from an AJA device in real time. I can optionally play the captured video with captions "burned" in on-screen using the device's mixer. More...

#include <ntv2ccgrabber.h>

Public Member Functions

 NTV2CCGrabber (const CCGrabberConfig &inConfigData)
 Constructs me using the given configuration settings. More...
 
virtual ~NTV2CCGrabber ()
 
virtual AJAStatus Init (void)
 Initializes me and prepares me to Run. More...
 
virtual AJAStatus Run (void)
 Runs me. More...
 
virtual void Quit (void)
 Gracefully stops me from running. More...
 
virtual void SetCaptionDisplayChannel (const NTV2Line21Channel inNewChannel)
 Changes the caption channel I'm displaying. More...
 
virtual bool IsCaptureThreadRunning (void) const
 Returns true if my capture thread is currently running. More...
 
virtual bool IsPlayThreadRunning (void) const
 Returns true if my play thread is currently running. More...
 
virtual AJAStatus StartPlayThread (void)
 Starts my playout thread. More...
 
virtual void ToggleHUD (void)
 Toggles the Head-Up-Display. More...
 
virtual void ToggleVANC (void)
 Toggles the use of VANC. (Debug, experimental) More...
 
virtual void SwitchOutput (void)
 Switches/rotates –output mode. More...
 
virtual void Switch608Source (void)
 Switches/rotates –608src. More...
 
virtual void SwitchPixelFormat (void)
 Switches/rotates –pixelFormat. More...
 

Static Public Member Functions

static std::string GetLine21ChannelNames (std::string inDelimiter=", ")
 Returns a string containing a concatenation of human-readable names of every available NTV2Line21Channel value. More...
 

Protected Member Functions

virtual AJAStatus SetupInputVideo (void)
 Sets up everything I need for capturing video. More...
 
virtual AJAStatus SetupAudio (void)
 Sets up audio for capture (and playout, if burning captions). More...
 
virtual bool RouteInputSignal (const NTV2VideoFormat inVideoFormat)
 
virtual void SetOutputStandards (const NTV2VideoFormat inVideoFormat)
 Sets the device output standard based on the given video format. More...
 
virtual AJAStatus StartCaptureThread (void)
 Starts my capture thread. More...
 
virtual void CaptureFrames (void)
 Repeatedly captures frames using AutoCirculate (until global quit flag set). More...
 
virtual NTV2VideoFormat WaitForStableInputSignal (void)
 Wait for a stable input signal, and return it. More...
 
virtual AJAStatus SetupHostBuffers (const NTV2VideoFormat inVideoFormat)
 Sets up my circular buffers. More...
 
virtual void ReleaseHostBuffers (void)
 Releases my circular buffers. More...
 
virtual void ExtractClosedCaptionData (const uint32_t inFrameCount, const NTV2VideoFormat inVideoFormat)
 Extracts closed-caption data, if present, and emits it on a character-by-character basis to the standard output stream. More...
 
virtual AJAStatus SetupOutputVideo (const NTV2VideoFormat inVideoFormat)
 Sets up everything I need for capturing video. More...
 
virtual void DoCCOutput (const uint32_t inFrameNum, const CaptionData &inCCData, const NTV2VideoFormat inVideoFormat)
 Outputs CC data. More...
 
virtual bool RouteOutputSignal (const NTV2VideoFormat inVideoFormat)
 
virtual void PlayFrames (void)
 Repeatedly updates captions (until global quit flag set). More...
 
virtual void CaptioningChanged (const NTV2Caption608ChangeInfo &inChangeInfo)
 This function gets called whenever caption changes occur. More...
 

Static Protected Member Functions

static void CaptureThreadStatic (AJAThread *pThread, void *pContext)
 This is the capture thread's static callback function that gets called when the capture thread runs. This function gets "Attached" to the AJAThread instance. More...
 
static void PlayThreadStatic (AJAThread *pThread, void *pContext)
 This is the playout thread's static callback function that gets called when the playout thread runs. This function gets "Attached" to the playout thread's AJAThread instance. More...
 
static void Caption608ChangedStatic (void *pInstance, const NTV2Caption608ChangeInfo &inChangeInfo)
 This static function gets called whenever 608 captioning changes. More...
 

Detailed Description

I can decode captions from frames captured from an AJA device in real time. I can optionally play the captured video with captions "burned" in on-screen using the device's mixer.

This app demonstrates how to properly react to input signal changes using AutoCirculate, resuming the capture stream once a stable video signal is restored. It also shows how to use the CEA-608 and CEA-708 decoders provided in the 'ajacclib' caption library. It also shows how to use the mixer/keyer widget to superimpose graphics (with alpha transparency) over live video.

Definition at line 111 of file ntv2ccgrabber.h.

Constructor & Destructor Documentation

◆ NTV2CCGrabber()

NTV2CCGrabber::NTV2CCGrabber ( const CCGrabberConfig inConfigData)

Constructs me using the given configuration settings.

Note
I'm not completely initialized and ready for use until after my Init method has been called.
Parameters
[in]inConfigDataSpecifies the grabber configuration.

Definition at line 40 of file ntv2ccgrabber.cpp.

◆ ~NTV2CCGrabber()

NTV2CCGrabber::~NTV2CCGrabber ( )
virtual

Definition at line 80 of file ntv2ccgrabber.cpp.

Member Function Documentation

◆ Caption608ChangedStatic()

void NTV2CCGrabber::Caption608ChangedStatic ( void *  pInstance,
const NTV2Caption608ChangeInfo inChangeInfo 
)
staticprotected

This static function gets called whenever 608 captioning changes.

Parameters
[in]pInstanceA valid pointer to the NTV2CCGrabber instance.
[in]inChangeInfoThe 608 captioning change.

Definition at line 1548 of file ntv2ccgrabber.cpp.

◆ CaptioningChanged()

void NTV2CCGrabber::CaptioningChanged ( const NTV2Caption608ChangeInfo inChangeInfo)
protectedvirtual

This function gets called whenever caption changes occur.

Parameters
[in]inChangeInfoThe caption change that occurred.

Definition at line 1542 of file ntv2ccgrabber.cpp.

◆ CaptureFrames()

void NTV2CCGrabber::CaptureFrames ( void  )
protectedvirtual

Repeatedly captures frames using AutoCirculate (until global quit flag set).

Definition at line 648 of file ntv2ccgrabber.cpp.

◆ CaptureThreadStatic()

void NTV2CCGrabber::CaptureThreadStatic ( AJAThread pThread,
void *  pContext 
)
staticprotected

This is the capture thread's static callback function that gets called when the capture thread runs. This function gets "Attached" to the AJAThread instance.

Parameters
[in]pThreadPoints to the AJAThread instance.
[in]pContextContext information to pass to the thread. (For this application, this will be set to point to the NTV2Burn instance.)

Definition at line 636 of file ntv2ccgrabber.cpp.

◆ DoCCOutput()

void NTV2CCGrabber::DoCCOutput ( const uint32_t  inFrameNum,
const CaptionData inCCData,
const NTV2VideoFormat  inVideoFormat 
)
protectedvirtual

Outputs CC data.

Parameters
[in]inFrameNumSpecifies the current frame number.
[in]inCCDataSpecifies the current CC data.
[in]inVideoFormatSpecifies the current video format.

Definition at line 1182 of file ntv2ccgrabber.cpp.

◆ ExtractClosedCaptionData()

void NTV2CCGrabber::ExtractClosedCaptionData ( const uint32_t  inFrameCount,
const NTV2VideoFormat  inVideoFormat 
)
protectedvirtual

Extracts closed-caption data, if present, and emits it on a character-by-character basis to the standard output stream.

Parameters
[in]inFrameCountSpecifies the current frame number of the captured video.
[in]inVideoFormatSpecifies the current video format of the captured video.

Definition at line 976 of file ntv2ccgrabber.cpp.

◆ GetLine21ChannelNames()

string NTV2CCGrabber::GetLine21ChannelNames ( std::string  inDelimiter = ", ")
static

Returns a string containing a concatenation of human-readable names of every available NTV2Line21Channel value.

Parameters
[in]inDelimiterThe string to be used to separate each name. Defaults to ", ".

Definition at line 1556 of file ntv2ccgrabber.cpp.

◆ Init()

AJAStatus NTV2CCGrabber::Init ( void  )
virtual

Initializes me and prepares me to Run.

Definition at line 119 of file ntv2ccgrabber.cpp.

◆ IsCaptureThreadRunning()

virtual bool NTV2CCGrabber::IsCaptureThreadRunning ( void  ) const
inlinevirtual

Returns true if my capture thread is currently running.

Definition at line 159 of file ntv2ccgrabber.h.

◆ IsPlayThreadRunning()

virtual bool NTV2CCGrabber::IsPlayThreadRunning ( void  ) const
inlinevirtual

Returns true if my play thread is currently running.

Definition at line 165 of file ntv2ccgrabber.h.

◆ PlayFrames()

void NTV2CCGrabber::PlayFrames ( void  )
protectedvirtual

Repeatedly updates captions (until global quit flag set).

Definition at line 1413 of file ntv2ccgrabber.cpp.

◆ PlayThreadStatic()

void NTV2CCGrabber::PlayThreadStatic ( AJAThread pThread,
void *  pContext 
)
staticprotected

This is the playout thread's static callback function that gets called when the playout thread runs. This function gets "Attached" to the playout thread's AJAThread instance.

Parameters
[in]pThreadA valid pointer to the playout thread's AJAThread instance.
[in]pContextContext information to pass to the thread. (For this application, this will be set to point to the NTV2CCGrabber instance.)

Definition at line 1402 of file ntv2ccgrabber.cpp.

◆ Quit()

void NTV2CCGrabber::Quit ( void  )
virtual

Gracefully stops me from running.

Definition at line 102 of file ntv2ccgrabber.cpp.

◆ ReleaseHostBuffers()

void NTV2CCGrabber::ReleaseHostBuffers ( void  )
protectedvirtual

Releases my circular buffers.

Definition at line 240 of file ntv2ccgrabber.cpp.

◆ RouteInputSignal()

bool NTV2CCGrabber::RouteInputSignal ( const NTV2VideoFormat  inVideoFormat)
protectedvirtual
Returns
True if device widget routing successfully configured for capture; otherwise false.
Note
This function also sets the output standard based on the given video format.
Parameters
[in]inVideoFormatSpecifies the video format in use.

Definition at line 386 of file ntv2ccgrabber.cpp.

◆ RouteOutputSignal()

bool NTV2CCGrabber::RouteOutputSignal ( const NTV2VideoFormat  inVideoFormat)
protectedvirtual
Returns
True if device widget routing successfully set up for playout; otherwise false.
Parameters
[in]inVideoFormatSpecifies the desired output video format.

Definition at line 1311 of file ntv2ccgrabber.cpp.

◆ Run()

AJAStatus NTV2CCGrabber::Run ( void  )
virtual

Runs me.

Note
Do not call this method without first calling my Init method.

Definition at line 605 of file ntv2ccgrabber.cpp.

◆ SetCaptionDisplayChannel()

void NTV2CCGrabber::SetCaptionDisplayChannel ( const NTV2Line21Channel  inNewChannel)
virtual

Changes the caption channel I'm displaying.

Parameters
inNewChannelSpecifies the new caption channel of interest.

Definition at line 1526 of file ntv2ccgrabber.cpp.

◆ SetOutputStandards()

void NTV2CCGrabber::SetOutputStandards ( const NTV2VideoFormat  inVideoFormat)
protectedvirtual

Sets the device output standard based on the given video format.

Parameters
[in]inVideoFormatSpecifies the video format.

Definition at line 584 of file ntv2ccgrabber.cpp.

◆ SetupAudio()

AJAStatus NTV2CCGrabber::SetupAudio ( void  )
protectedvirtual

Sets up audio for capture (and playout, if burning captions).

Definition at line 338 of file ntv2ccgrabber.cpp.

◆ SetupHostBuffers()

AJAStatus NTV2CCGrabber::SetupHostBuffers ( const NTV2VideoFormat  inVideoFormat)
protectedvirtual

Sets up my circular buffers.

Parameters
[in]inVideoFormatSpecifies the video format.
Returns
AJA_STATUS_SUCCESS if successful; otherwise a relevant AJAStatus value.

Definition at line 200 of file ntv2ccgrabber.cpp.

◆ SetupInputVideo()

AJAStatus NTV2CCGrabber::SetupInputVideo ( void  )
protectedvirtual

Sets up everything I need for capturing video.

Definition at line 257 of file ntv2ccgrabber.cpp.

◆ SetupOutputVideo()

AJAStatus NTV2CCGrabber::SetupOutputVideo ( const NTV2VideoFormat  inVideoFormat)
protectedvirtual

Sets up everything I need for capturing video.

Parameters
[in]inVideoFormatSpecifies the desired output video format.
Returns
AJA_STATUS_SUCCESS if successful; otherwise the AJAStatus failure code.

Definition at line 1285 of file ntv2ccgrabber.cpp.

◆ StartCaptureThread()

AJAStatus NTV2CCGrabber::StartCaptureThread ( void  )
protectedvirtual

Starts my capture thread.

Definition at line 622 of file ntv2ccgrabber.cpp.

◆ StartPlayThread()

AJAStatus NTV2CCGrabber::StartPlayThread ( void  )
virtual

Starts my playout thread.

Definition at line 1387 of file ntv2ccgrabber.cpp.

◆ Switch608Source()

void NTV2CCGrabber::Switch608Source ( void  )
virtual

Switches/rotates –608src.

Definition at line 951 of file ntv2ccgrabber.cpp.

◆ SwitchOutput()

void NTV2CCGrabber::SwitchOutput ( void  )
virtual

Switches/rotates –output mode.

Definition at line 940 of file ntv2ccgrabber.cpp.

◆ SwitchPixelFormat()

void NTV2CCGrabber::SwitchPixelFormat ( void  )
virtual

Switches/rotates –pixelFormat.

Definition at line 962 of file ntv2ccgrabber.cpp.

◆ ToggleHUD()

virtual void NTV2CCGrabber::ToggleHUD ( void  )
inlinevirtual

Toggles the Head-Up-Display.

Note
This only affects caption burn-in.

Definition at line 176 of file ntv2ccgrabber.h.

◆ ToggleVANC()

void NTV2CCGrabber::ToggleVANC ( void  )
virtual

Toggles the use of VANC. (Debug, experimental)

Definition at line 933 of file ntv2ccgrabber.cpp.

◆ WaitForStableInputSignal()

NTV2VideoFormat NTV2CCGrabber::WaitForStableInputSignal ( void  )
protectedvirtual

Wait for a stable input signal, and return it.

Returns
The input video format. Guaranteed to be valid unless the app is terminating.

Definition at line 824 of file ntv2ccgrabber.cpp.


The documentation for this class was generated from the following files: