Skip to content

Commit

Permalink
Update AJA SDK to 17.1
Browse files Browse the repository at this point in the history
Signed-off-by: Éloïse Brosseau <[email protected]>
  • Loading branch information
eloisebrosseau committed Oct 9, 2024
1 parent e8a3fb1 commit a8e2657
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 40 deletions.
7 changes: 0 additions & 7 deletions src/plugins/output/AJADevices/AJADevices/AJAModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,9 @@ namespace AJADevices
virtual void close();
virtual bool isOpen() const;

void* deviceScan() const
{
return m_devicescan;
}

private:
void* m_devicescan{ nullptr };
OperationMode m_mode{ OperationMode::ProMode };
unsigned int m_appID{ 0 };
};

} // namespace AJADevices

5 changes: 2 additions & 3 deletions src/plugins/output/AJADevices/AJADevices/KonaVideoDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ namespace AJADevices
// stereo, or quad 4K, can be used.
//

KonaVideoDevice( AJAModule*, const std::string& name, int devicenum,
KonaVideoDevice( AJAModule*, const std::string& name, unsigned int devicenum,
unsigned int appID, OperationMode mode = OperationMode::ProMode );

virtual ~KonaVideoDevice();
Expand Down Expand Up @@ -448,9 +448,8 @@ namespace AJADevices

private:
unsigned int m_appID{ 0 };
int m_devicenum{ 0 };
unsigned int m_devicenum{ 0 };
NTV2DeviceID m_deviceID{ DEVICE_ID_INVALID };
NTV2DeviceInfo* m_info{ nullptr };
CNTV2Card* m_card{ nullptr };
NTV2EveryFrameTaskMode m_taskMode{ NTV2_TASK_MODE_INVALID };
OperationMode m_operationMode{ OperationMode::ProMode };
Expand Down
33 changes: 15 additions & 18 deletions src/plugins/output/AJADevices/AJAModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "ntv2enums.h"
#include "ntv2devicefeatures.h"
#include "ntv2devicescanner.h"
#include <ntv2card.h>
#include "ntv2utils.h"

namespace AJADevices
Expand All @@ -30,11 +31,8 @@ namespace AJADevices

AJAModule::AJAModule( NativeDisplayPtr p, unsigned int appID,
OperationMode mode )
: VideoModule(), m_devicescan( 0 ), m_mode( mode ), m_appID( appID )
: VideoModule(), m_mode( mode ), m_appID( appID )
{
m_devicescan = new CNTV2DeviceScanner();
// cout << "m_devicescan: " << hex << m_devicescan << endl;
// cout << "opening AJA ...." << endl;
open();

if( !isOpen() )
Expand All @@ -46,7 +44,6 @@ namespace AJADevices
AJAModule::~AJAModule()
{
close();
delete reinterpret_cast<CNTV2DeviceScanner*>( m_devicescan );
}

string AJAModule::name() const
Expand All @@ -69,22 +66,22 @@ namespace AJADevices

void AJAModule::open()
{
if( isOpen() ) return;

reinterpret_cast<CNTV2DeviceScanner*>( m_devicescan )->ScanHardware();
if (isOpen())
{
return;
}

const NTV2DeviceInfoList& deviceList =
reinterpret_cast<CNTV2DeviceScanner*>( m_devicescan )
->GetDeviceInfoList();
CNTV2Card device;
ULWord deviceIndex = 0;

for( size_t i = 0; i < deviceList.size(); i++ )
while (CNTV2DeviceScanner::GetDeviceAtIndex(deviceIndex, device))
{
const NTV2DeviceInfo& info = deviceList[i];
// cout << "info.deviceIdentifier: " << info.deviceIdentifier << " Mode: "
// << m_mode << endl;
m_devices.push_back(
new KonaVideoDevice( this, info.deviceIdentifier, i, m_appID,
(KonaVideoDevice::OperationMode)m_mode ) );
auto konaVideoDevice = std::make_unique<KonaVideoDevice>(this, device.GetDisplayName(), deviceIndex, m_appID,
static_cast<KonaVideoDevice::OperationMode>(m_mode));

m_devices.push_back(konaVideoDevice.release());

deviceIndex++;
}
}

Expand Down
18 changes: 6 additions & 12 deletions src/plugins/output/AJADevices/KonaVideoDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ namespace AJADevices
bool KonaVideoDevice::m_infoFeedback = false;

KonaVideoDevice::KonaVideoDevice( AJAModule* m, const string& name,
int devicenum, unsigned int appID,
unsigned int devicenum, unsigned int appID,
OperationMode mode )
: GLBindableVideoDevice( m, name,
BlockingTransfer | ASyncReadBack | ImageOutput |
Expand Down Expand Up @@ -654,12 +654,6 @@ namespace AJADevices
m_writeBufferIndex( 0 ),
m_writeBufferCount( 0 )
{
//
// Default ringbuffer size is now 4, but allow setting of size by env var
// just in case.
//
m_info = &reinterpret_cast<CNTV2DeviceScanner*>( m->deviceScan() )
->GetDeviceInfoList()[devicenum];

//
// Query the card on construction so we can find out its
Expand Down Expand Up @@ -716,7 +710,7 @@ namespace AJADevices
//
// Again, this affects *only* 4K timings.

m_card = new CNTV2Card( m_info->deviceIndex );
m_card = new CNTV2Card( m_devicenum );
bool ok = m_card->IsOpen();

if( ok )
Expand Down Expand Up @@ -897,7 +891,7 @@ namespace AJADevices
m_actualVideoFormat = videoFormatsCP[0];
m_actualDataFormat = dataFormatsCP[0];

if( !m_open ) m_card = new CNTV2Card( m_info->deviceIndex );
if( !m_open ) m_card = new CNTV2Card( m_devicenum );

m_channelVector.clear();

Expand Down Expand Up @@ -1126,7 +1120,7 @@ namespace AJADevices
cout << "INFO: simple-routing = " << (int)m_simpleRouting << endl;
}

m_card = new CNTV2Card( m_info->deviceIndex );
m_card = new CNTV2Card( m_devicenum );

m_open = m_card->IsOpen();

Expand Down Expand Up @@ -2426,9 +2420,9 @@ namespace AJADevices

// Connect mux inputs to framestore outputs.
m_card->Connect( NTV2_Xpt425Mux1AInput, NTV2_XptFrameBuffer1RGB );
m_card->Connect( NTV2_Xpt425Mux1BInput, NTV2_XptFrameBuffer1_425RGB );
m_card->Connect( NTV2_Xpt425Mux1BInput, NTV2_XptFrameBuffer1_DS2RGB );
m_card->Connect( NTV2_Xpt425Mux2AInput, NTV2_XptFrameBuffer2RGB );
m_card->Connect( NTV2_Xpt425Mux2BInput, NTV2_XptFrameBuffer2_425RGB );
m_card->Connect( NTV2_Xpt425Mux2BInput, NTV2_XptFrameBuffer2_DS2RGB );
}

void KonaVideoDevice::routeCSC( bool tsiEnabled, bool outputIsRGB )
Expand Down

0 comments on commit a8e2657

Please sign in to comment.