本文整理匯總了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);
}