/** * Starts the transfer of media data from this * <tt>AbstractBufferStream</tt>. * * @throws IOException if anything goes wrong while starting the transfer of * media data from this <tt>AbstractBufferStream</tt> * @see AbstractBufferStream#start() */ @Override public void start() throws IOException { super.start(); frameRateControl = (FrameRateControl) dataSource.getControl(FrameRateControl.class.getName()); }
/** * Implements {@link PullBufferDataSource#getStreams()}. Delegates to the * wrapped <tt>CaptureDevice</tt> if it implements * <tt>PullBufferDataSource</tt>; otherwise, returns an empty array with * <tt>PullBufferStream</tt> element type. * * @return an array of <tt>PullBufferStream</tt>s as returned by the wrapped * <tt>CaptureDevice</tt> if it implements <tt>PullBufferDataSource</tt>; * otherwise, an empty array with <tt>PullBufferStream</tt> element type */ @Override public PullBufferStream[] getStreams() { if (captureDevice instanceof PullBufferDataSource) return ((PullBufferDataSource) captureDevice).getStreams(); return EMPTY_STREAMS; }
/** * Implements {@link PullBufferDataSource#getStreams()}. Wraps the streams * of the wrapped <tt>PullBufferDataSource</tt> into * <tt>MutePullBufferStream</tt> instances in order to provide mute support * to them. * * @return an array of <tt>PullBufferStream</tt> instances with enabled mute * support */ @Override public PullBufferStream[] getStreams() { PullBufferStream[] streams = dataSource.getStreams(); if (streams != null) for (int streamIndex = 0; streamIndex < streams.length; streamIndex++) streams[streamIndex] = new MutePullBufferStream(streams[streamIndex]); return streams; }
/** * 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; }
/** * Gets the output streams that this instance provides. Some of them may be * the result of transcoding the tracks of the input <tt>DataSource</tt> of * this instance in the output <tt>Format</tt> of this instance. * * @return an array of <tt>SourceStream</tt>s which represents the * collection of output streams that this instance provides */ public synchronized SourceStream[] getStreams() { if (outputDataSource instanceof PushBufferDataSource) return ((PushBufferDataSource) outputDataSource).getStreams(); if (outputDataSource instanceof PullBufferDataSource) return ((PullBufferDataSource) outputDataSource).getStreams(); if (outputDataSource instanceof PushDataSource) return ((PushDataSource) outputDataSource).getStreams(); if (outputDataSource instanceof PullDataSource) return ((PullDataSource) outputDataSource).getStreams(); return new SourceStream[0]; }
PullBufferStream[] dataSourceStreams = dataSource.getStreams(); int dataSourceStreamCount;
/** * Gets the <tt>SourceStream</tt>s of the effective input * <tt>DataSource</tt> described by this instance. * * @return an array of the <tt>SourceStream</tt>s of the effective input * <tt>DataSource</tt> described by this instance */ public synchronized SourceStream[] getStreams() { if (!connected) return EMPTY_STREAMS; DataSource inDataSource = getEffectiveInDataSource(); if (inDataSource instanceof PushBufferDataSource) return ((PushBufferDataSource) inDataSource).getStreams(); else if (inDataSource instanceof PullBufferDataSource) return ((PullBufferDataSource) inDataSource).getStreams(); else if (inDataSource instanceof TranscodingDataSource) return ((TranscodingDataSource) inDataSource).getStreams(); else return null; }
= ((PullBufferDataSource) dataSource).getStreams();