VapourSynth 66__zip → 71__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {VapourSynth-66/VapourSynth.egg-info → vapoursynth-71}/PKG-INFO +11 -2
  2. vapoursynth-71/VAPOURSYNTH_VERSION +1 -0
  3. {VapourSynth-66 → vapoursynth-71/VapourSynth.egg-info}/PKG-INFO +11 -2
  4. {VapourSynth-66 → vapoursynth-71}/VapourSynth.egg-info/SOURCES.txt +0 -10
  5. {VapourSynth-66 → vapoursynth-71}/include/VSScript4.h +12 -0
  6. {VapourSynth-66 → vapoursynth-71}/include/VapourSynth4.h +8 -0
  7. {VapourSynth-66 → vapoursynth-71}/setup.py +1 -1
  8. {VapourSynth-66 → vapoursynth-71}/src/cython/vapoursynth.c +18637 -32560
  9. {VapourSynth-66 → vapoursynth-71}/src/cython/vapoursynth.pxd +106 -100
  10. {VapourSynth-66 → vapoursynth-71}/src/cython/vapoursynth.pyx +204 -31
  11. vapoursynth-71/src/cython/vsconstants.pxd +150 -0
  12. {VapourSynth-66 → vapoursynth-71}/src/vsscript/vsscript_internal.h +1 -1
  13. VapourSynth-66/VAPOURSYNTH_VERSION +0 -1
  14. VapourSynth-66/src/cython/vsconstants.pxd +0 -84
  15. VapourSynth-66/test/__pycache__/async_test.cpython-312.pyc +0 -0
  16. VapourSynth-66/test/__pycache__/environment_test.cpython-312.pyc +0 -0
  17. VapourSynth-66/test/__pycache__/expr_test.cpython-312.pyc +0 -0
  18. VapourSynth-66/test/__pycache__/filter_test.cpython-312.pyc +0 -0
  19. VapourSynth-66/test/__pycache__/log_test.cpython-312.pyc +0 -0
  20. VapourSynth-66/test/__pycache__/lut_test.cpython-312.pyc +0 -0
  21. VapourSynth-66/test/__pycache__/prop_dict_test.cpython-312.pyc +0 -0
  22. VapourSynth-66/test/__pycache__/test.cpython-312.pyc +0 -0
  23. VapourSynth-66/test/__pycache__/weakref_test.cpython-312.pyc +0 -0
  24. VapourSynth-66/test/__pycache__/zimgtest.cpython-312.pyc +0 -0
  25. {VapourSynth-66 → vapoursynth-71}/COPYING.LESSER +0 -0
  26. {VapourSynth-66 → vapoursynth-71}/MANIFEST.in +0 -0
  27. {VapourSynth-66 → vapoursynth-71}/README.md +0 -0
  28. {VapourSynth-66 → vapoursynth-71}/VapourSynth.egg-info/dependency_links.txt +0 -0
  29. {VapourSynth-66 → vapoursynth-71}/VapourSynth.egg-info/top_level.txt +0 -0
  30. {VapourSynth-66 → vapoursynth-71}/include/VSConstants4.h +0 -0
  31. {VapourSynth-66 → vapoursynth-71}/include/VSHelper.h +0 -0
  32. {VapourSynth-66 → vapoursynth-71}/include/VSHelper4.h +0 -0
  33. {VapourSynth-66 → vapoursynth-71}/include/VSScript.h +0 -0
  34. {VapourSynth-66 → vapoursynth-71}/include/VapourSynth.h +0 -0
  35. {VapourSynth-66 → vapoursynth-71}/setup.cfg +0 -0
  36. {VapourSynth-66 → vapoursynth-71}/src/cython/vsscript.pxd +0 -0
  37. {VapourSynth-66 → vapoursynth-71}/src/cython/vsscript_internal.pxd +0 -0
  38. {VapourSynth-66 → vapoursynth-71}/test/async_test.py +0 -0
  39. {VapourSynth-66 → vapoursynth-71}/test/environment_test.py +0 -0
  40. {VapourSynth-66 → vapoursynth-71}/test/expr_compiler/compiler_test.py +0 -0
  41. {VapourSynth-66 → vapoursynth-71}/test/expr_compiler/havs_exprs.txt +0 -0
  42. {VapourSynth-66 → vapoursynth-71}/test/expr_compiler/muvs_exprs.txt +0 -0
  43. {VapourSynth-66 → vapoursynth-71}/test/expr_compiler/reference_output.txt +0 -0
  44. {VapourSynth-66 → vapoursynth-71}/test/expr_test.py +0 -0
  45. {VapourSynth-66 → vapoursynth-71}/test/filter_test.py +0 -0
  46. {VapourSynth-66 → vapoursynth-71}/test/log_test.py +0 -0
  47. {VapourSynth-66 → vapoursynth-71}/test/lut_test.py +0 -0
  48. {VapourSynth-66 → vapoursynth-71}/test/prop_dict_test.py +0 -0
  49. {VapourSynth-66 → vapoursynth-71}/test/test.py +0 -0
  50. {VapourSynth-66 → vapoursynth-71}/test/weakref_test.py +0 -0
  51. {VapourSynth-66 → vapoursynth-71}/test/zimgtest.py +0 -0
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2012-2020 Fredrik Mellbin
2
+ # Copyright (c) 2012-2025 Fredrik Mellbin
3
3
  #
