refactor(node): switch oaknode to refcounted value handles, migrate consumers
- all 15 OakNode* handle types become neutral by-value structs
{ctx, addref, release, abi_version}; shared box in
src/node/c_api/nodehandle.h with owns flag (borrowed accessors
return non-owning boxes; graph insertion flips owns off)
- oaktimeline/oaktask/oakrender call sites and their own public
headers migrated to value handles; identity comparisons in
timeline/task now compare native pointers
- regressions green: oaknode 96, oaktimeline 117, oaktask 106,
oakrender 44, oakcommon 193, oakcodec 18, oakaudio 36
This commit is contained in:
+28
-19
@@ -41,18 +41,21 @@ extern "C" {
|
||||
/** @brief olive::ProjectLoadTask. */
|
||||
OakTaskTask *oaktask_create_project_load(const char *filename);
|
||||
|
||||
/** @brief Take the loaded project (ownership transfer). */
|
||||
OakNodeProject *oaktask_load_take_project(OakTaskTask *t);
|
||||
/** @brief Take the loaded project (ownership transfer). Empty handle
|
||||
* (ctx == NULL) when the task has not succeeded or the project was
|
||||
* already taken. */
|
||||
OakNodeProject oaktask_load_take_project(OakTaskTask *t);
|
||||
|
||||
/** @brief olive::ProjectSaveTask. `filename_or_NULL` overrides the
|
||||
* project's own filename. */
|
||||
OakTaskTask *oaktask_create_project_save(OakNodeProject *project,
|
||||
* project's own filename. `project` is borrowed by the task. */
|
||||
OakTaskTask *oaktask_create_project_save(OakNodeProject project,
|
||||
const char *filename_or_NULL,
|
||||
int use_compression);
|
||||
|
||||
/** @brief olive::ProjectImportTask. */
|
||||
OakTaskTask *oaktask_create_project_import(OakNodeFolder *folder,
|
||||
OakNodeProject *project,
|
||||
/** @brief olive::ProjectImportTask. `folder`/`project` are borrowed by
|
||||
* the task. */
|
||||
OakTaskTask *oaktask_create_project_import(OakNodeFolder folder,
|
||||
OakNodeProject project,
|
||||
const char *const *urls,
|
||||
int url_count);
|
||||
|
||||
@@ -61,8 +64,10 @@ OakUndoCommand oaktask_import_take_command(OakTaskTask *t);
|
||||
|
||||
int oaktask_import_footage_count(OakTaskTask *t);
|
||||
|
||||
/** @brief Borrowed footage handle at index, NULL when out of range. */
|
||||
OakNodeFootage *oaktask_import_footage_at(OakTaskTask *t, int index);
|
||||
/** @brief Footage handle at index (addref'd; release with
|
||||
* handle.release(handle.ctx) - box only, the project owns the
|
||||
* footage). Empty handle when out of range. */
|
||||
OakNodeFootage oaktask_import_footage_at(OakTaskTask *t, int index);
|
||||
|
||||
int oaktask_import_invalid_count(OakTaskTask *t);
|
||||
|
||||
@@ -73,11 +78,13 @@ int oaktask_import_invalid_at(OakTaskTask *t, int index, char *buf,
|
||||
/** @brief olive::LoadOTIOTask. */
|
||||
OakTaskTask *oaktask_create_project_load_otio(const char *filename);
|
||||
|
||||
/** @brief Take the loaded project (ownership transfer). */
|
||||
OakNodeProject *oaktask_load_otio_take_project(OakTaskTask *t);
|
||||
/** @brief Take the loaded project (ownership transfer). Empty handle
|
||||
* (ctx == NULL) when the task has not succeeded or the project was
|
||||
* already taken. */
|
||||
OakNodeProject oaktask_load_otio_take_project(OakTaskTask *t);
|
||||
|
||||
/** @brief olive::SaveOTIOTask. */
|
||||
OakTaskTask *oaktask_create_project_save_otio(OakNodeProject *project,
|
||||
/** @brief olive::SaveOTIOTask. `project` is borrowed by the task. */
|
||||
OakTaskTask *oaktask_create_project_save_otio(OakNodeProject project,
|
||||
const char *filename);
|
||||
|
||||
/**
|
||||
@@ -89,13 +96,15 @@ typedef int (*oaktask_otio_import_confirm_fn)(
|
||||
void oaktask_load_otio_set_confirm_cb(oaktask_otio_import_confirm_fn fn,
|
||||
void *userdata);
|
||||
|
||||
/** @brief olive::PreCacheTask. */
|
||||
OakTaskTask *oaktask_create_precache(OakNodeFootage *footage, int index,
|
||||
OakNodeSequence *sequence);
|
||||
/** @brief olive::PreCacheTask. `footage`/`sequence` are borrowed by the
|
||||
* task. */
|
||||
OakTaskTask *oaktask_create_precache(OakNodeFootage footage, int index,
|
||||
OakNodeSequence sequence);
|
||||
|
||||
/** @brief olive::ExportTask (params POD from codec/encoder.h). */
|
||||
OakTaskTask *oaktask_create_export(OakNodeNode *viewer,
|
||||
OakNodeColorManager *color_manager,
|
||||
/** @brief olive::ExportTask (params POD from codec/encoder.h).
|
||||
* `viewer`/`color_manager` are borrowed by the task. */
|
||||
OakTaskTask *oaktask_create_export(OakNodeNode viewer,
|
||||
OakNodeColorManager color_manager,
|
||||
const oakcodec_encoding_params *params);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user