當前位置: 首頁>>代碼示例>>Java>>正文


Java VirtualDisplay類代碼示例

本文整理匯總了Java中android.hardware.display.VirtualDisplay的典型用法代碼示例。如果您正苦於以下問題:Java VirtualDisplay類的具體用法?Java VirtualDisplay怎麽用?Java VirtualDisplay使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VirtualDisplay類屬於android.hardware.display包,在下文中一共展示了VirtualDisplay類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: run

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
@Override
public void run() {
	MediaFormat format = MediaFormat.createVideoFormat("video/avc",
			mWidth, mHeight);
	format.setInteger(MediaFormat.KEY_COLOR_FORMAT,
			MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
	format.setInteger(MediaFormat.KEY_BIT_RATE, BIT_RATE);
	format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);
	format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL,
			I_FRAME_INTERVAL);

	MediaCodec codec = MediaCodec.createEncoderByType("video/avc");
	codec.configure(format, null, null,
			MediaCodec.CONFIGURE_FLAG_ENCODE);
	Surface surface = codec.createInputSurface();
	codec.start();

	VirtualDisplay virtualDisplay = mDisplayManager
			.createVirtualDisplay(DISPLAY_NAME, mWidth, mHeight,
					mDensityDpi, surface,
					DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC);
	
	if (virtualDisplay != null) {
		stream(codec);
		virtualDisplay.release();
	}

	codec.signalEndOfInputStream();
	codec.stop();
}
 
開發者ID:misgod,項目名稱:ScreenRecoder,代碼行數:31,代碼來源:ScreenRecoder.java

示例2: createVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
private VirtualDisplay createVirtualDisplay() {
    return mMediaProjection.createVirtualDisplay("MainActivity",
            DISPLAY_WIDTH, DISPLAY_HEIGHT, mScreenDensity,
            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
            mMediaRecorder.getSurface(), null /*Callbacks*/, null
            /*Handler*/);
}
 
開發者ID:Truiton,項目名稱:ScreenCapture,代碼行數:8,代碼來源:MainActivity.java

示例3: createVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
private VirtualDisplay createVirtualDisplay() {
    return mMediaProjection.createVirtualDisplay("ScreenCaptureActivity",
            DISPLAY_WIDTH, DISPLAY_HEIGHT, mScreenDensity,
            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
            mMediaRecorder.getSurface(), null /*Callbacks*/, null
            /*Handler*/);
}
 
開發者ID:altanai,項目名稱:androidStreamer,代碼行數:8,代碼來源:ScreenCaptureActivity.java

示例4: createVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private VirtualDisplay createVirtualDisplay() {
    return mMediaProjection.createVirtualDisplay("MainActivity",
            DISPLAY_WIDTH, DISPLAY_HEIGHT, mScreenDensity,
            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
            mMediaRecorder.getSurface(), null /*Callbacks*/, null
            /*Handler*/);
}
 
開發者ID:VideonaTalentum,項目名稱:ProyectoAndroid,代碼行數:9,代碼來源:Presenter.java

示例5: createVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
private VirtualDisplay createVirtualDisplay() {
    return mMediaProjection.createVirtualDisplay("MainActivity",
            WIDTH, HEIGHT, DENSITY_DPI,
            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
            mMediaRecorder.getSurface(), null /*Callbacks*/, null
            /*Handler*/);
}
 
開發者ID:vijai1996,項目名稱:screenrecorder,代碼行數:8,代碼來源:RecorderService.java

示例6: setupVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
private void setupVirtualDisplay() {
    setupVirtualDisplay(mPreviewSize, new VirtualDisplay.Callback() {
        @Override
        public void onPaused() {
        }

        @Override
        public void onResumed() {
        }

        @Override
        public void onStopped() {
        }
    });
}
 
開發者ID:DeviceConnect,項目名稱:DeviceConnect-Android,代碼行數:16,代碼來源:HostDeviceScreenCast.java

示例7: createVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
private VirtualDisplay createVirtualDisplay() {
    return mMediaProjection.createVirtualDisplay("MainActivity",
            DISPLAY_WIDTH, DISPLAY_HEIGHT, mScreenDensity,
            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
            mMediaRecorder.getSurface(), null /*Callbacks*/, null /*Handler*/);
}
 
開發者ID:HitRoxxx,項目名稱:FloatingNew,代碼行數:7,代碼來源:RecordingScreen.java

示例8: createVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
private VirtualDisplay createVirtualDisplay() {
    return mMediaProjection.createVirtualDisplay("LIFX",
            Config.VIRTUAL_DISPLAY_WIDTH, Config.VIRTUAL_DISPLAY_HEIGHT, mMetrics.densityDpi,
            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
            null, null /*Callbacks*/, null /*Handler*/);
}
 
開發者ID:davidvavra,項目名稱:MoodSync,代碼行數:7,代碼來源:MirroringHelper.java

示例9: createVirtualDisplay

import android.hardware.display.VirtualDisplay; //導入依賴的package包/類
private VirtualDisplay createVirtualDisplay() {
    return mMediaProjection.createVirtualDisplay("ScreenSharingDemo",
            mDisplayWidth, mDisplayHeight, mScreenDensity,
            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
            mSurface, null /*Callbacks*/, null /*Handler*/);
}
 
開發者ID:luoqii,項目名稱:ApkLauncher,代碼行數:7,代碼來源:MediaProjectionDemo.java


注:本文中的android.hardware.display.VirtualDisplay類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。