本文整理汇总了Java中android.view.SurfaceHolder.Callback方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceHolder.Callback方法的具体用法?Java SurfaceHolder.Callback怎么用?Java SurfaceHolder.Callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.SurfaceHolder
的用法示例。
在下文中一共展示了SurfaceHolder.Callback方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AutoFitSurfaceView
import android.view.SurfaceHolder; //导入方法依赖的package包/类
public AutoFitSurfaceView(@NonNull Context context, SurfaceHolder.Callback callback) {
super(context);
this.surfaceHolder = getHolder();
this.surfaceHolder.addCallback(callback);
this.surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
示例2: onCameraOpened
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
public void onCameraOpened(Integer cameraId, Size previewSize, SurfaceHolder.Callback surfaceCallback) {
surfacePreview = new AutoFitSurfaceView(cameraView.getActivity(), surfaceCallback);
cameraView.updateUiForMediaAction(configurationProvider.getMediaAction());
cameraView.updateCameraPreview(previewSize, surfacePreview);
cameraView.updateCameraSwitcher(getNumberOfCameras());
}
示例3: onCameraOpened
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
public void onCameraOpened(Integer cameraId, Size previewSize, SurfaceHolder.Callback surfaceCallback) {
cameraView.updateUiForMediaAction(configurationProvider.getMediaAction());
cameraView.updateCameraPreview(previewSize, new AutoFitSurfaceView(context, surfaceCallback));
cameraView.updateCameraSwitcher(getNumberOfCameras());
}
示例4: setSurfaceCallback
import android.view.SurfaceHolder; //导入方法依赖的package包/类
public void setSurfaceCallback(SurfaceHolder.Callback callback) {
if (mSurfaceView != null)
mSurfaceView.getHolder().addCallback(callback);
}