encoders/generic: Hide encoders that don't have a UI handler

This prevents the uninformed from using an encoder that they really shouldn't be using, thus reducing the amount of issues that come from showing too many encoders.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-07-21 11:51:42 +02:00
parent 38f154531c
commit 7663a25bb3
+13 -5
View File
@@ -28,9 +28,10 @@ extern "C" {
#include <obs-module.h>
#pragma warning(push)
#pragma warning(disable : 4244)
#include "libavutil/dict.h"
#include "libavutil/frame.h"
#include "libavutil/opt.h"
#include <libavutil/dict.h>
#include <libavutil/frame.h>
#include <libavutil/opt.h>
#include <libavutil/pixdesc.h>
#pragma warning(pop)
}
@@ -85,6 +86,13 @@ void encoder::generic_factory::register_encoder()
this->info.oei.id = this->info.uid.c_str();
this->info.oei.codec = this->info.codec.c_str();
// Is this a deprecated encoder?
#ifndef _DEBUG
if (!obsffmpeg::has_codec_handler(avcodec_ptr->name)) {
this->info.oei.caps |= OBS_ENCODER_CAP_DEPRECATED;
}
#endif
// Detect encoder type (only Video and Audio supported)
if (avcodec_ptr->type == AVMediaType::AVMEDIA_TYPE_VIDEO) {
this->info.oei.type = obs_encoder_type::OBS_ENCODER_VIDEO;
@@ -271,8 +279,8 @@ void encoder::generic_factory::register_encoder()
this->info.oei.type_data = this;
obs_register_encoder(&this->info.oei);
PLOG_INFO("Registered encoder #%llX with name '%s' and long name '%s' and caps %llX", avcodec_ptr,
avcodec_ptr->name, avcodec_ptr->long_name, avcodec_ptr->capabilities);
PLOG_DEBUG("Registered encoder #%llX with name '%s' and long name '%s' and caps %llX", avcodec_ptr,
avcodec_ptr->name, avcodec_ptr->long_name, avcodec_ptr->capabilities);
}
const char* encoder::generic_factory::get_name()