From 6dd64f4d27d899b8587c79c22fba9ce29efd8bb8 Mon Sep 17 00:00:00 2001 From: Jack Lau <2366536135@qq.com> Date: Thu, 12 Dec 2024 16:47:28 +0800 Subject: [PATCH] add cpp ForceClose api --- bmf/engine/connector/include/builder.hpp | 3 +++ bmf/engine/connector/src/builder.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/bmf/engine/connector/include/builder.hpp b/bmf/engine/connector/include/builder.hpp index 4610d417..f1868d85 100644 --- a/bmf/engine/connector/include/builder.hpp +++ b/bmf/engine/connector/include/builder.hpp @@ -236,6 +236,7 @@ class RealGraph : public std::enable_shared_from_this { bool dumpGraph, bool needMerge); int Run(bool dumpGraph, bool needMerge); + int ForceClose(); Packet Generate(std::string streamName, bool block = true); int FillPacket(std::string stream_name, Packet packet, bool block = false); std::shared_ptr InputStream(std::string streamName, std::string notify, std::string alias); @@ -637,6 +638,8 @@ class BMF_ENGINE_API Graph { void Start(std::vector& generateStreams, bool dumpGraph = true, bool needMerge = true); + int ForceClose(); + std::string Dump(); Node diff --git a/bmf/engine/connector/src/builder.cpp b/bmf/engine/connector/src/builder.cpp index b6b0dfcb..0c9ac15a 100644 --- a/bmf/engine/connector/src/builder.cpp +++ b/bmf/engine/connector/src/builder.cpp @@ -433,6 +433,10 @@ void RealGraph::Start( Start(dumpGraph, needMerge); } +int RealGraph::ForceClose() { + return graphInstance_->force_close(); +} + bmf::BMFGraph RealGraph::Instantiate(bool dumpGraph, bool needMerge) { auto graph_config = Dump().dump(4); if (dumpGraph || (graphOption_.json_value_.count("dump_graph") && @@ -796,6 +800,10 @@ void Graph::Start(std::vector &generateStreams, bool dumpGraph, graph_->Start(generateRealStreams, dumpGraph, needMerge); } +int Graph::ForceClose() { + return graph_->ForceClose(); +} + Packet Graph::Generate(std::string streamName, bool block) { return graph_->Generate(streamName, block); }