當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。