本文整理汇总了C#中DsDevice类的典型用法代码示例。如果您正苦于以下问题:C# DsDevice类的具体用法?C# DsDevice怎么用?C# DsDevice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DsDevice类属于命名空间,在下文中一共展示了DsDevice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WebCamCapture
/// <summary>
///
/// </summary>
/// <param name="deviceNumber"></param>
/// <param name="frameRate"></param>
/// <param name="width"></param>
/// <param name="height"></param>
public WebCamCapture(int deviceNumber, int frameRate, int width, int height)
{
DsDevice[] devices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
if (deviceNumber > devices.Length - 1)
{
throw new ArgumentException("No video capture device found at index " + deviceNumber);
}
try
{
mFrameRate = frameRate;
mWidth = width;
mHeight = height;
mDevice = devices[deviceNumber];
InitCaptureGraph();
mPictureReady = new ManualResetEvent(false);
mImageCaptured = true;
mIsRunning = false;
}
catch
{
Dispose();
throw;
}
}
示例2: PTZDevice
private PTZDevice(string name, PTZType type)
{
var devices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
var device = devices.Where(d => d.Name == name).FirstOrDefault();
_device = device;
_type = type;
if (_device == null) throw new ApplicationException(String.Format("Couldn't find device named {0}!", name));
IFilterGraph2 graphBuilder = new FilterGraph() as IFilterGraph2;
IBaseFilter filter = null;
IMoniker i = _device.Mon as IMoniker;
graphBuilder.AddSourceFilterForMoniker(i, null, _device.Name, out filter);
_camControl = filter as IAMCameraControl;
_ksPropertySet = filter as IKsPropertySet;
if (_camControl == null) throw new ApplicationException("Couldn't get ICamControl!");
if (_ksPropertySet == null) throw new ApplicationException("Couldn't get IKsPropertySet!");
//TODO: Add Absolute
if (type == PTZType.Relative &&
!(SupportFor(KSProperties.CameraControlFeature.KSPROPERTY_CAMERACONTROL_PAN_RELATIVE) &&
SupportFor(KSProperties.CameraControlFeature.KSPROPERTY_CAMERACONTROL_TILT_RELATIVE)))
{
throw new NotSupportedException("This camera doesn't appear to support Relative Pan and Tilt");
}
//TODO: Do I through NotSupported when methods are called or throw them now?
//TODO: Do I check for Zoom or ignore if it's not there?
InitZoomRanges();
}
示例3: DirectShowCamera
public DirectShowCamera(int id, int width, int height, int frameRate, DsDevice device)
: base(id, width, height, frameRate)
{
SetupDevice();
_videoInput = new Capture(id);
Name = device.Name;
}
示例4: TvCardDVBIP
/// <summary>
/// Contstructor
/// </summary>
/// <param name="epgEvents"></param>
/// <param name="device"></param>
/// <param name="sequence"></param>
public TvCardDVBIP(IEpgEvents epgEvents, DsDevice device, int sequence) : base(epgEvents, device)
{
_cardType = CardType.DvbIP;
_sequence = sequence;
if (_sequence > 0)
{
_name = _name + "_" + _sequence;
}
}
示例5: CreateFilterInstance
protected IBaseFilter CreateFilterInstance(DsDevice device)
{
var guid = typeof(IBaseFilter).GUID;
object objFilter;
device.Mon.BindToObject(null, null, ref guid, out objFilter);
if (objFilter == null)
throw new NullReferenceException("Cannot bind to filter");
return (IBaseFilter)objFilter;
}
示例6: Remove
/// <summary>
/// use this method to indicate that the device specified no longer in use
/// </summary>
/// <param name="device">device</param>
public void Remove(DsDevice device)
{
for (int i = 0; i < _devicesInUse.Count; ++i)
{
if (_devicesInUse[i].Mon == device.Mon && _devicesInUse[i].Name == device.Name)
{
_devicesInUse.RemoveAt(i);
return;
}
}
}
示例7: SetupFileRecorderGraph
public void SetupFileRecorderGraph(DsDevice dev, SystemCodecEntry compressor, ref float iFrameRate, ref int iWidth, ref int iHeight, string fileName)
{
try
{
SetupGraphInternal(dev, compressor, ref iFrameRate, ref iWidth, ref iHeight, fileName);
latestBitmap = new Bitmap(iWidth, iHeight, PixelFormat.Format24bppRgb);
fullRect = new Rectangle(0, 0, latestBitmap.Width, latestBitmap.Height);
}
catch
{
CloseResources();
throw;
}
}
示例8: TvCardBase
///<summary>
/// Base constructor
///</summary>
///<param name="device">Base DS device</param>
protected TvCardBase(DsDevice device)
{
_graphState = GraphState.Idle;
_device = device;
_tunerDevice = device;
_name = device.Name;
_devicePath = device.DevicePath;
//get preload card value
if (_devicePath != null)
{
GetPreloadBitAndCardId();
GetSupportsPauseGraph();
}
}
示例9: TvCardAnalog
///<summary>
/// Constrcutor for the analog
///</summary>
///<param name="device">Tuner Device</param>
public TvCardAnalog(DsDevice device)
: base(device)
{
_parameters = new ScanParameters();
_mapSubChannels = new Dictionary<int, BaseSubChannel>();
_supportsSubChannels = true;
_minChannel = 0;
_maxChannel = 128;
_camType = CamType.Default;
_conditionalAccess = null;
_cardType = CardType.Analog;
_epgGrabbing = false;
_configuration = Configuration.readConfiguration(_cardId, _name, _devicePath);
Configuration.writeConfiguration(_configuration);
}
示例10: SelectIndex
public void SelectIndex(DsDevice dev)
{
// Highlight the specified device (if we can find it)
if (dev != null)
{
for (int x = 0; x < lbDevices.Items.Count; x++)
{
VDevice d = lbDevices.Items[x] as VDevice;
if (d.Device.DevicePath == dev.DevicePath)
{
lbDevices.SelectedIndex = x;
break;
}
}
}
}
示例11: PropertyPageHelper
public PropertyPageHelper(DsDevice dev)
{
try
{
object source;
var id = typeof(IBaseFilter).GUID;
dev.Mon.BindToObject(null, null, ref id, out source);
if (source != null)
{
var filter = (IBaseFilter)source;
m_specifyPropertyPages = filter as ISpecifyPropertyPages;
}
}
catch
{
MessageBox.Show(NO_PROPERTY_PAGE_FOUND);
}
}
示例12: AnalogCamera
public AnalogCamera(DsDevice device, Device d3dDevice)
{
this.d3dDevice = d3dDevice;
texture = new Texture(d3dDevice, 720, 576, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
var desc = texture.GetLevelDescription(0);
DataRectangle dr = texture.LockRectangle(0, LockFlags.Discard);
int rowPitch = dr.Pitch;
texture.UnlockRectangle(0);
try
{
BuildGraph(device);
}
catch
{
Dispose();
throw;
}
}
示例13: DirectShowPropertyPage
/// <summary> Constructor </summary>
/// <param name="dev"> Shows the PropertyPages of a specific DsDevice </param>
public DirectShowPropertyPage(DsDevice dev)
{
try
{
object l_Source = null;
Guid l_Iid = typeof (IBaseFilter).GUID;
dev.Mon.BindToObject(null, null, ref l_Iid, out l_Source);
if (l_Source != null)
{
Name = dev.Name;
IBaseFilter filter = (IBaseFilter)l_Source;
SupportsPersisting = false;
this.specifyPropertyPages = filter as ISpecifyPropertyPages;
}
}
catch
{
MessageBox.Show("This filter has no property page!");
}
}
示例14: TvCardDvbB2C2
/// <summary>
/// Initializes a new instance of the <see cref="TvCardDvbB2C2"/> class.
/// </summary>
/// <param name="device">The device.</param>
public TvCardDvbB2C2(DsDevice device, DeviceInfo deviceInfo)
: base(device)
{
_deviceInfo = deviceInfo;
_devicePath = deviceInfo.DevicePath;
_name = deviceInfo.Name;
GetPreloadBitAndCardId();
_useDISEqCMotor = false;
TvBusinessLayer layer = new TvBusinessLayer();
Card card = layer.GetCardByDevicePath(_devicePath);
if (card != null)
{
Setting setting = layer.GetSetting("dvbs" + card.IdCard + "motorEnabled", "no");
if (setting.Value == "yes")
_useDISEqCMotor = true;
}
_conditionalAccess = new ConditionalAccess(null, null, null, this);
_ptrDisEqc = Marshal.AllocCoTaskMem(20);
_disEqcMotor = new DiSEqCMotor(this);
GetTunerCapabilities();
}
示例15: WebCamera
public WebCamera(DsDevice device, Device d3dDevice)
{
//bitmapWindow = new Test();
//bitmapWindow.Show();
this.d3dDevice = d3dDevice;
texture = new Texture(d3dDevice, 1280, 720, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
//texture = Texture.FromFile(d3dDevice, ".\\Images\\checkerboard.jpg", D3DX.DefaultNonPowerOf2, D3DX.DefaultNonPowerOf2, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default, Filter.None, Filter.None, 0);
var desc = texture.GetLevelDescription(0);
DataRectangle dr = texture.LockRectangle(0, LockFlags.Discard);
int rowPitch = dr.Pitch;
texture.UnlockRectangle(0);
try
{
BuildGraph(device);
}
catch
{
Dispose();
throw;
}
}