Skip to content

DirectShow get device name problem #26033

@gongjianbo

Description

@gongjianbo

System Information

OpenCV version: 4.x && 5.x
Operating System / Platform: Windows11

Detailed description

When getting the device name, reading "Description" successfully will also be overwritten by "FriendlyName".

`// opencv/modules/videoio/src/cap_dshow.cpp

int videoInput::listDevices(bool silent) {

// ...
VARIANT varName;

            VariantInit(&varName);

            hr = pPropBag->Read(L"Description", &varName, 0);

            if (FAILED(hr)) hr = pPropBag->Read(L"FriendlyName", &varName, 0);

            if (SUCCEEDED(hr)){

                hr = pPropBag->Read(L"FriendlyName", &varName, 0);

// ...

}`

Steps to reproduce

None

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions