mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 11:49:59 +01:00
BugFix Shmdata sink broadcasting Shared Memory
Fix termination of shmdatasink, improved UI and doc.
This commit is contained in:
11
README.md
11
README.md
@@ -127,9 +127,16 @@ Optionnal:
|
|||||||
|
|
||||||
apt-get install libglm-dev libstb-dev libtinyxml2-dev ableton-link-dev
|
apt-get install libglm-dev libstb-dev libtinyxml2-dev ableton-link-dev
|
||||||
|
|
||||||
+ Follow the instructions to [install Shmdata](https://gitlab.com/sat-mtl/tools/shmdata).
|
+ Follow the instructions to [install Shmdata](https://github.com/nicobou/shmdata/blob/develop/doc/install-from-sources.md).
|
||||||
|
|
||||||
|
git clone https://gitlab.com/sat-metalab/shmdata.git
|
||||||
|
mkdir shmdata-build
|
||||||
|
cd shmdata-build
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=Release -DWITH_PYTHON=0 -DWITH_SDCRASH=0 -DWITH_SDFLOW=0 ../shmdata-build
|
||||||
|
cmake --build . --target package
|
||||||
|
sudo dpkg -i ./libshmdata_1.3*_amd64.deb
|
||||||
|
|
||||||
#### OSX with Brew
|
#### OSX with Brew
|
||||||
|
|
||||||
~$ brew install cmake libpng glfw gstreamer icu4c
|
brew install cmake libpng glfw gstreamer icu4c
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ void Settings::Save(uint64_t runtime, const std::string &filename)
|
|||||||
applicationNode->SetAttribute("broadcast_port", application.broadcast_port);
|
applicationNode->SetAttribute("broadcast_port", application.broadcast_port);
|
||||||
applicationNode->SetAttribute("loopback_camera", application.loopback_camera);
|
applicationNode->SetAttribute("loopback_camera", application.loopback_camera);
|
||||||
applicationNode->SetAttribute("shm_socket_path", application.shm_socket_path.c_str());
|
applicationNode->SetAttribute("shm_socket_path", application.shm_socket_path.c_str());
|
||||||
|
applicationNode->SetAttribute("shm_method", application.shm_method);
|
||||||
applicationNode->SetAttribute("accept_audio", application.accept_audio);
|
applicationNode->SetAttribute("accept_audio", application.accept_audio);
|
||||||
pRoot->InsertEndChild(applicationNode);
|
pRoot->InsertEndChild(applicationNode);
|
||||||
|
|
||||||
@@ -462,6 +463,7 @@ void Settings::Load(const string &filename)
|
|||||||
applicationNode->QueryIntAttribute("broadcast_port", &application.broadcast_port);
|
applicationNode->QueryIntAttribute("broadcast_port", &application.broadcast_port);
|
||||||
applicationNode->QueryIntAttribute("loopback_camera", &application.loopback_camera);
|
applicationNode->QueryIntAttribute("loopback_camera", &application.loopback_camera);
|
||||||
applicationNode->QueryBoolAttribute("accept_audio", &application.accept_audio);
|
applicationNode->QueryBoolAttribute("accept_audio", &application.accept_audio);
|
||||||
|
applicationNode->QueryIntAttribute("shm_method", &application.shm_method);
|
||||||
|
|
||||||
// text attributes
|
// text attributes
|
||||||
const char *tmpstr = applicationNode->Attribute("shm_socket_path");
|
const char *tmpstr = applicationNode->Attribute("shm_socket_path");
|
||||||
|
|||||||
@@ -169,6 +169,9 @@ std::string ShmdataBroadcast::init(GstCaps *caps)
|
|||||||
|
|
||||||
void ShmdataBroadcast::terminate()
|
void ShmdataBroadcast::terminate()
|
||||||
{
|
{
|
||||||
|
// end src
|
||||||
|
gst_app_src_end_of_stream (src_);
|
||||||
|
|
||||||
// force finished
|
// force finished
|
||||||
endofstream_ = true;
|
endofstream_ = true;
|
||||||
active_ = false;
|
active_ = false;
|
||||||
@@ -188,9 +191,9 @@ std::string ShmdataBroadcast::gst_pipeline() const
|
|||||||
pipeline += (method_ == SHM_SHMDATASINK) ? "shmdatasrc" : "shmsrc";
|
pipeline += (method_ == SHM_SHMDATASINK) ? "shmdatasrc" : "shmsrc";
|
||||||
pipeline += " socket-path=";
|
pipeline += " socket-path=";
|
||||||
pipeline += socket_path_;
|
pipeline += socket_path_;
|
||||||
pipeline += " is-live=true";
|
|
||||||
|
|
||||||
if (method_ == SHM_SHMSINK){
|
if (method_ == SHM_SHMSINK){
|
||||||
|
pipeline += " is-live=true";
|
||||||
pipeline += " ! ";
|
pipeline += " ! ";
|
||||||
pipeline += std::string( gst_caps_to_string(caps_) );
|
pipeline += std::string( gst_caps_to_string(caps_) );
|
||||||
pipeline = std::regex_replace(pipeline, std::regex("\\(int\\)"), "");
|
pipeline = std::regex_replace(pipeline, std::regex("\\(int\\)"), "");
|
||||||
|
|||||||
@@ -5772,14 +5772,14 @@ void Navigator::RenderMainPannelSettings()
|
|||||||
ImFormatString(msg, IM_ARRAYSIZE(msg), "Shared Memory\n\n"
|
ImFormatString(msg, IM_ARRAYSIZE(msg), "Shared Memory\n\n"
|
||||||
"vimix can share to RAM with "
|
"vimix can share to RAM with "
|
||||||
"gstreamer default 'shmsink' "
|
"gstreamer default 'shmsink' "
|
||||||
"and with 'shmdatasink'.\n"
|
"and with 'shmdatasink'.\n\n"
|
||||||
"Socket file to connect to:\n%s\n",
|
"Socket file to connect to:\n%s\n",
|
||||||
_shm_socket_file.c_str());
|
_shm_socket_file.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ImFormatString(msg, IM_ARRAYSIZE(msg), "Shared Memory\n\n"
|
ImFormatString(msg, IM_ARRAYSIZE(msg), "Shared Memory\n\n"
|
||||||
"vimix can share to RAM with "
|
"vimix can share to RAM with "
|
||||||
"gstreamer 'shmsink'.\n"
|
"gstreamer 'shmsink'.\n\n"
|
||||||
"Socket file to connect to:\n%s\n",
|
"Socket file to connect to:\n%s\n",
|
||||||
_shm_socket_file.c_str());
|
_shm_socket_file.c_str());
|
||||||
}
|
}
|
||||||
@@ -5787,9 +5787,9 @@ void Navigator::RenderMainPannelSettings()
|
|||||||
ImGui::SameLine(0);
|
ImGui::SameLine(0);
|
||||||
ImGui::SetCursorPosX(width_);
|
ImGui::SetCursorPosX(width_);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
char bufsocket[64] = "";
|
char bufsocket[128] = "";
|
||||||
snprintf(bufsocket, 64, "%s", Settings::application.shm_socket_path.c_str());
|
snprintf(bufsocket, 128, "%s", Settings::application.shm_socket_path.c_str());
|
||||||
ImGui::InputTextWithHint("##SHM path", SystemToolkit::home_path().c_str(), bufsocket, 64);
|
ImGui::InputTextWithHint("##SHM path", SystemToolkit::home_path().c_str(), bufsocket, 128);
|
||||||
if (ImGui::IsItemDeactivatedAfterEdit()) {
|
if (ImGui::IsItemDeactivatedAfterEdit()) {
|
||||||
Settings::application.shm_socket_path = bufsocket;
|
Settings::application.shm_socket_path = bufsocket;
|
||||||
}
|
}
|
||||||
@@ -5799,7 +5799,7 @@ void Navigator::RenderMainPannelSettings()
|
|||||||
if (ShmdataBroadcast::available(ShmdataBroadcast::SHM_SHMDATASINK)) {
|
if (ShmdataBroadcast::available(ShmdataBroadcast::SHM_SHMDATASINK)) {
|
||||||
ImGui::SetCursorPosX(width_);
|
ImGui::SetCursorPosX(width_);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
ImGui::Combo("SHM plugin", &Settings::application.shm_method, "shmsink\0shmdatasink\0");
|
ImGui::Combo("SHM sink", &Settings::application.shm_method, "shmsink\0shmdatasink\0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user