[packages/mediastreamer/DEVEL-cmake] - added cmake-SDL,types patches, restored SDL support

qboosh qboosh at pld-linux.org
Fri Jul 9 20:21:57 CEST 2021


commit b41678699df2dc41a9689380e75f31641b18d963
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Jul 9 20:25:11 2021 +0200

    - added cmake-SDL,types patches, restored SDL support

 mediastreamer-cmake-SDL.patch | 27 +++++++++++++++++++++++++++
 mediastreamer-types.patch     | 29 +++++++++++++++++++++++++++++
 mediastreamer.spec            |  6 +++++-
 3 files changed, 61 insertions(+), 1 deletion(-)
---
diff --git a/mediastreamer.spec b/mediastreamer.spec
index 09aff13..9169888 100644
--- a/mediastreamer.spec
+++ b/mediastreamer.spec
@@ -19,7 +19,7 @@
 %bcond_without	spandsp		# G726 codec support via spandsp
 # video I/O
 %bcond_without	opengl		# X11+OpenGL rendering support
-%bcond_with	sdl		# SDL support (not supported in cmake build)
+%bcond_without	sdl		# SDL support
 # video codecs
 %bcond_without	matroska	# Matroska support via libebml2/libmatroska2
 %bcond_without	zxing		# QRcode support via zxing-cpp
@@ -39,6 +39,8 @@ Patch1:		%{name}-cmake-link.patch
 Patch2:		libupnp-1.14.patch
 Patch3:		%{name}-cmake-datadir.patch
 Patch4:		%{name}-cmake-install-pkgconfig.patch
+Patch5:		%{name}-cmake-SDL.patch
+Patch6:		%{name}-types.patch
 URL:		http://www.linphone.org/technical-corner/mediastreamer2/overview
 %{?with_opengl:BuildRequires:	OpenGL-GLX-devel}
 %{?with_sdl:BuildRequires:	SDL-devel >= 1.2.0}
@@ -157,6 +159,8 @@ Statyczne biblioteki mediastreamer.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
 
 #[ ! -e gitversion.h ] && echo '#define MS2_GIT_VERSION "%{version}"' > src/gitversion.h
 
diff --git a/mediastreamer-cmake-SDL.patch b/mediastreamer-cmake-SDL.patch
new file mode 100644
index 0000000..09d4690
--- /dev/null
+++ b/mediastreamer-cmake-SDL.patch
@@ -0,0 +1,27 @@
+--- mediastreamer2-4.5.22/CMakeLists.txt.orig	2021-07-09 18:37:34.690096407 +0200
++++ mediastreamer2-4.5.22/CMakeLists.txt	2021-07-09 19:32:39.148861285 +0200
+@@ -287,7 +287,13 @@ endif()
+ if(NOT APPLE AND NOT ANDROID AND OPENGL_FOUND OR GLX_FOUND)
+ 	find_package(Glew REQUIRED)
+ endif()
+-# TODO: Handle SDL option
++if(ENABLE_SDL)
++	find_package(SDL)
++	if(NOT SDL_FOUND)
++		message(WARNING "Could not find SDL library")
++		set(ENABLE_SDL OFF CACHE BOOL "Enable SDL video output." FORCE)
++	endif()
++endif()
+ if(ENABLE_THEORA)
+ 	find_package(Theora)
+ 	if(NOT THEORA_FOUND)
+@@ -453,6 +459,9 @@ if(GLEW_FOUND)
+ 	list(APPEND LINK_LIBS GLEW)
+ 	list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${GLEW_INCLUDE_DIRS})
+ endif()
++if(SDL_FOUND)
++	list(APPEND LINK_LIBS SDL)
++endif()
+ if(THEORA_FOUND)
+ 	list(APPEND LINK_LIBS theora)
+ endif()
diff --git a/mediastreamer-types.patch b/mediastreamer-types.patch
new file mode 100644
index 0000000..02256f1
--- /dev/null
+++ b/mediastreamer-types.patch
@@ -0,0 +1,29 @@
+--- mediastreamer2-4.5.22/src/videofilters/videoout.c.orig	2021-06-24 23:55:04.000000000 +0200
++++ mediastreamer2-4.5.22/src/videofilters/videoout.c	2021-07-09 19:42:52.842203289 +0200
+@@ -152,7 +152,7 @@ typedef struct _SdlDisplay{
+ 
+ #include <SDL/SDL_syswm.h>
+ 
+-static long sdl_get_native_window_id(){
++static long sdl_get_native_window_id(void){
+ 	SDL_SysWMinfo info;
+ 	SDL_VERSION(&info.version);
+ 	if ( SDL_GetWMInfo(&info) ) {
+@@ -191,7 +191,7 @@ static void sdl_show_window(bool_t show)
+ 	#endif
+ }
+ 
+-static long sdl_get_native_window_id(){
++static long sdl_get_native_window_id(void){
+ 	#if !SDL_VERSION_ATLEAST(1, 3, 0)
+ 	ms_warning("sdl_get_native_window_id not implemented");
+ 	#endif
+@@ -257,7 +257,7 @@ static int sdl_create_window(SdlDisplay
+ 		ms_message("%i x %i YUV overlay created: hw_accel=%i, pitches=%i,%i,%i",wd->lay->w,wd->lay->h,wd->lay->hw_overlay,
+ 			wd->lay->pitches[0],wd->lay->pitches[1],wd->lay->pitches[2]);
+ 		ms_message("planes= %p %p %p  %li %li",wd->lay->pixels[0],wd->lay->pixels[1],wd->lay->pixels[2],
+-			wd->lay->pixels[1]-wd->lay->pixels[0],wd->lay->pixels[2]-wd->lay->pixels[1]);
++			(long)(wd->lay->pixels[1]-wd->lay->pixels[0]),(long)(wd->lay->pixels[2]-wd->lay->pixels[1]));
+ 		SDL_UnlockYUVOverlay(wd->lay);
+ 	}
+ #ifdef __linux__
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mediastreamer.git/commitdiff/b41678699df2dc41a9689380e75f31641b18d963



More information about the pld-cvs-commit mailing list