AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
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  NTV2Buffer 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  NTV2Buffer buffer;
91  if (!StreamBufferOps(inChannel, buffer, bufferCookie, NTV2_STREAM_BUFFER_STATUS, status))
93  return status.mStatus;
94 }
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
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
Declares the CNTV2DriverInterface base class.
virtual ULWord StreamChannelRelease(const NTV2Channel inChannel)
Release a stream. Releases all buffers remaining in the queue.
Definition: ntv2stream.cpp:19
#define NTV2_STREAM_STATUS_FAIL
Used in NTV2Stream fail.
uint32_t ULWord
Definition: ajatypes.h:223
#define NTV2_STREAM_CHANNEL_START
Used in NTV2StreamChannel to start streaming.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1357
#define NTV2_STREAM_CHANNEL_INITIALIZE
Used in NTV2StreamChannel to initialize the stream.
#define NTV2_STREAM_BUFFER_STATUS
Used in NTV2StreamBuffer to request buffer status.
#define NTV2_STREAM_CHANNEL_RELEASE
Used in NTV2StreamChannel to release stream.
ULWord mStatus
Action status.
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
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
virtual ULWord StreamChannelStart(const NTV2Channel inChannel, NTV2StreamChannel &status)
Start a stream. Put the stream is the active state to start processing queued buffers. For frame based video, the stream will start with the current buffer on the next frame sync.
Definition: ntv2stream.cpp:27
virtual ULWord StreamChannelStatus(const NTV2Channel inChannel, NTV2StreamChannel &status)
Get the current stream status.
Definition: ntv2stream.cpp:51
uint64_t ULWord64
Definition: ajatypes.h:226
virtual ULWord StreamBufferStatus(const NTV2Channel inChannel, ULWord64 bufferCookie, NTV2StreamBuffer &status)
Get the status of the buffer identified by the bufferCookie.
Definition: ntv2stream.cpp:86
#define NTV2_STREAM_BUFFER_QUEUE
Used in NTV2StreamBuffer to add buffer to queue.
#define NTV2_STREAM_BUFFER_RELEASE
Used in NTV2StreamBuffer to signal on complete.
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.).
virtual ULWord StreamChannelWait(const NTV2Channel inChannel, NTV2StreamChannel &status)
Wait for any stream event. Returns for any state or buffer change.
Definition: ntv2stream.cpp:59
#define NTV2_STREAM_CHANNEL_WAIT
Used in NTV2StreamChannel to wait for signal.
virtual bool StreamBufferOps(const NTV2Channel inChannel, NTV2Buffer &inBuffer, ULWord64 bufferCookie, ULWord flags, NTV2StreamBuffer &status)
#define NTV2_STREAM_STATUS_MESSAGE
Used in NTV2Stream driver message failure.
virtual bool StreamChannelOps(const NTV2Channel inChannel, ULWord flags, NTV2StreamChannel &status)
#define NTV2_STREAM_CHANNEL_FLUSH
Used in NTV2StreamChannel to flush buffer queue.
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
Declares the CNTV2Card class.
ULWord mStatus
Action status.
#define NTV2_STREAM_CHANNEL_STOP
Used in NTV2StreamChannel to stop streaming.
#define NTV2_STREAM_CHANNEL_STATUS
Used in NTV2StreamChannel to request stream status.
Declares enums and structs used by all platform drivers and the SDK.