• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CaptureDeviceInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.media.CaptureDeviceInfo的典型用法代码示例。如果您正苦于以下问题:Java CaptureDeviceInfo类的具体用法?Java CaptureDeviceInfo怎么用?Java CaptureDeviceInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: JmfCaptureDeviceList

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
public JmfCaptureDeviceList() throws NyARRuntimeException
{ 
	this._devices = (Vector<CaptureDeviceInfo>)(CaptureDeviceManager.getDeviceList(null).clone());
	// ビデオソースのデバイスだけ残す
	try {

		for (int i = 0; i < this._devices.size();) {
			CaptureDeviceInfo cdi =this._devices.elementAt(i);
			// VideoFormatもってるかな?
			if (!isCaptureDevice(cdi)) {
				this._devices.remove(i);
				continue;
			}
			i++;
		}
	} catch (Exception e) {
		throw new NyARRuntimeException(e);
	}
	return;
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:21,代码来源:JmfCaptureDeviceList.java


示例2: deviceIdFromOrdinal

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
private String deviceIdFromOrdinal(int index) throws CaptureException
{
    final List list = system.getCaptureDeviceInfoList();
    if (index < 0 || index >= list.size())
        return null;

    com.lti.civil.CaptureDeviceInfo info = (com.lti.civil.CaptureDeviceInfo) list
            .get(index);
    return info.getDeviceID();

}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:12,代码来源:DataSource.java


示例3: listDevices

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
void listDevices() {
	Vector deviceInfos = CaptureDeviceManager.getDeviceList(null);
	if (deviceInfos.isEmpty()) {
		System.out.println("No capture devices found.");
	} else {
		for (Object o : deviceInfos) {
			CaptureDeviceInfo info = (CaptureDeviceInfo) o;
			System.out.println(info.getName() + " :");
			for (Format format : info.getFormats()) {
				System.out.println(String.format("\t%s", format.toString()));
			}
		}
	}
}
 
开发者ID:voxoid0,项目名称:java-motion-tracking,代码行数:15,代码来源:BlobTest.java


示例4: isCaptureDevice

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
/**
 * i_cdiがビデオキャプチャデバイスかを調べる。ようなことをする。
 * 
 * @param i_cdi
 * @return
 */
private static boolean isCaptureDevice(CaptureDeviceInfo i_cdi)
{
	Format[] fms = i_cdi.getFormats();
	for (int i = 0; i < fms.length; i++) {
		Format f = fms[i];
		if (f instanceof VideoFormat) {
			return true;
		}
	}
	return false;
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:18,代码来源:JmfCaptureDeviceList.java


示例5: printDeviceList

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
public static void printDeviceList() {
 System.out.println("List of capturing devices: ");
 Vector devices = CaptureDeviceManager.getDeviceList(null);
 Enumeration list = devices.elements();
 while (list.hasMoreElements()) {
  CaptureDeviceInfo deviceInfo =(CaptureDeviceInfo) list.nextElement();
  String name = deviceInfo.getName();
  
  Format[] fmts = deviceInfo.getFormats();
  System.out.println("NAME: " +name);
  for (int i = 0; i < fmts.length; i++) {
   System.out.println("\t"+fmts[i]);
  }
 }
}
 
开发者ID:LSIR,项目名称:gsn,代码行数:16,代码来源:WebCamWrapper.java


示例6: setAudioDevice

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
public void setAudioDevice(String device) {
	for ( CaptureDeviceInfo infoCaptureDevice : vectorAudioDevices) {
		if (infoCaptureDevice.getLocator().toExternalForm().equals(device)) {
			audioDevice.setSelectedItem(infoCaptureDevice.getName());
		}
	}	
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:8,代码来源:MediaPreferencePanel.java


示例7: setVideoDevice

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
public void setVideoDevice(String device) {
	for ( CaptureDeviceInfo infoCaptureDevice : vectorVideoDevices) {
		if (infoCaptureDevice.getLocator().toExternalForm().equals(device)) {
			videoDevice.setSelectedItem(infoCaptureDevice.getName());
		}
	}	
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:8,代码来源:MediaPreferencePanel.java


示例8: logAudioDevices

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
/**
* Logs the audio devices
*/
  public void logAudioDevices() {
      @SuppressWarnings("unchecked")
      final Vector<CaptureDeviceInfo> vectorDevices = CaptureDeviceManager.getDeviceList(null);

      for (CaptureDeviceInfo infoCaptureDevice : vectorDevices) {
          System.err.println(convertSysString(infoCaptureDevice.getName()));
          for (Format format : infoCaptureDevice.getFormats()) {
              System.err.println("   " + format);
          }
      }
  }
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:15,代码来源:MediaPreferencePanel.java


示例9: getCaptureDeviceInfo

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
public CaptureDeviceInfo getCaptureDeviceInfo()
{
    return new CaptureDeviceInfo(deviceName, getLocator(),
            getFormatControls()[0].getSupportedFormats());
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:6,代码来源:DataSource.java


示例10: main

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
    // for (Format f : new SimpleAWTRenderer().getSupportedInputFormats())
    // {
    // final Format civilOutputFormat = new RGBFormat(null, -1,
    // byte[].class, -1, 24, 1, 2, 3);
    // System.out.println(civilOutputFormat.matches(f) + " " + f);
    //
    // }

    PackageUtility.addContentPrefix("net.sf.fmj", false);
    PackageUtility.addProtocolPrefix("net.sf.fmj", false);

    PlugInUtility
            .registerPlugIn("net.sf.fmj.media.renderer.video.SimpleAWTRenderer");

    CaptureSystemFactory factory = DefaultCaptureSystemFactorySingleton
            .instance();
    CaptureSystem system = factory.createCaptureSystem();
    system.init();
    List list = system.getCaptureDeviceInfoList();
    for (int i = 0; i < list.size(); ++i)
    {
        com.lti.civil.CaptureDeviceInfo civilInfo = (com.lti.civil.CaptureDeviceInfo) list
                .get(i);

        {
            // String name, MediaLocator locator, Format[] formats
            CaptureDeviceInfo jmfInfo = new CaptureDeviceInfo(
                    civilInfo.getDescription(), new MediaLocator("civil:"
                            + civilInfo.getDeviceID()),
                    new Format[] { new RGBFormat() });
            CaptureDeviceManager.addDevice(jmfInfo);
        }

    }

    final java.util.Vector vectorDevices = CaptureDeviceManager
            .getDeviceList(null);
    if (vectorDevices == null)
    {
        System.out
                .println("CaptureDeviceManager.getDeviceList returned null");
        return;
    }
    if (vectorDevices.size() == 0)
    {
        System.out
                .println("CaptureDeviceManager.getDeviceList returned empty list");
        return;
    }

    for (int i = 0; i < vectorDevices.size(); i++)
    {
        CaptureDeviceInfo infoCaptureDevice = (CaptureDeviceInfo) vectorDevices
                .elementAt(i);
        System.out.println("CaptureDeviceInfo: ");
        System.out.println(infoCaptureDevice.getName());
        System.out.println(infoCaptureDevice.getLocator());
        System.out.println(infoCaptureDevice.getFormats()[0]);

        Player player;
        try
        {
            player = Manager.createRealizedPlayer(infoCaptureDevice
                    .getLocator());
        } catch (Exception e)
        {
            throw new CaptureException(e);
        }
        player.start();

    }

    system.dispose();
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:77,代码来源:FMJCaptureTest.java


示例11: getDevice

import javax.media.CaptureDeviceInfo; //导入依赖的package包/类
/**
 * i_index番目のキャプチャデバイスを得る。
 * @param i_index
 * @return
 * @throws NyARRuntimeException
 */
public JmfCaptureDevice getDevice(int i_index) throws NyARRuntimeException
{
	return new JmfCaptureDevice((CaptureDeviceInfo) this._devices.elementAt(i_index));
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:11,代码来源:JmfCaptureDeviceList.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PersistentEntityRegistry类代码示例发布时间:2022-05-22
下一篇:
Java NumericToNominal类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap