cth103 / libdcp

Library for reading and writing Digital Cinema Packages (DCPs).
GNU General Public License v2.0
22 stars 11 forks source link

smpte_subtitle_asset.cc Ambiguos overload error has appeared again #10

Open cfenell opened 1 year ago

cfenell commented 1 year ago

Hi, the previously solved ambiguos overload error in smpte_subtitle_asset.cc:112 has appeared again on my rolling release Arch system. So opening a new issue about the same problem. I'm installing it from AUR. PKGBUILD and patch files included.

     ../src/smpte_subtitle_asset.cc:112:83: error: call of overloaded ‘make_shared<dcp::DecryptionContext>      (boost::optional<dcp::Key>, dcp::Standard)’ is ambiguous
  112 |                         read_mxf_resources (reader, make_shared<DecryptionContext>(optional<Key>(), Standard::SMPTE));
# Maintainer: Markus Kalb <mk@filmkreis.tu-darmstadt.de>
# Maintainer: Benjamin Radel <aur@radel.tk>
# Contributor: Stefan Karner <stefan.karner@student.tuwien.ac.at>
pkgname=libdcp-git
pkgver=1.8.27.r1.gb36f9bf7
pkgrel=1
_branch=v1.8.x
pkgdesc="A small C++ library which can create and read Digital Cinema Packages using JPEG2000 and WAV files"
arch=('i686' 'x86_64')
url="https://carlh.net/libdcp"
license=('GPL')
depends=('libxml++2.6' 'xmlsec' 'imagemagick' 'openjpeg2>=2.5' 'libcxml-git' 'libsigc++>=2.0' 'boost-libs>=1.72.0' 'libasdcp-cth-git')
makedepends=('git' 'python' 'boost>=1.72.0' 'gcc' 'pkg-config')
provides=('libdcp')
conflicts=('libdcp')
source=("${pkgname}::git+git://git.carlh.net/git/libdcp.git#branch=${_branch}"
    "0001-fix-compile-with-openjp25.patch")
sha256sums=('SKIP'
            '671046a87eaf567ca94cde72a92497239155d7cb12450ee12b41b2eed13c78fb')

pkgver() {
    cd "$pkgname"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd $srcdir/${pkgname}
  ### Patch libdcp for openjpeg>2.5 ###
  for p in "${source[@]}"; do
    if [[ "$p" =~ \.patch$ ]]; then
      echo "Applying patch ${p##*/}"
      patch -p1 -N -i "${srcdir}/${p##*/}"
    fi
  done
}

build() {
  ### Configure libdcp ###
  cd "${srcdir}/${pkgname}"
  python waf configure --prefix=/usr --disable-tests
  python waf build
}

package() {
  cd "${srcdir}/${pkgname}"
  python waf install --destdir=$pkgdir
  cd "${pkgdir}"
  if [ -d usr/lib64   ]
    then
       mv usr/lib64 usr/lib
    fi
}

--- a/src/j2k_transcode.cc  2022-05-17 10:07:44.525679224 +0200
+++ b/src/j2k_transcode.cc  2022-05-17 10:04:18.846330309 +0200
@@ -46,7 +46,7 @@
 #include <openjpeg.h>
 #include <cmath>
 #include <iostream>
-
+#include <string>

 using std::min;
 using std::pow;
@@ -315,10 +315,13 @@
    parameters.max_comp_size = parameters.max_cs_size / 1.25;
    parameters.tcp_numlayers = 1;
    parameters.tcp_mct = 1;
-   parameters.numgbits = fourk ? 2 : 1;
+   string numgbits = "GUARD_BITS=";
+   numgbits.append(std::to_string(fourk ? 2 : 1));
+   const char* extraopt[] { numgbits.data(), nullptr };

    /* Setup the encoder parameters using the current image and user parameters */
    opj_setup_encoder (encoder, &parameters, xyz->opj_image());
+   opj_encoder_set_extra_options(encoder, extraopt);

    auto stream = opj_stream_default_create (OPJ_FALSE);
    if (!stream) {
cth103 commented 1 year ago

Hi, sorry for the confusion, I think this is because you are following the 1.8.x branch, but development is now back on the main branch.

cfenell commented 1 year ago

Thanks, I think this is me confusing things! The AUR pkgbuild indeed clones tag 1.8.64 from git+git://git.carlh.net/git/... There is also another AUR pkgbuild libdcp-git, which follows branch 1.8.x from the same source. Should we ask the AUR maintainers to switch to the main branch from here (Github)?

cth103 commented 1 year ago

I think that would be a good idea.