當前位置: 首頁>>代碼示例>>Java>>正文


Java ExoPlaybackException類代碼示例

本文整理匯總了Java中com.google.android.exoplayer.ExoPlaybackException的典型用法代碼示例。如果您正苦於以下問題:Java ExoPlaybackException類的具體用法?Java ExoPlaybackException怎麽用?Java ExoPlaybackException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExoPlaybackException類屬於com.google.android.exoplayer包,在下文中一共展示了ExoPlaybackException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: VLCSampleExtractor

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
public VLCSampleExtractor(LibVLC vlc, String uri) throws ExoPlaybackException {
	if (vlc == null || uri == null)
		throw new ExoPlaybackException("null parms!");
	this.uri = uri;
	this.lib = vlc;
	this.media = ExoVlcUtil.getMedia(vlc, uri);
	this.vlctracks = ExoVlcUtil.getAvailableTracks(media);
	if (this.vlctracks.length > 0)
		this.trackInfos = ExoVlcUtil.vlc2exoTracks(media.getDuration(), vlctracks, lib);
	else
		try {
			if ((hasVdo = vlc.hasVideoTrack(uri)))
				this.trackInfos = ExoVlcUtil.getDummyVdoTrack(media,
						com.exovlc.ExoVlcUtil.DUMM_VDO_MIME);
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	ExoVlcUtil.log(this, "get vlc tracks for uri = " + uri);

}
 
開發者ID:tyazid,項目名稱:Exoplayer_VLC,代碼行數:21,代碼來源:VLCSampleExtractor.java

示例2: doPrepare

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected boolean doPrepare(long positionUs) throws ExoPlaybackException {
    boolean sourcePrepared = mSource.prepare(positionUs);
    if (!sourcePrepared) {
        return false;
    }
    for (int i = 0; i < mSource.getTrackCount(); i++) {
        if (handlesMimeType(mSource.getFormat(i).mimeType)) {
            if (mTrackIndex < 0) {
                mTrackIndex = i;
            }
            mTracksIndex.add(i);
        }
    }

    // TODO: Check this case. Source does not have the proper mime type.
    return true;
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:19,代碼來源:Ac3PassthroughTrackRenderer.java

示例3: doPrepare

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected boolean doPrepare(long positionUs) throws ExoPlaybackException {
    boolean sourcePrepared = mSource.prepare(positionUs);
    if (!sourcePrepared) {
        return false;
    }
    int trackCount = mSource.getTrackCount();
    for (int i = 0; i < trackCount; ++i) {
        MediaFormat trackFormat = mSource.getFormat(i);
        if (handlesMimeType(trackFormat.mimeType)) {
            mTrackIndex = i;
            clearDecodeState();
            return true;
        }
    }
    // TODO: Check this case. (Source do not have the proper mime type.)
    return true;
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:19,代碼來源:Cea708TextTrackRenderer.java

示例4: doSomeWork

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected void doSomeWork(long positionUs, long elapsedRealtimeUs)
    throws ExoPlaybackException {
  source.continueBuffering(trackIndex, positionUs);

  if (!inputStreamEnded && pendingMetadata == null) {
      int result = source.readData(trackIndex, positionUs, formatHolder, sampleHolder, false);
      if (result == SampleSource.SAMPLE_READ) {
        pendingMetadataTimestamp = sampleHolder.timeUs;
        try {
          pendingMetadata = metadataParser.parse(sampleHolder.data.array(), sampleHolder.size);
        } catch (IOException e) {
          throw new ExoPlaybackException(e);
        }
        sampleHolder.data.clear();
      } else if (result == SampleSource.END_OF_STREAM) {
        inputStreamEnded = true;
      }
  }

  if (pendingMetadata != null && pendingMetadataTimestamp <= positionUs) {
    invokeRenderer(pendingMetadata);
    pendingMetadata = null;
  }
}
 
開發者ID:XueyanLiu,項目名稱:miku,代碼行數:26,代碼來源:MetadataTrackRenderer.java

示例5: onDisabled

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected void onDisabled() throws ExoPlaybackException {
  inputBuffer = null;
  outputBuffer = null;
  format = null;
  audioSessionId = AudioTrack.SESSION_ID_NOT_SET;
  try {
    if (decoder != null) {
      decoder.release();
      decoder = null;
      codecCounters.codecReleaseCount++;
    }
    audioTrack.release();
  } finally {
    super.onDisabled();
  }
}
 
開發者ID:asifkhan11,項目名稱:ExoPlayer-Demo,代碼行數:18,代碼來源:LibopusAudioTrackRenderer.java

示例6: doSomeWork

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected void doSomeWork(long positionUs, long elapsedRealtimeUs, boolean sourceIsReady)
    throws ExoPlaybackException {
  if (!inputStreamEnded && pendingMetadata == null) {
    sampleHolder.clearData();
    int result = readSource(positionUs, formatHolder, sampleHolder);
    if (result == SampleSource.SAMPLE_READ) {
      pendingMetadataTimestamp = sampleHolder.timeUs;
      try {
        pendingMetadata = metadataParser.parse(sampleHolder.data.array(), sampleHolder.size);
      } catch (IOException e) {
        throw new ExoPlaybackException(e);
      }
    } else if (result == SampleSource.END_OF_STREAM) {
      inputStreamEnded = true;
    }
  }

  if (pendingMetadata != null && pendingMetadataTimestamp <= positionUs) {
    invokeRenderer(pendingMetadata);
    pendingMetadata = null;
  }
}
 
開發者ID:asifkhan11,項目名稱:ExoPlayer-Demo,代碼行數:24,代碼來源:MetadataTrackRenderer.java

示例7: doPrepare

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected int doPrepare() throws ExoPlaybackException {
  try {
    boolean sourcePrepared = source.prepare();
    if (!sourcePrepared) {
      return TrackRenderer.STATE_UNPREPARED;
    }
  } catch (IOException e) {
    throw new ExoPlaybackException(e);
  }
  for (int i = 0; i < source.getTrackCount(); i++) {
    if (subtitleParser.canParse(source.getTrackInfo(i).mimeType)) {
      trackIndex = i;
      return TrackRenderer.STATE_PREPARED;
    }
  }
  return TrackRenderer.STATE_IGNORE;
}
 
開發者ID:Weco,項目名稱:android-exoplayer,代碼行數:19,代碼來源:TextTrackRenderer.java

示例8: onStarted

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected void onStarted() throws ExoPlaybackException {
	System.out.println(">>>VLCVideoTrackRenderer.onStarted()");
	VLCVideoSurfaceHandler.Start_Type t = this.surfaceHdl.doStart(new Runnable() {

		@Override
		public void run() {
			try {
				VLCVideoTrackRenderer.this.p_onStarted();
			} catch (ExoPlaybackException e) {
				e.printStackTrace();
				postError(new com.google.android.exoplayer.MediaCodecTrackRenderer.DecoderInitializationException(
						null, e, -1));
			}

		}
	});
	System.out.println(">>> VLCVideoTrackRenderer.onStarted() t = " + t);
	if (t == Start_Type.STARTED_IMMEDIATELY)
		super.onStarted();
}
 
開發者ID:tyazid,項目名稱:Exoplayer_VLC,代碼行數:22,代碼來源:VLCVideoTrackRenderer.java

示例9: VLCVideoSurfaceHandler

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
public VLCVideoSurfaceHandler( LibVLC libvlc, Handler eventHandler,
		MediaCodecVideoTrackRenderer.EventListener eventListener, SurfaceLayoutHandler layoutHandler) throws ExoPlaybackException {
	super();
	this.libvlc = libvlc;
	this.eventHandler = eventHandler;
	this.eventListener = eventListener;

	
	if (layoutHandler != null) {
		this.layoutHandler = layoutHandler;
			SurfaceHolder surfaceHolder = layoutHandler.getHolder();
		ExoVlcUtil.log(this, "VLCIVideoSurfaceHandler.VLCIVideoSurfaceHandler()");
		ExoVlcUtil.log(this, "## ====> rect= " + surfaceHolder.getSurfaceFrame());
		if (com.exovlc.ExoVlcUtil.validSurface(surfaceHolder))
			setVlcSurface(surfaceHolder.getSurface(), false);

	} else
		throw new ExoPlaybackException("layout handler null.");

}
 
開發者ID:tyazid,項目名稱:Exoplayer_VLC,代碼行數:21,代碼來源:VLCVideoSurfaceHandler.java

示例10: onStarted

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected void onStarted() throws ExoPlaybackException {
	super.onStarted();
	System.out.println(">>>>>>>>   VLCTrackRenderer.onStarted(" + getClass().getSimpleName() + ") ");
	Thread.dumpStack();
	String uri = source.getUri();

	if (!vlc.isPlaying())
		try {
			System.out.println(">>>>>>>>   VLCTrackRenderer.onStarted( ) uri =  " + uri + " vdo ="
					+ vlc.hasVideoTrack(uri));
			String[] options = vlc.getMediaOptions(!true, !vlc.hasVideoTrack(uri));
			System.out.println(">>VLCTrackRenderer.onStarted() OPTIONS:");
			for (int i = 0; i < options.length; i++)
				System.out.println(" o-" + i + ":" + options[i]);
			vlc.playMRL(uri, options);
			System.out.println(">>> VLCTrackRenderer.onStarted() playMRL done");
		} catch (IOException e) {
			e.printStackTrace();
			throw new ExoPlaybackException(e);
		}
}
 
開發者ID:tyazid,項目名稱:Exoplayer_VLC,代碼行數:23,代碼來源:VLCTrackRenderer.java

示例11: doPrepare

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected int doPrepare() throws ExoPlaybackException {
  try {
    boolean sourcePrepared = source.prepare();
    if (!sourcePrepared) {
      return TrackRenderer.STATE_UNPREPARED;
    }
  } catch (IOException e) {
    throw new ExoPlaybackException(e);
  }
  for (int i = 0; i < source.getTrackCount(); i++) {
    if (eia608Parser.canParse(source.getTrackInfo(i).mimeType)) {
      trackIndex = i;
      return TrackRenderer.STATE_PREPARED;
    }
  }
  return TrackRenderer.STATE_IGNORE;
}
 
開發者ID:tyazid,項目名稱:Exoplayer_VLC,代碼行數:19,代碼來源:Eia608TrackRenderer.java

示例12: doPrepare

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected int doPrepare() throws ExoPlaybackException {
  try {
    boolean sourcePrepared = source.prepare();
    if (!sourcePrepared) {
      return TrackRenderer.STATE_UNPREPARED;
    }
  } catch (IOException e) {
    throw new ExoPlaybackException(e);
  }
  for (int i = 0; i < subtitleParsers.length; i++) {
    for (int j = 0; j < source.getTrackCount(); j++) {
      if (subtitleParsers[i].canParse(source.getTrackInfo(j).mimeType)) {
        parserIndex = i;
        trackIndex = j;
        return TrackRenderer.STATE_PREPARED;
      }
    }
  }
  return TrackRenderer.STATE_IGNORE;
}
 
開發者ID:tyazid,項目名稱:Exoplayer_VLC,代碼行數:22,代碼來源:TextTrackRenderer.java

示例13: doPrepare

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected int doPrepare() throws ExoPlaybackException {
  try {
    boolean sourcePrepared = source.prepare();
    if (!sourcePrepared) {
      return TrackRenderer.STATE_UNPREPARED;
    }
  } catch (IOException e) {
    throw new ExoPlaybackException(e);
  }
  for (int i = 0; i < source.getTrackCount(); i++) {
    if (metadataParser.canParse(source.getTrackInfo(i).mimeType)) {
      trackIndex = i;
      return TrackRenderer.STATE_PREPARED;
    }
  }
  return TrackRenderer.STATE_IGNORE;
}
 
開發者ID:tyazid,項目名稱:Exoplayer_VLC,代碼行數:19,代碼來源:MetadataTrackRenderer.java

示例14: doPrepare

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
protected int doPrepare(long positionUs) throws ExoPlaybackException {
  boolean sourcePrepared = source.prepare(positionUs);
  if (!sourcePrepared) {
    return TrackRenderer.STATE_UNPREPARED;
  }
  int trackCount = source.getTrackCount();
  for (int i = 0; i < trackCount; i++) {
    if (source.getTrackInfo(i).mimeType.equalsIgnoreCase(MimeTypes.VIDEO_VP9)
        || source.getTrackInfo(i).mimeType.equalsIgnoreCase(MimeTypes.VIDEO_WEBM)) {
      trackIndex = i;
      return TrackRenderer.STATE_PREPARED;
    }
  }
  return TrackRenderer.STATE_IGNORE;
}
 
開發者ID:raphanda,項目名稱:ExoPlayer,代碼行數:17,代碼來源:LibvpxVideoTrackRenderer.java

示例15: onPlayerError

import com.google.android.exoplayer.ExoPlaybackException; //導入依賴的package包/類
@Override
public void onPlayerError(ExoPlaybackException exception) {
    rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
    for (Listener listener : listeners) {
        listener.onError(exception);
    }
}
 
開發者ID:nejtv,項目名稱:androidtv-sample,代碼行數:8,代碼來源:DemoPlayer.java


注:本文中的com.google.android.exoplayer.ExoPlaybackException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。