Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
******************************************************************************/

#include "inference_singleton.h"
#include "gva_base_inference_priv.hpp"
#include "inference_backend/buffer_mapper.h"

#include "gva_base_inference.h"
#include "inference_impl.h"
Expand All @@ -15,6 +17,7 @@
struct InferenceRefs {
std::set<GvaBaseInference *> refs;
InferenceImpl *proxy = nullptr;
dlstreamer::ContextPtr context = nullptr;
GstVideoFormat videoFormat = GST_VIDEO_FORMAT_UNKNOWN;
CapsFeature capsFeature = ANY_CAPS_FEATURE;
};
Expand Down Expand Up @@ -167,8 +170,12 @@ InferenceImpl *acquire_inference_instance(GvaBaseInference *base_inference) {
// if base_inference is not master element, it will get all master element's properties here
initExistingElements(infRefs);

if (infRefs->proxy == nullptr) // no instance for current inference-id acquired yet
if (infRefs->proxy == nullptr) { // no instance for current inference-id acquired yet
infRefs->proxy = new InferenceImpl(base_inference); // one instance for all elements with same inference-id
infRefs->context = base_inference->priv->va_display;
} else {
base_inference->priv->va_display = infRefs->context;
}

return infRefs->proxy;
} catch (const std::exception &e) {
Expand Down