mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
utils: remove dynloaded function for projector open
This commit is contained in:
parent
88d39ab47a
commit
247ca71bf9
@ -831,34 +831,6 @@ void getPauseRecordingFunctions(RecordingPausedFunction* recPausedFuncPtr, Pause
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::OpenProjectorSupported()
|
|
||||||
{
|
|
||||||
void* frontendApi = os_dlopen("obs-frontend-api");
|
|
||||||
if (!frontendApi) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void* openProjectorFunc = os_dlsym(frontendApi, "obs_frontend_open_projector");
|
|
||||||
return (openProjectorFunc != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Utils::OpenProjector(const char* type, int monitor, const char* geometry, const char* name)
|
|
||||||
{
|
|
||||||
typedef void(*OpenProjectorFunc)(const char*, int monitor, const char* geometry, const char* name);
|
|
||||||
|
|
||||||
void* frontendApi = os_dlopen("obs-frontend-api");
|
|
||||||
if (!frontendApi) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenProjectorFunc openProjectorFunc = (OpenProjectorFunc)os_dlsym(frontendApi, "obs_frontend_open_projector");
|
|
||||||
if (!openProjectorFunc) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
openProjectorFunc(type, monitor, geometry, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Utils::nsToTimestamp(uint64_t ns)
|
QString Utils::nsToTimestamp(uint64_t ns)
|
||||||
{
|
{
|
||||||
uint64_t ms = ns / 1000000ULL;
|
uint64_t ms = ns / 1000000ULL;
|
||||||
|
@ -83,9 +83,5 @@ namespace Utils {
|
|||||||
const char* GetFilenameFormatting();
|
const char* GetFilenameFormatting();
|
||||||
bool SetFilenameFormatting(const char* filenameFormatting);
|
bool SetFilenameFormatting(const char* filenameFormatting);
|
||||||
|
|
||||||
|
|
||||||
bool OpenProjectorSupported();
|
|
||||||
void OpenProjector(const char* type, int monitor, const char* geometry, const char* name);
|
|
||||||
|
|
||||||
QString nsToTimestamp(uint64_t ns);
|
QString nsToTimestamp(uint64_t ns);
|
||||||
};
|
};
|
||||||
|
@ -331,10 +331,6 @@ RpcResponse WSRequestHandler::GetVideoInfo(const RpcRequest& request) {
|
|||||||
* @since unreleased
|
* @since unreleased
|
||||||
*/
|
*/
|
||||||
RpcResponse WSRequestHandler::OpenProjector(const RpcRequest& request) {
|
RpcResponse WSRequestHandler::OpenProjector(const RpcRequest& request) {
|
||||||
if (!Utils::OpenProjectorSupported()) {
|
|
||||||
return request.failed("Projector opening requires OBS 24.0.4 or newer.");
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* type = obs_data_get_string(request.parameters(), "type");
|
const char* type = obs_data_get_string(request.parameters(), "type");
|
||||||
|
|
||||||
int monitor = -1;
|
int monitor = -1;
|
||||||
@ -345,6 +341,6 @@ RpcResponse WSRequestHandler::OpenProjector(const RpcRequest& request) {
|
|||||||
const char* geometry = obs_data_get_string(request.parameters(), "geometry");
|
const char* geometry = obs_data_get_string(request.parameters(), "geometry");
|
||||||
const char* name = obs_data_get_string(request.parameters(), "name");
|
const char* name = obs_data_get_string(request.parameters(), "name");
|
||||||
|
|
||||||
Utils::OpenProjector(type, monitor, geometry, name);
|
obs_frontend_open_projector(type, monitor, geometry, name);
|
||||||
return request.success();
|
return request.success();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user