android.provider.MediaStore#INTENT_ACTION_VIDEO_CAMERA源码实例Demo

下面列出了android.provider.MediaStore#INTENT_ACTION_VIDEO_CAMERA 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Camera2   文件: CameraStartUp.java
private long launchVideo()
{
    long startupTime = 0;

    try
    {
        Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
        intent.setClass(getInstrumentation().getTargetContext(), CameraActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        long beforeStart = System.currentTimeMillis();
        Instrumentation inst = getInstrumentation();
        Activity recorderActivity = inst.startActivitySync(intent);
        long cameraStarted = System.currentTimeMillis();
        recorderActivity.finish();
        startupTime = cameraStarted - beforeStart;
        Log.v(TAG, "Video Startup Time = " + startupTime);
        // wait for 1s to make sure it reach a clean stage
        Thread.sleep(WAIT_TIME_FOR_PREVIEW);
        Log.v(TAG, "video startup time: " + startupTime);
    } catch (Exception e)
    {
        Log.v(TAG, "Got exception", e);
        fail("Fails to launch video output file");
    }
    return startupTime;
}
 
源代码2 项目: Camera2   文件: VideoCapture.java
public void testBackVideoCapture() throws Exception
{
    Instrumentation inst = getInstrumentation();
    Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);

    intent.setClass(getInstrumentation().getTargetContext(), CameraActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.putExtra(EXTRAS_CAMERA_FACING,
            android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK);
    Activity act = inst.startActivitySync(intent);
    Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
    captureVideos("Back Camera Video Capture\n", inst);
    act.finish();
}
 
源代码3 项目: Camera2   文件: VideoCapture.java
public void testFrontVideoCapture() throws Exception
{
    Instrumentation inst = getInstrumentation();
    Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);

    intent.setClass(getInstrumentation().getTargetContext(), CameraActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.putExtra(EXTRAS_CAMERA_FACING,
            android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
    Activity act = inst.startActivitySync(intent);
    Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
    captureVideos("Front Camera Video Capture\n", inst);
    act.finish();
}