mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-19 05:51:16 -04:00
Add DecodeDeviceId helper with DStr targets
This commit is contained in:
@@ -156,10 +156,9 @@ void DShowInput::OnVideoData(DShowInput *input, unsigned char *data,
|
||||
UNUSED_PARAMETER(size);
|
||||
}
|
||||
|
||||
static bool DecodeDeviceId(DeviceId &out, const char *device_id)
|
||||
static bool DecodeDeviceId(DStr &name, DStr &path, const char *device_id)
|
||||
{
|
||||
const char *path_str;
|
||||
DStr name, path;
|
||||
const char *path_str;
|
||||
|
||||
if (!device_id || !*device_id)
|
||||
return false;
|
||||
@@ -178,6 +177,16 @@ static bool DecodeDeviceId(DeviceId &out, const char *device_id)
|
||||
decode_dstr(name);
|
||||
decode_dstr(path);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool DecodeDeviceId(DeviceId &out, const char *device_id)
|
||||
{
|
||||
DStr name, path;
|
||||
|
||||
if (!DecodeDeviceId(name, path, device_id))
|
||||
return false;
|
||||
|
||||
BPtr<wchar_t> wname = dstr_to_wcs(name);
|
||||
out.name = wname;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user