当前位置: 首页>>代码示例>>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;未经允许,请勿转载。