AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2streamplayer.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #ifndef _NTV2STREAMPLAYER_H
10 #define _NTV2STREAMPLAYER_H
11 
12 #include "ntv2democommon.h"
13 #include "ajabase/system/thread.h"
15 
16 
25 {
26  // Public Instance Methods
27  public:
33  NTV2StreamPlayer (const PlayerConfig & inConfig);
34 
35  virtual ~NTV2StreamPlayer (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 GetStreamStatus (NTV2StreamChannel & outStatus);
54 
55 
56  // Protected Instance Methods
57  protected:
58  virtual AJAStatus SetUpVideo (void);
59  virtual bool RouteOutputSignal (void);
60  virtual AJAStatus SetUpHostBuffers (void);
61  virtual AJAStatus SetUpTestPatternBuffers (void);
62  virtual void StartConsumerThread (void);
63  virtual void ConsumeFrames (void);
64  virtual void StartProducerThread (void);
65  virtual void ProduceFrames (void);
66 
67  // Protected Class Methods
68  protected:
75  static void ConsumerThreadStatic (AJAThread * pThread, void * pContext);
76 
83  static void ProducerThreadStatic (AJAThread * pThread, void * pContext);
84 
85 
86  // Private Member Data
87  private:
88  struct FrameData
89  {
90  NTV2Buffer fVideoBuffer;
91  bool fDataReady;
92  };
93  typedef std::vector<FrameData> FrameDataArray;
94  typedef FrameDataArray::iterator FrameDataArrayIter;
95  typedef std::vector<NTV2Buffer> NTV2Buffers;
96 
97  PlayerConfig mConfig;
98  AJAThread mConsumerThread;
99  AJAThread mProducerThread;
100  CNTV2Card mDevice;
101  NTV2DeviceID mDeviceID;
102  NTV2TaskMode mSavedTaskMode;
103  ULWord mCurrentFrame;
104  ULWord mCurrentSample;
105  NTV2FormatDesc mFormatDesc;
106 
107  bool mGlobalQuit;
108  AJATimeCodeBurn mTCBurner;
109  FrameDataArray mHostBuffers;
110  ULWord mProducerIndex;
111  ULWord mConsumerIndex;
112  NTV2Buffers mTestPatRasters;
113 
114 }; // NTV2StreamPlayer
115 
116 #endif // _NTV2STREAMPLAYER_H
virtual bool IsRunning(void) const
virtual void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit). ...
virtual void Quit(void)
Gracefully stops me from running.
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
I play out SD or HD test pattern (with timecode) to an output of an AJA device with or without audio ...
NTV2TaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
AJAStatus
Definition: types.h:380
virtual void StartConsumerThread(void)
Starts my consumer thread.
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
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 AJAStatus Run(void)
Runs me.
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
Declares the AJATimeCodeBurn class.
uint32_t ULWord
Definition: ajatypes.h:223
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
Declares the AJAThread class.
virtual ~NTV2StreamPlayer(void)
Describes a video frame for a given video standard or format and pixel format, including the total nu...
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
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 void GetStreamStatus(NTV2StreamChannel &outStatus)
Provides status information about my output (playout) process.
virtual void StartProducerThread(void)
Starts my producer thread.
NTV2StreamPlayer(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
This file contains some structures, constants, classes and functions that are used in some of the dem...
Configures an NTV2Player instance.
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
virtual void ProduceFrames(void)
My producer thread that repeatedly produces video frames.