当前位置: 首页>>代码示例>>Python>>正文


Python Device.getDisplayName方法代码示例

本文整理汇总了Python中VideoCapture.Device.getDisplayName方法的典型用法代码示例。如果您正苦于以下问题:Python Device.getDisplayName方法的具体用法?Python Device.getDisplayName怎么用?Python Device.getDisplayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VideoCapture.Device的用法示例。


在下文中一共展示了Device.getDisplayName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: options

# 需要导入模块: from VideoCapture import Device [as 别名]
# 或者: from VideoCapture.Device import getDisplayName [as 别名]
 def options(self, device_name=None, device_number=None):
     # I doubt people will have more than 5 webcams plugged in
     print 'Webcam\toptions() called'
     opts = []
     for i in range(2):
         try:
             print 'Webcam\toptions - attempting to connect to %s' % i
             d = Device(devnum=i)
             if device_name is not None and device_name == d.getDisplayName():
                 del self.device
                 self.device = d
             elif device_number is not None and device_number == i:
                 del self.device
                 self.device = d
             opts.append((i, d.getDisplayName()))
             del d
         except:
             pass
     print 'Webcam\toptions() returning %s' % opts
     return opts
开发者ID:brendan-esda,项目名称:Project-Gado,代码行数:22,代码来源:Webcam.py

示例2: options

# 需要导入模块: from VideoCapture import Device [as 别名]
# 或者: from VideoCapture.Device import getDisplayName [as 别名]
 def options(self, device_name=None, device_number=None):
     # I doubt people will have more than 5 webcams plugged in
     self.logger.debug('options() called with device_name %s and device_number %s' % (device_name, device_number))
     opts = []
     for i in range(2):
         try:
             self.logger.debug('options - attempting to connect to %s' % i)
             d = Device(devnum=i)
             if device_name is not None and device_name == d.getDisplayName():
                 del self.device
                 self.device = d
             elif device_number is not None and device_number == i:
                 del self.device
                 self.device = d
             opts.append((i, d.getDisplayName()))
             del d
         except:
             self.logger.exception("Exception while setting webcam options")
             pass
     self.logger.debug('options() returning %s' % opts)
     if self.connected():
         self.logger.debug('options - managed to connect to a device!')
     return opts
开发者ID:ProjectGado,项目名称:Project-Gado,代码行数:25,代码来源:Webcam.py

示例3: enumerateDevices

# 需要导入模块: from VideoCapture import Device [as 别名]
# 或者: from VideoCapture.Device import getDisplayName [as 别名]
 def enumerateDevices():
     """Lists all available video devices.
     
     Returns a tuple of 2-tuples, which contain the integral index
     and the display name (if available) of the video device.
     """
     
     devices = ()
     i = 0
     cont = True
     while cont:
         try:
             d = Device(i)
             devices += ((i, d.getDisplayName()),)
             i += 1
         except:
             cont = False
     return devices
开发者ID:HSOFEUP,项目名称:artos,代码行数:20,代码来源:WinCapture.py


注:本文中的VideoCapture.Device.getDisplayName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。