@Override protected final boolean playImpl() { pos_start = Platform.currentTimeMillis(); return true; }
@Override protected final boolean playImpl() { pos_start = Platform.currentTimeMillis(); return true; }
/** * To be called from implementation at 1st PTS after start * w/ current pts value in milliseconds. * @param audio_scr_t0 */ protected void setFirstAudioPTS2SCR(final int pts) { if( audioSCR_reset ) { audio_scr_t0 = Platform.currentTimeMillis() - pts; audioSCR_reset = false; } } private void flushAllVideoFrames() {
/** * To be called from implementation at 1st PTS after start * w/ current pts value in milliseconds. * @param audio_scr_t0 */ protected void setFirstAudioPTS2SCR(final int pts) { if( audioSCR_reset ) { audio_scr_t0 = Platform.currentTimeMillis() - pts; audioSCR_reset = false; } } private void flushAllVideoFrames() {
@Override public final void beginFrame(final GL gl) { frameStart = Platform.currentTimeMillis(); }
@Override public final void beginFrame(final GL gl) { frameStart = Platform.currentTimeMillis(); }
protected final void attributesUpdated(final int event_mask) { if( 0 != event_mask ) { final long now = Platform.currentTimeMillis(); synchronized(eventListenersLock) { for(final Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) { i.next().attributesChanged(this, event_mask, now); } } } }
@Override protected final int getAudioPTSImpl() { pos_ms = (int) ( Platform.currentTimeMillis() - pos_start ); validatePos(); return pos_ms; }
protected final void attributesUpdated(final int event_mask) { if( 0 != event_mask ) { final long now = Platform.currentTimeMillis(); synchronized(eventListenersLock) { for(final Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) { i.next().attributesChanged(this, event_mask, now); } } } }
@Override protected final int getAudioPTSImpl() { pos_ms = (int) ( Platform.currentTimeMillis() - pos_start ); validatePos(); return pos_ms; }
@Override public final String getPerfString() { final long currentTimeMillis = Platform.currentTimeMillis(); final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed ); final int d_vpts = video_pts_last - video_scr; final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed ); final int audio_pts = getAudioPTSImpl(); final int d_apts = audio_pts - audio_scr; return getPerfStringImpl( video_scr, video_pts_last, d_vpts, audio_scr, audio_pts, d_apts, getVideoDPTSAvg() ); } private final String getPerfStringImpl(final int video_scr, final int video_pts, final int d_vpts,
@Override public final String getPerfString() { final long currentTimeMillis = Platform.currentTimeMillis(); final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed ); final int d_vpts = video_pts_last - video_scr; final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed ); final int audio_pts = getAudioPTSImpl(); final int d_apts = audio_pts - audio_scr; return getPerfStringImpl( video_scr, video_pts_last, d_vpts, audio_scr, audio_pts, d_apts, getVideoDPTSAvg() ); } private final String getPerfStringImpl(final int video_scr, final int video_pts, final int d_vpts,
@Override public final String toString() { final float tt = getDuration() / 1000.0f; final String loc = ( null != streamLoc ) ? streamLoc.toString() : "<undefined stream>" ; final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0; final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0; final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed ); final String camPath = null != cameraPath ? ", camera: "+cameraPath : ""; return getClass().getSimpleName()+"["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s), z "+nullFrameCount+" / "+maxNullFrameCountUntilEOS+"], "+ "speed "+playSpeed+", "+bps_stream+" bps, hasSW "+(null!=streamWorker)+ ", Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+ "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+ "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]"; }
@Override public final String toString() { final float tt = getDuration() / 1000.0f; final String loc = ( null != streamLoc ) ? streamLoc.toString() : "<undefined stream>" ; final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0; final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0; final int video_scr = video_scr_pts + (int) ( ( Platform.currentTimeMillis() - video_scr_t0 ) * playSpeed ); final String camPath = null != cameraPath ? ", camera: "+cameraPath : ""; return "GLMediaPlayer["+state+", vSCR "+video_scr+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s), z "+nullFrameCount+" / "+maxNullFrameCountUntilEOS+"], "+ "speed "+playSpeed+", "+bps_stream+" bps, hasSW "+(null!=streamWorker)+ ", Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+ "Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+ "Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]"; }
protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, final boolean[] gotVFrame) throws InterruptedException { final int pts; if( STREAM_ID_NONE != vid ) { preNextTextureImpl(gl); pts = getNextTextureImpl(gl, nextFrame); postNextTextureImpl(gl); if( TimeFrameI.INVALID_PTS != pts ) { newFrameAvailable(nextFrame, Platform.currentTimeMillis()); gotVFrame[0] = true; } else { gotVFrame[0] = false; } } else { // audio only pts = getNextTextureImpl(null, null); gotVFrame[0] = false; } return pts; }
protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, final boolean[] gotVFrame) throws InterruptedException { final int pts; if( STREAM_ID_NONE != vid ) { preNextTextureImpl(gl); pts = getNextTextureImpl(gl, nextFrame); postNextTextureImpl(gl); if( TimeFrameI.INVALID_PTS != pts ) { newFrameAvailable(nextFrame, Platform.currentTimeMillis()); gotVFrame[0] = true; } else { gotVFrame[0] = false; } } else { // audio only pts = getNextTextureImpl(null, null); gotVFrame[0] = false; } return pts; }
throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); newFrameAvailable(nextFrame, Platform.currentTimeMillis()); nextFrame = null; } else {
final long currentTimeMillis = Platform.currentTimeMillis();
final long currentTimeMillis = Platform.currentTimeMillis();
throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this); newFrameAvailable(nextFrame, Platform.currentTimeMillis()); nextFrame = null; } else {