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


Java VideoSource.getKindFromInt方法代码示例

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


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

示例1: makeSourceValue

import edu.wpi.cscore.VideoSource; //导入方法依赖的package包/类
@SuppressWarnings("JavadocMethod")
private static String makeSourceValue(int source) {
  switch (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))) {
    case kUsb:
      return "usb:" + CameraServerJNI.getUsbCameraPath(source);
    case kHttp: {
      String[] urls = CameraServerJNI.getHttpCameraUrls(source);
      if (urls.length > 0) {
        return "ip:" + urls[0];
      } else {
        return "ip:";
      }
    }
    case kCv:
      // FIXME: Should be "cv:", but LabVIEW dashboard requires "usb:".
      // https://github.com/wpilibsuite/allwpilib/issues/407
      return "usb:";
    default:
      return "unknown:";
  }
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:22,代码来源:CameraServer.java

示例2: getSourceStreamValues

import edu.wpi.cscore.VideoSource; //导入方法依赖的package包/类
@SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
private synchronized String[] getSourceStreamValues(int source) {
  // Ignore all but HttpCamera
  if (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))
          != VideoSource.Kind.kHttp) {
    return new String[0];
  }

  // Generate values
  String[] values = CameraServerJNI.getHttpCameraUrls(source);
  for (int j = 0; j < values.length; j++) {
    values[j] = "mjpg:" + values[j];
  }

  // Look to see if we have a passthrough server for this source
  for (VideoSink i : m_sinks.values()) {
    int sink = i.getHandle();
    int sinkSource = CameraServerJNI.getSinkSource(sink);
    if (source == sinkSource
        && VideoSink.getKindFromInt(CameraServerJNI.getSinkKind(sink)) == VideoSink.Kind.kMjpeg) {
      // Add USB-only passthrough
      String[] finalValues = new String[values.length + 1];
      for (int j = 0; j < values.length; j++) {
        finalValues[j] = values[j];
      }
      int port = CameraServerJNI.getMjpegServerPort(sink);
      finalValues[values.length] = makeStreamValue("172.22.11.2", port);
      return finalValues;
    }
  }

  return values;
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:34,代码来源:CameraServer.java


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