From 3978c3ef0e5dfb8d3c4dd2c4030d06c4dbbda1ef Mon Sep 17 00:00:00 2001 From: zuozhiwei Date: Fri, 26 Apr 2024 17:22:05 +0800 Subject: [PATCH] fix build failed issue --- debian/changelog | 6 ++ .../patches/0003-fix-build-failed-issue.patch | 99 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 106 insertions(+) create mode 100644 debian/patches/0003-fix-build-failed-issue.patch diff --git a/debian/changelog b/debian/changelog index 8eeda57..652145c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pipewire (1.0.0-1ok3) nile; urgency=medium + + * Build for openkylin. + + -- zuozhiwei Fri, 26 Apr 2024 17:17:50 +0800 + pipewire (1.0.0-1ok2) nile; urgency=medium * Sync upstream config. diff --git a/debian/patches/0003-fix-build-failed-issue.patch b/debian/patches/0003-fix-build-failed-issue.patch new file mode 100644 index 0000000..7ce2873 --- /dev/null +++ b/debian/patches/0003-fix-build-failed-issue.patch @@ -0,0 +1,99 @@ +From: zuozhiwei +Date: Fri, 26 Apr 2024 17:22:05 +0800 +Subject: fix build failed issue + +--- + spa/meson.build | 3 +-- + spa/plugins/libcamera/libcamera-device.cpp | 2 -- + spa/plugins/libcamera/libcamera-utils.cpp | 36 ++++++++++++++---------------- + 3 files changed, 18 insertions(+), 23 deletions(-) + +diff --git a/spa/meson.build b/spa/meson.build +index 27cdd21..bc83f9a 100644 +--- a/spa/meson.build ++++ b/spa/meson.build +@@ -96,9 +96,8 @@ if get_option('spa-plugins').allowed() + endif + summary({'Vulkan': have_vulkan}, bool_yn: true, section: 'Misc dependencies') + +- libcamera_dep = dependency('libcamera', required: get_option('libcamera')) ++ libcamera_dep = dependency('libcamera', version: '>= 0.2.0', required: get_option('libcamera')) + summary({'libcamera': libcamera_dep.found()}, bool_yn: true, section: 'Backend') +- cdata.set('HAVE_LIBCAMERA_SYSTEM_DEVICES', libcamera_dep.version().version_compare('>= 0.1.0')) + + compress_offload_option = get_option('compress-offload') + summary({'Compress-Offload': compress_offload_option.allowed()}, bool_yn: true, section: 'Backend') +diff --git a/spa/plugins/libcamera/libcamera-device.cpp b/spa/plugins/libcamera/libcamera-device.cpp +index 0abf2f6..b25a4eb 100644 +--- a/spa/plugins/libcamera/libcamera-device.cpp ++++ b/spa/plugins/libcamera/libcamera-device.cpp +@@ -61,12 +61,10 @@ struct impl { + static const libcamera::Span cameraDevice( + const Camera *camera) + { +-#ifdef HAVE_LIBCAMERA_SYSTEM_DEVICES + const ControlList &props = camera->properties(); + + if (auto devices = props.get(properties::SystemDevices)) + return devices.value(); +-#endif + + return {}; + } +diff --git a/spa/plugins/libcamera/libcamera-utils.cpp b/spa/plugins/libcamera/libcamera-utils.cpp +index 2b1aea5..c197248 100644 +--- a/spa/plugins/libcamera/libcamera-utils.cpp ++++ b/spa/plugins/libcamera/libcamera-utils.cpp +@@ -716,25 +716,23 @@ static int spa_libcamera_use_buffers(struct impl *impl, struct port *port, + } + + static const struct { +- Transform libcamera_transform; +- uint32_t spa_transform_value; +-} transform_map[] = { +- { Transform::Identity, SPA_META_TRANSFORMATION_None }, +- { Transform::Rot0, SPA_META_TRANSFORMATION_None }, +- { Transform::HFlip, SPA_META_TRANSFORMATION_Flipped }, +- { Transform::VFlip, SPA_META_TRANSFORMATION_Flipped180 }, +- { Transform::HVFlip, SPA_META_TRANSFORMATION_180 }, +- { Transform::Rot180, SPA_META_TRANSFORMATION_180 }, +- { Transform::Transpose, SPA_META_TRANSFORMATION_Flipped90 }, +- { Transform::Rot90, SPA_META_TRANSFORMATION_90 }, +- { Transform::Rot270, SPA_META_TRANSFORMATION_270 }, +- { Transform::Rot180Transpose, SPA_META_TRANSFORMATION_Flipped270 }, ++ Orientation libcamera_orientation; /* clockwise rotation then horizontal mirroring */ ++ uint32_t spa_transform_value; /* horizontal mirroring then counter-clockwise rotation */ ++} orientation_map[] = { ++ { Orientation::Rotate0, SPA_META_TRANSFORMATION_None }, ++ { Orientation::Rotate0Mirror, SPA_META_TRANSFORMATION_Flipped }, ++ { Orientation::Rotate90, SPA_META_TRANSFORMATION_270 }, ++ { Orientation::Rotate90Mirror, SPA_META_TRANSFORMATION_Flipped90 }, ++ { Orientation::Rotate180, SPA_META_TRANSFORMATION_180 }, ++ { Orientation::Rotate180Mirror, SPA_META_TRANSFORMATION_Flipped180 }, ++ { Orientation::Rotate270, SPA_META_TRANSFORMATION_90 }, ++ { Orientation::Rotate270Mirror, SPA_META_TRANSFORMATION_Flipped270 }, + }; + +-static uint32_t libcamera_transform_to_spa_transform_value(Transform transform) ++static uint32_t libcamera_orientation_to_spa_transform_value(Orientation orientation) + { +- for (const auto& t : transform_map) { +- if (t.libcamera_transform == transform) ++ for (const auto& t : orientation_map) { ++ if (t.libcamera_orientation == orientation) + return t.spa_transform_value; + } + return SPA_META_TRANSFORMATION_None; +@@ -788,9 +786,9 @@ mmap_init(struct impl *impl, struct port *port, + buffers[i], SPA_META_VideoTransform, sizeof(*b->videotransform)); + if (b->videotransform) { + b->videotransform->transform = +- libcamera_transform_to_spa_transform_value(impl->config->transform); +- spa_log_debug(impl->log, "Setting videotransform for buffer %d to %u (from %s)", +- i, b->videotransform->transform, transformToString(impl->config->transform)); ++ libcamera_orientation_to_spa_transform_value(impl->config->orientation); ++ spa_log_debug(impl->log, "Setting videotransform for buffer %u to %u", ++ i, b->videotransform->transform); + + } + diff --git a/debian/patches/series b/debian/patches/series index e83cd79..a4d27b3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 0002-fix-echo-cancel-module-reloading-issues.patch 0002-fix-build-error.patch +0003-fix-build-failed-issue.patch