1 package com.inzyme.jmds; 2 3 import java.util.ArrayList ; 4 import java.util.List ; 5 6 import javax.media.Format; 7 8 import com.sun.media.vfw.BitMapInfo; 9 10 15 public class DSCapturePin { 16 private DSCaptureDeviceInfo myCaptureDevice; 17 private String myPinID; 18 private String myName; 19 private Format[] myFormats; 20 21 private List myFormatsList; 22 23 30 public DSCapturePin(DSCaptureDeviceInfo _captureDevice, String _pinID, String _name) { 31 myCaptureDevice = _captureDevice; 32 myPinID = _pinID; 33 myName = _name; 34 } 35 36 41 public DSCaptureDeviceInfo getCaptureDevice() { 42 return myCaptureDevice; 43 } 44 45 50 public String getPinID() { 51 return myPinID; 52 } 53 54 59 public String getName() { 60 return myName; 61 } 62 63 68 public Format[] getFormats() { 69 if (myFormats == null) { 70 synchronized (this) { 71 myFormatsList = new ArrayList (); 72 fillInFormats(); 73 myFormats = (Format[])myFormatsList.toArray(new Format[myFormatsList.size()]); 74 } 75 } 76 return myFormats; 77 } 78 79 private void formatFound(BitMapInfo _bitMapInfo, float _frameRate) { 80 Format format = _bitMapInfo.createVideoFormat(Format.byteArray, _frameRate); 81 myFormatsList.add(format); 82 } 83 84 private native void fillInFormats(); 85 86 public String toString() { 87 return "[DSCapturePin: captureDevice = " + myCaptureDevice + "; pinID = " + myPinID + "; name = " + myName + "]"; 88 } 89 } 90 | Popular Tags |