From ccc722b7ed330198d82a3cf28ead76d6d107a70a Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 6 Jun 2022 21:25:48 +0000 Subject: added java --- repo/libde265/disable_tools.patch | 44 +++++ repo/libde265/export-only-decoder-api.patch | 290 ++++++++++++++++++++++++++++ repo/libde265/libde265.xibuild | 38 ++++ 3 files changed, 372 insertions(+) create mode 100644 repo/libde265/disable_tools.patch create mode 100644 repo/libde265/export-only-decoder-api.patch create mode 100644 repo/libde265/libde265.xibuild (limited to 'repo/libde265') diff --git a/repo/libde265/disable_tools.patch b/repo/libde265/disable_tools.patch new file mode 100644 index 0000000..8fb5ddd --- /dev/null +++ b/repo/libde265/disable_tools.patch @@ -0,0 +1,44 @@ +Description: Disable building of some internal tools that no longer link + because internal symbols are no longer exported. +Author: Joachim Bauch + +Patch-Source: https://launchpad.net/~strukturag/+archive/ubuntu/libde265/+sourcefiles/libde265/1.0.8-1~ppa1~ubuntu20.10.1/libde265_1.0.8-1~ppa1~ubuntu20.10.1.debian.tar.gz + +--- a/dec265/Makefile.am ++++ b/dec265/Makefile.am +@@ -1,5 +1,5 @@ + +-bin_PROGRAMS = dec265 hdrcopy ++bin_PROGRAMS = dec265 + + AM_CPPFLAGS = -I$(top_srcdir)/libde265 -I$(top_srcdir) + +@@ -9,12 +9,6 @@ + dec265_LDADD = ../libde265/libde265.la -lstdc++ + dec265_SOURCES = dec265.cc + +-hdrcopy_DEPENDENCIES = ../libde265/libde265.la +-hdrcopy_CXXFLAGS = +-hdrcopy_LDFLAGS = +-hdrcopy_LDADD = ../libde265/libde265.la -lstdc++ +-hdrcopy_SOURCES = hdrcopy.cc +- + if HAVE_VIDEOGFX + dec265_CXXFLAGS += $(VIDEOGFX_CFLAGS) + dec265_LDFLAGS += $(VIDEOGFX_LIBS) +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,13 +8,6 @@ + SUBDIRS+=dec265 + endif + +-if ENABLE_ENCODER +-SUBDIRS+=enc265 +-endif +- +-SUBDIRS+=tools +-SUBDIRS+=acceleration-speed +- + if ENABLE_SHERLOCK265 + SUBDIRS+=sherlock265 + endif diff --git a/repo/libde265/export-only-decoder-api.patch b/repo/libde265/export-only-decoder-api.patch new file mode 100644 index 0000000..cd58d39 --- /dev/null +++ b/repo/libde265/export-only-decoder-api.patch @@ -0,0 +1,290 @@ +Description: Only export symbols defined in the decoder API. + The encoder API is not final yet, so upstream exports all symbols to make + development easier. For packaging we only want to expose the public API. +Author: Joachim Bauch + +Patch-Source: https://build.opensuse.org/package/view_file/home:jirutka/libde265/libde265-only_export_decoder_api.patch + +--- a/libde265/encoder/Makefile.am ++++ b/libde265/encoder/Makefile.am +@@ -12,6 +12,18 @@ + encpicbuf.h encpicbuf.cc \ + sop.h sop.cc + ++libde265_encoder_la_CFLAGS = \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++libde265_encoder_la_CXXFLAGS += \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++ ++if HAVE_VISIBILITY ++ libde265_encoder_la_CFLAGS += -DHAVE_VISIBILITY ++ libde265_encoder_la_CXXFLAGS += -DHAVE_VISIBILITY ++endif ++ + SUBDIRS=algo + libde265_encoder_la_LIBADD = algo/libde265_encoder_algo.la + +--- a/libde265/encoder/algo/Makefile.am ++++ b/libde265/encoder/algo/Makefile.am +@@ -17,5 +17,13 @@ + tb-rateestim.h tb-rateestim.cc \ + pb-mv.h pb-mv.cc + ++libde265_encoder_algo_la_CXXFLAGS += \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++ ++if HAVE_VISIBILITY ++ libde265_encoder_algo_la_CXXFLAGS += -DHAVE_VISIBILITY ++endif ++ + EXTRA_DIST = \ + CMakeLists.txt +--- a/configure.ac ++++ b/configure.ac +@@ -56,9 +56,7 @@ + fi + changequote([,])dnl + +-dnl gl_VISIBILITY +-dnl : In encoder branch, we still export all library symbols : +-HAVE_VISIBILITY=0 ++gl_VISIBILITY + AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" != "x0"]) + + # Checks for header files. +--- a/libde265/image-io.cc ++++ b/libde265/image-io.cc +@@ -186,7 +186,7 @@ + } + + +-LIBDE265_API PacketSink_File::~PacketSink_File() ++PacketSink_File::~PacketSink_File() + { + if (mFH) { + fclose(mFH); +@@ -194,7 +194,7 @@ + } + + +-LIBDE265_API void PacketSink_File::set_filename(const char* filename) ++void PacketSink_File::set_filename(const char* filename) + { + assert(mFH==NULL); + +@@ -202,7 +202,7 @@ + } + + +-LIBDE265_API void PacketSink_File::send_packet(const uint8_t* data, int n) ++void PacketSink_File::send_packet(const uint8_t* data, int n) + { + uint8_t startCode[3]; + startCode[0] = 0; +--- a/libde265/image-io.h ++++ b/libde265/image-io.h +@@ -30,17 +30,17 @@ + class ImageSource + { + public: +- LIBDE265_API ImageSource(); +- virtual LIBDE265_API ~ImageSource() { } ++ ImageSource(); ++ virtual ~ImageSource() { } + + //enum ImageStatus { Available, Waiting, EndOfVideo }; + + //virtual ImageStatus get_status() = 0; +- virtual LIBDE265_API de265_image* get_image(bool block=true) = 0; +- virtual LIBDE265_API void skip_frames(int n) = 0; ++ virtual de265_image* get_image(bool block=true) = 0; ++ virtual void skip_frames(int n) = 0; + +- virtual LIBDE265_API int get_width() const = 0; +- virtual LIBDE265_API int get_height() const = 0; ++ virtual int get_width() const = 0; ++ virtual int get_height() const = 0; + }; + + +@@ -48,17 +48,17 @@ + class ImageSource_YUV : public ImageSource + { + public: +- LIBDE265_API ImageSource_YUV(); +- virtual LIBDE265_API ~ImageSource_YUV(); ++ ImageSource_YUV(); ++ virtual ~ImageSource_YUV(); + +- bool LIBDE265_API set_input_file(const char* filename, int w,int h); ++ bool set_input_file(const char* filename, int w,int h); + + //virtual ImageStatus get_status(); +- virtual LIBDE265_API de265_image* get_image(bool block=true); +- virtual LIBDE265_API void skip_frames(int n); ++ virtual de265_image* get_image(bool block=true); ++ virtual void skip_frames(int n); + +- virtual LIBDE265_API int get_width() const { return width; } +- virtual LIBDE265_API int get_height() const { return height; } ++ virtual int get_width() const { return width; } ++ virtual int get_height() const { return height; } + + private: + FILE* mFH; +@@ -74,20 +74,20 @@ + class ImageSink + { + public: +- virtual LIBDE265_API ~ImageSink() { } ++ virtual ~ImageSink() { } + +- virtual LIBDE265_API void send_image(const de265_image* img) = 0; ++ virtual void send_image(const de265_image* img) = 0; + }; + + class ImageSink_YUV : public ImageSink + { + public: +- LIBDE265_API ImageSink_YUV() : mFH(NULL) { } +- LIBDE265_API ~ImageSink_YUV(); ++ ImageSink_YUV() : mFH(NULL) { } ++ ~ImageSink_YUV(); + +- bool LIBDE265_API set_filename(const char* filename); ++ bool set_filename(const char* filename); + +- virtual LIBDE265_API void send_image(const de265_image* img); ++ virtual void send_image(const de265_image* img); + + private: + FILE* mFH; +@@ -98,21 +98,21 @@ + class PacketSink + { + public: +- virtual LIBDE265_API ~PacketSink() { } ++ virtual ~PacketSink() { } + +- virtual LIBDE265_API void send_packet(const uint8_t* data, int n) = 0; ++ virtual void send_packet(const uint8_t* data, int n) = 0; + }; + + + class PacketSink_File : public PacketSink + { + public: +- LIBDE265_API PacketSink_File(); +- virtual LIBDE265_API ~PacketSink_File(); ++ PacketSink_File(); ++ virtual ~PacketSink_File(); + +- LIBDE265_API void set_filename(const char* filename); ++ void set_filename(const char* filename); + +- virtual LIBDE265_API void send_packet(const uint8_t* data, int n); ++ virtual void send_packet(const uint8_t* data, int n); + + private: + FILE* mFH; +--- a/libde265/configparam.h ++++ b/libde265/configparam.h +@@ -95,7 +95,7 @@ + bool hasLongOption() const { return true; } //mLongOption!=NULL; } + std::string getLongOption() const { return mLongOption ? std::string(mLongOption) : get_name(); } + +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx) { return false; } ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx) { return false; } + + + +@@ -132,7 +132,7 @@ + virtual std::string get_default_string() const { return default_value ? "true":"false"; } + + virtual std::string getTypeDescr() const { return "(boolean)"; } +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx) { set(true); return true; } ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx) { set(true); return true; } + + bool set(bool v) { value_set=true; value=v; return true; } + +@@ -162,10 +162,10 @@ + virtual bool has_default() const { return default_set; } + + void set_default(std::string v) { default_value=v; default_set=true; } +- virtual LIBDE265_API std::string get_default_string() const { return default_value; } ++ virtual std::string get_default_string() const { return default_value; } + +- virtual LIBDE265_API std::string getTypeDescr() const { return "(string)"; } +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx); ++ virtual std::string getTypeDescr() const { return "(string)"; } ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx); + + bool set(std::string v) { value_set=true; value=v; return true; } + +@@ -201,10 +201,10 @@ + virtual bool has_default() const { return default_set; } + + void set_default(int v) { default_value=v; default_set=true; } +- virtual LIBDE265_API std::string get_default_string() const; ++ virtual std::string get_default_string() const; + +- virtual LIBDE265_API std::string getTypeDescr() const; +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx); ++ virtual std::string getTypeDescr() const; ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx); + + bool set(int v) { + if (is_valid(v)) { value_set=true; value=v; return true; } +@@ -239,7 +239,7 @@ + virtual std::vector get_choice_names() const = 0; + + virtual std::string getTypeDescr() const; +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx); ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx); + + const char** get_choices_string_table() const; + +@@ -368,10 +368,10 @@ + config_parameters() : param_string_table(NULL) { } + ~config_parameters() { delete[] param_string_table; } + +- void LIBDE265_API add_option(option_base* o); ++ void add_option(option_base* o); + +- void LIBDE265_API print_params() const; +- bool LIBDE265_API parse_command_line_params(int* argc, char** argv, int* first_idx=NULL, ++ void print_params() const; ++ bool parse_command_line_params(int* argc, char** argv, int* first_idx=NULL, + bool ignore_unknown_options=false); + + +--- a/libde265/quality.h ++++ b/libde265/quality.h +@@ -26,11 +26,11 @@ + #include + + +-LIBDE265_API uint32_t SSD(const uint8_t* img, int imgStride, ++uint32_t SSD(const uint8_t* img, int imgStride, + const uint8_t* ref, int refStride, + int width, int height); + +-LIBDE265_API uint32_t SAD(const uint8_t* img, int imgStride, ++uint32_t SAD(const uint8_t* img, int imgStride, + const uint8_t* ref, int refStride, + int width, int height); + +@@ -41,7 +41,7 @@ + LIBDE265_API double PSNR(double mse); + + +-LIBDE265_API uint32_t compute_distortion_ssd(const de265_image* img1, const de265_image* img2, ++uint32_t compute_distortion_ssd(const de265_image* img1, const de265_image* img2, + int x0, int y0, int log2size, int cIdx); + + #endif + + diff --git a/repo/libde265/libde265.xibuild b/repo/libde265/libde265.xibuild new file mode 100644 index 0000000..2806505 --- /dev/null +++ b/repo/libde265/libde265.xibuild @@ -0,0 +1,38 @@ +#!/bin/sh + +NAME="libde265" +DESC="Open h.265 video codec implementation" + +MAKEDEPS=" autoconf automake libtool" + +PKG_VER=1.0.8 +SOURCE="https://github.com/strukturag/libde265/releases/download/v$PKG_VER/libde265-$PKG_VER.tar.gz" + +ADDITIONAL=" +disable_tools.patch +export-only-decoder-api.patch +" + +prepare() { + apply_patches + autoreconf -fvi +} + +build() { + # This is en/decoder, so performance matters more than size. + export CPPFLAGS="$CPPFLAGS -O2" + export CXXFLAGS="$CXXFLAGS -O2" + + ./configure \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --disable-sherlock265 + make +} + +package() { + make DESTDIR="$PKG_DEST" install + + # The upstream do the same in their Ubuntu/PPA packages. + mv "$PKG_DEST"/usr/bin/dec265 "$PKG_DEST"/usr/bin/libde265-dec265 +} -- cgit v1.2.1