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


Java SurfaceHolder.setType方法代码示例

本文整理汇总了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;
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:24,代码来源:CaptureActivity.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:CaptureActivity.java

示例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;
	
}
 
开发者ID:CoderCF,项目名称:ZXingDemo,代码行数:24,代码来源:CaptureActivity.java

示例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);
    }
}
 
开发者ID:10045125,项目名称:QrCode,代码行数:24,代码来源:QrCodeView.java

示例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();
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:25,代码来源:CaptureVideoActivity.java

示例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);

}
 
开发者ID:vitaviva,项目名称:QRCodeScanner,代码行数:20,代码来源:BarcodeScanView.java

示例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);
}
 
开发者ID:wuyisheng,项目名称:libRtmp,代码行数:11,代码来源:LivingView.java

示例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);
		}
	}
}
 
开发者ID:Zhaoss,项目名称:WeiXinRecordedDemo,代码行数:14,代码来源:MediaRecorderBase.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:SweepActivity.java

示例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);

}
 
开发者ID:android-notes,项目名称:CameraPreview,代码行数:12,代码来源:PreviewView.java

示例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;

}
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:16,代码来源:QrCodeActivity.java

示例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));
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:9,代码来源:GLSurfaceView_SDL.java

示例13: surfaceCreated

import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
    Log.v("SDL", "surfaceCreated()");
    holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
}
 
开发者ID:jomof,项目名称:cdep-android-studio-freetype-sample,代码行数:6,代码来源:SDLActivity.java


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