/** * Implements {@link DataSource#connect()}. Delegates to the wrapped * <tt>DataSource</tt>. Overrides * {@link CaptureDeviceDelegatePullBufferDataSource#connect()} because the * wrapped <tt>DataSource</tt> may not be a <tt>CaptureDevice</tt> yet it * still needs to be connected. * * @throws IOException if the wrapped <tt>DataSource</tt> throws such an * exception */ @Override public void connect() throws IOException { dataSource.connect(); }
/** * Implements {@link DataSource#connect()}. Delegates to the wrapped * <tt>DataSource</tt>. Overrides * {@link CaptureDeviceDelegatePushBufferDataSource#connect()} because the * wrapped <tt>DataSource</tt> may not be a <tt>CaptureDevice</tt> yet it * still needs to be connected. * * @throws IOException if the wrapped <tt>DataSource</tt> throws such an * exception */ @Override public void connect() throws IOException { dataSource.connect(); }
/** * Connects to a specific <tt>DataSource</tt> which this <tt>AudioMixer<tt> * will read audio from. The specified <tt>DataSource</tt> is known to exist * because of a specific <tt>DataSource</tt> added as an input to this * instance i.e. it may be an actual input <tt>DataSource</tt> added to this * instance or a <tt>DataSource</tt> transcoding an input * <tt>DataSource</tt> added to this instance. * * @param dataSource the <tt>DataSource</tt> to connect to * @param inDataSource the <tt>DataSource</tt> which is the cause for * <tt>dataSource</tt> to exist in this <tt>AudioMixer</tt> * @throws IOException if anything wrong happens while connecting to * <tt>dataSource</tt> */ protected void connect(DataSource dataSource, DataSource inDataSource) throws IOException { dataSource.connect(); }
/** * Connects to a specific <tt>CaptureDevice</tt> given in the form of a * <tt>DataSource</tt>. Explicitly defined in order to allow extenders to * customize the connect procedure. * * @param captureDevice the <tt>CaptureDevice</tt> to be connected to * @throws IOException if anything wrong happens while connecting to the * specified <tt>captureDevice</tt> */ public void connect(DataSource captureDevice) throws IOException { if (captureDevice == null) throw new NullPointerException("captureDevice"); try { captureDevice.connect(); } catch (NullPointerException npe) { /* * The old media says it happens when the operating system does not * support the operation. */ IOException ioe = new IOException(); ioe.initCause(npe); throw ioe; } }
effectiveCaptureDevice.connect(); else device.connect(effectiveCaptureDevice);
dataSource.connect(); try
/** * {@inheritDoc} */ @Override public void open() throws IOException, SecurityException { synchronized (openCloseSyncRoot) { if (dataSource instanceof PushBufferDataSource) { PushBufferDataSource pbds = (PushBufferDataSource) dataSource; PushBufferStream[] streams = pbds.getStreams(); //XXX: should we allow for multiple streams in the data source? for (PushBufferStream stream : streams) { //XXX whats the proper way to check for this? and handle? if (!stream.getFormat().matches(new VideoFormat("VP8"))) throw new IOException("Unsupported stream format"); stream.setTransferHandler(this); } } dataSource.connect(); open = true; } }
sendStreamDataSource.connect(); sendStream.start(); sendStreamDataSource.start();
dataSource.connect();