AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
ntv2stream.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
7 #include "ntv2card.h"
8 #include "ntv2publicinterface.h"
9 #include "ntv2driverinterface.h"
10 
12 {
13  NTV2StreamChannel status;
14  if (!StreamChannelOps(inChannel, NTV2_STREAM_CHANNEL_INITIALIZE, status))
16  return status.mStatus;
17 }
18 
20 {
21  NTV2StreamChannel status;
22  if (!StreamChannelOps(inChannel, NTV2_STREAM_CHANNEL_RELEASE, status))
24  return status.mStatus;
25 }
26 
28  NTV2StreamChannel& status)
29 {
30  if (!StreamChannelOps(inChannel, NTV2_STREAM_CHANNEL_START, status))
32  return status.mStatus;
33 }
34 
36  NTV2StreamChannel& status)
37 {
38  if (!StreamChannelOps(inChannel, NTV2_STREAM_CHANNEL_STOP, status))
40  return status.mStatus;
41 }
42 
44  NTV2StreamChannel& status)
45 {
46  if (!StreamChannelOps(inChannel, NTV2_STREAM_CHANNEL_FLUSH, status))
48  return status.mStatus;
49 }
50 
52  NTV2StreamChannel& status)
53 {
54  if (!StreamChannelOps(inChannel, NTV2_STREAM_CHANNEL_STATUS, status))
56  return status.mStatus;
57 }
58 
60  NTV2StreamChannel& status)
61 {
62  if (!StreamChannelOps(inChannel, NTV2_STREAM_CHANNEL_WAIT, status))
64  return status.mStatus;
65 }
66 
68  NTV2Buffer& inBuffer,
69  ULWord64 bufferCookie,
70  NTV2StreamBuffer& status)
71 {
72  if (!StreamBufferOps(inChannel, inBuffer, bufferCookie, NTV2_STREAM_BUFFER_QUEUE, status))
74  return status.mStatus;
75 }
76 
78  NTV2StreamBuffer& status)
79 {
80  NTV2_POINTER buffer;
81  if (!StreamBufferOps(inChannel, buffer, 0, NTV2_STREAM_BUFFER_RELEASE, status))
83  return status.mStatus;
84 }
85 
87  ULWord64 bufferCookie,
88  NTV2StreamBuffer& status)
89 {
90  NTV2_POINTER buffer;
91  if (!StreamBufferOps(inChannel, buffer, bufferCookie, NTV2_STREAM_BUFFER_STATUS, status))
93  return status.mStatus;
94 }
CNTV2Card::StreamBufferQueue
virtual ULWord StreamBufferQueue(const NTV2Channel inChannel, NTV2Buffer &inBuffer, ULWord64 bufferCookie, NTV2StreamBuffer &status)
Queue a buffer to the stream. The bufferCookie is a user defined identifier of the buffer used by the...
Definition: ntv2stream.cpp:67
NTV2_STREAM_STATUS_FAIL
#define NTV2_STREAM_STATUS_FAIL
Used in NTV2Stream fail.
Definition: ntv2publicinterface.h:8661
CNTV2DriverInterface::StreamBufferOps
virtual bool StreamBufferOps(const NTV2Channel inChannel, NTV2Buffer &inBuffer, ULWord64 bufferCookie, ULWord flags, NTV2StreamBuffer &status)
Definition: ntv2driverinterface.cpp:864
NTV2StreamChannel
Definition: ntv2publicinterface.h:8669
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1305
NTV2Buffer
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
Definition: ntv2publicinterface.h:5993
CNTV2DriverInterface::StreamChannelOps
virtual bool StreamChannelOps(const NTV2Channel inChannel, ULWord flags, NTV2StreamChannel &status)
Definition: ntv2driverinterface.cpp:854
CNTV2Card::StreamChannelFlush
virtual ULWord StreamChannelFlush(const NTV2Channel inChannel, NTV2StreamChannel &status)
Flush a stream. Remove all the buffers from the stream except a currently active idle buffer....
Definition: ntv2stream.cpp:43
NTV2_STREAM_CHANNEL_RELEASE
#define NTV2_STREAM_CHANNEL_RELEASE
Used in NTV2StreamChannel to release stream.
Definition: ntv2publicinterface.h:8631
CNTV2Card::StreamChannelRelease
virtual ULWord StreamChannelRelease(const NTV2Channel inChannel)
Release a stream. Releases all buffers remaining in the queue.
Definition: ntv2stream.cpp:19
NTV2_STREAM_CHANNEL_START
#define NTV2_STREAM_CHANNEL_START
Used in NTV2StreamChannel to start streaming.
Definition: ntv2publicinterface.h:8632
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
NTV2StreamChannel::mStatus
ULWord mStatus
Action status.
Definition: ntv2publicinterface.h:8673
NTV2_STREAM_CHANNEL_INITIALIZE
#define NTV2_STREAM_CHANNEL_INITIALIZE
Used in NTV2StreamChannel to initialize the stream.
Definition: ntv2publicinterface.h:8630
CNTV2Card::StreamChannelStart
virtual ULWord StreamChannelStart(const NTV2Channel inChannel, NTV2StreamChannel &status)
Start a stream. Put the stream is the active state to start processing queued buffers....
Definition: ntv2stream.cpp:27
CNTV2Card::StreamChannelStatus
virtual ULWord StreamChannelStatus(const NTV2Channel inChannel, NTV2StreamChannel &status)
Get the current stream status.
Definition: ntv2stream.cpp:51
ntv2card.h
Declares the CNTV2Card class.
NTV2_STREAM_BUFFER_STATUS
#define NTV2_STREAM_BUFFER_STATUS
Used in NTV2StreamBuffer to request buffer status.
Definition: ntv2publicinterface.h:8649
NTV2_STREAM_CHANNEL_WAIT
#define NTV2_STREAM_CHANNEL_WAIT
Used in NTV2StreamChannel to wait for signal.
Definition: ntv2publicinterface.h:8636
CNTV2Card::StreamBufferStatus
virtual ULWord StreamBufferStatus(const NTV2Channel inChannel, ULWord64 bufferCookie, NTV2StreamBuffer &status)
Get the status of the buffer identified by the bufferCookie.
Definition: ntv2stream.cpp:86
NTV2_STREAM_STATUS_MESSAGE
#define NTV2_STREAM_STATUS_MESSAGE
Used in NTV2Stream driver message failure.
Definition: ntv2publicinterface.h:8663
NTV2_STREAM_CHANNEL_FLUSH
#define NTV2_STREAM_CHANNEL_FLUSH
Used in NTV2StreamChannel to flush buffer queue.
Definition: ntv2publicinterface.h:8634
CNTV2Card::StreamBufferRelease
virtual ULWord StreamBufferRelease(const NTV2Channel inChannel, NTV2StreamBuffer &status)
Remove the oldest buffer released by the streaming engine from the buffer queue.
Definition: ntv2stream.cpp:77
NTV2_STREAM_BUFFER_QUEUE
#define NTV2_STREAM_BUFFER_QUEUE
Used in NTV2StreamBuffer to add buffer to queue.
Definition: ntv2publicinterface.h:8647
NTV2_STREAM_BUFFER_RELEASE
#define NTV2_STREAM_BUFFER_RELEASE
Used in NTV2StreamBuffer to signal on complete.
Definition: ntv2publicinterface.h:8648
CNTV2Card::StreamChannelStop
virtual ULWord StreamChannelStop(const NTV2Channel inChannel, NTV2StreamChannel &status)
Stop a stream. Put the stream is the idle state. For frame based video, the stream will idle on the b...
Definition: ntv2stream.cpp:35
CNTV2Card::StreamChannelWait
virtual ULWord StreamChannelWait(const NTV2Channel inChannel, NTV2StreamChannel &status)
Wait for any stream event. Returns for any state or buffer change.
Definition: ntv2stream.cpp:59
ULWord64
uint64_t ULWord64
Definition: ajatypes.h:256
CNTV2Card::StreamChannelInitialize
virtual ULWord StreamChannelInitialize(const NTV2Channel inChannel)
Initialize a stream. Put the stream queue and hardware in a known good state ready for use....
Definition: ntv2stream.cpp:11
ntv2publicinterface.h
Declares enums and structs used by all platform drivers and the SDK.
NTV2_STREAM_CHANNEL_STATUS
#define NTV2_STREAM_CHANNEL_STATUS
Used in NTV2StreamChannel to request stream status.
Definition: ntv2publicinterface.h:8635
NTV2StreamBuffer
Definition: ntv2publicinterface.h:8729
NTV2StreamBuffer::mStatus
ULWord mStatus
Action status.
Definition: ntv2publicinterface.h:8733
ntv2driverinterface.h
Declares the CNTV2DriverInterface base class.
NTV2_STREAM_CHANNEL_STOP
#define NTV2_STREAM_CHANNEL_STOP
Used in NTV2StreamChannel to stop streaming.
Definition: ntv2publicinterface.h:8633