ui/handler: Add ability to override UI name

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-07-24 20:03:44 +02:00
parent 7c3e313bcd
commit c8f3f9201c
3 changed files with 11 additions and 0 deletions
+4
View File
@@ -76,6 +76,10 @@ void obsffmpeg::encoder_factory::register_encoder()
sstr << " [" << caps << "]";
}
this->info.readable_name = sstr.str();
// Allow UI Handler to replace visible name.
obsffmpeg::find_codec_handler(this->avcodec_ptr->name)
->override_visible_name(this->avcodec_ptr, this->info.readable_name);
}
// Assign Ids.
+2
View File
@@ -20,3 +20,5 @@
// SOFTWARE.
#include "handler.hpp"
void obsffmpeg::ui::handler::override_visible_name(AVCodec* codec, std::string& name) {}
+5
View File
@@ -21,7 +21,10 @@
#pragma once
#include <string>
extern "C" {
#include <obs-data.h>
#include <obs-properties.h>
#pragma warning(push)
#pragma warning(disable : 4244)
@@ -33,6 +36,8 @@ namespace obsffmpeg {
namespace ui {
class handler {
public:
virtual void override_visible_name(AVCodec* codec, std::string& name);
virtual void get_defaults(obs_data_t* settings, AVCodec* codec, AVCodecContext* context) = 0;
virtual void get_properties(obs_properties_t* props, AVCodec* codec,