backdropper.graph revision 9efb0b19fa929c528253f0a9b6f5b27791e1ee52
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 audioSource;
33
34@external previewSurface;
35@external previewWidth;
36@external previewHeight;
37
38@external learningDoneListener;
39
40// Filters ---------------------------------------------------
41
42// Camera input
43@filter SurfaceTextureSource source {
44  sourceListener = $textureSourceCallback;
45  width = $recordingWidth;
46  height = $recordingHeight;
47  closeOnTimeout = true;
48}
49
50// Background video input
51@filter MediaSource background {
52  sourceUrl = "no_file_specified";
53  waitForNewFrame = false;
54  sourceIsUrl = true;
55}
56
57// Background replacer
58@filter BackDropperFilter replacer {
59  autowbToggle = 1;
60  learningDoneListener = $learningDoneListener;
61}
62
63// Display output
64@filter SurfaceTargetFilter display {
65  surface = $previewSurface;
66  owidth = $previewWidth;
67  oheight = $previewHeight;
68}
69
70// Recording output
71@filter MediaEncoderFilter recorder {
72  audioSource = $audioSource;
73  recordingProfile = $recordingProfile;
74  recording = false;
75  // outputFile, orientationHint, listeners will be set when recording starts
76}
77
78// Connections -----------------------------------------------
79@connect source[video] => replacer[video];
80@connect background[video] => replacer[background];
81@connect replacer[video] => display[frame];
82@connect replacer[video] => recorder[videoframe];
83
84