Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions plugins/PIPEWIRE/recordPIPEWIRE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ bool recordPIPEWIRE :: start(const std::string&filename, gem::Properties&props)
} else if (("PortName" == key) && (props.get(key, s)) && !s.empty()) {
pw_properties_set(pwprops, PW_KEY_PORT_NAME, s.c_str());
#endif
} else if (("Description" == key) && (props.get(key, s)) && !s.empty()) {
/* OBS only accepts streams with descriptions */
pw_properties_set(pwprops, PW_KEY_NODE_DESCRIPTION, s.c_str());
} else if (("autoconnect" == key) && (props.get(key, d))) {
if((int)d) {
flags |= PW_STREAM_FLAG_AUTOCONNECT;
Expand Down Expand Up @@ -357,6 +360,7 @@ bool recordPIPEWIRE :: enumProperties(gem::Properties&props)
props.set("MediaRole", std::string("Source"));
props.set("AppName", std::string("Pd"));
props.set("NodeName", std::string("Gem"));
props.set("Description", std::string(""));
props.set("autoconnect", 0);
return true;
}
Expand Down Expand Up @@ -432,6 +436,10 @@ void recordPIPEWIRE::on_param_changed(uint32_t id, const struct spa_pod *param)
{
//::post("%s:%d@%s", __FILE__, __LINE__, __FUNCTION__);
if (param == NULL || id != SPA_PARAM_Format) {
// 4 SPA_PARAM_Format
// 15 SPA_PARAM_Latency
// 17 SPA_PARAM_Tag
// 20 SPA_PARAM_PeerCapability
return;
}
struct spa_video_info format;
Expand Down
99 changes: 51 additions & 48 deletions src/Pixes/pix_frei0r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@

#include "Gem/GemGL.h"


#ifndef HAVE_STRNLEN
#define strnlen f0r_strnlen
static size_t f0r_strnlen(const char* str, size_t maxlen)
{
size_t len=0;
if(NULL==str) {
# define strnlen f0r_strnlen
static size_t f0r_strnlen(const char *str, size_t maxlen) {
size_t len = 0;
if (NULL == str) {
return len;
}
while(*str++ && len<maxlen) {
while (*str++ && len < maxlen) {
len++;
}

Expand All @@ -60,61 +58,66 @@ static size_t f0r_strnlen(const char* str, size_t maxlen)
#endif

namespace {
static std::vector<std::string>s_frei0r_paths;
void frei0r_paths_initialize(void) {
std::vector<std::string>paths;
const char*f0path = getenv("FREI0R_PATH");
if (f0path) {
std::string frei0r_path = f0path;
static std::vector<std::string> s_frei0r_paths;
void frei0r_paths_initialize(void) {
std::vector<std::string> paths;
const char *f0path = getenv("FREI0R_PATH");
if (f0path) {
std::string frei0r_path = f0path;

#ifdef _WIN32
const char *separator = ";";
const char *separator = ";";
#else
const char *separator = ":";
const char *separator = ":";
#endif
size_t start;
size_t end = 0;
while ((start = frei0r_path.find_first_not_of(separator, end)) !=
std::string::npos) {
end = frei0r_path.find(separator, start);
paths.push_back(frei0r_path.substr(start, end - start));
}
} else {
/* no FREI0R_PATH...fall back to the defaults */
static const char *const frei0r_pathlist[] = {
#ifdef MULTIARCH_TRIPLET
/* Debian's multiarch */
"/usr/local/lib/" MULTIARCH_TRIPLET "/frei0r-1",
#endif
size_t start;
size_t end = 0;
while ((start = frei0r_path.find_first_not_of(separator, end)) != std::string::npos) {
end = frei0r_path.find(separator, start);
paths.push_back(frei0r_path.substr(start, end - start));
}
} else {
/* no FREI0R_PATH...fall back to the defaults */
static const char* const frei0r_pathlist[] = {
"/usr/local/lib/frei0r-1/",
"/usr/lib/frei0r-1/",
#if defined __SIZEOF_POINTER__ && (__SIZEOF_POINTER__ == 8)
/* these are only valid for 64bit archs */
"/usr/local/lib64/frei0r-1/",
"/usr/lib64/frei0r-1/",
/* only valid for 64bit archs */
"/usr/local/lib64/frei0r-1",
#endif
"/usr/local/lib/frei0r-1",

#ifdef MULTIARCH_TRIPLET
/* Debian's multiarch */
"/usr/local/lib/" MULTIARCH_TRIPLET "/frei0r-1/",
"/usr/lib/" MULTIARCH_TRIPLET "/frei0r-1/",
"/usr/lib/" MULTIARCH_TRIPLET "/frei0r-1",
#endif
0
};

f0path = getenv("HOME");
if(f0path) {
std::string p(f0path);
paths.push_back(p + "/.frei0r-1/lib/");
paths.push_back(p + "/.local/lib/frei0r-1/");
#if defined __SIZEOF_POINTER__ && (__SIZEOF_POINTER__ == 8)
/* only valid for 64bit archs */
"/usr/lib64/frei0r-1",
#endif
"/usr/lib/frei0r-1", 0};

f0path = getenv("HOME");
if (f0path) {
std::string p(f0path);
paths.push_back(p + "/.frei0r-1/lib");
#ifdef MULTIARCH_TRIPLET
/* Debian's multiarch */
paths.push_back(p + "/.local/lib/" MULTIARCH_TRIPLET "/frei0r-1/");
/* Debian's multiarch */
paths.push_back(p + "/.local/lib/" MULTIARCH_TRIPLET "/frei0r-1");
#endif
}
for(int i=0; frei0r_pathlist[i]; i++) {
paths.push_back(frei0r_pathlist[i]);
}
paths.push_back(p + "/.local/lib/frei0r-1");
}
for (int i = 0; frei0r_pathlist[i]; i++) {
paths.push_back(frei0r_pathlist[i]);
}

s_frei0r_paths = paths;
}
};

s_frei0r_paths = paths;
}
}; // namespace

class pix_frei0r::F0RPlugin
{
Expand Down
Loading