1// Copyright (C) 2011 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15// A simple graph that displays the raw camera stream. 16 17@setting autoBranch = "synced"; 18 19// Imports --------------------------------------------------- 20@import android.filterpacks.videosrc; 21@import android.filterpacks.ui; 22@import android.filterpacks.videosink; 23@import android.filterpacks.base; 24 25// Externals ------------------------------------------------- 26@external cameraView; 27@external outputFileName; 28@external cameraId; 29 30@set widthLoc = 320; 31@set heightLoc = 240; 32 33// Filters --------------------------------------------------- 34@filter CameraSource camera { 35 id = $cameraId; 36 width = $widthLoc; 37 height = $heightLoc; 38 waitForNewFrame = false; 39} 40 41@filter MediaEncoderFilter mediaEncoder { 42 width = $widthLoc; 43 height = $heightLoc; 44 outputFile = $outputFileName; 45} 46 47@filter SurfaceRenderFilter renderer { 48 surfaceView = $cameraView; 49} 50 51 52// Connections ----------------------------------------------- 53// Camera->Preview, Camera->Encoder 54// Render camera output on to a surface 55@connect camera[video] => renderer[frame]; 56// Also pass it to an encoder 57@connect camera[video] => mediaEncoder[videoframe]; 58