JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java SE 討論區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 请教JMF CaptureDeviceManager.getDevice的问题
BraverHamlet





發文: 10
積分: 0
於 2008-05-06 21:29 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
1
2
3
String camera = "vfw:Microsoft WDM Image Capture (Win32):0"; //1
CaptureDeviceInfo captureDeviceInfo = CaptureDeviceManager.getDevice(camera);//2
MediaLocator mediaLocator = captureDeviceInfo.getLocator();//3

code 很简单,第3行出现java.lang.NullPointerException,在第2行CaptureDeviceManager.getDevice(camera)未获得device,试用了CaptureDeviceManager.getDeviceList(null).size()得到的值也为0!
但JMStudio却可以正常取得系统中的视频设备,图像抓取也一切正常,求教问题原因,谢谢!


reply to postreply to post
作者 Re:请教JMF CaptureDeviceManager.getDevice的问题 [Re:BraverHamlet]
BraverHamlet





發文: 10
積分: 0
於 2008-05-06 21:42 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
在网路上爬了很久,也看了sun的程式码,都没找到问题原因,希望得到朋友们的指点。

reply to postreply to post
作者 Re:请教JMF CaptureDeviceManager.getDevice的问题 [Re:BraverHamlet]
Duncan

還隱隱作痛

版主

發文: 7816
積分: 39
於 2008-05-06 23:13 user profilesend a private message to usersend email to Duncanreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
BraverHamlet wrote:
1
2
3
String camera = "vfw:Microsoft WDM Image Capture (Win32):0"; //1
CaptureDeviceInfo captureDeviceInfo = CaptureDeviceManager.getDevice(camera);//2
MediaLocator mediaLocator = captureDeviceInfo.getLocator();//3

code 很简单,第3行出现java.lang.NullPointerException,在第2行CaptureDeviceManager.getDevice(camera)未获得device,试用了CaptureDeviceManager.getDeviceList(null).size()得到的值也为0!
但JMStudio却可以正常取得系统中的视频设备,图像抓取也一切正常,求教问题原因,谢谢!


在執行程式時請設定 classpath(或 java system property: java.class.path)包含你的 JMF 安裝目錄(檔案夾)下的 lib\jmf.jar 的路徑。

如果你是把 jmf.jar copy 到 JRE 的 ext 目錄(檔案夾)下,請確定運行程式時,java system property: java.library.path 有包含 JMF 附帶的 dll 所在的目錄(檔案夾)路徑。


reply to postreply to post

給我
辣味豆腐 其餘免談
作者 Re:请教JMF CaptureDeviceManager.getDevice的问题 [Re:BraverHamlet]
BraverHamlet





發文: 10
積分: 0
於 2008-05-07 22:12 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
感谢Duncan的回复。
的确如你所提到的,我的project使用的是JRE ext 目錄(檔案夾)下的jmf.jar(奇怪我并不记得自己做过copy Sad),现在我使用JMF 安裝目錄(檔案夾)下的 lib\jmf.jar就没有上述问题了。Big Smile


reply to postreply to post
» JWorld@TW »  Java SE 討論區

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8