android.view.TextureView.getSurfaceTextureListener()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中android.view.TextureView.getSurfaceTextureListener()方法的一些代码示例,展示了TextureView.getSurfaceTextureListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextureView.getSurfaceTextureListener()方法的具体详情如下:
包路径:android.view.TextureView
类名称:TextureView
方法名:getSurfaceTextureListener

TextureView.getSurfaceTextureListener介绍

暂无

代码示例

代码示例来源:origin: google/ExoPlayer

private void removeSurfaceCallbacks() {
 if (textureView != null) {
  if (textureView.getSurfaceTextureListener() != componentListener) {
   Log.w(TAG, "SurfaceTextureListener already unset or replaced.");
  } else {
   textureView.setSurfaceTextureListener(null);
  }
  textureView = null;
 }
 if (surfaceHolder != null) {
  surfaceHolder.removeCallback(componentListener);
  surfaceHolder = null;
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
public void setVideoTextureView(TextureView textureView) {
 verifyApplicationThread();
 removeSurfaceCallbacks();
 this.textureView = textureView;
 if (textureView == null) {
  setVideoSurfaceInternal(null, true);
  maybeNotifySurfaceSizeChanged(/* width= */ 0, /* height= */ 0);
 } else {
  if (textureView.getSurfaceTextureListener() != null) {
   Log.w(TAG, "Replacing existing SurfaceTextureListener.");
  }
  textureView.setSurfaceTextureListener(componentListener);
  SurfaceTexture surfaceTexture = textureView.isAvailable() ? textureView.getSurfaceTexture()
    : null;
  if (surfaceTexture == null) {
   setVideoSurfaceInternal(/* surface= */ null, /* ownsSurface= */ true);
   maybeNotifySurfaceSizeChanged(/* width= */ 0, /* height= */ 0);
  } else {
   setVideoSurfaceInternal(new Surface(surfaceTexture), /* ownsSurface= */ true);
   maybeNotifySurfaceSizeChanged(textureView.getWidth(), textureView.getHeight());
  }
 }
}

代码示例来源:origin: stackoverflow.com

tv.getSurfaceTextureListener().onSurfaceTextureAvailable(tv.getSurfaceTexture(),
    tv.getWidth(), tv.getHeight());
tvFull.getSurfaceTextureListener().onSurfaceTextureAvailable(tvFull.getSurfaceTexture(),
    tvFull.getWidth(), tvFull.getHeight());

相关文章