4
4
  # This file is part of VapourSynth.
5
5
  #
@@ -48,76 +48,82 @@ cdef extern from "include/VapourSynth4.h" nogil:
48
48
  ctypedef struct VSFrameContext:
49
49
  pass
50
50
 
51
- cpdef enum MediaType "VSMediaType":
52
- VIDEO "mtVideo"
53
- AUDIO "mtAudio"
54
-
55
- cpdef enum ColorFamily "VSColorFamily":
56
- UNDEFINED "cfUndefined"
57
- GRAY "cfGray"
58
- RGB "cfRGB"
59
- YUV "cfYUV"
60
-
61
- cpdef enum SampleType "VSSampleType":
62
- INTEGER "stInteger"
63
- FLOAT "stFloat"
64
-
65
- cpdef enum PresetVideoFormat "VSPresetVideoFormat":
66
- NONE "pfNone"
67
-
68
- GRAY8 "pfGray8"
69
- GRAY9 "pfGray9"
70
- GRAY10 "pfGray10"
71
- GRAY12 "pfGray12"
72
- GRAY14 "pfGray14"
73
- GRAY16 "pfGray16"
74
- GRAY32 "pfGray32"
75
-
76
- GRAYH "pfGrayH"
77
- GRAYS "pfGrayS"
78
-
79
- YUV410P8 "pfYUV410P8"
80
- YUV411P8 "pfYUV411P8"
81
- YUV440P8 "pfYUV440P8"
82
-
83
- YUV420P8 "pfYUV420P8"
84
- YUV422P8 "pfYUV422P8"
85
- YUV444P8 "pfYUV444P8"
86
-
87
- YUV420P9 "pfYUV420P9"
88
- YUV422P9 "pfYUV422P9"
89
- YUV444P9 "pfYUV444P9"
90
-
91
- YUV420P10 "pfYUV420P10"
92
- YUV422P10 "pfYUV422P10"
93
- YUV444P10 "pfYUV444P10"
94
-
95
- YUV420P12 "pfYUV420P12"
96
- YUV422P12 "pfYUV422P12"
97
- YUV444P12 "pfYUV444P12"
98
-
99
- YUV420P14 "pfYUV420P14"
100
- YUV422P14 "pfYUV422P14"
101
- YUV444P14 "pfYUV444P14"
102
-
103
- YUV420P16 "pfYUV420P16"
104
- YUV422P16 "pfYUV422P16"
105
- YUV444P16 "pfYUV444P16"
51
+ enum:
52
+ mtVideo
53
+ mtAudio
106
54
 
107
- YUV444PH "pfYUV444PH"
108
- YUV444PS "pfYUV444PS"
55
+ enum:
56
+ cfUndefined
57
+ cfGray
58
+ cfRGB
59
+ cfYUV
109
60
 
110
- RGB24 "pfRGB24"
111
- RGB27 "pfRGB27"
112
- RGB30 "pfRGB30"
113
- RGB36 "pfRGB36"
114
- RGB42 "pfRGB42"
115
- RGB48 "pfRGB48"
61
+ enum:
62
+ stInteger
63
+ stFloat
116
64
 
117
- RGBH "pfRGBH"
118
- RGBS "pfRGBS"
65
+ enum:
66
+ pfNone
67
+
68
+ pfGray8
69
+ pfGray9
70
+ pfGray10
71
+ pfGray12
72
+ pfGray14
73
+ pfGray16
74
+ pfGray32
75
+
76
+ pfGrayH
77
+ pfGrayS
78
+
79
+ pfYUV410P8
80
+ pfYUV411P8
81
+ pfYUV440P8
82
+
83
+ pfYUV420P8
84
+ pfYUV422P8
85
+ pfYUV444P8
86
+
87
+ pfYUV420P9
88
+ pfYUV422P9
89
+ pfYUV444P9
90
+
91
+ pfYUV420P10
92
+ pfYUV422P10
93
+ pfYUV444P10
94
+
95
+ pfYUV420P12
96
+ pfYUV422P12
97
+ pfYUV444P12
98
+
99
+ pfYUV420P14
100
+ pfYUV422P14
101
+ pfYUV444P14
102
+
103
+ pfYUV420P16
104
+ pfYUV422P16
105
+ pfYUV444P16
106
+
107
+ pfYUV420PH
108
+ pfYUV420PS
109
+
110
+ pfYUV422PH
111
+ pfYUV422PS
112
+
113
+ pfYUV444PH
114
+ pfYUV444PS
115
+
116
+ pfRGB24
117
+ pfRGB27
118
+ pfRGB30
119
+ pfRGB36
120
+ pfRGB42
121
+ pfRGB48
122
+
123
+ pfRGBH
124
+ pfRGBS
119
125
 
