File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed
Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010### Added
1111
1212- bindings/python : expose video recorder settings
13+ - bindings/python : add function ` hasFfmpegSupport() ` to check if... library was built with FFmpeg support
1314- pixi : separate ` pinocchio ` and ` ffmpeg ` features, add to CI build matrix
1415
1516### Changed
Original file line number Diff line number Diff line change 11from contextlib import contextmanager
2- from . import Visualizer
2+ from . import Visualizer , hasFfmpegSupport
33import warnings
44
5- try :
6- import importlib
7-
8- importlib .import_module ("VideoRecorderSettings" , package = "." )
9- CANDLEWICK_HAS_VIDEO_RECORDER = True
10- except ImportError :
11- CANDLEWICK_HAS_VIDEO_RECORDER = False
12-
135_DEFAULT_VIDEO_SETTINGS = {"fps" : 30 , "bitRate" : 3_000_000 }
146
157__all__ = ["create_recorder_context" ]
@@ -23,7 +15,7 @@ def create_recorder_context(
2315 fps : int = _DEFAULT_VIDEO_SETTINGS ["fps" ],
2416 bitRate : int = _DEFAULT_VIDEO_SETTINGS ["bitRate" ],
2517):
26- if not CANDLEWICK_HAS_VIDEO_RECORDER :
18+ if not hasFfmpegSupport () :
2719 warnings .warn (
2820 "This context will do nothing, as Candlewick was built without video recording support."
2921 )
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ BOOST_PYTHON_MODULE(pycandlewick) {
2626 }
2727 bp::def (" setShadersDirectory" , &setShadersDirectory, (" path" _a));
2828 bp::def (" currentShaderDirectory" , ¤tShaderDirectory);
29+ bp::def (
30+ " hasFfmpegSupport" , +[] {
31+ #ifdef CANDLEWICK_WITH_FFMPEG_SUPPORT
32+ return true ;
33+ #else
34+ return false ;
35+ #endif
36+ });
2937
3038 // Register SDL_Quit() as a function to call when interpreter exits.
3139 Py_AtExit (SDL_Quit);
You can’t perform that action at this time.
0 commit comments