if (bc != null) { int bl = 160; bc.setBufferLength(bl);
/** * Performs any optional configuration on the <tt>BufferControl</tt> of the * specified <tt>RTPManager</tt> which is to be used as the * <tt>RTPManager</tt> of this <tt>MediaStreamImpl</tt>. * * @param rtpManager the <tt>RTPManager</tt> which is to be used by this * <tt>MediaStreamImpl</tt> * @param bufferControl the <tt>BufferControl</tt> of <tt>rtpManager</tt> on * which any optional configuration is to be performed */ @Override protected void configureRTPManagerBufferControl( StreamRTPManager rtpManager, BufferControl bufferControl) { super.configureRTPManagerBufferControl(rtpManager, bufferControl); bufferControl.setBufferLength(BufferControl.MAX_VALUE); }
Player p = Manager.createRealizedPlayer( f.toURI().toURL() ); BufferControl bc = (BufferControl) p.getControl( "javax.media.control.BufferControl" ); if ( bc != null ) bc.setBufferLength( 500 ); // buffer length specified in milliseconds p.start(); System.out.println( "Player playing" ); Thread.sleep( 1000 ); System.out.println( " Clip is at time: " + p.getMediaTime().getSeconds() ); p.stop(); System.out.println( " Clip is at time: " + p.getMediaTime().getSeconds() );
bufferControl.setBufferLength(60 /* millis */);
/** * Attempts to equalize the length in milliseconds of the buffering * performed by the <tt>inStreams</tt> in order to always read and mix * one and the same length in milliseconds. */ void equalizeInStreamBufferLength() { synchronized (inStreamsSyncRoot) { if ((inStreams == null) || (inStreams.length < 1)) return; /* * The first inStream is expected to be from the CaptureDevice * and no custom BufferControl is provided for it so the * bufferLength is whatever it says. */ BufferControl bufferControl = getBufferControl(inStreams[0]); long bufferLength = (bufferControl == null) ? CachingPushBufferStream.DEFAULT_BUFFER_LENGTH : bufferControl.getBufferLength(); for (int i = 1; i < inStreams.length; i++) { BufferControl inStreamBufferControl = getBufferControl(inStreams[i]); if (inStreamBufferControl != null) inStreamBufferControl.setBufferLength(bufferLength); } } }
bufferLength = bufferControl.setBufferLength(bufferLength); if (logger.isTraceEnabled()) logger.trace("Set receiver buffer length to " + bufferLength);
if (bc != null) { int bl = 160; bc.setBufferLength(bl);
if (bc != null) { int bl = 160; bc.setBufferLength(bl);