120
- cpdef enum FilterMode "VSFilterMode":
126
+ enum:
121
127
  fmParallel
122
128
  fmParallelRequests
123
129
  fmUnordered
@@ -132,32 +138,32 @@ cdef extern from "include/VapourSynth4.h" nogil:
132
138
  int subSamplingH
133
139
  int numPlanes
134
140
 
135
- cpdef enum AudioChannels "VSAudioChannels":
136
- FRONT_LEFT "acFrontLeft"
137
- FRONT_RIGHT "acFrontRight"
138
- FRONT_CENTER "acFrontCenter"
139
- LOW_FREQUENCY "acLowFrequency"
140
- BACK_LEFT "acBackLeft"
141
- BACK_RIGHT "acBackRight"
142
- FRONT_LEFT_OF_CENTER "acFrontLeftOFCenter"
143
- FRONT_RIGHT_OF_CENTER "acFrontRightOFCenter"
144
- BACK_CENTER "acBackCenter"
145
- SIDE_LEFT "acSideLeft"
146
- SIDE_RIGHT "acSideRight"
147
- TOP_CENTER "acTopCenter"
148
- TOP_FRONT_LEFT "acTopFrontLeft"
149
- TOP_FRONT_CENTER "acTopFrontCenter"
150
- TOP_FRONT_RIGHT "acTopFrontRight"
151
- TOP_BACK_LEFT "acTopBackLeft"
152
- TOP_BACK_CENTER "acTopBackCenter"
153
- TOP_BACK_RIGHT "acTopBackRight"
154
- STEREO_LEFT "acStereoLeft"
155
- STEREO_RIGHT "acStereoRight"
156
- WIDE_LEFT "acWideLeft"
157
- WIDE_RIGHT "acWideRight"
158
- SURROUND_DIRECT_LEFT "acSurroundDirectLeft"
159
- SURROUND_DIRECT_RIGHT "acSurroundDirectRight"
160
- LOW_FREQUENCY2 "acLowFrequency2"
141
+ enum:
142
+ acFrontLeft
143
+ acFrontRight
144
+ acFrontCenter
145
+ acLowFrequency
146
+ acBackLeft
147
+ acBackRight
148
+ acFrontLeftOFCenter
149
+ acFrontRightOFCenter
150
+ acBackCenter
151
+ acSideLeft
152
+ acSideRight
153
+ acTopCenter
154
+ acTopFrontLeft
155
+ acTopFrontCenter
156
+ acTopFrontRight
157
+ acTopBackLeft
158
+ acTopBackCenter
159
+ acTopBackRight
160
+ acStereoLeft
161
+ acStereoRight
162
+ acWideLeft
163
+ acWideRight
164
+ acSurroundDirectLeft
165
+ acSurroundDirectRight
166
+ acLowFrequency2
161
167
 
162
168
  ctypedef struct VSAudioFormat:
163
169
  int sampleType
@@ -215,14 +221,14 @@ cdef extern from "include/VapourSynth4.h" nogil:
215
221
  arAllFramesReady
216
222
  arError
217
223
 
218
- cpdef enum MessageType "VSMessageType":
219
- MESSAGE_TYPE_DEBUG "mtDebug"
220
- MESSAGE_TYPE_INFORMATION "mtInformation"
221
- MESSAGE_TYPE_WARNING "mtWarning"
222
- MESSAGE_TYPE_CRITICAL "mtCritical"
223
- MESSAGE_TYPE_FATAL "mtFatal"
224
+ enum:
225
+ mtDebug
226
+ mtInformation
227
+ mtWarning
228
+ mtCritical
229
+ mtFatal
224
230
 
225
- cpdef enum CoreCreationFlags "VSCoreCreationFlags":
231
+ enum:
226
232
  ccfEnableGraphInspection
227
233
  ccfDisableAutoLoading
228
234
  ccfDisableLibraryUnloading
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2012-2021 Fredrik Mellbin
1
+ # Copyright (c) 2012-2025 Fredrik Mellbin
2
2
  #
3
3
  # This file is part of VapourSynth.
4
4
  #
