AJA NTV2 SDK  18.1.0.2439
NTV2 SDK 18.1.0.2439
ntv2player8k.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #ifndef _NTV2PLAYER8K_H
10 #define _NTV2PLAYER8K_H
11 
12 #include "ntv2democommon.h"
13 #include "ajabase/system/thread.h"
15 
16 
25 {
26  // Public Instance Methods
27  public:
33  NTV2Player8K (const PlayerConfig & inConfig);
34 
35  virtual ~NTV2Player8K (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 
74  virtual uint32_t AddTone (ULWord * audioBuffer);
75 
76 
77  // Protected Class Methods
78  protected:
85  static void ConsumerThreadStatic (AJAThread * pThread, void * pContext);
86 
93  static void ProducerThreadStatic (AJAThread * pThread, void * pContext);
94 
95 
96  // Private Member Data
97  private:
98  typedef std::vector<NTV2Buffer> NTV2Buffers;
99 
100  PlayerConfig mConfig;
101  AJAThread mConsumerThread;
102  AJAThread mProducerThread;
103  CNTV2Card mDevice;
104  NTV2TaskMode mSavedTaskMode;
105  ULWord mCurrentFrame;
106  ULWord mCurrentSample;
107  double mToneFrequency;
108  NTV2AudioSystem mAudioSystem;
109  NTV2FormatDesc mFormatDesc;
110 
111  bool mGlobalQuit;
112  AJATimeCodeBurn mTCBurner;
113  NTV2FrameDataArray mHostBuffers;
114  FrameDataRingBuffer mFrameDataRing;
115  NTV2Buffers mTestPatRasters;
116 
117 }; // NTV2Player8K
118 
119 #endif // _NTV2PLAYER8K_H
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3901
virtual AJAStatus SetUpAudio(void)
Performs all audio setup.
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
virtual bool IsRunning(void) const
Definition: ntv2player8k.h:47
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2TaskMode
Describes the task mode state. See also: NTV2 Device Sharing.
AJAStatus
Definition: types.h:380
virtual void Quit(void)
Gracefully stops me from running.
virtual uint32_t AddTone(ULWord *audioBuffer)
Inserts audio tone (based on my current tone frequency) into the given audio buffer.
Declares the AJATimeCodeBurn class.
uint32_t ULWord
Definition: ajatypes.h:236
virtual void StartProducerThread(void)
Starts my producer thread.
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
Declares the AJAThread class.
virtual void ProduceFrames(void)
My producer thread that repeatedly produces video frames.
Describes a video frame for a given video standard or format and pixel format, including the total nu...
virtual void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit). ...
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the producer thread&#39;s static callback function that gets called when the producer thread star...
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
I am an object that can play out an 8K or UHD2 test pattern (with timecode) to 4 x 12G SDI outputs of...
Definition: ntv2player8k.h:24
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
virtual AJAStatus Run(void)
Runs me.
This file contains some structures, constants, classes and functions that are used in some of the dem...
Configures an NTV2Player instance.
virtual ~NTV2Player8K(void)
virtual void StartConsumerThread(void)
Starts my consumer thread.
virtual void GetACStatus(AUTOCIRCULATE_STATUS &outStatus)
Provides status information about my output (playout) process.
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread&#39;s static callback function that gets called when the consumer thread star...
I am a circular frame buffer that simplifies implementing a type-safe producer/consumer model for pro...
NTV2Player8K(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.