/** * Implements {@link SourceStream#endOfStream()}. Delegates to the * wrapped <tt>PullBufferStream</tt>. * * @return <tt>true</tt> if the wrapped <tt>PullBufferStream</tt> has * reached the end of the media data; otherwise, <tt>false</tt> */ @Override public boolean endOfStream() { return stream.endOfStream(); }
/** * Implements {@link SourceStream#getContentDescriptor()}. Delegates to * the wrapped <tt>PullBufferStream</tt>. * * @return the <tt>ContentDescriptor</tt> of the wrapped * <tt>PullBufferStream</tt> which describes the type of the media data * it gives access to */ @Override public ContentDescriptor getContentDescriptor() { return stream.getContentDescriptor(); }
/** * Implements {@link SourceStream#getContentLength()}. Delegates to the * wrapped <tt>PullBufferStream</tt>. * * @return the length of the content the wrapped * <tt>PullBufferStream</tt> gives access to */ @Override public long getContentLength() { return stream.getContentLength(); }
/** * Implements {@link PullBufferStream#getFormat()}. Delegates to the * wrapped <tt>PullBufferStream</tt>. * * @return the <tt>Format</tt> of the wrapped <tt>PullBufferStream</tt> */ public Format getFormat() { return stream.getFormat(); }
stream.read(buffer); this.bufferIsWritten = !buffer.isDiscard(); streamReadException = null;
/** * Implements {@link javax.media.Controls#getControls()}. Delegates to * the wrapped <tt>PushBufferStream</tt>. * * @return an array of <tt>Object</tt>s which represent the controls * available for the wrapped <tt>PushBufferStream</tt> */ @Override public Object[] getControls() { return stream.getControls(); }
/** * Implements PullBufferStream#willReadBlock(). Delegates to the wrapped * PullSourceStream. * @return <tt>true</tt> if read would block; otherwise returns * <tt>false</tt>. */ public boolean willReadBlock() { return stream.willReadBlock(); } }
/** * Implements {@link javax.media.Controls#getControl(String)}. Delegates * to the wrapped <tt>PullBufferStream</tt>. * * @param controlType a <tt>String</tt> value which specifies the type * of the control of the wrapped <tt>PullBufferStream</tt> to be * retrieved * @return an <tt>Object</tt> which represents the control of the * wrapped <tt>PushBufferStream</tt> of the requested type if the * wrapped <tt>PushBufferStream</tt> has such a control; <tt>null</tt> * if the wrapped <tt>PushBufferStream</tt> does not have a control of * the specified type */ @Override public Object getControl(String controlType) { return stream.getControl(controlType); }
/** * Implements {@link PushBufferStream#getFormat()}. Delegates to the * wrapped <tt>PullBufferStream</tt>. * * @return the <tt>Format</tt> of the wrapped <tt>PullBufferStream</tt> */ @Override public Format getFormat() { return stream.getFormat(); }
/** * Implements PullBufferStream#read(Buffer). If this instance is muted * (through its owning RewritablePullBufferDataSource), overwrites the * data read from the wrapped PullBufferStream with silence data. * @param buffer which data will be filled. @throws IOException Thrown * if an error occurs while reading. */ public void read(Buffer buffer) throws IOException { stream.read(buffer); if (isSendingDTMF()) RewritablePushBufferDataSource.sendDTMF(buffer, tones.poll()); else if (isMute()) RewritablePushBufferDataSource.mute(buffer); }
/** * 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; }
/** * Returns the format of the video we are streaming to the remote peer. * * @return The video format of the sent video. Null, if no video is sent. */ public VideoFormat getSentVideoFormat() { DataSource capture = getCaptureDevice(); if (capture instanceof PullBufferDataSource) { PullBufferStream[] streams = ((PullBufferDataSource) capture).getStreams(); for (PullBufferStream stream : streams) { VideoFormat format = (VideoFormat) stream.getFormat(); if (format != null) return format; } } return null; }
Format format = stream.getFormat(); int threadPriority;