mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-13 19:29:58 +01:00
BugFix Prevent warnings gstreamer
This commit is contained in:
@@ -163,24 +163,25 @@ void Device::add(GstDevice *device)
|
|||||||
auto handle = std::find_if(handles_.cbegin(), handles_.cend(), hasDeviceName(device_name) );
|
auto handle = std::find_if(handles_.cbegin(), handles_.cend(), hasDeviceName(device_name) );
|
||||||
if ( handle == handles_.cend() ) {
|
if ( handle == handles_.cend() ) {
|
||||||
|
|
||||||
std::string p = pipelineForDevice(device, handles_.size());
|
|
||||||
GstToolkit::PipelineConfigSet confs = GstToolkit::getPipelineConfigs(p);
|
|
||||||
|
|
||||||
// add if not in the list and valid
|
// add if not in the list and valid
|
||||||
if (!p.empty() && !confs.empty()) {
|
std::string p = pipelineForDevice(device, handles_.size());
|
||||||
DeviceHandle dev;
|
if (!p.empty()) {
|
||||||
dev.name = device_name;
|
|
||||||
dev.pipeline = p;
|
|
||||||
dev.configs = confs;
|
|
||||||
dev.properties = get_device_properties (device);
|
|
||||||
#ifdef DEVICE_DEBUG
|
|
||||||
GstStructure *stru = gst_device_get_properties(device);
|
|
||||||
g_print("\n%s: %s\n", device_name, gst_structure_to_string(stru) );
|
|
||||||
#endif
|
|
||||||
handles_.push_back(dev);
|
|
||||||
Log::Info("Device '%s' is plugged-in.", device_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
GstToolkit::PipelineConfigSet confs = GstToolkit::getPipelineConfigs(p);
|
||||||
|
if (!confs.empty()) {
|
||||||
|
DeviceHandle dev;
|
||||||
|
dev.name = device_name;
|
||||||
|
dev.pipeline = p;
|
||||||
|
dev.configs = confs;
|
||||||
|
dev.properties = get_device_properties (device);
|
||||||
|
#ifdef DEVICE_DEBUG
|
||||||
|
GstStructure *stru = gst_device_get_properties(device);
|
||||||
|
g_print("\n%s: %s\n", device_name, gst_structure_to_string(stru) );
|
||||||
|
#endif
|
||||||
|
handles_.push_back(dev);
|
||||||
|
Log::Info("Device '%s' is plugged-in.", device_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// unlock access
|
// unlock access
|
||||||
access_.unlock();
|
access_.unlock();
|
||||||
|
|||||||
@@ -18,14 +18,9 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <thread>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <glm/gtc/matrix_transform.hpp>
|
#include <thread>
|
||||||
|
|
||||||
#include <gst/pbutils/gstdiscoverer.h>
|
|
||||||
#include <gst/pbutils/pbutils.h>
|
|
||||||
#include <gst/gst.h>
|
|
||||||
|
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Decorations.h"
|
#include "Decorations.h"
|
||||||
@@ -47,7 +42,7 @@ std::string gst_plugin_vidcap = "ximagesrc show-pointer=false";
|
|||||||
|
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xproto.h>
|
#include <xcb/xproto.h>
|
||||||
int X11_error_handler(Display *d, XErrorEvent *e);
|
int X11_error_handler(Display *d, XErrorEvent *e);
|
||||||
std::map<unsigned long, std::string> getListX11Windows();
|
std::map<unsigned long, std::string> getListX11Windows();
|
||||||
|
|
||||||
@@ -87,18 +82,6 @@ private:
|
|||||||
|
|
||||||
void ScreenCaptureHandle::update(const std::string &newname)
|
void ScreenCaptureHandle::update(const std::string &newname)
|
||||||
{
|
{
|
||||||
GstToolkit::PipelineConfigSet confs = GstToolkit::getPipelineConfigs(pipeline);
|
|
||||||
|
|
||||||
if (!confs.empty()) {
|
|
||||||
GstToolkit::PipelineConfig best = *confs.rbegin();
|
|
||||||
GstToolkit::PipelineConfigSet confscreen;
|
|
||||||
// limit framerate to 30fps
|
|
||||||
best.fps_numerator = MIN( best.fps_numerator, 30);
|
|
||||||
best.fps_denominator = 1;
|
|
||||||
confscreen.insert(best);
|
|
||||||
|
|
||||||
configs = confscreen;
|
|
||||||
}
|
|
||||||
name = newname;
|
name = newname;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +142,7 @@ void ScreenCapture::remove(const std::string &windowname, unsigned long id)
|
|||||||
|
|
||||||
// just inform if there is no source connected
|
// just inform if there is no source connected
|
||||||
if (handle->associated_sources.empty()) {
|
if (handle->associated_sources.empty()) {
|
||||||
Log::Info("Window %s closed.", windowname.c_str());
|
Log::Info("Window %s available.", windowname.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// otherwise unplug all sources and close their streams
|
// otherwise unplug all sources and close their streams
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "GstToolkit.h"
|
#include "GstToolkit.h"
|
||||||
#include "StreamSource.h"
|
#include "StreamSource.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user