|
AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
Go to the documentation of this file.
5 #include <QJsonDocument>
23 QJsonArray decoderArray =
json[
"decoder"].toArray();
24 for (
int decoderIndex = 0; decoderIndex < decoderArray.size(); ++decoderIndex)
26 std::cout <<
"Decoder" << std::endl;
28 QJsonObject pDecoder = decoderArray[decoderIndex].toObject();
31 decoderStruct.
selectionMode = pDecoder[
"SelectionMode"].toInt();
32 std::cout <<
"SelectionMode " << decoderStruct.
selectionMode << std::endl;
33 decoderStruct.
programNumber = pDecoder[
"ProgramNumber"].toInt();
34 std::cout <<
"ProgramNumber " << decoderStruct.
selectionMode << std::endl;
35 decoderStruct.
programPID = pDecoder[
"ProgramPID"].toInt();
36 std::cout <<
"ProgramPID " << decoderStruct.
selectionMode << std::endl;
37 decoderStruct.
audioNumber = pDecoder[
"AudioNumber"].toInt();
38 std::cout <<
"AudioNumber " << decoderStruct.
selectionMode << std::endl;
43 QJsonArray encoderArray =
json[
"encoder"].toArray();
44 for (
int encoderIndex = 0; encoderIndex < encoderArray.size(); ++encoderIndex)
46 std::cout <<
"Encoder" << std::endl;
48 QJsonObject pEncoder = encoderArray[encoderIndex].toObject();
51 encoderStruct.
channels = pEncoder[
"Channels"].toInt();
52 std::cout <<
"Channels " << encoderStruct.
channels << std::endl;
54 QString vf = pEncoder[
"VideoFormat"].toString();
56 std::cout <<
"VideoFormat " << vf.toStdString().c_str() << std::endl;
58 QString st = pEncoder[
"StreamType"].toString();
60 std::cout <<
"StreamType " << st.toStdString().c_str() << std::endl;
62 QString css = pEncoder[
"ChromaSampling"].toString();
64 std::cout <<
"ChromaSampling " << css.toStdString().c_str() << std::endl;
66 encoderStruct.
bitDepth = pEncoder[
"BitDepth"].toInt();
67 std::cout <<
"BitDepth " << encoderStruct.
bitDepth << std::endl;
68 encoderStruct.
mbps = pEncoder[
"Mbps"].toInt();
69 std::cout <<
"Mbps " << encoderStruct.
mbps << std::endl;
70 encoderStruct.
audioChannels = pEncoder[
"AudioChannels"].toInt();
71 std::cout <<
"AudioChannels " << encoderStruct.
audioChannels << std::endl;
73 encoderStruct.
programPid = pEncoder[
"ProgramPid"].toInt();
74 std::cout <<
"ProgramPid " << encoderStruct.
programPid << std::endl;
75 encoderStruct.
videoPid = pEncoder[
"VideoPid"].toInt();
76 std::cout <<
"VideoPid " << encoderStruct.
videoPid << std::endl;
77 encoderStruct.
pcrPid = pEncoder[
"PcrPid"].toInt();
78 std::cout <<
"PcrPid " << encoderStruct.
pcrPid << std::endl;
79 encoderStruct.
audio1Pid = pEncoder[
"Audio1Pid"].toInt();
80 std::cout <<
"Audio1Pid " << encoderStruct.
audio1Pid << std::endl << std::endl;
90 QFile loadFile(fileName);
91 if ( !loadFile.open(QIODevice::ReadOnly))
93 qWarning(
"Couldn't open json file.");
96 QByteArray saveData = loadFile.readAll();
97 QJsonDocument loadDoc(QJsonDocument::fromJson(saveData));
105 QMap<QString, NTV2VideoFormat>::iterator i;
108 QString str = i.key();
109 std::cout << str.toStdString() << std::endl;
157 if (!mDevice.IsOpen())
159 std::cerr <<
"## ERROR: No devices found" << std::endl;
169 std::cout <<
"## NOTE: Waiting for device to become ready... (Ctrl-C will abort)" << std::endl;
173 std::cout <<
"## NOTE: Device is ready" << std::endl;
180 std::cerr <<
"## ERROR: board firmware package is incompatible with this application" << std::endl;
184 if (pKonaIpJ2kParams->
mEncoder.size() == 0)
186 std::cerr <<
"Not setting up encoder, no data" << std::endl;
190 if (pKonaIpJ2kParams->
mEncoder.size() > 1)
192 std::cerr <<
"Multiple encoders not supported at this time" << std::endl;
196 QListIterator<EncoderStruct> encoderIter(pKonaIpJ2kParams->
mEncoder);
197 while (encoderIter.hasNext())
199 std::cerr <<
"## encoderIter did" << std::endl;
230 std::cerr <<
"## NOTE: Encoder is setup and running" << std::endl;
240 if (!mDevice.IsOpen())
241 {std::cerr <<
"## ERROR: No devices found" << std::endl;
return false;}
248 std::cout <<
"## NOTE: Waiting for device to become ready... (Ctrl-C will abort)" << std::endl;
252 std::cout <<
"## NOTE: Device is ready" << std::endl;
258 std::cerr <<
"## ERROR: board firmware package is incompatible with this application" << std::endl;
262 if (pKonaIpJ2kParams->
mDecoder.size() == 0)
264 std::cerr <<
"Not setting up decoder, no data" << std::endl;
268 if (pKonaIpJ2kParams->
mDecoder.size() > 1)
270 std::cerr <<
"Multiple decoders not supported at this time" << std::endl;
274 QListIterator<DecoderStruct> decoderIter(pKonaIpJ2kParams->
mDecoder);
275 while (decoderIter.hasNext())
277 std::cerr <<
"## decoderIter did" << std::endl;
292 std::cerr <<
"## NOTE: Decoder is setup and running" << std::endl;
bool openJson(QString fileName)
bool setupBoard(std::string pDeviceSpec, KonaIPParamJ2KSetupStruct *pKonaIpJ2kParams)
bool SetJ2KDecoderConfiguration(const j2kDecoderConfig &j2kConfig)
uint32_t mbps
Specifies the mbits per-second for J2K encode.
@ NTV2_CHANNEL2
Specifies channel or Frame Store 2 (or the 2nd item).
Declares device capability functions.
uint32_t videoPid
Specifies the PID for the video.
Declares the AJATime class.
The CNTV2Config2022 class is the interface to Kona-IP network I/O using SMPTE 2022.
static bool GetFirstDeviceFromArgument(const std::string &inArgument, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command li...
@ NTV2_FORMAT_1080p_2K_3000
QMap< QString, NTV2VideoFormat > videoFormatMap
J2KStreamType streamType
Specifies the stream type for J2K encode.
bool readJson(const QJsonObject &json)
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
uint32_t audioChannels
Specifies the number of audio channels for J2K encode, a value of 0 indicates no audio.
bool SetJ2KEncoderConfiguration(const NTV2Channel channel, const j2kEncoderConfig &j2kConfig)
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
@ NTV2_FORMAT_1080p_2K_2400
uint32_t bitDepth
Specifies the bit depth for J2K encode.
Declares the CNTV2DeviceScanner class.
QList< EncoderStruct > mEncoder
KonaIPParamJ2KSetupStruct mKonaIpJ2kParams
Enumerations for controlling NTV2 devices.
Declares numerous NTV2 utility functions.
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
QList< DecoderStruct > mDecoder
uint32_t ullMode
Specifies the ull mode for J2K encode.
I interrogate and control an AJA video/audio capture/playout device.
bool setupBoard(std::string pDeviceSpec, KonaIPParamJ2KSetupStruct *pKonaIpJ2kParams)
virtual bool IsMBSystemValid(void)
@ NTV2_FORMAT_1080p_6000_A
@ NTV2_FORMAT_1080p_2K_2398
NTV2VideoFormat videoFormat
uint32_t pmtPid
Specifies the PID for the PMT.
void printVideoFormatMap()
@ NTV2_FORMAT_1080p_5000_A
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
NTV2VideoFormat videoFormat
Specifies the video format for J2K encode.
@ NTV2_FORMAT_1080p_5994_A
J2KChromaSubSampling chromaSubsamp
Specifies the chroma sub sampling for J2K encode.
uint32_t pcrPid
Specifies the PID for the PCR.
Declares the CNTV2ConfigTs2022 class.
uint32_t audio1Pid
Specifies the PID for audio 1.
uint32_t chromaSubSampling
basic_json<> json
default specialization
virtual bool IsMBSystemReady(void)
QMap< QString, uint32_t > chromaSubSamplingMap
eProgSelMode_t selectionMode
QMap< QString, uint32_t > streamTypeMap
@ NTV2_FORMAT_1080p_2K_2997