GithubHelp home page GithubHelp logo

Comments (4)

yangjieshao avatar yangjieshao commented on July 19, 2024

you can read DevicePath

/// <summary>
/// 获取过滤器列表
/// </summary>
/// <param name="category"></param>
/// <param name="isVideo">是否视频设备</param>
/// <param name="isWave">是否音频设备</param>
/// <returns></returns>
public static List<DeviceInfo> GetFiltes(Guid category, bool isVideo, bool isWave)
{
	var result = new List<DeviceInfo>();

	EnumMonikers(category, (moniker, prop) =>
	{
		try
		{
			DeviceInfo info = new DeviceInfo();
			object value = null;
			prop.Read("FriendlyName", ref value, 0);
			info.Name = value + string.Empty;
			if (isVideo)
			{
				prop.Read("DevicePath", ref value, 0);
				info.DevicePath = (string)value;
			}
			if (isWave)
			{
				prop.Read("WaveInID", ref value, 0);
				info.WaveInID = value + string.Empty;
			}

			result.Add(info);
		}
		catch
		{
			// can not find Virtual Cam 
		}

		return false; // 継続。
	});

	return result;
}
public class DeviceInfo
{
	/// <summary>
	/// 设备名称
	/// </summary>
	public string Name { get; set; }

	/// <summary>
	/// 标识设备的唯一字符串
	/// <para>(仅限视频捕获设备)VT_BSTR</para>
	/// </summary>
	public string DevicePath { get; set; }

	/// <summary>
	/// 音频捕获设备的标识符
	/// <para>(仅限音频捕获设备)VT_I4</para>
	/// </summary>
	public string WaveInID { get; set; }
}

from usbcamera.

Wissdom09 avatar Wissdom09 commented on July 19, 2024

你的写作救了我。
非常感谢

from usbcamera.

secile avatar secile commented on July 19, 2024

Thank you for your question.

I agree with @yangjieshao 's comment.
Thank you @yangjieshao.

Please read issue #3 also.

from usbcamera.

yangjieshao avatar yangjieshao commented on July 19, 2024

你的写作救了我。 非常感谢

所以 你为啥 还不关掉这个issues

from usbcamera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.