@@ -66,7 +66,7 @@ __all__ = [
66
66
  'YUV420P8', 'YUV420P9', 'YUV420P10', 'YUV420P12', 'YUV420P14', 'YUV420P16',
67
67
  'YUV422P8', 'YUV422P9', 'YUV422P10', 'YUV422P12', 'YUV422P14', 'YUV422P16',
68
68
  'YUV440P8',
69
- 'YUV444P8', 'YUV444P9', 'YUV444P10', 'YUV444P12', 'YUV444P14', 'YUV444P16', 'YUV444PH', 'YUV444PS',
69
+ 'YUV444P8', 'YUV444P9', 'YUV444P10', 'YUV444P12', 'YUV444P14', 'YUV444P16', 'YUV420PH', 'YUV420PS', 'YUV422PH', 'YUV422PS', 'YUV444PH', 'YUV444PS',
70
70
  'NONE',
71
71
 
72
72
  'FLOAT', 'INTEGER',
@@ -83,6 +83,144 @@ __all__ = [
83
83
  'core',
84
84
  ]
85
85
 
86
+ class MediaType(IntEnum):
87
+ VIDEO = mtVideo
88
+ AUDIO = mtAudio
89
+
90
+ class ColorFamily(IntEnum):
91
+ UNDEFINED = cfUndefined
92
+ GRAY = cfGray
93
+ RGB = cfRGB
94
+ YUV = cfYUV
95
+
96
+ class SampleType(IntEnum):
97
+ INTEGER = stInteger
98
+ FLOAT = stFloat
99
+
100
+ class PresetVideoFormat(IntEnum):
101
+ NONE = pfNone
102
+
103
+ GRAY8 = pfGray8
104
+ GRAY9 = pfGray9
105
+ GRAY10 = pfGray10
106
+ GRAY12 = pfGray12
107
+ GRAY14 = pfGray14
108
+ GRAY16 = pfGray16
109
+ GRAY32 = pfGray32
110
+
111
+ GRAYH = pfGrayH
112
+ GRAYS = pfGrayS
113
+
114
+ YUV410P8 = pfYUV410P8
115
+ YUV411P8 = pfYUV411P8
116
+ YUV440P8 = pfYUV440P8
117
+
118
+ YUV420P8 = pfYUV420P8
119
+ YUV422P8 = pfYUV422P8
120
+ YUV444P8 = pfYUV444P8
121
+
122
+ YUV420P9 = pfYUV420P9
123
+ YUV422P9 = pfYUV422P9
124
+ YUV444P9 = pfYUV444P9
125
+
126
+ YUV420P10 = pfYUV420P10
127
+ YUV422P10 = pfYUV422P10
128
+ YUV444P10 = pfYUV444P10
129
+
130
+ YUV420P12 = pfYUV420P12
131
+ YUV422P12 = pfYUV422P12
132
+ YUV444P12 = pfYUV444P12
133
+
134
+ YUV420P14 = pfYUV420P14
135
+ YUV422P14 = pfYUV422P14
136
+ YUV444P14 = pfYUV444P14
137
+
138
+ YUV420P16 = pfYUV420P16
139
+ YUV422P16 = pfYUV422P16
140
+ YUV444P16 = pfYUV444P16
141
+
142
+ YUV420PH = pfYUV420PH
143
+ YUV420PS = pfYUV420PS
144
+
145
+ YUV422PH = pfYUV422PH
146
+ YUV422PS = pfYUV422PS
147
+
148
+ YUV444PH = pfYUV444PH
149
+ YUV444PS = pfYUV444PS
150
+
151
+ RGB24 = pfRGB24
152
+ RGB27 = pfRGB27
153
+ RGB30 = pfRGB30
154
+ RGB36 = pfRGB36
155
+ RGB42 = pfRGB42
156
+ RGB48 = pfRGB48
157
+
158
+ RGBH = pfRGBH
159
+ RGBS = pfRGBS
160
+
161
+ class FilterMode(IntEnum):
162
+ PARALLEL = fmParallel
163
+ PARALLEL_REQUESTS = fmParallelRequests
164
+ UNORDERED = fmUnordered
165
+ FRAME_STATE = fmFrameState
166
+
167
+ class AudioChannels(IntEnum):
168
+ FRONT_LEFT = acFrontLeft
169
+ FRONT_RIGHT = acFrontRight
170
+ FRONT_CENTER = acFrontCenter
171
+ LOW_FREQUENCY = acLowFrequency
172
+ BACK_LEFT = acBackLeft
173
+ BACK_RIGHT = acBackRight
174
+ FRONT_LEFT_OF_CENTER = acFrontLeftOFCenter
175
+ FRONT_RIGHT_OF_CENTER = acFrontRightOFCenter
176
+ BACK_CENTER = acBackCenter
177
+ SIDE_LEFT = acSideLeft
178
+ SIDE_RIGHT = acSideRight
179
+ TOP_CENTER = acTopCenter
180
+ TOP_FRONT_LEFT = acTopFrontLeft
181
+ TOP_FRONT_CENTER = acTopFrontCenter
182
+ TOP_FRONT_RIGHT = acTopFrontRight
183
+ TOP_BACK_LEFT = acTopBackLeft
184
+ TOP_BACK_CENTER = acTopBackCenter
185
+ TOP_BACK_RIGHT = acTopBackRight
186
+ STEREO_LEFT = acStereoLeft
187
+ STEREO_RIGHT = acStereoRight
188
+ WIDE_LEFT = acWideLeft
189
+ WIDE_RIGHT = acWideRight
190
+ SURROUND_DIRECT_LEFT = acSurroundDirectLeft
191
+ SURROUND_DIRECT_RIGHT = acSurroundDirectRight
192
+ LOW_FREQUENCY2 = acLowFrequency2
193
+
194
+ class MessageType(IntFlag):
195
+ MESSAGE_TYPE_DEBUG = mtDebug
196
+ MESSAGE_TYPE_INFORMATION = mtInformation
197
+ MESSAGE_TYPE_WARNING = mtWarning
198
+ MESSAGE_TYPE_CRITICAL = mtCritical
199
+ MESSAGE_TYPE_FATAL = mtFatal
200
+
201
+ class CoreCreationFlags(IntFlag):
202
+ ENABLE_GRAPH_INSPECTION = ccfEnableGraphInspection
203
+ DISABLE_AUTO_LOADING = ccfDisableAutoLoading
204
+ DISABLE_LIBRARY_UNLOADING = ccfDisableLibraryUnloading
205
+
206
+ # In this file
207
+ globals().update(MediaType.__members__)
208
+ globals().update(ColorFamily.__members__)
209
+ globals().update(SampleType.__members__)
210
+ globals().update(PresetVideoFormat.__members__)
211
+ globals().update(FilterMode.__members__)
212
+ globals().update(AudioChannels.__members__)
213
+ globals().update(MessageType.__members__)
214
+ globals().update(CoreCreationFlags.__members__)
215
+
216
+ # From vsconstants.pxd
217
+ globals().update(ColorRange.__members__)
218
+ globals().update(ChromaLocation.__members__)
219
+ globals().update(FieldBased.__members__)
220
+ globals().update(MatrixCoefficients.__members__)
221
+ globals().update(TransferCharacteristics.__members__)
222
+ globals().update(ColorPrimaries.__members__)
223
+
86
224
  class VapourSynthVersion(typing.NamedTuple):
87
225
  release_major: int
88
226
  release_minor: int
@@ -103,7 +241,6 @@ class VapourSynthAPIVersion(typing.NamedTuple):
103
241
  __version__ = VapourSynthVersion(VS_CURRENT_RELEASE, 0)
104
242
  __api_version__ = VapourSynthAPIVersion(VAPOURSYNTH_API_MAJOR, VAPOURSYNTH_API_MINOR)
105
243
 
106
-
107
244
  @final
108
245
  cdef class EnvironmentData(object):
109
246
  cdef bint alive
@@ -218,7 +355,7 @@ cdef void _unset_logger(EnvironmentData env):
218
355
  cdef void __stdcall _logCb(int msgType, const char *msg, void *userData) noexcept nogil:
219
356
  with gil:
220
357
  message = msg.decode("utf-8")
221
- (<object>userData)(MessageType(msgType), message)
358
+ (<object>userData)(msgType, message)
222
359
 
223
360
  cdef void __stdcall _logFree(void* userData) noexcept nogil:
224
361
  with gil:
@@ -343,7 +480,7 @@ def _try_enable_introspection(version=None):
343
480
  return False
344
481
 
345
482
  cdef StandaloneEnvironmentPolicy standalone_policy = StandaloneEnvironmentPolicy.__new__(StandaloneEnvironmentPolicy)
346
- standalone_policy._flags = int(CoreCreationFlags.ccfEnableGraphInspection)
483
+ standalone_policy._flags = ccfEnableGraphInspection;
347
484
  register_policy(standalone_policy)
348
485
 
349
486
  return True
@@ -865,7 +1002,7 @@ cdef void dictToMap(dict ndict, VSMap *inm, VSCore *core, const VSAPI *funcs) ex
865
1002
  ckey = key.encode('utf-8')
866
1003
  val = ndict[key]
867
1004
 
868
- if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame)):
1005
+ if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame, enum.Flag)):
869
1006
  val = [val]
