2021-10-16 01:26:26 -04:00
|
|
|
|
/**
|
|
|
|
|
|
* @file
|
|
|
|
|
|
* @brief SWIG configuration for libopenshot (to generate Python SWIG bindings)
|
|
|
|
|
|
* @author Jonathan Thomas <jonathan@openshot.org>
|
|
|
|
|
|
*
|
|
|
|
|
|
* @section LICENSE
|
|
|
|
|
|
*/
|
|
|
|
|
|
// Copyright (c) 2008-2019 OpenShot Studios, LLC
|
|
|
|
|
|
//
|
|
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
2022-10-31 14:20:18 -05:00
|
|
|
|
%module("threads"=1) openshot
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
2019-07-12 13:28:47 -04:00
|
|
|
|
/* Suppress warnings about ignored operator= */
|
|
|
|
|
|
%warnfilter(362);
|
|
|
|
|
|
|
2019-09-28 21:43:59 -04:00
|
|
|
|
/* Don't generate multiple wrappers for functions with default args */
|
|
|
|
|
|
%feature("compactdefaultargs", "1");
|
|
|
|
|
|
|
2014-04-10 22:38:01 -05:00
|
|
|
|
/* Enable inline documentation */
|
|
|
|
|
|
%feature("autodoc", "1");
|
|
|
|
|
|
|
|
|
|
|
|
/* Include various SWIG helpers */
|
|
|
|
|
|
%include "typemaps.i"
|
|
|
|
|
|
%include "std_string.i"
|
|
|
|
|
|
%include "std_list.i"
|
|
|
|
|
|
%include "std_vector.i"
|
2018-02-03 01:57:18 -06:00
|
|
|
|
%include "std_map.i"
|
2020-10-18 05:17:27 -04:00
|
|
|
|
%include <stdint.i>
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
|
|
|
|
|
/* Unhandled STL Exception Handling */
|
|
|
|
|
|
%include <std_except.i>
|
|
|
|
|
|
|
2020-10-18 05:11:43 -04:00
|
|
|
|
/* Include shared pointer code */
|
|
|
|
|
|
%include <std_shared_ptr.i>
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
|
|
|
|
|
/* Mark these classes as shared_ptr classes */
|
2016-02-23 01:24:13 -06:00
|
|
|
|
#ifdef USE_IMAGEMAGICK
|
2020-10-18 05:11:43 -04:00
|
|
|
|
%shared_ptr(Magick::Image)
|
2016-02-23 01:24:13 -06:00
|
|
|
|
#endif
|
2021-08-24 04:21:55 -04:00
|
|
|
|
%shared_ptr(juce::AudioBuffer<float>)
|
2020-10-18 05:11:43 -04:00
|
|
|
|
%shared_ptr(openshot::Frame)
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
2021-08-24 04:21:55 -04:00
|
|
|
|
/* Instantiate the required template specializations */
|
2020-12-04 11:26:20 -05:00
|
|
|
|
%template() std::map<std::string, int>;
|
|
|
|
|
|
%template() std::pair<int, int>;
|
|
|
|
|
|
%template() std::vector<int>;
|
2022-10-31 14:20:18 -05:00
|
|
|
|
%template() std::vector<float>;
|
2020-12-04 11:26:20 -05:00
|
|
|
|
%template() std::pair<double, double>;
|
|
|
|
|
|
%template() std::pair<float, float>;
|
2021-08-24 04:21:55 -04:00
|
|
|
|
%template() std::pair<std::string, std::string>;
|
|
|
|
|
|
%template() std::vector<std::pair<std::string, std::string>>;
|
2022-11-01 15:17:03 -05:00
|
|
|
|
%template() std::vector<std::vector<float>>;
|
2020-12-04 11:26:20 -05:00
|
|
|
|
|
2014-04-10 22:38:01 -05:00
|
|
|
|
%{
|
2019-01-26 11:53:08 -05:00
|
|
|
|
/* Ruby and FFmpeg define competing RSHIFT macros,
|
|
|
|
|
|
* so we move Ruby's out of the way for now. We'll
|
|
|
|
|
|
* restore it after dealing with FFmpeg's
|
|
|
|
|
|
*/
|
|
|
|
|
|
#ifdef RSHIFT
|
|
|
|
|
|
#define RB_RSHIFT(a, b) RSHIFT(a, b)
|
|
|
|
|
|
#undef RSHIFT
|
|
|
|
|
|
#endif
|
2019-07-01 12:24:50 -05:00
|
|
|
|
#include "OpenShotVersion.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
#include "ReaderBase.h"
|
|
|
|
|
|
#include "WriterBase.h"
|
2021-08-24 04:21:55 -04:00
|
|
|
|
#include "AudioDevices.h"
|
2022-10-30 22:04:19 -05:00
|
|
|
|
#include "AudioWaveformer.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
#include "CacheBase.h"
|
|
|
|
|
|
#include "CacheDisk.h"
|
|
|
|
|
|
#include "CacheMemory.h"
|
|
|
|
|
|
#include "ChannelLayouts.h"
|
|
|
|
|
|
#include "ChunkReader.h"
|
|
|
|
|
|
#include "ChunkWriter.h"
|
|
|
|
|
|
#include "ClipBase.h"
|
|
|
|
|
|
#include "Clip.h"
|
|
|
|
|
|
#include "Coordinate.h"
|
|
|
|
|
|
#include "Color.h"
|
|
|
|
|
|
#include "DummyReader.h"
|
|
|
|
|
|
#include "EffectBase.h"
|
|
|
|
|
|
#include "Effects.h"
|
|
|
|
|
|
#include "EffectInfo.h"
|
|
|
|
|
|
#include "Enums.h"
|
|
|
|
|
|
#include "Exceptions.h"
|
|
|
|
|
|
#include "FFmpegReader.h"
|
|
|
|
|
|
#include "FFmpegWriter.h"
|
|
|
|
|
|
#include "Fraction.h"
|
|
|
|
|
|
#include "Frame.h"
|
|
|
|
|
|
#include "FrameMapper.h"
|
|
|
|
|
|
#include "PlayerBase.h"
|
|
|
|
|
|
#include "Point.h"
|
|
|
|
|
|
#include "Profiles.h"
|
|
|
|
|
|
#include "QtHtmlReader.h"
|
|
|
|
|
|
#include "QtImageReader.h"
|
|
|
|
|
|
#include "QtPlayer.h"
|
|
|
|
|
|
#include "QtTextReader.h"
|
|
|
|
|
|
#include "KeyFrame.h"
|
|
|
|
|
|
#include "RendererBase.h"
|
|
|
|
|
|
#include "Settings.h"
|
Large refactor of Timeline, TimelineBase, ClipBase, and Clip, to allow a Clip access to the parent timeline instance (if available), and thus, certain properties (preview size, timeline FPS, etc...). This allows for a simpler rendering of Clip keyframes (during the Clip::GetFrame method), and a simpler Timeline class, that can change the preview window size dynamically and no longer requires a Singleton Settings class.
- Also removed "crop" from Clip class, as it was never implmeneted correctly, and we have a fully functional "crop" effect when needed
- Added caching to Clip class, to optimize previewing of cached frames (much faster than previous)
2020-10-04 16:59:21 -05:00
|
|
|
|
#include "TimelineBase.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
#include "Timeline.h"
|
2025-06-06 15:33:43 -05:00
|
|
|
|
#include "Qt/VideoCacheThread.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
#include "ZmqLogger.h"
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
2019-01-26 11:53:08 -05:00
|
|
|
|
/* Move FFmpeg's RSHIFT to FF_RSHIFT, if present */
|
|
|
|
|
|
#ifdef RSHIFT
|
|
|
|
|
|
#define FF_RSHIFT(a, b) RSHIFT(a, b)
|
|
|
|
|
|
#undef RSHIFT
|
|
|
|
|
|
#endif
|
|
|
|
|
|
/* And restore Ruby's RSHIFT, if we captured it */
|
|
|
|
|
|
#ifdef RB_RSHIFT
|
|
|
|
|
|
#define RSHIFT(a, b) RB_RSHIFT(a, b)
|
|
|
|
|
|
#endif
|
2014-04-10 22:38:01 -05:00
|
|
|
|
%}
|
|
|
|
|
|
|
2025-06-06 15:33:43 -05:00
|
|
|
|
// Prevent SWIG from ever generating a wrapper for juce::Thread’s constructor (or run())
|
|
|
|
|
|
%ignore juce::Thread::Thread;
|
|
|
|
|
|
|
2016-02-23 00:27:03 -06:00
|
|
|
|
#ifdef USE_IMAGEMAGICK
|
|
|
|
|
|
%{
|
2020-03-23 08:13:46 -04:00
|
|
|
|
#include "ImageReader.h"
|
|
|
|
|
|
#include "ImageWriter.h"
|
|
|
|
|
|
#include "TextReader.h"
|
2016-02-23 00:27:03 -06:00
|
|
|
|
%}
|
|
|
|
|
|
#endif
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
2021-08-24 04:21:55 -04:00
|
|
|
|
/* Wrap std templates (list, vector, etc...) */
|
|
|
|
|
|
%template(ClipList) std::list<openshot::Clip *>;
|
|
|
|
|
|
%template(EffectBaseList) std::list<openshot::EffectBase *>;
|
|
|
|
|
|
%template(CoordinateVector) std::vector<openshot::Coordinate>;
|
|
|
|
|
|
%template(PointsVector) std::vector<openshot::Point>;
|
|
|
|
|
|
%template(FieldVector) std::vector<openshot::Field>;
|
|
|
|
|
|
%template(MappedFrameVector) std::vector<openshot::MappedFrame>;
|
|
|
|
|
|
%template(MetadataMap) std::map<std::string, std::string>;
|
|
|
|
|
|
|
|
|
|
|
|
/* Deprecated */
|
|
|
|
|
|
%template(AudioDeviceInfoVector) std::vector<openshot::AudioDeviceInfo>;
|
|
|
|
|
|
|
2019-07-01 12:24:50 -05:00
|
|
|
|
%include "OpenShotVersion.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "ReaderBase.h"
|
|
|
|
|
|
%include "WriterBase.h"
|
2021-08-24 04:21:55 -04:00
|
|
|
|
%include "AudioDevices.h"
|
2022-10-30 22:04:19 -05:00
|
|
|
|
%include "AudioWaveformer.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "CacheBase.h"
|
|
|
|
|
|
%include "CacheDisk.h"
|
|
|
|
|
|
%include "CacheMemory.h"
|
|
|
|
|
|
%include "ChannelLayouts.h"
|
|
|
|
|
|
%include "ChunkReader.h"
|
|
|
|
|
|
%include "ChunkWriter.h"
|
|
|
|
|
|
%include "ClipBase.h"
|
|
|
|
|
|
%include "Clip.h"
|
|
|
|
|
|
%include "Coordinate.h"
|
|
|
|
|
|
%include "Color.h"
|
|
|
|
|
|
%include "DummyReader.h"
|
|
|
|
|
|
%include "EffectBase.h"
|
|
|
|
|
|
%include "Effects.h"
|
|
|
|
|
|
%include "EffectInfo.h"
|
|
|
|
|
|
%include "Enums.h"
|
|
|
|
|
|
%include "Exceptions.h"
|
2019-01-26 11:53:08 -05:00
|
|
|
|
|
|
|
|
|
|
/* Ruby and FFmpeg define competing RSHIFT macros,
|
|
|
|
|
|
* so we move Ruby's out of the way for now. We'll
|
|
|
|
|
|
* restore it after dealing with FFmpeg's
|
|
|
|
|
|
*/
|
|
|
|
|
|
#ifdef RSHIFT
|
|
|
|
|
|
#define RB_RSHIFT(a, b) RSHIFT(a, b)
|
|
|
|
|
|
#undef RSHIFT
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "FFmpegReader.h"
|
|
|
|
|
|
%include "FFmpegWriter.h"
|
2019-01-26 11:53:08 -05:00
|
|
|
|
|
|
|
|
|
|
/* Move FFmpeg's RSHIFT to FF_RSHIFT, if present */
|
|
|
|
|
|
#ifdef RSHIFT
|
|
|
|
|
|
#define FF_RSHIFT(a, b) RSHIFT(a, b)
|
|
|
|
|
|
#undef RSHIFT
|
|
|
|
|
|
#endif
|
|
|
|
|
|
/* And restore Ruby's RSHIFT, if we captured it */
|
|
|
|
|
|
#ifdef RB_RSHIFT
|
|
|
|
|
|
#define RSHIFT(a, b) RB_RSHIFT(a, b)
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "Fraction.h"
|
|
|
|
|
|
%include "Frame.h"
|
|
|
|
|
|
%include "FrameMapper.h"
|
|
|
|
|
|
%include "PlayerBase.h"
|
|
|
|
|
|
%include "Point.h"
|
|
|
|
|
|
%include "Profiles.h"
|
|
|
|
|
|
%include "QtHtmlReader.h"
|
|
|
|
|
|
%include "QtImageReader.h"
|
|
|
|
|
|
%include "QtPlayer.h"
|
|
|
|
|
|
%include "QtTextReader.h"
|
|
|
|
|
|
%include "KeyFrame.h"
|
|
|
|
|
|
%include "RendererBase.h"
|
|
|
|
|
|
%include "Settings.h"
|
Large refactor of Timeline, TimelineBase, ClipBase, and Clip, to allow a Clip access to the parent timeline instance (if available), and thus, certain properties (preview size, timeline FPS, etc...). This allows for a simpler rendering of Clip keyframes (during the Clip::GetFrame method), and a simpler Timeline class, that can change the preview window size dynamically and no longer requires a Singleton Settings class.
- Also removed "crop" from Clip class, as it was never implmeneted correctly, and we have a fully functional "crop" effect when needed
- Added caching to Clip class, to optimize previewing of cached frames (much faster than previous)
2020-10-04 16:59:21 -05:00
|
|
|
|
%include "TimelineBase.h"
|
2025-06-06 15:33:43 -05:00
|
|
|
|
%include "Qt/VideoCacheThread.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "Timeline.h"
|
|
|
|
|
|
%include "ZmqLogger.h"
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
2016-02-23 00:27:03 -06:00
|
|
|
|
#ifdef USE_IMAGEMAGICK
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "ImageReader.h"
|
|
|
|
|
|
%include "ImageWriter.h"
|
|
|
|
|
|
%include "TextReader.h"
|
2016-02-23 00:27:03 -06:00
|
|
|
|
#endif
|
|
|
|
|
|
|
2014-04-10 22:38:01 -05:00
|
|
|
|
/* Effects */
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "effects/Bars.h"
|
|
|
|
|
|
%include "effects/Blur.h"
|
|
|
|
|
|
%include "effects/Brightness.h"
|
2020-12-03 10:52:27 -06:00
|
|
|
|
%include "effects/Caption.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "effects/ChromaKey.h"
|
|
|
|
|
|
%include "effects/ColorShift.h"
|
|
|
|
|
|
%include "effects/Crop.h"
|
|
|
|
|
|
%include "effects/Deinterlace.h"
|
|
|
|
|
|
%include "effects/Hue.h"
|
2025-05-28 17:40:47 -05:00
|
|
|
|
%include "effects/LensFlare.h"
|
2020-03-23 08:13:46 -04:00
|
|
|
|
%include "effects/Mask.h"
|
|
|
|
|
|
%include "effects/Negate.h"
|
|
|
|
|
|
%include "effects/Pixelate.h"
|
|
|
|
|
|
%include "effects/Saturation.h"
|
|
|
|
|
|
%include "effects/Shift.h"
|
|
|
|
|
|
%include "effects/Wave.h"
|
2014-04-10 22:38:01 -05:00
|
|
|
|
|
|
|
|
|
|
|