utils: remove dynloaded function for projector open

This commit is contained in:
Stéphane Lepin 2020-03-17 23:46:24 +01:00
parent 88d39ab47a
commit 247ca71bf9
3 changed files with 1 additions and 37 deletions

View File

@ -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)
{
uint64_t ms = ns / 1000000ULL;

View File

@ -83,9 +83,5 @@ namespace Utils {
const char* GetFilenameFormatting();
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);
};

View File

@ -331,10 +331,6 @@ RpcResponse WSRequestHandler::GetVideoInfo(const RpcRequest& request) {
* @since unreleased
*/
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");
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* 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();
}