AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2player4k.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #ifndef _NTV2PLAYER4K_H
10 #define _NTV2PLAYER4K_H
11 
12 #include "ntv2democommon.h"
13 #include "ajabase/system/thread.h"
15 
16 
25 {
26  // Public Instance Methods
27  public:
33  NTV2Player4K (const PlayerConfig & inConfig);
34 
35  virtual ~NTV2Player4K (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 
82  virtual void SetupSDITransmitters (const NTV2Channel inFirstSDI, const UWord inNumSDIs);
83 
84  // Widget Routing
85  virtual bool Route4KDownConverter (void);
86  virtual bool RouteHDMIOutput (void);
87  virtual bool RouteFsToDLOut (void);
88  virtual bool RouteFsToCsc (void);
89  virtual bool RouteFsToSDIOut (void);
90  virtual bool RouteFsToTsiMux (void);
91  virtual bool RouteDLOutToSDIOut (void);
92  virtual bool RouteCscTo2xSDIOut (void);
93  virtual bool RouteCscTo4xSDIOut (void);
94  virtual bool RouteCscToDLOut (void);
95  virtual bool RouteTsiMuxToDLOut (void);
96  virtual bool RouteTsiMuxToCsc (void);
97  virtual bool RouteTsiMuxTo2xSDIOut (void);
98  virtual bool RouteTsiMuxTo4xSDIOut (void);
99 
100 
101  // Protected Class Methods
102  protected:
109  static void ConsumerThreadStatic (AJAThread * pThread, void * pContext);
110 
117  static void ProducerThreadStatic (AJAThread * pThread, void * pContext);
118 
119 
120  // Private Member Data
121  private:
122  typedef std::vector<NTV2Buffer> NTV2Buffers;
123 
124  PlayerConfig mConfig;
125  AJAThread mConsumerThread;
126  AJAThread mProducerThread;
127  CNTV2Card mDevice;
128  NTV2DeviceID mDeviceID;
129  NTV2TaskMode mSavedTaskMode;
130  ULWord mCurrentFrame;
131  ULWord mCurrentSample;
132  double mToneFrequency;
133  NTV2AudioSystem mAudioSystem;
134  NTV2FormatDesc mFormatDesc;
135 
136  bool mGlobalQuit;
137  AJATimeCodeBurn mTCBurner;
138  NTV2FrameDataArray mHostBuffers;
139  FrameDataRingBuffer mFrameDataRing;
140  NTV2Buffers mTestPatRasters;
141 
142 }; // NTV2Player4K
143 
144 #endif // _NTV2PLAYER4K_H
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3895
virtual bool RouteDLOutToSDIOut(void)
Sets up board routing from the Dual Link outputs to the SDI outputs.
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
virtual AJAStatus SetUpAudio(void)
Performs all audio setup.
virtual bool RouteFsToSDIOut(void)
Sets up board routing from the Frame Stores to the SDI outputs.
NTV2TaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
virtual void GetACStatus(AUTOCIRCULATE_STATUS &outStatus)
Provides status information about my output (playout) process.
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
AJAStatus
Definition: types.h:380
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...
virtual bool RouteCscToDLOut(void)
Sets up board routing from the Color Space Converters to the Dual Link outputs.
virtual void Quit(void)
Gracefully stops me from running.
virtual void ProduceFrames(void)
My producer thread that repeatedly produces video frames.
Declares the AJATimeCodeBurn class.
uint32_t ULWord
Definition: ajatypes.h:223
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
virtual void StartProducerThread(void)
Starts my producer thread.
virtual bool RouteTsiMuxToDLOut(void)
Sets up board routing from the Two Sample Interleave muxes to the Dual Link outputs.
virtual bool RouteTsiMuxToCsc(void)
Sets up board routing from the Two Sample Interleave muxes to the color Space Converters.
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
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...
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
Declares the AJAThread class.
virtual bool RouteTsiMuxTo4xSDIOut(void)
Sets up board routing from the Two Sample Interleave muxes to the 4xSDI outputs.
virtual void StartConsumerThread(void)
Starts my consumer thread.
Describes a video frame for a given video standard or format and pixel format, including the total nu...
virtual bool RouteTsiMuxTo2xSDIOut(void)
Sets up board routing from the Two Sample Interleave muxes to the 2xSDI outputs.
virtual bool IsRunning(void) const
Definition: ntv2player4k.h:47
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
virtual bool RouteHDMIOutput(void)
Sets up board routing output via the HDMI (if available).
virtual ~NTV2Player4K(void)
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
virtual bool RouteFsToDLOut(void)
Sets up board routing from the Frame Stores to the Dual Link out.
virtual uint32_t AddTone(ULWord *audioBuffer)
Inserts audio tone (based on my current tone frequency) into the given audio buffer.
I am an object that can play out a 4K or UHD test pattern (with timecode) to an output of an AJA devi...
Definition: ntv2player4k.h:24
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
uint16_t UWord
Definition: ajatypes.h:221
virtual bool RouteFsToTsiMux(void)
Sets up board routing from the Frame Stores to the Two Sample Interleave muxes.
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 void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit). ...
virtual bool RouteCscTo2xSDIOut(void)
Sets up board routing from the Color Space Converters to the 2xSDI outputs.
I am a circular frame buffer that simplifies implementing a type-safe producer/consumer model for pro...
virtual bool Route4KDownConverter(void)
Sets up board routing for the 4K DownConverter to SDI Monitor (if available).
virtual bool RouteCscTo4xSDIOut(void)
Sets up board routing from the Color Space Converters to the 4xSDI outputs.
NTV2Player4K(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
virtual bool RouteFsToCsc(void)
Sets up board routing from the Frame Stores to the Color Space Converters.
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
virtual void SetupSDITransmitters(const NTV2Channel inFirstSDI, const UWord inNumSDIs)
Sets up bi-directional SDI transmitters.