870
1007
  else:
871
1008
  try:
@@ -913,7 +1050,7 @@ cdef void typedDictToMap(dict ndict, dict atypes, VSMap *inm, VSCore *core, cons
913
1050
  if val is None:
914
1051
  continue
915
1052
 
916
- if isinstance(val, (str, bytes, bytearray, enum.Flag, RawNode, RawFrame)) or not isinstance(val, Iterable):
1053
+ if isinstance(val, (str, bytes, bytearray, enum.Flag, RawNode, RawFrame, enum.Flag)) or not isinstance(val, Iterable):
917
1054
  val = [val]
918
1055
 
919
1056
  for v in val:
@@ -1115,7 +1252,7 @@ cdef class FrameProps(object):
1115
1252
  cdef bytes b = name.encode('utf-8')
1116
1253
  cdef const VSAPI *funcs = self.funcs
1117
1254
  val = value
1118
- if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame)):
1255
+ if isinstance(val, (str, bytes, bytearray, RawNode, RawFrame, enum.Flag)):
1119
1256
  val = [val]
1120
1257
  else:
1121
1258
  try:
@@ -1535,7 +1672,7 @@ cdef class _frame:
1535
1672
  cdef:
1536
1673
  unsigned mask
1537
1674
 
1538
- if lib.getFrameType(frame) is VIDEO:
1675
+ if lib.getFrameType(frame) == mtVideo:
1539
1676
  mask = 1 << index+1
