2 // Copyright (C) 2011 The Android Open Source Project
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
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;
24 @setting autoBranch = "synced";
26 // Externals -------------------------------------------------
28 @external textureSourceCallback;
29 @external recordingWidth;
30 @external recordingHeight;
31 @external recordingProfile;
32 @external recordingDoneListener;
34 @external previewSurfaceTexture;
35 @external previewWidth;
36 @external previewHeight;
38 @external orientation;
40 @external learningDoneListener;
42 // Filters ---------------------------------------------------
45 @filter SurfaceTextureSource source {
46 sourceListener = $textureSourceCallback;
47 width = $recordingWidth;
48 height = $recordingHeight;
49 closeOnTimeout = true;
52 // Background video input
53 @filter MediaSource background {
54 sourceUrl = "no_file_specified";
55 waitForNewFrame = false;
57 orientation = $orientation;
60 // Background replacer
61 @filter BackDropperFilter replacer {
63 learningDoneListener = $learningDoneListener;
64 orientation = $orientation;
68 @filter SurfaceTextureTarget display {
69 surfaceTexture = $previewSurfaceTexture;
70 width = $previewWidth;
71 height = $previewHeight;
75 @filter MediaEncoderFilter recorder {
76 recordingProfile = $recordingProfile;
77 recordingDoneListener = $recordingDoneListener;
79 width = $recordingWidth;
80 height = $recordingHeight;
81 // outputFile, orientationHint, inputRegion,
82 // audioSource, listeners, captureRate
83 // will be set when recording starts
86 // Connections -----------------------------------------------
87 @connect source[video] => replacer[video];
88 @connect background[video] => replacer[background];
89 @connect replacer[video] => display[frame];
90 @connect replacer[video] => recorder[videoframe];