@@ -48,55 +48,53 @@ function(make_torchcodec_libraries
48
48
# We create three shared libraries per version of FFmpeg, where the version
49
49
# is denoted by N:
50
50
#
51
- # 1. libtorchcodec_decoderN .{ext}: Base library which contains the
51
+ # 1. libtorchcodec_coreN .{ext}: Base library which contains the
52
52
# implementation of VideoDecoder and everything VideoDecoder needs. On
53
53
# Linux, {ext} is so. On Mac, it is dylib.
54
54
#
55
55
# 2. libtorchcodec_custom_opsN.{ext}: Implementation of the PyTorch custom
56
- # ops. Depends on libtorchcodec_decoderN .{ext}. On Linux, {ext} is so.
56
+ # ops. Depends on libtorchcodec_coreN .{ext}. On Linux, {ext} is so.
57
57
# On Mac, it is dylib.
58
58
#
59
59
# 3. libtorchcodec_pybind_opsN.{ext}: Implementation of the pybind11 ops. We
60
60
# keep these separate from the PyTorch custom ops because we have to
61
61
# load these libraries separately on the Python side. Depends on
62
- # libtorchcodec_decoderN .{ext}. On BOTH Linux and Mac {ext} is so.
62
+ # libtorchcodec_coreN .{ext}. On BOTH Linux and Mac {ext} is so.
63
63
64
- # 1. Create libtorchcodec_decoderN .{ext}.
65
- set (decoder_library_name "libtorchcodec_decoder ${ffmpeg_major_version} " )
66
- set (decoder_sources
64
+ # 1. Create libtorchcodec_coreN .{ext}.
65
+ set (core_library_name "libtorchcodec_core ${ffmpeg_major_version} " )
66
+ set (core_sources
67
67
AVIOContextHolder.cpp
68
68
AVIOTensorContext.cpp
69
69
FFMPEGCommon.cpp
70
70
Frame.cpp
71
71
DeviceInterface.cpp
72
72
CpuDeviceInterface.cpp
73
73
SingleStreamDecoder.cpp
74
- # TODO: lib name should probably not be "*_decoder*" now that it also
75
- # contains an encoder
76
74
Encoder.cpp
77
75
)
78
76
79
77
if (ENABLE_CUDA )
80
- list (APPEND decoder_sources CudaDeviceInterface.cpp )
78
+ list (APPEND core_sources CudaDeviceInterface.cpp )
81
79
endif ()
82
80
83
- set (decoder_library_dependencies
81
+ set (core_library_dependencies
84
82
${ffmpeg_target}
85
83
${TORCH_LIBRARIES}
86
84
)
87
85
88
86
if (ENABLE_CUDA )
89
- list (APPEND decoder_library_dependencies
87
+ list (APPEND core_library_dependencies
90
88
${CUDA_nppi_LIBRARY}
91
89
${CUDA_nppicc_LIBRARY}
92
90
)
93
91
endif ()
94
92
95
93
make_torchcodec_sublibrary (
96
- "${decoder_library_name } "
94
+ "${core_library_name } "
97
95
SHARED
98
- "${decoder_sources } "
99
- "${decoder_library_dependencies } "
96
+ "${core_sources } "
97
+ "${core_library_dependencies } "
100
98
)
101
99
102
100
# 2. Create libtorchcodec_custom_opsN.{ext}.
@@ -106,7 +104,7 @@ function(make_torchcodec_libraries
106
104
custom_ops.cpp
107
105
)
108
106
set (custom_ops_dependencies
109
- ${decoder_library_name }
107
+ ${core_library_name }
110
108
${Python3_LIBRARIES}
111
109
)
112
110
make_torchcodec_sublibrary (
@@ -123,7 +121,7 @@ function(make_torchcodec_libraries
123
121
pybind_ops.cpp
124
122
)
125
123
set (pybind_ops_dependencies
126
- ${decoder_library_name }
124
+ ${core_library_name }
127
125
pybind11::module # This library dependency makes sure we have the right
128
126
# Python libraries included as well as all of the right
129
127
# settings so that we can successfully load the shared
@@ -158,7 +156,7 @@ function(make_torchcodec_libraries
158
156
target_compile_definitions (
159
157
${pybind_ops_library_name}
160
158
PRIVATE
161
- PYBIND_OPS_MODULE_NAME=decoder_core_pybind_ops
159
+ PYBIND_OPS_MODULE_NAME=core_pybind_ops
162
160
)
163
161
# If we don't make sure this flag is set, we run into segfauls at import
164
162
# time on Mac. See:
@@ -172,7 +170,7 @@ function(make_torchcodec_libraries
172
170
# Install all libraries.
173
171
set (
174
172
all_libraries
175
- ${decoder_library_name }
173
+ ${core_library_name }
176
174
${custom_ops_library_name}
177
175
${pybind_ops_library_name}
178
176
)
@@ -249,7 +247,7 @@ else()
249
247
# Expose these values updwards so that the test compilation does not need
250
248
# to re-figure it out. FIXME: it's not great that we just copy-paste the
251
249
# library names.
252
- set (libtorchcodec_library_name "libtorchcodec_decoder ${ffmpeg_major_version} " PARENT_SCOPE )
250
+ set (libtorchcodec_library_name "libtorchcodec_core ${ffmpeg_major_version} " PARENT_SCOPE )
253
251
set (libtorchcodec_custom_ops_name "libtorchcodec_custom_ops${ffmpeg_major_version} " PARENT_SCOPE )
254
252
set (libav_include_dirs ${LIBAV_INCLUDE_DIRS} PARENT_SCOPE )
255
253
endif ()
0 commit comments