backdropper.graph revision caf8466dcdf6d6c496e46961bb3132126363ef83
1// 2// Copyright (C) 2011 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17// Imports --------------------------------------------------- 18@import android.filterpacks.base; 19@import android.filterpacks.ui; 20@import android.filterpacks.videosrc; 21@import android.filterpacks.videoproc; 22@import android.filterpacks.videosink; 23 24@setting autoBranch = "synced"; 25 26// Externals ------------------------------------------------- 27 28@external textureSourceCallback; 29@external recordingWidth; 30@external recordingHeight; 31@external recordingProfile; 32@external recordingDoneListener; 33@external audioSource; 34 35@external previewSurface; 36@external previewWidth; 37@external previewHeight; 38 39@external orientation; 40 41@external learningDoneListener; 42 43// Filters --------------------------------------------------- 44 45// Camera input 46@filter SurfaceTextureSource source { 47 sourceListener = $textureSourceCallback; 48 width = $recordingWidth; 49 height = $recordingHeight; 50 closeOnTimeout = true; 51} 52 53// Background video input 54@filter MediaSource background { 55 sourceUrl = "no_file_specified"; 56 waitForNewFrame = false; 57 sourceIsUrl = true; 58 orientation = $orientation; 59} 60 61// Background replacer 62@filter BackDropperFilter replacer { 63 autowbToggle = 1; 64 learningDoneListener = $learningDoneListener; 65} 66 67// Display output 68@filter SurfaceTargetFilter display { 69 surface = $previewSurface; 70 owidth = $previewWidth; 71 oheight = $previewHeight; 72} 73 74// Recording output 75@filter MediaEncoderFilter recorder { 76 audioSource = $audioSource; 77 recordingProfile = $recordingProfile; 78 recordingDoneListener = $recordingDoneListener; 79 recording = false; 80 // outputFile, orientationHint, inputRegion, listeners 81 // will be set when recording starts 82} 83 84// Connections ----------------------------------------------- 85@connect source[video] => replacer[video]; 86@connect background[video] => replacer[background]; 87@connect replacer[video] => display[frame]; 88@connect replacer[video] => recorder[videoframe]; 89 90