com.github.sarxos.webcam.Webcam.getDiscoveryServiceRef()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中com.github.sarxos.webcam.Webcam.getDiscoveryServiceRef()方法的一些代码示例,展示了Webcam.getDiscoveryServiceRef()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Webcam.getDiscoveryServiceRef()方法的具体详情如下:
包路径:com.github.sarxos.webcam.Webcam
类名称:Webcam
方法名:getDiscoveryServiceRef

Webcam.getDiscoveryServiceRef介绍

[英]Return discovery service without creating it if not exists.
[中]返回发现服务,如果不存在,则不创建它。

代码示例

代码示例来源:origin: sarxos/webcam-capture

/**
 * Run discovery service once if device has been removed to trigger disconnected webcam
 * discovery event and keep webcams list up-to-date.
 */
private static void rescan() {
  WebcamDiscoveryService discovery = Webcam.getDiscoveryServiceRef();
  if (discovery != null) {
    discovery.scan();
  }
}

代码示例来源:origin: sarxos/webcam-capture

/**
 * Shutdown webcam framework. This method should be used <b>ONLY</b> when you are exiting JVM,
 * but please <b>do not invoke it</b> if you really don't need to.
 */
protected static void shutdown() {
  // stop discovery service
  WebcamDiscoveryService discovery = getDiscoveryServiceRef();
  if (discovery != null) {
    discovery.stop();
  }
  // stop processor
  WebcamProcessor.getInstance().shutdown();
}

代码示例来源:origin: com.github.sarxos/webcam-capture-driver-ipcam

/**
 * Run discovery service once if device has been removed to trigger disconnected webcam
 * discovery event and keep webcams list up-to-date.
 */
private static void rescan() {
  WebcamDiscoveryService discovery = Webcam.getDiscoveryServiceRef();
  if (discovery != null) {
    discovery.scan();
  }
}

相关文章