AJA NTV2 SDK  17.5.0.1492
NTV2 SDK 17.5.0.1492
ntv2player.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #ifndef _NTV2PLAYER_H
10 #define _NTV2PLAYER_H
11 
12 #include "ntv2democommon.h"
13 #include "ajabase/system/thread.h"
15 
16 
25 {
26  // Public Instance Methods
27  public:
33  NTV2Player (const PlayerConfig & inConfig);
34 
35  virtual ~NTV2Player (void);
36 
37  virtual AJAStatus Init (void);
38 
43  virtual AJAStatus Run (void);
44 
45  virtual void Quit (void);
46 
47  virtual bool IsRunning (void) const {return !mGlobalQuit;}
48 
53  virtual void GetACStatus (AUTOCIRCULATE_STATUS & outStatus);
54 
55 
56  // Protected Instance Methods
57  protected:
58  virtual AJAStatus SetUpVideo (void);
59  virtual AJAStatus SetUpAudio (void);
60  virtual bool RouteOutputSignal (void);
61  virtual AJAStatus SetUpHostBuffers (void);
62  virtual AJAStatus SetUpTestPatternBuffers (void);
63  virtual void StartConsumerThread (void);
64  virtual void ConsumeFrames (void);
65  virtual void StartProducerThread (void);
66  virtual void ProduceFrames (void);
67 
73  virtual uint32_t AddTone (NTV2FrameData & inFrameData);
74 
75  // Protected Class Methods
76  protected:
83  static void ConsumerThreadStatic (AJAThread * pThread, void * pContext);
84 
91  static void ProducerThreadStatic (AJAThread * pThread, void * pContext);
92 
93 
94  // Private Member Data
95  private:
96  typedef std::vector<NTV2Buffer> NTV2Buffers;
97 
98  PlayerConfig mConfig;
99  AJAThread mConsumerThread;
100  AJAThread mProducerThread;
101  CNTV2Card mDevice;
102  NTV2TaskMode mSavedTaskMode;
103  ULWord mCurrentFrame;
104  ULWord mCurrentSample;
105  double mToneFrequency;
106  NTV2AudioSystem mAudioSystem;
107  NTV2FormatDesc mFormatDesc;
108  NTV2TCIndexes mTCIndexes;
109 
110  bool mGlobalQuit;
111  AJATimeCodeBurn mTCBurner;
112  NTV2FrameDataArray mHostBuffers;
113  FrameDataRingBuffer mFrameDataRing;
114  NTV2Buffers mTestPatRasters;
115 
116 }; // NTV2Player
117 
118 #endif // _NTV2PLAYER_H
NTV2TaskMode
enum NTV2EveryFrameTaskMode NTV2TaskMode
NTV2Player::RouteOutputSignal
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
Definition: ntv2player.cpp:408
NTV2Player::StartConsumerThread
virtual void StartConsumerThread(void)
Starts my consumer thread.
Definition: ntv2player.cpp:480
NTV2FormatDescriptor
Describes a video frame for a given video standard or format and pixel format, including the total nu...
Definition: ntv2formatdescriptor.h:41
NTV2TCIndexes
std::set< NTV2TCIndex > NTV2TCIndexes
Definition: ntv2publicinterface.h:6960
NTV2FrameData
I encapsulate the video, audio and anc host buffers used in the AutoCirculate demos....
Definition: ntv2democommon.h:79
NTV2Player::ProducerThreadStatic
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the producer thread's static callback function that gets called when the producer thread star...
Definition: ntv2player.cpp:691
NTV2Player
I play out SD or HD test pattern (with timecode) to an output of an AJA device with or without audio ...
Definition: ntv2player.h:24
NTV2Player::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2player.cpp:111
AJAThread
Definition: thread.h:69
timecodeburn.h
Declares the AJATimeCodeBurn class.
NTV2Player::StartProducerThread
virtual void StartProducerThread(void)
Starts my producer thread.
Definition: ntv2player.cpp:681
AJAStatus
AJAStatus
Definition: types.h:378
ULWord
uint32_t ULWord
Definition: ajatypes.h:255
AUTOCIRCULATE_STATUS
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
Definition: ntv2publicinterface.h:7274
NTV2Player::SetUpAudio
virtual AJAStatus SetUpAudio(void)
Performs all audio setup.
Definition: ntv2player.cpp:268
NTV2Player::~NTV2Player
virtual ~NTV2Player(void)
Definition: ntv2player.cpp:79
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2Player::ConsumerThreadStatic
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread's static callback function that gets called when the consumer thread star...
Definition: ntv2player.cpp:491
NTV2FrameDataArray
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
Definition: ntv2democommon.h:152
NTV2Player::ProduceFrames
virtual void ProduceFrames(void)
My producer thread that repeatedly produces video frames.
Definition: ntv2player.cpp:700
ntv2democommon.h
This file contains some structures, constants, classes and functions that are used in some of the dem...
NTV2Player::SetUpTestPatternBuffers
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
Definition: ntv2player.cpp:357
NTV2Player::AddTone
virtual uint32_t AddTone(NTV2FrameData &inFrameData)
Inserts audio tone (based on my current tone frequency) into the given NTV2FrameData's audio buffer.
Definition: ntv2player.cpp:779
NTV2Player::NTV2Player
NTV2Player(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
Definition: ntv2player.cpp:58
NTV2Player::ConsumeFrames
virtual void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit).
Definition: ntv2player.cpp:505
NTV2Player::Quit
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2player.cpp:88
NTV2Player::SetUpHostBuffers
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
Definition: ntv2player.cpp:312
PlayerConfig
Configures an NTV2Player instance.
Definition: ntv2democommon.h:319
NTV2Player::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2player.cpp:466
NTV2Player::SetUpVideo
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
Definition: ntv2player.cpp:192
AJATimeCodeBurn
Definition: timecodeburn.h:19
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3865
thread.h
Declares the AJAThread class.
NTV2Player::GetACStatus
virtual void GetACStatus(AUTOCIRCULATE_STATUS &outStatus)
Provides status information about my output (playout) process.
Definition: ntv2player.cpp:815
AJACircularBuffer< NTV2FrameData * >