本文整理汇总了Java中android.view.SurfaceHolder.setType方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceHolder.setType方法的具体用法?Java SurfaceHolder.setType怎么用?Java SurfaceHolder.setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.SurfaceHolder
的用法示例。
在下文中一共展示了SurfaceHolder.setType方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onResume
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
Log.d(TAG, "xxxxxxxxxxxxxxxxxxxonResume");
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
playBeep = true;
final AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
playBeep = false;
}
initBeepSound();
vibrate = true;
}
示例2: onResume
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
playBeep = true;
AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
playBeep = false;
}
initBeepSound();
vibrate = true;
}
示例3: onResume
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
playBeep = true;
AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
playBeep = false;
}
initBeepSound();
vibrate = true;
}
示例4: onResume
import android.view.SurfaceHolder; //导入方法依赖的package包/类
public void onResume() {
if (inactivityTimer == null) {
inactivityTimer = new InactivityTimer(mActivity);
}
if (beepManager == null) {
beepManager = new BeepManager(mActivity);
}
if (inactivityTimer != null) {
inactivityTimer.onResume();
}
SurfaceHolder surfaceHolder = mSurfaceView.getHolder();
if (hasSurface) {
// The activity was paused but not stopped, so the surface still exists. Therefore
// surfaceCreated() won't be called, so init the camera here.
initCamera(surfaceHolder);
} else {
// Install the callback and wait for surfaceCreated() to init the camera.
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
}
示例5: onCreate
import android.view.SurfaceHolder; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFormat(PixelFormat.TRANSLUCENT); // 使得窗口支持透明度
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.nim_capture_video_activity);
setTitle(R.string.video_record);
parseIntent();
findViews();
initActionBar();
setViewsListener();
updateRecordUI();
getVideoPreviewSize();
surfaceview = (SurfaceView) this.findViewById(R.id.videoView);
SurfaceHolder holder = surfaceview.getHolder();
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
holder.addCallback(this);
resizeSurfaceView();
}
示例6: init
import android.view.SurfaceHolder; //导入方法依赖的package包/类
private void init() {
// init surfaceholder
SurfaceHolder holder = getHolder();
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
holder.addCallback(this);
WindowManager manager = (WindowManager) getContext().getSystemService(
Context.WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();
screenWidth = display.getWidth();
screenHeight = display.getHeight();
int width = screenWidth >= screenHeight ? screenWidth : screenHeight;
int height = screenWidth + screenHeight - width;
int rotation = display.getRotation();
mScanner = CameraScanner.getInstance();
mScanner.setRotation(0); //此处直接设为0,配合竖屏展示
mScanner.setReqSize(width, height);
}
示例7: initRenderer
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private void initRenderer() {
mRenderer = new RendererImpl(mGLSurfaceView);
mGLSurfaceView.setEGLContextClientVersion(2);
mGLSurfaceView.setRenderer(mRenderer);
mGLSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
SurfaceHolder surfaceHolder = mGLSurfaceView.getHolder();
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
surfaceHolder.addCallback(mSurfaceHolderCallback);
}
示例8: setSurfaceHolder
import android.view.SurfaceHolder; //导入方法依赖的package包/类
/**
* 设置预览输出SurfaceHolder
* @param sh
*/
@SuppressWarnings("deprecation")
public void setSurfaceHolder(SurfaceHolder sh) {
if (sh != null) {
sh.addCallback(this);
if (!DeviceUtils.hasHoneycomb()) {
sh.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
}
}
示例9: initCapture
import android.view.SurfaceHolder; //导入方法依赖的package包/类
private void initCapture() {
this.surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = this.surfaceView.getHolder();
if (this.hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(3);
}
this.decodeFormats = null;
this.characterSet = null;
}
示例10: init
import android.view.SurfaceHolder; //导入方法依赖的package包/类
private void init() {
LayoutInflater.from(getContext()).inflate(R.layout.preview_layout, this);
mPreviewView = findViewById(R.id.preview);
// Install a SurfaceHolder.Callback so we get notified when the
// underlying surface is created and destroyed.
SurfaceHolder holder = mPreviewView.getHolder();
holder.addCallback(new PreviewCallback());
// deprecated setting, but required on Android versions prior to 3.0
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
示例11: onResume
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
}
示例12: init
import android.view.SurfaceHolder; //导入方法依赖的package包/类
private void init() {
// Install a SurfaceHolder.Callback so we get notified when the
// underlying surface is created and destroyed
SurfaceHolder holder = getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
mKeyguardManager = ((KeyguardManager)getContext().getSystemService(Context.KEYGUARD_SERVICE));
}
示例13: surfaceCreated
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
Log.v("SDL", "surfaceCreated()");
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
}