/** * Implements {@link PushBufferStream#getFormat()}. Delegates to the wrapped * <tt>PushBufferStream</tt>. * * @return the <tt>Format</tt> of the media data available for reading in * this <tt>PushBufferStream</tt> */ public Format getFormat() { return stream.getFormat(); }
/** * Implements {@link PushBufferStream#getFormat()}. Delegates to the * wrapped <tt>PushBufferStream</tt>. * * @return the <tt>Format</tt> of the wrapped <tt>PushBufferStream</tt> */ public Format getFormat() { return stream.getFormat(); }
/** * Gets the <tt>Format</tt> in which a specific <tt>SourceStream</tt> * provides data. * * @param stream the <tt>SourceStream</tt> for which the <tt>Format</tt> in * which it provides data is to be determined * @return the <tt>Format</tt> in which the specified <tt>SourceStream</tt> * provides data if it was determined; otherwise, <tt>null</tt> */ private static Format getFormat(SourceStream stream) { if (stream instanceof PushBufferStream) return ((PushBufferStream) stream).getFormat(); if (stream instanceof PullBufferStream) return ((PullBufferStream) stream).getFormat(); return null; }
/** * {@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; } }
AudioFormat inStreamFormat = (AudioFormat) inStream.getFormat();
for (PushBufferStream pbs : pbds.getStreams()) if ((format = pbs.getFormat()) != null) break;
AudioFormat inStreamFormat = (AudioFormat) inStream.getFormat(); Buffer inBuffer = inStreamDesc.getBuffer(true);