|
@@ -4,7 +4,7 @@
|
|
|
* @Autor: lishengyin
|
|
|
* @Date: 2021-10-13 09:35:37
|
|
|
* @LastEditors: lishengyin
|
|
|
- * @LastEditTime: 2021-10-13 09:54:15
|
|
|
+ * @LastEditTime: 2021-10-13 14:51:24
|
|
|
*/
|
|
|
#include "inference.h"
|
|
|
|
|
@@ -54,7 +54,7 @@ GstElement *g_streammux = NULL;
|
|
|
|
|
|
namespace MIVA{
|
|
|
std::shared_ptr<Inference> infer = NULL;
|
|
|
- // ThreadPool pool(3,ThreadPool::PRIORITY_HIGHEST, false);
|
|
|
+ ThreadPool pool(1,ThreadPool::PRIORITY_HIGHEST, false);
|
|
|
/**
|
|
|
* @description: 创建对象 单例
|
|
|
* @param {*}
|
|
@@ -230,7 +230,11 @@ namespace MIVA{
|
|
|
this->RestartTask();
|
|
|
}else{
|
|
|
ret++;
|
|
|
- gst_element_set_state(this->pipeline, GST_STATE_PLAYING);
|
|
|
+ pool.async([&](){
|
|
|
+ gst_element_set_state(this->pipeline, GST_STATE_PLAYING);
|
|
|
+ g_main_loop_run(this->loop);
|
|
|
+ });
|
|
|
+ pool.start();
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
@@ -421,6 +425,16 @@ namespace MIVA{
|
|
|
g_signal_connect (G_OBJECT (object), "child-added",
|
|
|
G_CALLBACK (decodebin_child_added), user_data);
|
|
|
}
|
|
|
+ if (g_strrstr (name, "nvv4l2decoder") == name) {
|
|
|
+ #ifdef PLATFORM_TEGRA
|
|
|
+ g_object_set (object, "enable-max-performance", TRUE, NULL);
|
|
|
+ g_object_set (object, "bufapi-version", TRUE, NULL);
|
|
|
+ g_object_set (object, "drop-frame-interval", 0, NULL);
|
|
|
+ g_object_set (object, "num-extra-surfaces", 0, NULL);
|
|
|
+ #else
|
|
|
+ g_object_set (object, "gpu-id", 0, NULL);
|
|
|
+ #endif
|
|
|
+ }
|
|
|
}
|
|
|
/**
|
|
|
* @description: 释放数据源
|
|
@@ -484,7 +498,7 @@ namespace MIVA{
|
|
|
gchar pad_name[16] = { 0 };
|
|
|
GstPad *sinkpad = NULL;
|
|
|
g_snprintf (pad_name, 15, "sink_%u", source_id);
|
|
|
-
|
|
|
+
|
|
|
sinkpad = gst_element_get_static_pad (g_streammux, pad_name);
|
|
|
if(sinkpad == NULL) sinkpad = gst_element_get_request_pad (g_streammux, pad_name);
|
|
|
if (gst_pad_link (pad, sinkpad) != GST_PAD_LINK_OK) {
|