0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00
obs-studio/plugins/aja/aja-source.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.7 KiB
C++
Raw Normal View History

aja: Capture and Output plugin for AJA Video Systems IO devices * aja: Initial commit of AJA capture/output plugin * aja: Fix clang-format on aja-output-ui code * aja: Remove script used during dev/testing * aja: Address pull request feedback from @RytoEX * aja: Remove the SDK sources and update CMakeLists to point to new headers-only/static libs dependency distribution. * aja: Only build AJA plugin on x64 on macOS for now * aja: Remove the non-English placeholder locale files. The english strings/files will be produced via crowdin, according to @ddrboxman. * aja: Add FindLibAJANTV2.cmake script to locate the ajantv2 headers and static libs in the OBS external deps package(s). Tested on Windows x64. macOS and Linux x64 TBD. * aja: Add ajantv2/includes to FindLibAJANTV2 include search paths * aja: Remove commented code from aja CMakeLists * aja: Remove debug code and comments that are no longer needed. * aja: Fix indentation * aja: Remove disablement of clang-format in routing table and SDIWireFormat map * aja: Use spaces for all indentation in widget crosspoint arrays where we disable clang-format * aja: Address code style comments made by @RytoEX * aja: Fix uneven indentation * aja: More fixes to if/else placement and remove superfluous comments. * aja: Rename 'dwns' to 'deactivateWhileNotShowing' for clarity. The DeckLink plugin still uses the variable name 'dwns' and should be changed, if desired, in a separate PR. * aja: Remove X11Extras dependency from AJA Output frontend plugin * aja: Add patch from Jim to find AJA release/debug libs * aja: Improve AV sync of queued video/audio sent to the AJA card in the AJA Output plugin.
2021-11-24 03:31:11 +01:00
#pragma once
#include "aja-props.hpp"
#include <obs-module.h>
#include <ajantv2/includes/ajatypes.h>
#include <ajantv2/includes/ntv2testpatterngen.h>
#include <ajabase/common/types.h>
#include <ajabase/system/thread.h>
#include <mutex>
class CNTV2Card;
class AJASource {
public:
explicit AJASource(obs_source_t *source);
~AJASource();
void SetCard(CNTV2Card *card);
CNTV2Card *GetCard();
void SetOBSSource(obs_source_t *source);
obs_source_t *GetOBSSource(void) const;
void SetName(const std::string &name);
std::string GetName() const;
void GenerateTestPattern(NTV2VideoFormat vf, NTV2PixelFormat pf,
NTV2TestPatternSelect ps);
// Capture Thread stuff
static void CaptureThread(AJAThread *thread, void *data);
void Activate(bool enable = false);
void Deactivate();
bool IsCapturing() const;
void SetCapturing(bool capturing);
// CardEntry/Device stuff
std::string CardID() const;
void SetCardID(const std::string &cardID);
uint32_t DeviceIndex() const;
void SetDeviceIndex(uint32_t index);
// Source Props
void SetSourceProps(const SourceProps &props);
SourceProps GetSourceProps() const;
bool ReadChannelVPIDs(NTV2Channel channel, VPIDData &vpids);
bool ReadWireFormats(NTV2DeviceID device_id, IOSelection io_select,
aja: Capture and Output plugin for AJA Video Systems IO devices * aja: Initial commit of AJA capture/output plugin * aja: Fix clang-format on aja-output-ui code * aja: Remove script used during dev/testing * aja: Address pull request feedback from @RytoEX * aja: Remove the SDK sources and update CMakeLists to point to new headers-only/static libs dependency distribution. * aja: Only build AJA plugin on x64 on macOS for now * aja: Remove the non-English placeholder locale files. The english strings/files will be produced via crowdin, according to @ddrboxman. * aja: Add FindLibAJANTV2.cmake script to locate the ajantv2 headers and static libs in the OBS external deps package(s). Tested on Windows x64. macOS and Linux x64 TBD. * aja: Add ajantv2/includes to FindLibAJANTV2 include search paths * aja: Remove commented code from aja CMakeLists * aja: Remove debug code and comments that are no longer needed. * aja: Fix indentation * aja: Remove disablement of clang-format in routing table and SDIWireFormat map * aja: Use spaces for all indentation in widget crosspoint arrays where we disable clang-format * aja: Address code style comments made by @RytoEX * aja: Fix uneven indentation * aja: More fixes to if/else placement and remove superfluous comments. * aja: Rename 'dwns' to 'deactivateWhileNotShowing' for clarity. The DeckLink plugin still uses the variable name 'dwns' and should be changed, if desired, in a separate PR. * aja: Remove X11Extras dependency from AJA Output frontend plugin * aja: Add patch from Jim to find AJA release/debug libs * aja: Improve AV sync of queued video/audio sent to the AJA card in the AJA Output plugin.
2021-11-24 03:31:11 +01:00
NTV2VideoFormat &vf, NTV2PixelFormat &pf,
VPIDDataList &vpids);
void ResetVideoBuffer(NTV2VideoFormat vf, NTV2PixelFormat pf);
void ResetAudioBuffer(size_t size);
NTV2_POINTER mVideoBuffer;
NTV2_POINTER mAudioBuffer;
private:
CNTV2Card *mCard;
std::string mSourceName;
std::string mCardID;
UWord mDeviceIndex;
bool mBuffering;
bool mIsCapturing;
SourceProps mSourceProps;
NTV2TestPatternBuffer mTestPattern;
AJAThread *mCaptureThread;
std::mutex mMutex;
obs_source_t *mSource;
};