Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add device type to --list_devices #713

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/Common/AvfCtlWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class AVFCtlWrapper : public BaseWrapper {
bool WaitForSessionEnd(uint64_t Timeout);

private:
static std::string Interface;
void* Ctl;
ControllerBaseWrapper* ExtCtl;
};
4 changes: 3 additions & 1 deletion Source/Common/AvfCtlWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ - (AVCaptureDeviceTransportControlsSpeed) getSpeed
}
@end

string AVFCtlWrapper::Interface = "DV";

AVFCtlWrapper::AVFCtlWrapper(size_t DeviceIndex, ControllerBaseWrapper* ExtCtl) : ExtCtl(ExtCtl)
{
AVFCtlExternalController* ExternalController = nil;
Expand Down Expand Up @@ -164,7 +166,7 @@ - (AVCaptureDeviceTransportControlsSpeed) getSpeed
if (DeviceIndex < 0)
return string();

return string([[AVFCtl getDeviceName:DeviceIndex] UTF8String]);
return string([[AVFCtl getDeviceName:DeviceIndex] UTF8String]) + " [" + Interface + "]";
}

string AVFCtlWrapper::GetDeviceID(size_t DeviceIndex)
Expand Down
5 changes: 4 additions & 1 deletion Source/Common/DecklinkWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ HRESULT DecklinkWrapper::StatusDelegate::DeckControlStatusChanged(BMDDeckControl
return S_OK;
}

//---------------------------------------------------------------------------
string DecklinkWrapper::Interface = "DeckLink";

//---------------------------------------------------------------------------
void DecklinkWrapper::Init()
{
Expand Down Expand Up @@ -404,7 +407,7 @@ string DecklinkWrapper::GetDeviceName(size_t DeviceIndex)
if (DeviceIndex >= Devices.size())
return "";

return Devices[DeviceIndex].Name;
return Devices[DeviceIndex].Name + " [" + Interface + "]";
}

//---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions Source/Common/DecklinkWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class DecklinkWrapper : public BaseWrapper {
private:
playback_mode PlaybackMode = Playback_Mode_NotPlaying;
bool Capture = false;
static std::string Interface;

//DeckLink
IDeckLink* DeckLinkDevice = nullptr;
Expand Down
4 changes: 3 additions & 1 deletion Source/Common/LinuxWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ static int ReceiveFrame(unsigned char* Data, int Lenght, int, void *UserData)
return 0;
}

//---------------------------------------------------------------------------
string LinuxWrapper::Interface = "DV";

//---------------------------------------------------------------------------
void LinuxWrapper::Init()
Expand Down Expand Up @@ -220,7 +222,7 @@ string LinuxWrapper::GetDeviceName(const string& DeviceID)
for (size_t Pos = 0; Pos < Devices.size(); Pos++)
{
if (Devices[Pos].UUID == ID)
return Devices[Pos].Vendor + " " + Devices[Pos].Model;
return Devices[Pos].Vendor + " " + Devices[Pos].Model + " [" + Interface + "]";
}

return "";
Expand Down
2 changes: 2 additions & 0 deletions Source/Common/LinuxWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class LinuxWrapper : public BaseWrapper {
bool WaitForSessionEnd(uint64_t Timeout);

private:
static std::string Interface;

// global
int Port = -1;
nodeid_t Node = (nodeid_t)-1;
Expand Down
5 changes: 4 additions & 1 deletion Source/Common/SimulatorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ static ZtringListList ReadFileNames()
return List;
}

//---------------------------------------------------------------------------
string SimulatorWrapper::Interface = "Simulator";

//---------------------------------------------------------------------------
SimulatorWrapper::SimulatorWrapper(std::size_t DeviceIndex)
{
Expand Down Expand Up @@ -188,7 +191,7 @@ std::string SimulatorWrapper::GetDeviceName(std::size_t DeviceIndex)
auto List = ReadFileNames();
if (DeviceIndex >= List.size() || List[DeviceIndex].empty())
return {};
return List[DeviceIndex][0].To_UTF8() + " (Simulator)";
return List[DeviceIndex][0].To_UTF8() + " [" + Interface + "]";
}

//---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions Source/Common/SimulatorWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ class SimulatorWrapper : public BaseWrapper {
bool WaitForSessionEnd(uint64_t Timeout);

private:
static std::string Interface;
void* Ctl;
};
Loading