Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for custom adapter hooks #1711

Conversation

timlehr
Copy link
Contributor

@timlehr timlehr commented Mar 13, 2024

Summarize your change.

This adds support for attributing custom hooks to adapters and executing them with hook_function_argument_map being passed along through the adapter IO functions.

Describe the reason for the change.

I added two custom hooks to the OTIO AAF adapter (OpenTimelineIO/otio-aaf-adapter#43), allowing for embedding of media essence into the resulting AAF. This was needed to facilitate just-in-time DNXHR transcoding of the media for the AAF creation and adding a certain level of control and flexibility to the feature.

These features to the core are required in order to properly pass the hook argument map along to potential custom hooks run by the adapter. I tried to work with _FEATURE_MAP instead of creating a new version of the Adapter schema in order to minimize the impact of this change, while adding the necessary changes to facilitate custom hooks for adapters.

Reference associated tests.

tests/test_adapter_plugin.py
tests/test_hooks_plugins.py

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 90.90909% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 74.20%. Comparing base (134b9b2) to head (f6b309e).

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                  @@
##           extract_adapters    #1711      +/-   ##
====================================================
+ Coverage             74.16%   74.20%   +0.04%     
====================================================
  Files                   175      176       +1     
  Lines                 12056    12091      +35     
  Branches               2789     2794       +5     
====================================================
+ Hits                   8941     8972      +31     
- Misses                 1356     1358       +2     
- Partials               1759     1761       +2     
Flag Coverage Δ
py-unittests 74.20% <90.90%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...sts/baselines/custom_adapter_hookscript_example.py 100.00% <100.00%> (ø)
tests/baselines/example.py 100.00% <100.00%> (ø)
tests/test_adapter_plugin.py 87.83% <100.00%> (+0.08%) ⬆️
tests/test_hooks_plugins.py 98.01% <100.00%> (+0.29%) ⬆️
...-opentimelineio/opentimelineio/adapters/adapter.py 78.37% <73.33%> (-1.63%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 134b9b2...f6b309e. Read the comment docs.

@timlehr
Copy link
Contributor Author

timlehr commented Mar 20, 2024

@ssteinbach If you could have a look at this sometime, that'd be wonderful. See OpenTimelineIO/otio-aaf-adapter#43 for why this is needed.

apetrynet and others added 14 commits April 4, 2024 15:38
…SoftwareFoundation#1488)

* add "extract_adapters" to CI triggers
* use "otiod" as override example

Signed-off-by: apetrynet <[email protected]>
…oftwareFoundation#1487)

* Removed the cmx_3600 adapter
* Removed sample data only used by the cmx_3600 adapter
* Add "extract_adapters" to CI triggers
* otioz test called for an edl we removed. Replaced with an otio file
* Converted screening_example.edl to screening_example.otio and used it in tests
* Removed other adapter suffixes from plugin tests as they belong to adapters soon to be extracted
* Autogenerated docs for CMX3600 removed

Signed-off-by: apetrynet <[email protected]>
…cademySoftwareFoundation#1348)

* Remove AAF adapter
* Add Note about the AAF adapter being moved

Signed-off-by: Mark Reid <[email protected]>
* removing the fcp adapter and it's test files
* replaced premiere_example.xml with premiere_example.otio to pass console tests.
* updated auto generated docs

Signed-off-by: apetrynet <[email protected]>
* removed svg adapter and related test files
* updated auto documentation

Signed-off-by: apetrynet <[email protected]>
…n#1520)

* Remove maya adapter related files
* Update docs

Signed-off-by: rosborne132 <[email protected]>
* remove fcp x xml adapter files
* update docs

Signed-off-by: rosborne132 <[email protected]>
* remove ale adapter related files

Signed-off-by: rosborne132 <[email protected]>
* extract burnin files
* remove test

Signed-off-by: rosborne132 <[email protected]>
* extract xges adapter files

Signed-off-by: rosborne132 <[email protected]>
* Removed the "contrib" directory tree and all references to the contrib adapters.
* Plugin system, setup and auto doc scripts no longer rely on contrib files.
* Also removed some entries on other adapters left behind in the adapters.md file.
* add README_contrib.md to the manifest

Signed-off-by: apetrynet <[email protected]>
@reinecke
Copy link
Collaborator

reinecke commented Apr 4, 2024

@timlehr Can you switch the base branch in this PR to the new extract_adapters_post_beta_16 branch - that one was rebased on the main branch after the beta 16 release.

@timlehr timlehr changed the base branch from extract_adapters to extract_adapters_post_beta_16 April 4, 2024 23:37
This adds support for attributing custom hooks to adapters and executing them with `hook_function_argument_map` being passed along through the adapter IO functions.

Signed-off-by: Tim Lehr <[email protected]>
@timlehr timlehr force-pushed the adapterHooks_tlehr branch from f6b309e to 31c51db Compare April 4, 2024 23:46
@timlehr
Copy link
Contributor Author

timlehr commented Apr 4, 2024

@reinecke Just rebased the code!

@reinecke reinecke force-pushed the extract_adapters_post_beta_16 branch 2 times, most recently from fbe098e to 7f09945 Compare April 12, 2024 05:22
@ssteinbach
Copy link
Collaborator

ssteinbach commented Apr 18, 2024

@reinecke @timlehr did the rebase capture too much stuff? It seems like there is a lot in here -- or did the base change w/o/ rebasing?

(sorry, accidentally closed/reopened the PR)

@ssteinbach ssteinbach closed this Apr 18, 2024
@ssteinbach ssteinbach reopened this Apr 18, 2024
@timlehr
Copy link
Contributor Author

timlehr commented Apr 18, 2024

@ssteinbach Seems like there were force-pushes to the extract_adapters_post_beta_16 branch after I rebased, so I will have to do that again.

@reinecke reinecke force-pushed the extract_adapters_post_beta_16 branch 2 times, most recently from 96a5a1a to 58b11c7 Compare June 12, 2024 21:26
@reinecke reinecke force-pushed the extract_adapters_post_beta_16 branch from 9d33bd3 to b052e57 Compare June 12, 2024 23:17
@reinecke reinecke deleted the branch AcademySoftwareFoundation:extract_adapters_post_beta_16 June 12, 2024 23:38
@reinecke reinecke closed this Jun 12, 2024
@timlehr timlehr deleted the adapterHooks_tlehr branch October 8, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants