torchcodec 1.0.0__py3-none-win_amd64.whl
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.
- torchcodec/__init__.py +50 -0
- torchcodec/_core/AVIOContextHolder.cpp +85 -0
- torchcodec/_core/AVIOContextHolder.h +44 -0
- torchcodec/_core/AudioCommon.cpp +101 -0
- torchcodec/_core/AudioCommon.h +48 -0
- torchcodec/_core/AudioConverter.cpp +130 -0
- torchcodec/_core/AudioConverter.h +59 -0
- torchcodec/_core/BetaCudaDeviceInterface.cpp +1635 -0
- torchcodec/_core/BetaCudaDeviceInterface.h +364 -0
- torchcodec/_core/CMakeLists.txt +661 -0
- torchcodec/_core/CUDACommon.cpp +129 -0
- torchcodec/_core/CUDACommon.h +115 -0
- torchcodec/_core/Cache.h +126 -0
- torchcodec/_core/CodecParameters.cpp +98 -0
- torchcodec/_core/CodecParameters.h +59 -0
- torchcodec/_core/ColorConverter.cpp +92 -0
- torchcodec/_core/ColorConverter.h +40 -0
- torchcodec/_core/CpuDeviceInterface.cpp +654 -0
- torchcodec/_core/CpuDeviceInterface.h +153 -0
- torchcodec/_core/CudaDeviceInterface.cpp +519 -0
- torchcodec/_core/CudaDeviceInterface.h +92 -0
- torchcodec/_core/DecodeAvif.cpp +284 -0
- torchcodec/_core/DecodeAvif.h +28 -0
- torchcodec/_core/DecodeGif.cpp +488 -0
- torchcodec/_core/DecodeGif.h +32 -0
- torchcodec/_core/DecodeHeic.cpp +306 -0
- torchcodec/_core/DecodeHeic.h +18 -0
- torchcodec/_core/DecodeJpeg.cpp +489 -0
- torchcodec/_core/DecodeJpeg.h +17 -0
- torchcodec/_core/DecodeJpegCuda.cpp +638 -0
- torchcodec/_core/DecodeJpegCuda.h +92 -0
- torchcodec/_core/DecodePng.cpp +569 -0
- torchcodec/_core/DecodePng.h +31 -0
- torchcodec/_core/DecodeWebp.cpp +238 -0
- torchcodec/_core/DecodeWebp.h +17 -0
- torchcodec/_core/Demuxer.cpp +415 -0
- torchcodec/_core/Demuxer.h +158 -0
- torchcodec/_core/DeviceInterface.cpp +152 -0
- torchcodec/_core/DeviceInterface.h +255 -0
- torchcodec/_core/EncodeJpeg.cpp +223 -0
- torchcodec/_core/EncodeJpeg.h +19 -0
- torchcodec/_core/EncodeJpegCuda.cpp +272 -0
- torchcodec/_core/EncodeJpegCuda.h +56 -0
- torchcodec/_core/EncodePng.cpp +207 -0
- torchcodec/_core/EncodePng.h +19 -0
- torchcodec/_core/Encoder.cpp +1023 -0
- torchcodec/_core/Encoder.h +144 -0
- torchcodec/_core/Exif.h +241 -0
- torchcodec/_core/FFMPEGCommon.cpp +1159 -0
- torchcodec/_core/FFMPEGCommon.h +506 -0
- torchcodec/_core/FileIO.cpp +78 -0
- torchcodec/_core/FileIO.h +34 -0
- torchcodec/_core/FileLikeIO.cpp +76 -0
- torchcodec/_core/FileLikeIO.h +68 -0
- torchcodec/_core/FilterGraph.cpp +211 -0
- torchcodec/_core/FilterGraph.h +59 -0
- torchcodec/_core/Frame.cpp +75 -0
- torchcodec/_core/Frame.h +76 -0
- torchcodec/_core/IOInterface.h +44 -0
- torchcodec/_core/ImageCommon.h +113 -0
- torchcodec/_core/Logging.cpp +42 -0
- torchcodec/_core/Logging.h +38 -0
- torchcodec/_core/Metadata.cpp +312 -0
- torchcodec/_core/Metadata.h +115 -0
- torchcodec/_core/NVCUVIDRuntimeLoader.cpp +324 -0
- torchcodec/_core/NVCUVIDRuntimeLoader.h +14 -0
- torchcodec/_core/NVDECCache.cpp +111 -0
- torchcodec/_core/NVDECCache.h +136 -0
- torchcodec/_core/NVDECCacheConfig.cpp +61 -0
- torchcodec/_core/NVDECCacheConfig.h +30 -0
- torchcodec/_core/PacketDecoder.cpp +358 -0
- torchcodec/_core/PacketDecoder.h +140 -0
- torchcodec/_core/SingleStreamDecoder.cpp +1856 -0
- torchcodec/_core/SingleStreamDecoder.h +424 -0
- torchcodec/_core/StableABICompat.h +213 -0
- torchcodec/_core/StreamOptions.h +93 -0
- torchcodec/_core/SwScale.cpp +124 -0
- torchcodec/_core/SwScale.h +67 -0
- torchcodec/_core/TensorIO.cpp +136 -0
- torchcodec/_core/TensorIO.h +53 -0
- torchcodec/_core/Transform.cpp +207 -0
- torchcodec/_core/Transform.h +125 -0
- torchcodec/_core/ValidationUtils.cpp +65 -0
- torchcodec/_core/ValidationUtils.h +29 -0
- torchcodec/_core/WavDecoder.cpp +494 -0
- torchcodec/_core/WavDecoder.h +73 -0
- torchcodec/_core/__init__.py +45 -0
- torchcodec/_core/_decoder_utils.py +258 -0
- torchcodec/_core/_ffmpeg_op_names.py +95 -0
- torchcodec/_core/_ffmpeg_ops.py +699 -0
- torchcodec/_core/_file_like.py +221 -0
- torchcodec/_core/_metadata.py +402 -0
- torchcodec/_core/color_conversion.cpp +316 -0
- torchcodec/_core/color_conversion.cu +391 -0
- torchcodec/_core/color_conversion.h +150 -0
- torchcodec/_core/custom_ops.cpp +2438 -0
- torchcodec/_core/fetch_and_expose_non_gpl_ffmpeg_libs.cmake +192 -0
- torchcodec/_core/fetch_avif_from_s3.cmake +81 -0
- torchcodec/_core/giflib/README +28 -0
- torchcodec/_core/giflib/dgif_lib.c +1313 -0
- torchcodec/_core/giflib/gif_hash.c +129 -0
- torchcodec/_core/giflib/gif_hash.h +43 -0
- torchcodec/_core/giflib/gif_lib.h +292 -0
- torchcodec/_core/giflib/gif_lib_private.h +73 -0
- torchcodec/_core/giflib/gifalloc.c +426 -0
- torchcodec/_core/giflib/openbsd-reallocarray.c +74 -0
- torchcodec/_core/heic_custom_ops.cpp +20 -0
- torchcodec/_core/image_custom_ops.cpp +137 -0
- torchcodec/_core/nvcuvid_include/cuviddec.h +1374 -0
- torchcodec/_core/nvcuvid_include/nvcuvid.h +610 -0
- torchcodec/_core/ops.py +103 -0
- torchcodec/_core/sources.bzl +113 -0
- torchcodec/_frame.py +146 -0
- torchcodec/_internally_replaced_utils.py +129 -0
- torchcodec/_logging.py +59 -0
- torchcodec/decoders/__init__.py +50 -0
- torchcodec/decoders/_audio_decoder.py +183 -0
- torchcodec/decoders/_blocks/__init__.py +48 -0
- torchcodec/decoders/_blocks/_audio_converter.py +155 -0
- torchcodec/decoders/_blocks/_codec_parameters.py +229 -0
- torchcodec/decoders/_blocks/_color_converter.py +107 -0
- torchcodec/decoders/_blocks/_demuxer.py +678 -0
- torchcodec/decoders/_blocks/_frame.py +577 -0
- torchcodec/decoders/_blocks/_helpers.py +53 -0
- torchcodec/decoders/_blocks/_packet_decoder.py +357 -0
- torchcodec/decoders/_decoder_utils.py +128 -0
- torchcodec/decoders/_image_decoders.py +1575 -0
- torchcodec/decoders/_video_decoder.py +592 -0
- torchcodec/decoders/_wav_decoder.py +131 -0
- torchcodec/encoders/__init__.py +4 -0
- torchcodec/encoders/_audio_encoder.py +167 -0
- torchcodec/encoders/_image_encoders.py +181 -0
- torchcodec/encoders/_multi_stream_encoder.py +272 -0
- torchcodec/encoders/_video_encoder.py +227 -0
- torchcodec/jpeg8.dll +0 -0
- torchcodec/libavif.dll +0 -0
- torchcodec/libpng16.dll +0 -0
- torchcodec/libsharpyuv.dll +0 -0
- torchcodec/libtorchcodec_core4.dll +0 -0
- torchcodec/libtorchcodec_core5.dll +0 -0
- torchcodec/libtorchcodec_core6.dll +0 -0
- torchcodec/libtorchcodec_core7.dll +0 -0
- torchcodec/libtorchcodec_core8.dll +0 -0
- torchcodec/libtorchcodec_core9.dll +0 -0
- torchcodec/libtorchcodec_custom_ops4.dll +0 -0
- torchcodec/libtorchcodec_custom_ops5.dll +0 -0
- torchcodec/libtorchcodec_custom_ops6.dll +0 -0
- torchcodec/libtorchcodec_custom_ops7.dll +0 -0
- torchcodec/libtorchcodec_custom_ops8.dll +0 -0
- torchcodec/libtorchcodec_custom_ops9.dll +0 -0
- torchcodec/libtorchcodec_heic.dll +0 -0
- torchcodec/libtorchcodec_image.dll +0 -0
- torchcodec/libwebp.dll +0 -0
- torchcodec/libwebpdecoder.dll +0 -0
- torchcodec/libwebpdemux.dll +0 -0
- torchcodec/libwebpmux.dll +0 -0
- torchcodec/libzstd.dll +0 -0
- torchcodec/py.typed +0 -0
- torchcodec/samplers/__init__.py +2 -0
- torchcodec/samplers/_common.py +83 -0
- torchcodec/samplers/_index_based.py +287 -0
- torchcodec/samplers/_time_based.py +360 -0
- torchcodec/share/cmake/TorchCodec/TorchCodecConfig.cmake +76 -0
- torchcodec/share/cmake/TorchCodec/ffmpeg_versions.cmake +128 -0
- torchcodec/transforms/__init__.py +12 -0
- torchcodec/transforms/_decoder_transforms.py +375 -0
- torchcodec/version.py +1 -0
- torchcodec/zlib.dll +0 -0
- torchcodec-1.0.0.dist-info/METADATA +275 -0
- torchcodec-1.0.0.dist-info/RECORD +179 -0
- torchcodec-1.0.0.dist-info/WHEEL +5 -0
- torchcodec-1.0.0.dist-info/licenses/LICENSE +28 -0
- torchcodec-1.0.0.dist-info/licenses/third_party/COPYING.dav1d +23 -0
- torchcodec-1.0.0.dist-info/licenses/third_party/LICENSE.libavif +387 -0
- torchcodec-1.0.0.dist-info/licenses/third_party/LICENSE.libjpeg-turbo +135 -0
- torchcodec-1.0.0.dist-info/licenses/third_party/LICENSE.libpng +134 -0
- torchcodec-1.0.0.dist-info/licenses/third_party/LICENSE.libwebp +30 -0
- torchcodec-1.0.0.dist-info/licenses/third_party/LICENSE.libyuv +29 -0
- torchcodec-1.0.0.dist-info/licenses/third_party/LICENSE.zlib +22 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# This file fetches the non-GPL ffmpeg libraries from the torchcodec S3 bucket,
|
|
2
|
+
# and exposes them as CMake targets so we can dynamically link against them.
|
|
3
|
+
# These libraries were built on the CI via the build_ffmpeg.yaml workflow.
|
|
4
|
+
|
|
5
|
+
# Avoid warning: see https://cmake.org/cmake/help/latest/policy/CMP0135.html
|
|
6
|
+
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
|
7
|
+
cmake_policy(SET CMP0135 NEW)
|
|
8
|
+
endif()
|
|
9
|
+
|
|
10
|
+
include(FetchContent)
|
|
11
|
+
|
|
12
|
+
set(
|
|
13
|
+
base_url
|
|
14
|
+
https://pytorch.s3.amazonaws.com/torchcodec/ffmpeg/2025-03-14
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if (LINUX)
|
|
18
|
+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
|
|
19
|
+
set(
|
|
20
|
+
platform_url
|
|
21
|
+
${base_url}/linux_aarch64
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
set(
|
|
25
|
+
f4_sha256
|
|
26
|
+
a310a2ed9ffe555fd3278dae15065541098dd35e124564671dcda6a6620ac842
|
|
27
|
+
)
|
|
28
|
+
set(
|
|
29
|
+
f5_sha256
|
|
30
|
+
89ca7996bccbc2db49adaa401d20fdbabffe0e1b4e07a0f81d6b143e858b7c8d
|
|
31
|
+
)
|
|
32
|
+
set(
|
|
33
|
+
f6_sha256
|
|
34
|
+
ae44c67b4587d061b8e9cc8990ca891ee013fe52ad79e5016ba29871562621da
|
|
35
|
+
)
|
|
36
|
+
set(
|
|
37
|
+
f7_sha256
|
|
38
|
+
948e2cac66ca6f68ff526d5e84138e94bce0f1a7c83f502d15d85d0bd3ddc112
|
|
39
|
+
)
|
|
40
|
+
set(
|
|
41
|
+
f8_sha256
|
|
42
|
+
b9cfd99ae75a14e58300854967d4dc49de0b3daa551df51ea1f52a3f08d2c8af
|
|
43
|
+
)
|
|
44
|
+
set(
|
|
45
|
+
f9_sha256
|
|
46
|
+
e68d3a5a17705740f0f8cf69a92ab65ae47c9e17eb3969b17966bd11ab12b382
|
|
47
|
+
)
|
|
48
|
+
elseif (LINUX) # assume x86_64
|
|
49
|
+
set(
|
|
50
|
+
platform_url
|
|
51
|
+
${base_url}/linux_x86_64
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
set(
|
|
55
|
+
f4_sha256
|
|
56
|
+
1a083f1922443bedb5243d04896383b8c606778a7ddb9d886c8303e55339fe0c
|
|
57
|
+
)
|
|
58
|
+
set(
|
|
59
|
+
f5_sha256
|
|
60
|
+
65d6ad54082d94dcb3f801d73df2265e0e1bb303c7afbce7723e3b77ccd0e207
|
|
61
|
+
)
|
|
62
|
+
set(
|
|
63
|
+
f6_sha256
|
|
64
|
+
8bd5939c2f4a4b072e837e7870c13fe7d13824e5ff087ab534e4db4e90b7be9c
|
|
65
|
+
)
|
|
66
|
+
set(
|
|
67
|
+
f7_sha256
|
|
68
|
+
1cb946d8b7c6393c2c3ebe1f900b8de7a2885fe614c45d4ec32c9833084f2f26
|
|
69
|
+
)
|
|
70
|
+
set(
|
|
71
|
+
f8_sha256
|
|
72
|
+
c55b3c1a4b5e4d5fdd7c632bea3ab6f45b4e37cc8e0999dda3f84a8ed8defad8
|
|
73
|
+
)
|
|
74
|
+
set(
|
|
75
|
+
f9_sha256
|
|
76
|
+
ac033158731d452858f3248f93e51939547e87e3dda4fc0e1dc08ae9087d5a35
|
|
77
|
+
)
|
|
78
|
+
endif()
|
|
79
|
+
elseif (APPLE)
|
|
80
|
+
set(
|
|
81
|
+
platform_url
|
|
82
|
+
${base_url}/macos_arm64
|
|
83
|
+
)
|
|
84
|
+
set(
|
|
85
|
+
f4_sha256
|
|
86
|
+
f0335434529d9e19359eae0fe912dd9e747667534a1c92e662f5219a55dfad8c
|
|
87
|
+
)
|
|
88
|
+
set(
|
|
89
|
+
f5_sha256
|
|
90
|
+
cfc3449c9af6863731a431ce89e32c08c5f8ece94b306fb6b695828502a76166
|
|
91
|
+
)
|
|
92
|
+
set(
|
|
93
|
+
f6_sha256
|
|
94
|
+
ec47b4783c342038e720e33b2fdfa55a9a490afb1cf37a26467733983688647e
|
|
95
|
+
)
|
|
96
|
+
set(
|
|
97
|
+
f7_sha256
|
|
98
|
+
48a4fc8ce098305cfd4a58f40889249c523ca3c285f66ba704b5bad0e3ada53a
|
|
99
|
+
)
|
|
100
|
+
set(
|
|
101
|
+
f8_sha256
|
|
102
|
+
beb936b76f25d2621228a12cdb67c9ae3d1eff7aa713ef8d1167ebf0c25bd5ec
|
|
103
|
+
)
|
|
104
|
+
set(
|
|
105
|
+
f9_sha256
|
|
106
|
+
2cd1114e5139aee070959121e0a03cc40d2f0cb771b4a3ecfa28195176e3fa73
|
|
107
|
+
)
|
|
108
|
+
elseif (WIN32)
|
|
109
|
+
set(
|
|
110
|
+
platform_url
|
|
111
|
+
${base_url}/windows_x86_64
|
|
112
|
+
)
|
|
113
|
+
set(
|
|
114
|
+
f4_sha256
|
|
115
|
+
270a1aa8892225267e68a7eb87c417931da30dccbf08ee2bde8833e659cab5cb
|
|
116
|
+
)
|
|
117
|
+
set(
|
|
118
|
+
f5_sha256
|
|
119
|
+
b8b2a349a847e56a6da875b066dff1cae53cb8ee7cf5ba9321ec1243dea0cde0
|
|
120
|
+
)
|
|
121
|
+
set(
|
|
122
|
+
f6_sha256
|
|
123
|
+
5d9f8c76dc55f790fa31d825985e9270bf9e498b8bfec21a0ad3a1feb1fa053a
|
|
124
|
+
)
|
|
125
|
+
set(
|
|
126
|
+
f7_sha256
|
|
127
|
+
ae391ace382330e912793b70b68529ee7c91026d2869b4df7e7c3e7d3656bdd5
|
|
128
|
+
)
|
|
129
|
+
set(
|
|
130
|
+
f8_sha256
|
|
131
|
+
bac845ac79876b104959cb0e7b9dec772a261116344dd17d2f97e7ddfac4a73f
|
|
132
|
+
)
|
|
133
|
+
set(
|
|
134
|
+
f9_sha256
|
|
135
|
+
228b9f9123ac07e7ca38907e75b0f4b0d97273787c98fad922b0775fe17b86f1
|
|
136
|
+
)
|
|
137
|
+
else()
|
|
138
|
+
message(
|
|
139
|
+
FATAL_ERROR
|
|
140
|
+
"Unsupported operating system: ${CMAKE_SYSTEM_NAME}"
|
|
141
|
+
)
|
|
142
|
+
endif()
|
|
143
|
+
|
|
144
|
+
FetchContent_Declare(
|
|
145
|
+
f4
|
|
146
|
+
URL ${platform_url}/4.4.4.tar.gz
|
|
147
|
+
URL_HASH
|
|
148
|
+
SHA256=${f4_sha256}
|
|
149
|
+
)
|
|
150
|
+
FetchContent_Declare(
|
|
151
|
+
f5
|
|
152
|
+
URL ${platform_url}/5.1.4.tar.gz
|
|
153
|
+
URL_HASH
|
|
154
|
+
SHA256=${f5_sha256}
|
|
155
|
+
)
|
|
156
|
+
FetchContent_Declare(
|
|
157
|
+
f6
|
|
158
|
+
URL ${platform_url}/6.1.1.tar.gz
|
|
159
|
+
URL_HASH
|
|
160
|
+
SHA256=${f6_sha256}
|
|
161
|
+
)
|
|
162
|
+
FetchContent_Declare(
|
|
163
|
+
f7
|
|
164
|
+
URL ${platform_url}/7.0.1.tar.gz
|
|
165
|
+
URL_HASH
|
|
166
|
+
SHA256=${f7_sha256}
|
|
167
|
+
)
|
|
168
|
+
FetchContent_Declare(
|
|
169
|
+
f8
|
|
170
|
+
URL ${platform_url}/8.0.tar.gz
|
|
171
|
+
URL_HASH
|
|
172
|
+
SHA256=${f8_sha256}
|
|
173
|
+
)
|
|
174
|
+
FetchContent_Declare(
|
|
175
|
+
f9
|
|
176
|
+
URL ${platform_url}/9.0.tar.gz
|
|
177
|
+
URL_HASH
|
|
178
|
+
SHA256=${f9_sha256}
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
FetchContent_MakeAvailable(f4 f5 f6 f7 f8 f9)
|
|
182
|
+
|
|
183
|
+
# makes add_ffmpeg_target available
|
|
184
|
+
include("${CMAKE_CURRENT_SOURCE_DIR}/../share/cmake/TorchCodec/ffmpeg_versions.cmake")
|
|
185
|
+
|
|
186
|
+
# Note: the f?_SOURCE_DIR variables were set by FetchContent_MakeAvailable
|
|
187
|
+
add_ffmpeg_target(4 "${f4_SOURCE_DIR}")
|
|
188
|
+
add_ffmpeg_target(5 "${f5_SOURCE_DIR}")
|
|
189
|
+
add_ffmpeg_target(6 "${f6_SOURCE_DIR}")
|
|
190
|
+
add_ffmpeg_target(7 "${f7_SOURCE_DIR}")
|
|
191
|
+
add_ffmpeg_target(8 "${f8_SOURCE_DIR}")
|
|
192
|
+
add_ffmpeg_target(9 "${f9_SOURCE_DIR}")
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# This file fetches a decode-only libavif from the torchcodec S3 bucket and
|
|
2
|
+
# exposes it as the `avif` CMake target, so wheel builds can link+bundle a tiny
|
|
3
|
+
# self-contained libavif (dav1d + libyuv statically embedded, no encoders)
|
|
4
|
+
# instead of conda-forge's libavif (which drags in ~20MB of unused AV1 encoder
|
|
5
|
+
# libraries). The tarball is built by packaging/build_libavif.sh.
|
|
6
|
+
#
|
|
7
|
+
# This mirrors fetch_and_expose_non_gpl_ffmpeg_libs.cmake.
|
|
8
|
+
|
|
9
|
+
# Avoid warning: see https://cmake.org/cmake/help/latest/policy/CMP0135.html
|
|
10
|
+
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
|
11
|
+
cmake_policy(SET CMP0135 NEW)
|
|
12
|
+
endif()
|
|
13
|
+
|
|
14
|
+
include(FetchContent)
|
|
15
|
+
|
|
16
|
+
set(libavif_version "1.4.2")
|
|
17
|
+
|
|
18
|
+
set(
|
|
19
|
+
base_url
|
|
20
|
+
https://pytorch.s3.amazonaws.com/torchcodec/libavif/2026-07-22
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
if (LINUX)
|
|
24
|
+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
|
|
25
|
+
set(platform_url ${base_url}/linux_aarch64)
|
|
26
|
+
set(avif_sha256 9a377d3183bfabdc2e5f2e2f3969d8c3d605de56640b695832827aa7df8a8cce)
|
|
27
|
+
else() # assume x86_64
|
|
28
|
+
set(platform_url ${base_url}/linux_x86_64)
|
|
29
|
+
set(avif_sha256 b814cbb53ede0b2e32f4907116f466cd68a789283ba8be149d919fb33d336300)
|
|
30
|
+
endif()
|
|
31
|
+
elseif (APPLE)
|
|
32
|
+
set(platform_url ${base_url}/macos_arm64)
|
|
33
|
+
set(avif_sha256 3130f6aa6087d38fb3769073899a17e6c570a88ba68fec97e3d2d90d0ead57f5)
|
|
34
|
+
elseif (WIN32)
|
|
35
|
+
set(platform_url ${base_url}/windows_x86_64)
|
|
36
|
+
set(avif_sha256 eb30dad70894e6d8b15a677b1cd2560d900c5333820be944cc3a8584765e24ac)
|
|
37
|
+
else()
|
|
38
|
+
message(FATAL_ERROR "Unsupported operating system: ${CMAKE_SYSTEM_NAME}")
|
|
39
|
+
endif()
|
|
40
|
+
|
|
41
|
+
FetchContent_Declare(
|
|
42
|
+
avif_s3
|
|
43
|
+
URL ${platform_url}/${libavif_version}.tar.gz
|
|
44
|
+
URL_HASH
|
|
45
|
+
SHA256=${avif_sha256}
|
|
46
|
+
)
|
|
47
|
+
FetchContent_MakeAvailable(avif_s3)
|
|
48
|
+
|
|
49
|
+
# avif_s3_SOURCE_DIR was set by FetchContent_MakeAvailable and contains the usual
|
|
50
|
+
# include/ and lib/ (and bin/ on Windows) directories
|
|
51
|
+
set(include_dir "${avif_s3_SOURCE_DIR}/include")
|
|
52
|
+
|
|
53
|
+
# libavif's SOVERSION is 16 (paired with libavif 1.4.2).
|
|
54
|
+
if (LINUX)
|
|
55
|
+
set(lib_path "${avif_s3_SOURCE_DIR}/lib/libavif.so.16")
|
|
56
|
+
elseif (APPLE)
|
|
57
|
+
set(lib_path "${avif_s3_SOURCE_DIR}/lib/libavif.16.dylib")
|
|
58
|
+
elseif (WIN32)
|
|
59
|
+
set(lib_path "${avif_s3_SOURCE_DIR}/lib/libavif.dll.a")
|
|
60
|
+
endif()
|
|
61
|
+
|
|
62
|
+
foreach (path IN LISTS include_dir lib_path)
|
|
63
|
+
if (NOT EXISTS "${path}")
|
|
64
|
+
message(FATAL_ERROR "${path} does not exist")
|
|
65
|
+
endif()
|
|
66
|
+
endforeach()
|
|
67
|
+
|
|
68
|
+
if (WIN32)
|
|
69
|
+
# Windows only: we link the .dll.a import lib above, but the actual runtime
|
|
70
|
+
# DLL (from bin/) is what must be shipped. We expose it to the calling
|
|
71
|
+
# CMakelists.txt for Windows editable builds.
|
|
72
|
+
set(avif_runtime_lib "${avif_s3_SOURCE_DIR}/bin/libavif.dll")
|
|
73
|
+
if (NOT EXISTS "${avif_runtime_lib}")
|
|
74
|
+
message(FATAL_ERROR "${avif_runtime_lib} does not exist")
|
|
75
|
+
endif()
|
|
76
|
+
endif()
|
|
77
|
+
|
|
78
|
+
message(STATUS "Adding libavif (decode-only, from S3) as the `avif` target")
|
|
79
|
+
add_library(avif INTERFACE IMPORTED)
|
|
80
|
+
target_include_directories(avif INTERFACE ${include_dir})
|
|
81
|
+
target_link_libraries(avif INTERFACE ${lib_path})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
These files come from the GIFLIB project (https://giflib.sourceforge.net/) and
|
|
2
|
+
are licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
Some modifications have been made to the original files:
|
|
5
|
+
- Remove use of "register" keyword in gifalloc.c for C++17 compatibility.
|
|
6
|
+
- Declare loop variable i in DGifGetImageHeader as int instead of unsigned int.
|
|
7
|
+
|
|
8
|
+
Below is the original license text from the COPYING file of the GIFLIB project:
|
|
9
|
+
|
|
10
|
+
= MIT LICENSE
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in
|
|
20
|
+
all copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
28
|
+
THE SOFTWARE.
|