当前位置: 首页>>代码示例>>Java>>正文


Java TextureView.setSurfaceTexture方法代码示例

本文整理汇总了Java中android.view.TextureView.setSurfaceTexture方法的典型用法代码示例。如果您正苦于以下问题:Java TextureView.setSurfaceTexture方法的具体用法?Java TextureView.setSurfaceTexture怎么用?Java TextureView.setSurfaceTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.TextureView的用法示例。


在下文中一共展示了TextureView.setSurfaceTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import android.view.TextureView; //导入方法依赖的package包/类
/**
 * Creates instances of TextureRender and SurfaceTexture, and a Surface associated
 * with the SurfaceTexture.
 */
private void setup() {
	mTextureView = new TextureView(mContext);
    mTextureRender = new TextureRender();
    mTextureRender.surfaceCreated();
    // Even if we don't access the SurfaceTexture after the constructor returns, we
    // still need to keep a reference to it.  The Surface doesn't retain a reference
    // at the Java level, so if we don't either then the object can get GCed, which
    // causes the native finalizer to run.
    if (VERBOSE) Log.d(TAG, "textureID=" + mTextureRender.getTextureId());
    mSurfaceTexture = new SurfaceTexture(mTextureRender.getTextureId());
    mTextureView.setSurfaceTexture(mSurfaceTexture);
    
    task = new TimerTask() {
        public void run() {
          if (VERBOSE) Log.d(TAG, "new frame available");
          synchronized (mFrameSyncObject) {
              mFrameSyncObject.notifyAll();
          }
        }
    };
    timer = new Timer();
    timer.scheduleAtFixedRate(task, 25, 25);
}
 
开发者ID:livio,项目名称:sdl_video_streaming_android_sample,代码行数:28,代码来源:InputSurface.java

示例2: recreateView

import android.view.TextureView; //导入方法依赖的package包/类
/**
 * Performs partial construction.  The VideoBlob is already created, but the Activity
 * was recreated, so we need to update our view.
 */
public void recreateView(TextureView view) {
    Log.d(LTAG, "recreateView: " + view);
    mTextureView = view;
    mTextureView.setSurfaceTextureListener(this);
    if (mSavedSurfaceTexture != null) {
        Log.d(LTAG, "using saved st=" + mSavedSurfaceTexture);
        view.setSurfaceTexture(mSavedSurfaceTexture);
    }
}
 
开发者ID:AndyZhu1991,项目名称:grafika,代码行数:14,代码来源:DoubleDecodeActivity.java


注:本文中的android.view.TextureView.setSurfaceTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。