[packages/mediastreamer-plugin-msopenh264] - fix building with openh264 1.6+ - rel 4

baggins baggins at pld-linux.org
Thu Aug 24 22:42:01 CEST 2017


commit 6f41714be8e1f868b1c8518cf47ec533bf9e90f9
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Aug 24 22:41:36 2017 +0200

    - fix building with openh264 1.6+
    - rel 4

 mediastreamer-plugin-msopenh264.spec |  4 ++-
 openh264-1.6.patch                   | 57 ++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletion(-)
---
diff --git a/mediastreamer-plugin-msopenh264.spec b/mediastreamer-plugin-msopenh264.spec
index 6396b69..a108245 100644
--- a/mediastreamer-plugin-msopenh264.spec
+++ b/mediastreamer-plugin-msopenh264.spec
@@ -2,11 +2,12 @@ Summary:	H.264 video codec for mediastreamer based on the openh264 library
 Summary(pl.UTF-8):	Kodek obrazu H.264 dla mediastreamera oparty na bibliotece openh264
 Name:		mediastreamer-plugin-msopenh264
 Version:	1.1.1
-Release:	3
+Release:	4
 License:	GPL v2+
 Group:		Libraries
 Source0:	http://linphone.org/releases/sources/plugins/msopenh264/msopenh264-%{version}.tar.gz
 # Source0-md5:	7500abc43b1f3c935c97ea6a5c0d75ee
+Patch0:		openh264-1.6.patch
 URL:		http://www.linphone.org/technical-corner/mediastreamer2/overview
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -29,6 +30,7 @@ opartą na bibliotece openh264.
 
 %prep
 %setup -q -n msopenh264-%{version}
+%patch0 -p1
 
 %build
 %{__libtoolize}
diff --git a/openh264-1.6.patch b/openh264-1.6.patch
new file mode 100644
index 0000000..a8ce873
--- /dev/null
+++ b/openh264-1.6.patch
@@ -0,0 +1,57 @@
+diff -ur msopenh264-1.1.1/src/msopenh264dec.cpp msopenh264-1.2.1/src/msopenh264dec.cpp
+--- msopenh264-1.1.1/src/msopenh264dec.cpp	2015-09-23 15:14:22.000000000 +0200
++++ msopenh264-1.2.1/src/msopenh264dec.cpp	2016-10-19 17:32:52.000000000 +0200
+@@ -14,6 +14,8 @@
+ #include "msopenh264dec.h"
+ #include "mediastreamer2/msticker.h"
+ #include "ortp/b64.h"
++#include "wels/codec_ver.h"
++
+ 
+ MSOpenH264Decoder::MSOpenH264Decoder(MSFilter *f)
+ 	: mFilter(f), mDecoder(0), mUnpacker(0), mSPS(0), mPPS(0), mYUVMsg(0),
+@@ -53,11 +62,14 @@
+ 		mUnpacker=rfc3984_new();
+ 		if (mDecoder != 0) {
+ 			SDecodingParam params = { 0 };
++#if (OPENH264_MAJOR == 1) && (OPENH264_MINOR >=6)
++#else
+ 			params.eOutputColorFormat = videoFormatI420;
++#endif
+ 			params.uiTargetDqLayer = (unsigned char) -1;
+ 			params.eEcActiveIdc = ERROR_CON_FRAME_COPY_CROSS_IDR;
+ 			params.sVideoProperty.size = sizeof(params.sVideoProperty);
+-			params.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
++			params.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;
+ 			long ret = mDecoder->Initialize(&params);
+ 			if (ret != 0) {
+ 				ms_error("OpenH264 decoder: Failed to initialize: %li", ret);
+diff -ur msopenh264-1.1.1/src/msopenh264enc.cpp msopenh264-1.2.1/src/msopenh264enc.cpp
+--- msopenh264-1.1.1/src/msopenh264enc.cpp	2015-09-23 15:14:22.000000000 +0200
++++ msopenh264-1.2.1/src/msopenh264enc.cpp	2017-07-20 15:56:32.000000000 +0200
+@@ -14,7 +14,7 @@
+ #include "msopenh264enc.h"
+ #include "mediastreamer2/msticker.h"
+ #include "wels/codec_app_def.h"
+-
++#include "wels/codec_ver.h"
+ 
+ //static const int RC_MARGIN = 10000; // bits per sec
+ #if MSOPENH264_DEBUG
+@@ -114,9 +112,15 @@
+ 			params.sSpatialLayers[0].fFrameRate = mVConf.fps;
+ 			params.sSpatialLayers[0].iSpatialBitrate = targetBitrate;
+ 			params.sSpatialLayers[0].iMaxSpatialBitrate = maxBitrate;
++
++#if (OPENH264_MAJOR == 1) && (OPENH264_MINOR >=6)
++			params.sSpatialLayers[0].sSliceArgument.uiSliceMode = SM_SIZELIMITED_SLICE;
++			params.sSpatialLayers[0].sSliceArgument.uiSliceSizeConstraint = ms_factory_get_payload_max_size(mFilter->factory);
++#else
+ 			params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_DYN_SLICE;
+ 			params.sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceSizeConstraint = ms_factory_get_payload_max_size(mFilter->factory);
+-
++#endif
++			//params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_AUTO_SLICE;
+ 			ret = mEncoder->InitializeExt(&params);
+ 			if (ret != 0) {
+ 				ms_error("OpenH264 encoder: Failed to initialize: %d", ret);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mediastreamer-plugin-msopenh264.git/commitdiff/6f41714be8e1f868b1c8518cf47ec533bf9e90f9



More information about the pld-cvs-commit mailing list