/** * Implements {@link DataSource#getLocator()}. Delegates to the wrapped * <tt>DataSource</tt>. * * @return a <tt>MediaLocator</tt> value which describes the locator of the * wrapped <tt>DataSource</tt> */ @Override public MediaLocator getLocator() { return dataSource.getLocator(); }
/** * Implements {@link DataSource#getLocator()}. Delegates to the wrapped * <tt>DataSource</tt>. * * @return a <tt>MediaLocator</tt> value which describes the locator of the * wrapped <tt>DataSource</tt> */ @Override public MediaLocator getLocator() { return dataSource.getLocator(); }
/** * Initializes a new <tt>TranscodingDataSource</tt> instance to transcode * the tracks of a specific <tt>DataSource</tt> into a specific output * <tt>Format</tt>. * * @param inputDataSource the <tt>DataSource</tt> which is to have its * tracks transcoded in a specific output <tt>Format</tt> * @param outputFormat the <tt>Format</tt> in which the new instance is to * transcode the tracks of <tt>inputDataSource</tt> */ public TranscodingDataSource( DataSource inputDataSource, Format outputFormat) { super(inputDataSource.getLocator()); this.inputDataSource = inputDataSource; this.outputFormat = outputFormat; }
/** * Returns a human-readable representation of a specific <tt>DataSource</tt> * instance in the form of a <tt>String</tt> value. * * @param dataSource the <tt>DataSource</tt> to return a human-readable * representation of * @return a <tt>String</tt> value which gives a human-readable * representation of the specified <tt>dataSource</tt> */ public static String toString(DataSource dataSource) { StringBuilder str = new StringBuilder(); str.append(dataSource.getClass().getSimpleName()); str.append(" with hashCode "); str.append(dataSource.hashCode()); MediaLocator locator = dataSource.getLocator(); if (locator != null) { str.append(" and locator "); str.append(locator); } return str.toString(); }
/** * Gets the <tt>CaptureDeviceInfo</tt> of a specific <tt>CaptureDevice</tt> * by locating its registration in JMF using its <tt>MediaLocator</tt>. * * @param captureDevice the <tt>CaptureDevice</tt> to gets the * <tt>CaptureDeviceInfo</tt> of * @return the <tt>CaptureDeviceInfo</tt> of the specified * <tt>CaptureDevice</tt> as registered in JMF */ public static CaptureDeviceInfo getCaptureDeviceInfo( DataSource captureDevice) { /* * TODO The implemented search for the CaptureDeviceInfo of this * CaptureDevice by looking for its MediaLocator is inefficient. */ @SuppressWarnings("unchecked") Vector<CaptureDeviceInfo> captureDeviceInfos = CaptureDeviceManager.getDeviceList(null); MediaLocator locator = captureDevice.getLocator(); for (CaptureDeviceInfo captureDeviceInfo : captureDeviceInfos) if (captureDeviceInfo.getLocator().toString().equals( locator.toString())) return captureDeviceInfo; return null; }
videoContainer, player); videoContainer.addHierarchyListener(listener); final MediaLocator locator = dataSource.getLocator();
MediaLocator locator = captureDevice.getLocator(); String protocol = (locator == null) ? null : locator.getProtocol(); float frameRate;