Create gstdsexample

This commit is contained in:
Barzan Hayati 2025-06-30 19:15:47 +00:00
parent 9360f4130e
commit d92e7bdb11
5 changed files with 31 additions and 1 deletions

View File

@ -50,9 +50,11 @@ include_directories(${PROJECT_SOURCE_DIR}/camera_manager.hpp)
include_directories(${PROJECT_SOURCE_DIR}/pipeline_manager.hpp)
include_directories(${PROJECT_SOURCE_DIR}/streammux_manager.hpp)
include_directories(${PROJECT_SOURCE_DIR}/source_bin.hpp)
include_directories(${PROJECT_SOURCE_DIR}/gstds_example_manager.hpp)
set(SOURCES src/main.cpp src/camera_manager.cpp src/pipeline_manager.cpp src/streammux_manager.cpp src/source_bin.cpp)
set(SOURCES src/main.cpp src/camera_manager.cpp src/pipeline_manager.cpp src/streammux_manager.cpp src/source_bin.cpp src/gstds_example_manager.cpp)
# Create the executable
add_executable(${PROJECT_NAME} ${SOURCES})

View File

@ -0,0 +1,13 @@
#include "gstds_example_manager.hpp"
GstdsExampleManager::GstdsExampleManager() {}
bool GstdsExampleManager::create_gstds_example() {
custom_plugin = gst_element_factory_make("dsexample", "nvdsgst_dsexample");
g_object_set(G_OBJECT(custom_plugin), "full-frame", 0, NULL);
if (!custom_plugin) {
g_printerr("Custom_plugin could not be created. Exiting.\n");
return false;
}
return true;
}

View File

@ -0,0 +1,10 @@
#include <gst/gst.h>
class GstdsExampleManager {
private:
public:
GstElement *custom_plugin = NULL;
GstdsExampleManager();
bool create_gstds_example();
~GstdsExampleManager();
};

View File

@ -56,5 +56,8 @@ bool PipelineManager::create_pipeline_elements(int num_sources,
// g_source_bin_list[i] = source_bin;
gst_bin_add(GST_BIN(pipeline), source_bin);
}
gstds_example_manager->create_gstds_example();
return true;
}

View File

@ -2,6 +2,7 @@
#include <gst/gst.h>
#include "cuda_runtime_api.h"
#include "gstds_example_manager.hpp"
#include "source_bin.hpp"
#include "streammux_manager.hpp"
@ -12,6 +13,7 @@ class PipelineManager {
GstElement *pipeline = NULL;
GMutex eos_lock;
StreammuxManager *streammux_manager = new StreammuxManager();
GstdsExampleManager *gstds_example_manager = new GstdsExampleManager();
public:
int current_device = -1;