1 /* 2 * Copyright 2020 Rockchip Electronics Co. LTD 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 * author: <fxw@rock-chips.com> 17 * date: 2020-09-03 18 * module: RTAIGraph 19 */ 20 21 #ifndef SRC_RT_TASK_APP_GRAPH_RTAIGRAPH_H_ 22 #define SRC_RT_TASK_APP_GRAPH_RTAIGRAPH_H_ 23 24 #include "rt_header.h" 25 #include "RTTaskGraph.h" 26 27 class RTAIGraph : public RTTaskGraph { 28 public: 29 explicit RTAIGraph(const char* tagName); 30 ~RTAIGraph(); 31 32 RT_RET prepare(); 33 RT_RET start(); 34 RT_RET stop(); 35 36 RT_RET preload(RtMetaData *meta); 37 RT_RET recognize(RTMediaBuffer *buffer); 38 RT_RET observeOutputStream(std::function<RT_RET(RTMediaBuffer *)> streamCallback); 39 40 private: 41 RT_RET initialize(const char* tagName); 42 RT_RET deinitialize(); 43 }; 44 45 #endif // SRC_RT_TASK_APP_GRAPH_RTAIGRAPH_H_ 46