Skip to content

Commit

Permalink
meson: Make gst-codecparser optional
Browse files Browse the repository at this point in the history
Disable vp8 and vp9 if not available.
  • Loading branch information
philipl committed Jul 18, 2022
1 parent a4fb2d6 commit 78ade10
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
36 changes: 21 additions & 15 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,34 @@ cc = meson.get_compiler('c')
m_dep = cc.find_library('m')
dl_dep = cc.find_library('dl', required : false)
egl_dep = cc.find_library('EGL')
gst_codecs_deps = dependency('gstreamer-codecparsers-1.0')
gst_codecs_deps = dependency('gstreamer-codecparsers-1.0', required: false)
ffnvcodec_deps = dependency('ffnvcodec', version: '>= 11.1.5.1')
libva_deps = dependency('libva', version: '>= 1.8.0')
thread_dep = dependency('threads')

sources = [
'src/av1.c',
'src/export-buf.c',
'src/h264.c',
'src/hevc.c',
'src/jpeg.c',
'src/mpeg2.c',
'src/mpeg4.c',
'src/vabackend.c',
'src/vc1.c',
'src/list.c',
]

if gst_codecs_deps.found()
sources += ['src/vp8.c',
'src/vp9.c',]
add_global_arguments(['-DWITH_VP9', '-DWITH_VP8'], language: 'c')
endif

shared_library(
'nvidia_drv_video',
name_prefix: '',
sources: [
'src/av1.c',
'src/export-buf.c',
'src/h264.c',
'src/hevc.c',
'src/jpeg.c',
'src/mpeg2.c',
'src/mpeg4.c',
'src/vabackend.c',
'src/vc1.c',
'src/vp8.c',
'src/vp9.c',
'src/list.c',
],
sources: sources,
dependencies: [
libva_deps,
ffnvcodec_deps,
Expand Down
4 changes: 4 additions & 0 deletions src/vabackend.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,12 @@ static VAStatus nvQueryConfigProfiles(
// if (doesGPUSupportCodec(cudaVideoCodec_HEVC, 12, cudaVideoChromaFormat_420, NULL, NULL)) {
// profile_list[profiles++] = VAProfileHEVCMain12;
// }
#ifdef WITH_VP8
if (doesGPUSupportCodec(cudaVideoCodec_VP8, 8, cudaVideoChromaFormat_420, NULL, NULL)) {
profile_list[profiles++] = VAProfileVP8Version0_3;
}
#endif
#ifdef WITH_VP9
if (doesGPUSupportCodec(cudaVideoCodec_VP9, 8, cudaVideoChromaFormat_420, NULL, NULL)) {
profile_list[profiles++] = VAProfileVP9Profile0; //color depth: 8 bit, 4:2:0
}
Expand All @@ -465,6 +468,7 @@ static VAStatus nvQueryConfigProfiles(
// if (doesGPUSupportCodec(cudaVideoCodec_VP9, 10, cudaVideoChromaFormat_444, NULL, NULL)) {
// profile_list[profiles++] = VAProfileVP9Profile3; //color depth: 10–12 bit, 4:2:2, 4:4:0, 4:4:4
// }
#endif
if (doesGPUSupportCodec(cudaVideoCodec_AV1, 8, cudaVideoChromaFormat_420, NULL, NULL)) {
profile_list[profiles++] = VAProfileAV1Profile0;
}
Expand Down

0 comments on commit 78ade10

Please sign in to comment.