Create gstdsexample
This commit is contained in:
parent
9360f4130e
commit
d92e7bdb11
@ -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})
|
||||
|
||||
|
||||
13
src/gstds_example_manager.cpp
Normal file
13
src/gstds_example_manager.cpp
Normal 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;
|
||||
}
|
||||
10
src/gstds_example_manager.hpp
Normal file
10
src/gstds_example_manager.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include <gst/gst.h>
|
||||
|
||||
class GstdsExampleManager {
|
||||
private:
|
||||
public:
|
||||
GstElement *custom_plugin = NULL;
|
||||
GstdsExampleManager();
|
||||
bool create_gstds_example();
|
||||
~GstdsExampleManager();
|
||||
};
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user