https://bugs.kde.org/show_bug.cgi?id=520162

            Bug ID: 520162
           Summary: kde-plasma/krdp-9999 (git version from kde-overlay)
                    fails to build: no matching conversion for
                    functional-style cast from 'const value_type' to
                    'clk::system_clock::time_point'
    Classification: Plasma
           Product: KRdp
      Version First 6.6.90
       Reported In:
          Platform: Gentoo Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 192288
  --> https://bugs.kde.org/attachment.cgi?id=192288&action=edit
krdp-build.log

DESCRIPTION

krdp fails to compile on Gentoo Linux amd64 musl libc with LLVM/Clang and
-stdlib=libc++

STEPS TO REPRODUCE
emerge -1 =kde-plasma/krdp-9999

OBSERVED RESULT

```
FAILED: [code=1] src/CMakeFiles/KRdp.dir/VideoStream.cpp.o
/var/tmp/portage/kde-plasma/krdp-9999/work/krdp-9999/src/VideoStream.cpp:654:43:
error: no matching conversion for functional-style cast from 'const value_type'
(aka 'const std::chrono::duration<long long, std::ratio<1, 1000000000>>') to
'clk::system_clock::time_point' (aka 'time_point<system_clock>')
  654 |         frameData.presentationTimeStamp =
clk::system_clock::time_point(*data.presentationTimestamp);
      |                                          
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__chrono/time_point.h:34:7: note: candidate constructor
(the implicit copy constructor) not viable: no known conversion from 'const
value_type' (aka 'const std::chrono::duration<long long, std::ratio<1,
1000000000>>') to 'const time_point<std::chrono::system_clock>' for 1st
argument
   34 | class time_point {
      |       ^~~~~~~~~~
/usr/include/c++/v1/__chrono/time_point.h:34:7: note: candidate constructor
(the implicit move constructor) not viable: no known conversion from 'const
value_type' (aka 'const std::chrono::duration<long long, std::ratio<1,
1000000000>>') to 'time_point<std::chrono::system_clock>' for 1st argument
   34 | class time_point {
      |       ^~~~~~~~~~
/usr/include/c++/v1/__chrono/time_point.h:48:64: note: candidate constructor
not viable: no known conversion from 'const duration<[...], ratio<[...],
1000000000>>' to 'const duration<[...], ratio<[...], 1000000>>' for 1st
argument
   48 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit
time_point(const duration& __d) : __d_(__d) {}
      |                                                                ^       
  ~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__chrono/time_point.h:52:55: note: candidate template
ignored: could not match 'time_point' against 'duration'
   52 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 time_point(const
time_point<clock, _Duration2>& __t)
      |                                                       ^
/usr/include/c++/v1/__chrono/time_point.h:47:55: note: candidate constructor
not viable: requires 0 arguments, but 1 was provided
   47 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 time_point() :
__d_(duration::zero()) {}
      |                                                       ^
4 warnings and 1 error generated.
```

EXPECTED RESULT

It should compile with Clang/libc++.

SOFTWARE/OS VERSIONS
Operating System: Gentoo 2.18
KDE Plasma Version: 6.6.90
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1

ADDITIONAL INFORMATION

Works fine after applying the following patch:
```
diff --git a/src/VideoStream.cpp b/src/VideoStream.cpp
index 69a6d08..2024cba 100644
--- a/src/VideoStream.cpp
+++ b/src/VideoStream.cpp
@@ -652,7 +652,7 @@ void VideoStream::onFrameReceived(const PipeWireFrame
&data)
     frameData.size = data.dataFrame ? data.dataFrame->size : QSize(data.dmabuf
? data.dmabuf->width : 0, data.dmabuf ? data.dmabuf->height : 0);
     frameData.damage = data.damage.value_or(QRegion(QRect(QPoint(0, 0),
frameData.size)));
     if (data.presentationTimestamp) {
-        frameData.presentationTimeStamp =
clk::system_clock::time_point(*data.presentationTimestamp);
+        frameData.presentationTimeStamp =
clk::system_clock::time_point(clk::duration_cast<clk::milliseconds>(*data.presentationTimestamp));
     }

     if (data.dataFrame) {
```

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to