AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
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 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 
68  // Protected Class Methods
69  protected:
76  static void ConsumerThreadStatic (AJAThread * pThread, void * pContext);
77 
84  static void ProducerThreadStatic (AJAThread * pThread, void * pContext);
85 
86 
87  // Private Member Data
88  private:
89  typedef std::vector<NTV2Buffer> NTV2Buffers;
90 
91  PlayerConfig mConfig;
92  AJAThread mConsumerThread;
93  AJAThread mProducerThread;
94  CNTV2Card mDevice;
95  NTV2DeviceID mDeviceID;
96  NTV2TaskMode mSavedTaskMode;
97  ULWord mCurrentFrame;
98  ULWord mCurrentSample;
99  double mToneFrequency;
100  NTV2AudioSystem mAudioSystem;
101  NTV2FormatDesc mFormatDesc;
102 
103  bool mGlobalQuit;
104  AJATimeCodeBurn mTCBurner;
105  NTV2FrameDataArray mHostBuffers;
106  FrameDataRingBuffer mFrameDataRing;
107  NTV2Buffers mTestPatRasters;
108 
109 }; // NTV2StreamPlayer
110 
111 #endif // _NTV2STREAMPLAYER_H
NTV2TaskMode
enum NTV2EveryFrameTaskMode NTV2TaskMode
NTV2StreamChannel
Definition: ntv2publicinterface.h:8701
NTV2FormatDescriptor
Describes a video frame for a given video standard or format and pixel format, including the total nu...
Definition: ntv2formatdescriptor.h:41
NTV2StreamPlayer::SetUpHostBuffers
virtual AJAStatus SetUpHostBuffers(void)
Sets up my host video & audio buffers.
Definition: ntv2streamplayer.cpp:294
NTV2StreamPlayer::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2streamplayer.cpp:109
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
NTV2StreamPlayer
I play out SD or HD test pattern (with timecode) to an output of an AJA device with or without audio ...
Definition: ntv2streamplayer.h:24
NTV2StreamPlayer::ConsumeFrames
virtual void ConsumeFrames(void)
My consumer thread that repeatedly plays frames using AutoCirculate (until quit).
Definition: ntv2streamplayer.cpp:498
NTV2StreamPlayer::Quit
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2streamplayer.cpp:86
AJAThread
Definition: thread.h:69
NTV2StreamPlayer::~NTV2StreamPlayer
virtual ~NTV2StreamPlayer(void)
Definition: ntv2streamplayer.cpp:77
timecodeburn.h
Declares the AJATimeCodeBurn class.
AJAStatus
AJAStatus
Definition: types.h:365
NTV2StreamPlayer::StartConsumerThread
virtual void StartConsumerThread(void)
Starts my consumer thread.
Definition: ntv2streamplayer.cpp:476
NTV2StreamPlayer::SetUpVideo
virtual AJAStatus SetUpVideo(void)
Performs all video setup.
Definition: ntv2streamplayer.cpp:181
NTV2StreamPlayer::SetUpAudio
virtual AJAStatus SetUpAudio(void)
Performs all audio setup.
Definition: ntv2streamplayer.cpp:250
NTV2StreamPlayer::SetUpTestPatternBuffers
virtual AJAStatus SetUpTestPatternBuffers(void)
Creates my test pattern buffers.
Definition: ntv2streamplayer.cpp:341
ULWord
uint32_t ULWord
Definition: ajatypes.h:246
NTV2StreamPlayer::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: ntv2streamplayer.cpp:487
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:262
NTV2FrameDataArray
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
Definition: ntv2democommon.h:152
NTV2StreamPlayer::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2streamplayer.cpp:462
ntv2democommon.h
This file contains some structures, constants, classes and functions that are used in some of the dem...
NTV2StreamPlayer::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: ntv2streamplayer.cpp:625
PlayerConfig
Configures an NTV2Player instance.
Definition: ntv2democommon.h:310
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:3809
NTV2StreamPlayer::RouteOutputSignal
virtual bool RouteOutputSignal(void)
Performs all widget/signal routing for playout.
Definition: ntv2streamplayer.cpp:393
thread.h
Declares the AJAThread class.
NTV2StreamPlayer::NTV2StreamPlayer
NTV2StreamPlayer(const PlayerConfig &inConfig)
Constructs me using the given configuration settings.
Definition: ntv2streamplayer.cpp:56
NTV2StreamPlayer::StartProducerThread
virtual void StartProducerThread(void)
Starts my producer thread.
Definition: ntv2streamplayer.cpp:615
NTV2StreamPlayer::GetStreamStatus
virtual void GetStreamStatus(NTV2StreamChannel &outStatus)
Provides status information about my output (playout) process.
Definition: ntv2streamplayer.cpp:667
AJACircularBuffer< NTV2FrameData * >
NTV2StreamPlayer::ProduceFrames
virtual void ProduceFrames(void)
My producer thread that repeatedly produces video frames.
Definition: ntv2streamplayer.cpp:634