1540
1677
  else:
1541
1678
  mask = ~1 # there's only one plane in audio frames
@@ -1595,14 +1732,14 @@ cdef class _video:
1595
1732
  self.base.itemsize = format.bytesPerSample
1596
1733
  self.base.strides[1] = format.bytesPerSample
1597
1734
 
1598
- if format.sampleType == INTEGER:
1735
+ if format.sampleType == stInteger:
1599
1736
  if format.bytesPerSample == 1:
1600
1737
  self.base.format = 'B'
1601
1738
  elif format.bytesPerSample == 2:
1602
1739
  self.base.format = 'H'
1603
1740
  elif format.bytesPerSample == 4:
1604
1741
  self.base.format = 'I'
1605
- elif format.sampleType == FLOAT:
1742
+ elif format.sampleType == stFloat:
1606
1743
  if format.bytesPerSample == 2:
1607
1744
  self.base.format = 'e'
1608
1745
  elif format.bytesPerSample == 4:
@@ -1767,12 +1904,12 @@ cdef class _audio:
1767
1904
  self = _1dview_contig.__new__(_1dview_contig)
1768
1905
  self.base.itemsize = format.bytesPerSample
1769
1906
 
1770
- if format.sampleType == INTEGER:
1907
+ if format.sampleType == stInteger:
1771
1908
  if format.bytesPerSample == 2:
1772
1909
  self.base.format = 'H'
1773
1910
  elif format.bytesPerSample == 4:
1774
1911
  self.base.format = 'I'
1775
- elif format.sampleType == FLOAT:
1912
+ elif format.sampleType == stFloat:
1776
1913
  if format.bytesPerSample == 4:
1777
1914
  self.base.format = 'f'
1778
1915
 
@@ -1945,7 +2082,7 @@ cdef class RawNode(object):
1945
2082
  cdef bint _inspectable(self):
1946
2083
  if self.funcs.getAPIVersion() != VAPOURSYNTH_API_VERSION:
1947
2084
  return False
1948
- return bool(self.core.flags & CoreCreationFlags.ccfEnableGraphInspection)
2085
+ return bool(self.core.flags & ccfEnableGraphInspection)
1949
2086
 
1950
2087
  def is_inspectable(self, version=None):
1951
2088
  if version != 0:
@@ -2036,7 +2173,7 @@ cdef class VideoNode(RawNode):
2036
2173
  (<Plugin>obj).injected_arg = self
2037
2174
  return obj
2038
2175
  except AttributeError:
2039
- raise AttributeError(f'There is no attribute or namespace named {name}') from None
2176
+ raise AttributeError(f'There is no attribute or namespace named {name}. Did you mistype a plugin namespace or forget to install a plugin?') from None
2040
2177
 
2041
2178
  cdef ensure_valid_frame_number(self, int n):
2042
2179
  if n < 0:
@@ -2066,10 +2203,10 @@ cdef class VideoNode(RawNode):
2066
2203
  raise Error('Alpha clip dimensions must match the main video')
2067
2204
  if (self.num_frames != alpha.num_frames):
2068
2205
  raise Error('Alpha clip length must match the main video')
2069
- if (self.vi.format.colorFamily != UNDEFINED) and (alpha.vi.format.colorFamily != UNDEFINED):
2070
- if (alpha.vi.format.colorFamily != GRAY) or (alpha.vi.format.sampleType != self.vi.format.sampleType) or (alpha.vi.format.bitsPerSample != self.vi.format.bitsPerSample):
2206
+ if (self.vi.format.colorFamily != cfUndefined) and (alpha.vi.format.colorFamily != cfUndefined):
2207
+ if (alpha.vi.format.colorFamily != cfGray) or (alpha.vi.format.sampleType != self.vi.format.sampleType) or (alpha.vi.format.bitsPerSample != self.vi.format.bitsPerSample):
2071
2208
  raise Error('Alpha clip format must match the main video')
2072
- elif (self.vi.format.colorFamily != UNDEFINED) or (alpha.vi.format.colorFamily != UNDEFINED):
2209
+ elif (self.vi.format.colorFamily != cfUndefined) or (alpha.vi.format.colorFamily != cfUndefined):
2073
2210
  raise Error('Format must be either known or unknown for both alpha and main clip')
2074
2211
 
2075
2212
  _get_output_dict("set_output")[index] = VideoOutputTuple(self, alpha, alt_output)
