Trait opencv::prelude::GStreamingCompiledTrait
source · pub trait GStreamingCompiledTrait: GStreamingCompiledTraitConst {
// Required method
fn as_raw_mut_GStreamingCompiled(&mut self) -> *mut c_void;
// Provided methods
fn set_source(&mut self, ins: GRunArgs) -> Result<()> { ... }
fn set_source_1(&mut self, callback: &ExtractArgsCallback) -> Result<()> { ... }
fn start(&mut self) -> Result<()> { ... }
fn stop(&mut self) -> Result<()> { ... }
}
Expand description
Mutable methods for crate::gapi::GStreamingCompiled
Required Methods§
fn as_raw_mut_GStreamingCompiled(&mut self) -> *mut c_void
Provided Methods§
sourcefn set_source(&mut self, ins: GRunArgs) -> Result<()>
fn set_source(&mut self, ins: GRunArgs) -> Result<()>
Specify the input data to GStreamingCompiled for processing, a generic version.
Use gin() to create an input parameter vector.
Input vectors must have the same number of elements as defined in the cv::GComputation protocol (at the moment of its construction). Shapes of elements also must conform to protocol (e.g. cv::Mat needs to be passed where cv::GMat has been declared as input, and so on). Run-time exception is generated on type mismatch.
In contrast with regular GCompiled, user can also pass an object of type GVideoCapture for a GMat parameter of the parent GComputation. The compiled pipeline will start fetching data from that GVideoCapture and feeding it into the pipeline. Pipeline stops when a GVideoCapture marks end of the stream (or when stop() is called).
Passing a regular Mat for a GMat parameter makes it “infinite” source – pipeline may run forever feeding with this Mat until stopped explicitly.
Currently only a single GVideoCapture is supported as input. If the parent GComputation is declared with multiple input GMat’s, one of those can be specified as GVideoCapture but all others must be regular Mat objects.
Throws if pipeline is already running. Use stop() and then setSource() to run the graph on a new video stream.
Note: This method is not thread-safe (with respect to the user side) at the moment. Protect the access if start()/stop()/setSource() may be called on the same object in multiple threads in your application.
Parameters
- ins: vector of inputs to process.
See also
gin
sourcefn set_source_1(&mut self, callback: &ExtractArgsCallback) -> Result<()>
fn set_source_1(&mut self, callback: &ExtractArgsCallback) -> Result<()>
@private – Exclude this function from OpenCV documentation
sourcefn start(&mut self) -> Result<()>
fn start(&mut self) -> Result<()>
Start the pipeline execution.
Use pull()/try_pull() to obtain data. Throws an exception if a video source was not specified.
setSource() must be called first, even if the pipeline has been working already and then stopped (explicitly via stop() or due stream completion)
Note: This method is not thread-safe (with respect to the user side) at the moment. Protect the access if start()/stop()/setSource() may be called on the same object in multiple threads in your application.