当前位置: 首页>>代码示例>>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;未经允许,请勿转载。