@@ -2088,11 +2225,11 @@ cdef class VideoNode(RawNode):
2088
2225
  progress_update(0, len(self))
2089
2226
 
2090
2227
  if y4m:
2091
- if self.format.color_family == GRAY:
2228
+ if self.format.color_family == cfGray:
2092
2229
  y4mformat = 'mono'
2093
2230
  if self.format.bits_per_sample > 8:
2094
2231
  y4mformat = y4mformat + str(self.format.bits_per_sample)
2095
- elif self.format.color_family == YUV:
2232
+ elif self.format.color_family == cfYUV:
2096
2233
  if self.format.subsampling_w == 1 and self.format.subsampling_h == 1:
2097
2234
  y4mformat = '420'
2098
2235
  elif self.format.subsampling_w == 1 and self.format.subsampling_h == 0:
@@ -2245,7 +2382,7 @@ cdef VideoNode createVideoNode(VSNode *node, const VSAPI *funcs, Core core):
2245
2382
  instance.funcs = funcs
2246
2383
  instance.vi = funcs.getVideoInfo(node)
2247
2384
 
2248
- if (instance.vi.format.colorFamily != UNDEFINED):
2385
+ if (instance.vi.format.colorFamily != cfUndefined):
2249
2386
  instance.format = createVideoFormat(&instance.vi.format, funcs, core.core)
2250
2387
  else:
2251
2388
  instance.format = None
@@ -2287,7 +2424,7 @@ cdef class AudioNode(RawNode):
2287
2424
  except AttributeError:
2288
2425
  err = True
2289
2426
  if err:
2290
- raise AttributeError('There is no attribute or namespace named ' + name)
2427
+ raise AttributeError(f'There is no attribute or namespace named {name}. Did you mistype a plugin namespace or forget to install a plugin?')
2291
2428
 
2292
2429
  cdef ensure_valid_frame_number(self, int n):
2293
2430
  if n < 0:
@@ -2450,7 +2587,7 @@ cdef LogHandle createLogHandle(object handler_func):
2450
2587
 
2451
2588
  cdef void __stdcall log_handler_wrapper(int msgType, const char *msg, void *userData) noexcept nogil:
2452
2589
  with gil:
2453
- (<LogHandle>userData).handler_func(MessageType(msgType), msg.decode('utf-8'))
2590
+ (<LogHandle>userData).handler_func(msgType, msg.decode('utf-8'))
2454
2591
 
2455
2592
  cdef void __stdcall log_handler_free(void *userData) noexcept nogil:
2456
2593
  with gil:
@@ -2570,7 +2707,7 @@ cdef class Core(object):
2570
2707
  plugin = self.funcs.getNextPlugin(plugin, self.core)
2571
2708
  yield tmp
2572
2709
 
2573
- def query_video_format(self, ColorFamily color_family, SampleType sample_type, int bits_per_sample, int subsampling_w = 0, int subsampling_h = 0):
2710
+ def query_video_format(self, int color_family, int sample_type, int bits_per_sample, int subsampling_w = 0, int subsampling_h = 0):
2574
2711
  cdef VSVideoFormat fmt
2575
2712
  if not self.funcs.queryVideoFormat(&fmt, color_family, sample_type, bits_per_sample, subsampling_w, subsampling_h, self.core):
2576
2713
  raise Error('Invalid format specified')
@@ -2591,11 +2728,11 @@ cdef class Core(object):
2591
2728
  cdef VSFrame* ref = self.funcs.newVideoFrame(&fmt, width, height, NULL, self.core)
2592
2729
  return createVideoFrame(ref, self.funcs, self.core)
2593
2730
 
2594
- def log_message(self, MessageType message_type, str message):
2731
+ def log_message(self, int message_type, str message):
2595
2732
  self.funcs.logMessage(message_type, message.encode('utf-8'), self.core)
2596
2733
 
2597
2734
  def add_log_handler(self, handler_func):
2598
- handler_func(MESSAGE_TYPE_DEBUG, 'New message handler installed from python')
2735
+ handler_func(mtDebug, 'New message handler installed from python')
2599
2736
  cdef LogHandle lh = createLogHandle(handler_func)
2600
2737
  Py_INCREF(lh)
2601
2738
  lh.handle = self.funcs.addLogHandler(log_handler_wrapper, log_handler_free, <void *>lh, self.core)
@@ -2663,13 +2800,13 @@ cdef class Core(object):
2663
2800
  )
2664
2801
 
2665
2802
  cdef object createNode(VSNode *node, const VSAPI *funcs, Core core):
2666
- if funcs.getNodeType(node) == VIDEO:
2803
+ if funcs.getNodeType(node) == mtVideo:
2667
2804
  return createVideoNode(node, funcs, core)
2668
2805
  else:
2669
2806
  return createAudioNode(node, funcs, core)
2670
2807
 
2671
2808
  cdef object createConstFrame(const VSFrame *f, const VSAPI *funcs, VSCore *core):
