refactor(plugin): de-Qt oakplugin and wrap it in a pure C ABI

- de-Qt src/plugin/src (olivehost/oliveplugininstance/oliveclip/
  paraminstance/image/pluginprogressreporter); QMessageBox/
  QApplication replaced by facade callbacks
- new C ABI in include/plugin/{error,host,instance}.h with
  refcounted OakPluginInstance value handle
- paraminstance bridges via oaknode C ABI (OakNodeNode value handle,
  oaknode_node_identity registry); undo via oakundo C ABI
- oliveclip textures are OakRenderTexture value handles; oakrender
  gains texture/copier/ticket C API additions
- oaknode gains get_input_at_time/set_input_at_time_undoable/
  node_identity/sequence_from_node/sequence_set_default_parameters/
  find_input_footage
- move avframeptr.h to src/common/src (shared by codec and render)
- node transition pluginSupport stubs bridge the real oakplugin
  headers; all oaknode-building standalone trees add src/plugin and
  link oakplugin into their test binaries
- plugin tests self-sufficient (ipc shim, OfxHost force_load,
  PRE_TEST discovery, OCIO env); timeline standalone gains
  render/c_api
- restore ffmpegdecoder.cpp in src/codec/src/ffmpeg/CMakeLists.txt
  (dropped in 3d004c081, caused jump-to-0 in decoder/encoder tests)

All six standalone trees green: codec 22, audio 40, task 110,
render 49, timeline 121, plugin 100.
This commit is contained in:
2026-08-07 22:18:36 +08:00
parent 0462842f8c
commit fd2111d560
54 changed files with 6014 additions and 324 deletions
+3
View File
@@ -52,6 +52,8 @@
#include "alivecount.h"
#include "avframeptr.h"
#include "codec/frame.h"
#include "colorprocessor.h"
#include "texture.h"
@@ -70,6 +72,7 @@ struct OakRenderTextureImpl {
*/
struct OakCodecFrameImpl {
olive::FramePtr ptr;
olive::AVFramePtr avptr; /**< Set when wrapping a texture's CPU copy. */
};
/**
+87
View File
@@ -363,6 +363,9 @@ void *oakrender_codec_frame_data(OakCodecFrame frame)
if (!f || !f->ptr) {
return nullptr;
}
if (f->avptr) {
return f->avptr->data(0);
}
return f->ptr->data();
}
@@ -380,6 +383,9 @@ int oakrender_codec_frame_linesize_bytes(OakCodecFrame frame)
{
OakCodecFrameImpl *f =
oakrender_c_api::to_native<OakCodecFrameImpl>(frame);
if (f && f->avptr) {
return f->avptr->linesize(0);
}
if (!f || !f->ptr) {
return 0;
}
@@ -508,3 +514,84 @@ int oakrender_current_backend(char *buf, int n)
}
return write_string(g_requested_backend, buf, n);
}
int oakrender_display_texture_is_dummy(OakRenderTexture texture)
{
if (!texture.ctx) {
return 0;
}
return oakrender_c_api::to_native<OakRenderTextureImpl>(texture)
->ptr->is_dummy()
? 1
: 0;
}
int oakrender_display_texture_get_frame(OakRenderTexture texture,
OakCodecFrame *out)
{
if (!texture.ctx || !out) {
return OAKRENDER_E_INVALID;
}
*out = OakCodecFrame{};
olive::AVFramePtr frame =
oakrender_c_api::to_native<OakRenderTextureImpl>(texture)->ptr->frame();
if (!frame) {
return OAKRENDER_E_NOT_FOUND;
}
// The texture's CPU copy is an AVFramePtr (ffmpeg_bridge RAII); wrap
// the shared_ptr so the frame stays alive with the handle.
auto *fimpl = new OakCodecFrameImpl;
fimpl->avptr = frame;
*out = oakrender_c_api::make_handle<OakCodecFrame>(
fimpl, true, &oakrender_c_api::delete_as<OakCodecFrameImpl>);
return out->ctx ? OAKRENDER_OK : OAKRENDER_E_NOMEM;
}
OakRenderTexture oakrender_display_texture_wrap_native(
const olive::TexturePtr &texture)
{
if (!texture) {
return OakRenderTexture{};
}
auto *impl = new OakRenderTextureImpl;
impl->ptr = texture;
return oakrender_c_api::make_handle<OakRenderTexture>(
impl, true, &oakrender_c_api::delete_as<OakRenderTextureImpl>);
}
int oakrender_codec_frame_width(OakCodecFrame frame)
{
OakCodecFrameImpl *f =
oakrender_c_api::to_native<OakCodecFrameImpl>(frame);
if (!f) {
return 0;
}
if (f->avptr) {
return f->avptr->width();
}
return f->ptr ? f->ptr->width() : 0;
}
int oakrender_codec_frame_height(OakCodecFrame frame)
{
OakCodecFrameImpl *f =
oakrender_c_api::to_native<OakCodecFrameImpl>(frame);
if (!f) {
return 0;
}
if (f->avptr) {
return f->avptr->height();
}
return f->ptr ? f->ptr->height() : 0;
}
int oakrender_codec_frame_fb_format(OakCodecFrame frame)
{
OakCodecFrameImpl *f =
oakrender_c_api::to_native<OakCodecFrameImpl>(frame);
if (!f || !f->avptr) {
return -1;
}
return f->avptr->format();
}