2672
- if funcs.getFrameType(f) == VIDEO:
2809
+ if funcs.getFrameType(f) == mtVideo:
2673
2810
  return createConstVideoFrame(f, funcs, core)
2674
2811
  else:
2675
2812
  return createConstAudioFrame(f, funcs, core)
@@ -2678,19 +2815,36 @@ cdef Core createCore(EnvironmentData env):
2678
2815
  cdef Core instance = Core.__new__(Core)
2679
2816
  instance.funcs = getVapourSynthAPI(VAPOURSYNTH_API_VERSION)
2680
2817
  if instance.funcs == NULL:
2681
- raise Error('Failed to obtain VapourSynth API pointer. System does not support SSE2 or is the Python module and loaded core library mismatched?')
2818
+ raise Error('Failed to obtain VapourSynth API pointer. Is the Python module and loaded core library mismatched?')
2682
2819
  instance.core = instance.funcs.createCore(env.coreCreationFlags)
2683
2820
  instance.timings = createCoreTimings(instance)
2684
2821
  instance.creationFlags = env.coreCreationFlags
2822
+ if instance.core_version.release_major <> VS_CURRENT_RELEASE:
2823
+ instance.log_message(mtWarning, f'Version mismatch: The VapourSynth Python module version is R{__version__.release_major:d} but the VapourSynth core library is R{instance.core_version.release_major:d}. This usually indicates a broken install.')
2685
2824
  return instance
2686
2825
 
2687
2826
  cdef Core createCore2(VSCore *core):
2688
2827
  cdef Core instance = Core.__new__(Core)
2828
+ cdef VSMap *min
2829
+ cdef VSMap *mout
2830
+ cdef VSPlugin *plugin
2831
+ cdef VSNode *node
2689
2832
  instance.funcs = getVapourSynthAPI(VAPOURSYNTH_API_VERSION)
2690
2833
  if instance.funcs == NULL:
2691
- raise Error('Failed to obtain VapourSynth API pointer. System does not support SSE2 or is the Python module and loaded core library mismatched?')
2834
+ raise Error('Failed to obtain VapourSynth API pointer. Is the Python module and loaded core library mismatched?')
2692
2835
  instance.core = core
2693
2836
  instance.timings = createCoreTimings(instance)
2837
+ if instance.core_version.release_major <> VS_CURRENT_RELEASE:
2838
+ instance.log_message(mtWarning, f'Version mismatch: The VapourSynth Python module version is R{__version__.release_major:d} but the VapourSynth core library is R{instance.core_version.release_major:d}. This usually indicates a broken install.')
2839
+ plugin = instance.funcs.getPluginByID('com.vapoursynth.std', core)
2840
+ min = instance.funcs.createMap()
2841
+ mout = instance.funcs.invoke(plugin, "BlankClip", min)
2842
+ instance.funcs.freeMap(min)
2843
+ node = instance.funcs.mapGetNode(mout, "clip", 0, NULL)
2844
+ instance.funcs.freeMap(mout)
2845
+ if instance.funcs.getNodeCreationFunctionName(node, 0) <> NULL:
2846
+ instance.creationFlags = ccfEnableGraphInspection
2847
+ instance.funcs.freeNode(node)
2694
2848
  return instance
2695
2849
 
2696
2850
  cdef Core _get_core(threads = None):
@@ -3017,7 +3171,7 @@ def _showwarning(message, category, filename, lineno, file=None, line=None):
3017
3171
 
3018
3172
  s = warnings.formatwarning(message, category, filename, lineno, line)
3019
3173
  core = vsscript_get_core_internal(env)
3020
- core.log_message(MESSAGE_TYPE_WARNING, s)
3174
+ core.log_message(mtWarning, s)
3021
3175
 
3022
3176
  class PythonVSScriptLoggingBridge(logging.Handler):
3023
3177
 
@@ -3421,6 +3575,25 @@ cdef public api int vpy4_getAltOutputMode(VSScript *se, int index) nogil:
3421
3575
  if isinstance(output, VideoOutputTuple):
3422
3576
  return output[2]
3423
3577
  return 0
3578
+
3579
+ cdef public api int vpy4_getAvailableOutputNodes(VSScript *se, int size, int *dst) nogil:
3580
+ cdef int dstidx = 0
3581
+ with gil:
3582
+ pyenvdict = <dict>se.pyenvdict
3583
+ nodes = None
3584
+ try:
3585
+ nodes = _get_vsscript_policy().get_environment(se.id).outputs
3586
+ except:
3587
+ return 0
3588
+
3589
+ if size > 0:
3590
+ for key in nodes:
3591
+ dst[dstidx] = key
3592
+ dstidx = dstidx + 1
3593
+ if size - dstidx <= 0:
3594
+ break
3595
+
3596
+ return len(nodes)
3424
3597
 
3425
3598
  cdef public api int vpy_clearOutput(VSScript *se, int index) nogil:
3426
3599
  with gil: