]> git.pld-linux.org Git - packages/mediastreamer.git/commitdiff
- updated to 5.3.29 (library name changed to libmediastreamer2)
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 10 Mar 2024 06:45:12 +0000 (07:45 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 10 Mar 2024 06:45:38 +0000 (07:45 +0100)
build.patch
ffmpeg_5_0_fixes.patch
libupnp-1.14.patch
mediastreamer-cmake-SDL.patch
mediastreamer-cmake-find.patch [new file with mode: 0644]
mediastreamer-cmake-install-pkgconfig.patch
mediastreamer-cmake-link.patch
mediastreamer-gcc.patch [deleted file]
mediastreamer-types.patch
mediastreamer.spec

index f9f9a0e9ebbcc4d7a2cde4d7f92ee50144453c1e..56d9738f8c99f47dbe17efff21e7f7f8fe8df31c 100644 (file)
  
  img_DATA=voip/nowebcamCIF.jpg
  
---- mediastreamer2-4.4.2/src/base/msfactory.c.orig     2020-09-24 11:44:00.000000000 +0200
-+++ mediastreamer2-4.4.2/src/base/msfactory.c  2020-09-26 18:00:06.215992977 +0200
-@@ -236,7 +236,7 @@
+--- mediastreamer2-5.3.29/src/base/msfactory.c.orig    2024-03-07 22:23:17.768973732 +0100
++++ mediastreamer2-5.3.29/src/base/msfactory.c 2024-03-07 22:24:22.358623820 +0100
+@@ -248,7 +248,7 @@ void ms_factory_init(MSFactory *obj) {
        ms_message("ms_factory_init() done: platform_tags=%s", tags);
        ms_free(tags);
  
 +      obj->image_resources_dir = bctbx_strdup_printf("%s/mediastreamer/images", PACKAGE_DATA_DIR);
  }
  
+ MSFactory *ms_factory_new(void) {
index 9e73a0df2af43c6a76cfda86e8e4fb500658ab18..1d492e8e7cd7ca286b8ecb06d30c4e342c6db508 100644 (file)
@@ -6,79 +6,98 @@ Description: Port to ffmpeg 5.0 API
 Author: Dennis Filder <d.filder@web.de>
 Last-Update: 2022-06-28
 Bug-Debian: https://bugs.debian.org/1004819
---- a/src/utils/ffmpeg-priv.h
-+++ b/src/utils/ffmpeg-priv.h
-@@ -66,6 +66,7 @@
- #if defined(HAVE_LIBAVCODEC_AVCODEC_H)
- #if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52,24,0)
-+#if 0
- /*should work as long as nobody uses avformat.h*/
- typedef struct AVPacket{
-       uint8_t *data;
-@@ -81,6 +82,7 @@
-       return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size);
- }
- #endif
-+#endif
- #if HAVE_AVCODEC_OLD_CODEC_IDS
- #include <libavcodec/old_codec_ids.h>
- #endif
-@@ -117,13 +119,17 @@
+--- mediastreamer2-5.3.29/cmake/FindFFMpeg.cmake.orig  2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/cmake/FindFFMpeg.cmake       2024-03-09 15:46:23.298516579 +0100
+@@ -71,8 +71,11 @@ endif()
+ set(_FFMpeg_CACHE_VARS ${_FFMpeg_REQUIRED_VARS}
+       HAVE_LIBAVCODEC_AVCODEC_H
+       HAVE_LIBSWSCALE_SWSCALE_H
++      HAVE_FUN_avcodec_alloc_context3
++      HAVE_FUN_avcodec_get_context_defaults
+       HAVE_FUN_avcodec_get_context_defaults3
+       HAVE_FUN_avcodec_open2
++      HAVE_FUN_avcodec_encode_video
+       HAVE_FUN_avcodec_encode_video2
+       HAVE_FUN_av_frame_alloc
+       HAVE_FUN_av_frame_free
+@@ -145,8 +148,11 @@ else()
+                       if(LIBM)
+                               list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBM})
+                       endif()
++                      check_symbol_exists(avcodec_alloc_context3 "libavcodec/avcodec.h" HAVE_FUN_avcodec_alloc_context3)
++                      check_symbol_exists(avcodec_get_context_defaults "libavcodec/avcodec.h" HAVE_FUN_avcodec_get_context_defaults)
+                       check_symbol_exists(avcodec_get_context_defaults3 "libavcodec/avcodec.h" HAVE_FUN_avcodec_get_context_defaults3)
+                       check_symbol_exists(avcodec_open2 "libavcodec/avcodec.h" HAVE_FUN_avcodec_open2)
++                      check_symbol_exists(avcodec_encode_video "libavcodec/avcodec.h" HAVE_FUN_avcodec_encode_video)
+                       check_symbol_exists(avcodec_encode_video2 "libavcodec/avcodec.h" HAVE_FUN_avcodec_encode_video2)
+                       check_symbol_exists(av_frame_alloc "libavutil/avutil.h;libavutil/frame.h" HAVE_FUN_av_frame_alloc)
+                       check_symbol_exists(av_frame_free "libavutil/avutil.h;libavutil/frame.h" HAVE_FUN_av_frame_free)
+--- mediastreamer2-5.3.29/mediastreamer-config.h.cmake.orig    2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/mediastreamer-config.h.cmake 2024-03-09 17:07:32.915468933 +0100
+@@ -60,8 +60,11 @@
+ #cmakedefine HAVE_LIBAVCODEC_AVCODEC_H 1
+ #cmakedefine HAVE_LIBSWSCALE_SWSCALE_H 1
+ #cmakedefine HAVE_LIBYUV_H 1
++#cmakedefine HAVE_FUN_avcodec_alloc_context3
++#cmakedefine HAVE_FUN_avcodec_get_context_defaults 1
+ #cmakedefine HAVE_FUN_avcodec_get_context_defaults3 1
+ #cmakedefine HAVE_FUN_avcodec_open2 1
++#cmakedefine HAVE_FUN_avcodec_encode_video 1
+ #cmakedefine HAVE_FUN_avcodec_encode_video2 1
+ #cmakedefine HAVE_FUN_av_frame_alloc 1
+ #cmakedefine HAVE_FUN_av_frame_free 1
+--- mediastreamer2-5.3.29/src/utils/ffmpeg-priv.h.orig 2024-03-09 15:55:58.335401336 +0100
++++ mediastreamer2-5.3.29/src/utils/ffmpeg-priv.h      2024-03-09 15:56:01.452051119 +0100
+@@ -112,12 +112,14 @@ extern "C" {
+ extern "C" {
  #endif
  
- #ifndef HAVE_FUN_avcodec_encode_video2
-+#if 0
- int avcodec_encode_video2 (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr);
+-#ifndef HAVE_FUN_avcodec_encode_video2
++#if defined(HAVE_FUN_avcodec_encode_video) && !defined(HAVE_FUN_avcodec_encode_video2)
+ int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr);
  #endif
-+#endif
  
- #ifndef HAVE_FUN_avcodec_get_context_defaults3 /**/
-+#if 0
- int avcodec_get_context_defaults3 (AVCodecContext *s, AVCodec *codec);
+-#ifndef HAVE_FUN_avcodec_get_context_defaults3 /**/
++#if defined(HAVE_FUN_avcodec_get_context_defaults) && !defined(HAVE_FUN_avcodec_get_context_defaults3) /**/
+ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
++#endif
++#ifndef HAVE_FUN_avcodec_alloc_context3
  AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
  #endif
-+#endif
  
- #ifndef HAVE_FUN_avcodec_open2 /**/
- int avcodec_open2 (AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);
---- a/src/utils/ffmpeg-priv.c
-+++ b/src/utils/ffmpeg-priv.c
-@@ -23,6 +23,7 @@
+--- mediastreamer2-5.3.29/src/utils/ffmpeg-priv.c.orig 2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/src/utils/ffmpeg-priv.c      2024-03-09 15:56:57.378414806 +0100
+@@ -21,7 +21,7 @@
  
+ #include "ffmpeg-priv.h"
  
- #ifndef HAVE_FUN_avcodec_encode_video2
-+#if 0
- int avcodec_encode_video2 (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) {
-       int error=avcodec_encode_video(avctx, avpkt->data, avpkt->size,frame);
-       if (error<0){
-@@ -36,10 +37,12 @@
-       return 0;
+-#ifndef HAVE_FUN_avcodec_encode_video2
++#if defined(HAVE_FUN_avcodec_encode_video) && !defined(HAVE_FUN_avcodec_encode_video2)
+ int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) {
+       int error = avcodec_encode_video(avctx, avpkt->data, avpkt->size, frame);
+       if (error < 0) {
+@@ -36,12 +36,14 @@ int avcodec_encode_video2(AVCodecContext
  }
  #endif
-+#endif
  
- #ifndef HAVE_FUN_avcodec_get_context_defaults3 /**/
-+#if 0
- int avcodec_get_context_defaults3 (AVCodecContext *s, AVCodec *codec) {
+-#ifndef HAVE_FUN_avcodec_get_context_defaults3 /**/
++#if defined(HAVE_FUN_avcodec_get_context_defaults) && !defined(HAVE_FUN_avcodec_get_context_defaults3) /**/
+ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec) {
        avcodec_get_context_defaults(s);
        return 0;
-@@ -48,6 +51,7 @@
- AVCodecContext *avcodec_alloc_context3(AVCodec *codec){
-       return avcodec_alloc_context();
  }
 +#endif
  
- #endif
---- a/src/videofilters/videodec.c
-+++ b/src/videofilters/videodec.c
-@@ -49,8 +49,8 @@
++#ifndef HAVE_FUN_avcodec_alloc_context3 /**/
+ AVCodecContext *avcodec_alloc_context3(AVCodec *codec) {
+       return avcodec_alloc_context();
+ }
+--- mediastreamer2-5.3.29/src/videofilters/videodec.c.orig     2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/src/videofilters/videodec.c  2024-03-09 16:15:27.685733089 +0100
+@@ -47,8 +47,8 @@
+ extern void ms_ffmpeg_check_init(void);
  
- typedef struct DecState{
+ typedef struct DecState {
 -      AVCodecContext av_context;
 -      AVCodec *av_codec;
 +      AVCodecContext *av_contextp;
@@ -86,25 +105,25 @@ Bug-Debian: https://bugs.debian.org/1004819
        enum CodecID codec;
        mblk_t *input;
        YuvBuf outbuf;
-@@ -66,11 +66,14 @@
}DecState;
+@@ -63,11 +63,14 @@ typedef struct DecState {
      bool_t first_image_decoded;
+ } DecState;
  
 +/*
 + * FIXME: With the ffmpeg 5.0 API this ought to return an error when
 + * allocation fails.
 + */
- static void dec_init(MSFilter *f, enum CodecID cid){
-       DecState *s=(DecState *)ms_new0(DecState,1);
+ static void dec_init(MSFilter *f, enum CodecID cid) {
+       DecState *s = (DecState *)ms_new0(DecState, 1);
        ms_ffmpeg_check_init();
  
 -      avcodec_get_context_defaults3(&s->av_context, NULL);
        s->allocator = ms_yuv_buf_allocator_new();
-       s->av_codec=NULL;
-       s->codec=cid;
-@@ -86,6 +89,10 @@
-       if (s->av_codec==NULL){
-               ms_error("Could not find decoder %i!",s->codec);
+       s->av_codec = NULL;
+       s->codec = cid;
+@@ -83,6 +86,10 @@ static void dec_init(MSFilter *f, enum C
+       if (s->av_codec == NULL) {
+               ms_error("Could not find decoder %i!", s->codec);
        }
 +      s->av_contextp = avcodec_alloc_context3(s->av_codec);
 +      if (s->av_contextp==NULL){
@@ -113,96 +132,93 @@ Bug-Debian: https://bugs.debian.org/1004819
        s->orig = av_frame_alloc();
        if (!s->orig) {
                ms_error("Could not allocate frame");
-@@ -119,9 +126,8 @@
+@@ -118,9 +125,8 @@ static void dec_uninit(MSFilter *f) {
                av_frame_free(&s->orig);
                s->orig = NULL;
        }
--      if (s->av_context.codec!=NULL){
+-      if (s->av_context.codec != NULL) {
 -              avcodec_close(&s->av_context);
--              s->av_context.codec=NULL;
-+      if (s->av_contextp && s->av_contextp->codec!=NULL){
+-              s->av_context.codec = NULL;
++      if (s->av_contextp != NULL && s->av_contextp->codec != NULL) {
 +              avcodec_free_context(&s->av_contextp);
        }
        ms_yuv_buf_allocator_free(s->allocator);
-       if (s->input!=NULL) freemsg(s->input);
-@@ -160,16 +166,16 @@
+       if (s->input != NULL) freemsg(s->input);
+@@ -159,16 +165,16 @@ static void dec_preprocess(MSFilter *f)
  
        s->first_image_decoded = FALSE;
        ms_average_fps_init(&s->fps, "Video decoder: FPS: %f");
--      if (s->av_context.codec==NULL){
-+      if (s->av_contextp && s->av_contextp->codec==NULL){
+-      if (s->av_context.codec == NULL) {
++      if (s->av_contextp != NULL && s->av_contextp->codec == NULL) {
                /* we must know picture size before initializing snow decoder*/
  #if HAVE_AVCODEC_SNOW
-               if (s->codec!=CODEC_ID_SNOW){
+               if (s->codec != CODEC_ID_SNOW) {
  #endif
--                      error=avcodec_open2(&s->av_context, s->av_codec, NULL);
-+                      error=avcodec_open2(s->av_contextp, s->av_codec, NULL);
-                       if (error!=0) ms_error("avcodec_open() failed: %i",error);
-                       if (s->codec==CODEC_ID_MPEG4 && s->dci_size>0){
--                              s->av_context.extradata=s->dci;
--                              s->av_context.extradata_size=s->dci_size;
-+                              s->av_contextp->extradata=s->dci;
-+                              s->av_contextp->extradata_size=s->dci_size;
+-                      error = avcodec_open2(&s->av_context, s->av_codec, NULL);
++                      error = avcodec_open2(s->av_contextp, s->av_codec, NULL);
+                       if (error != 0) ms_error("avcodec_open() failed: %i", error);
+                       if (s->codec == CODEC_ID_MPEG4 && s->dci_size > 0) {
+-                              s->av_context.extradata = s->dci;
+-                              s->av_context.extradata_size = s->dci_size;
++                              s->av_contextp->extradata = s->dci;
++                              s->av_contextp->extradata_size = s->dci_size;
                        }
  #if HAVE_AVCODEC_SNOW
                }
-@@ -256,15 +262,15 @@
-               uint32_t h = ntohl(*(uint32_t*)inm->b_rptr);
-               if (!s->snow_initialized){
+@@ -258,13 +264,13 @@ static mblk_t *parse_snow_header(DecStat
+               uint32_t h = ntohl(*(uint32_t *)inm->b_rptr);
+               if (!s->snow_initialized) {
                        int error;
--                      s->av_context.width=h>>16;
--                      s->av_context.height=h&0xffff;
--                      error=avcodec_open2(&s->av_context, s->av_codec, NULL);
-+                      s->av_contextp->width=h>>16;
-+                      s->av_contextp->height=h&0xffff;
-+                      error=avcodec_open2(s->av_contextp, s->av_codec, NULL);
-                       if (error!=0) ms_error("avcodec_open() failed for snow: %i",error);
+-                      s->av_context.width = h >> 16;
+-                      s->av_context.height = h & 0xffff;
+-                      error = avcodec_open2(&s->av_context, s->av_codec, NULL);
++                      s->av_contextp->width = h >> 16;
++                      s->av_contextp->height = h & 0xffff;
++                      error = avcodec_open2(s->av_contextp, s->av_codec, NULL);
+                       if (error != 0) ms_error("avcodec_open() failed for snow: %i", error);
                        else {
-                               s->snow_initialized=TRUE;
-                               ms_message("Snow decoder initialized,size=%ix%i",
--                              s->av_context.width,
--                              s->av_context.height);
-+                              s->av_contextp->width,
-+                              s->av_contextp->height);
+                               s->snow_initialized = TRUE;
+-                              ms_message("Snow decoder initialized,size=%ix%i", s->av_context.width, s->av_context.height);
++                              ms_message("Snow decoder initialized,size=%ix%i", s->av_contextp->width, s->av_contextp->height);
                        }
                }
-               inm->b_rptr+=4;
-@@ -628,7 +634,7 @@
+               inm->b_rptr += 4;
+@@ -558,7 +564,7 @@ static mblk_t *read_rfc2435_header(DecSt
  }
  
- static mblk_t *get_as_yuvmsg(MSFilter *f, DecState *s, AVFrame *orig){
--      AVCodecContext *ctx=&s->av_context;
-+      AVCodecContext *ctx=s->av_contextp;
+ static mblk_t *get_as_yuvmsg(MSFilter *f, DecState *s, AVFrame *orig) {
+-      AVCodecContext *ctx = &s->av_context;
++      AVCodecContext *ctx = s->av_contextp;
        mblk_t *yuv_msg;
  
-       if (ctx->width==0 || ctx->height==0){
-@@ -662,7 +668,7 @@
+       if (ctx->width == 0 || ctx->height == 0) {
+@@ -591,7 +597,7 @@ static mblk_t *get_as_yuvmsg(MSFilter *f
  #endif
-               ms_error("%s: error in ms_sws_scale().",f->desc->name);
+               ms_error("%s: error in ms_sws_scale().", f->desc->name);
        }
 -      mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pkt_pts);
 +      mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pts);
        return yuv_msg;
  }
  /* Bitmasks to select bits of a byte from low side */
-@@ -671,7 +677,7 @@
- static void dec_process_frame(MSFilter *f, mblk_t *inm){
-       DecState *s=(DecState*)f->data;
+@@ -600,7 +606,7 @@ static unsigned char smasks[7] = {0x7f,
+ static void dec_process_frame(MSFilter *f, mblk_t *inm) {
+       DecState *s = (DecState *)f->data;
  
 -      int got_picture;
 +      int got_picture = 0;
        /* get a picture from the input queue */
  
-       if (f->desc->id==MS_H263_DEC_ID) inm=skip_rfc2429_header(inm);
-@@ -720,12 +726,27 @@
+       if (f->desc->id == MS_H263_DEC_ID) inm = skip_rfc2429_header(inm);
+@@ -649,12 +655,27 @@ static void dec_process_frame(MSFilter *
                                pkt.data = frame->b_rptr;
                                pkt.size = remain;
                                pkt.pts = frame_ts;
--                              len=avcodec_decode_video2(&s->av_context, s->orig, &got_picture,&pkt);
+-                              len = avcodec_decode_video2(&s->av_context, s->orig, &got_picture, &pkt);
 -
--                              if (len<=0) {
--                                      ms_warning("ms_AVdecoder_process: error %i.",len);
--                                      ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_DECODING_ERRORS);
+-                              if (len <= 0) {
+-                                      ms_warning("ms_AVdecoder_process: error %i.", len);
+-                                      ms_filter_notify_no_arg(f, MS_VIDEO_DECODER_DECODING_ERRORS);
 -                                      break;
 +                              {
 +                                      int ret1 = avcodec_send_packet(s->av_contextp, &pkt), ret2;
@@ -227,58 +243,59 @@ Bug-Debian: https://bugs.debian.org/1004819
 +                                      }
                                }
                                if (got_picture) {
-                                       mblk_t *om = get_as_yuvmsg(f,s,s->orig);
---- a/src/videofilters/videoenc.c
-+++ b/src/videofilters/videoenc.c
-@@ -37,6 +37,8 @@
+                                       mblk_t *om = get_as_yuvmsg(f, s, s->orig);
+--- mediastreamer2-5.3.29/src/videofilters/videoenc.c.orig     2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/src/videofilters/videoenc.c  2024-03-09 16:23:29.366456934 +0100
+@@ -37,6 +37,9 @@
  
  #include "rfc2429.h"
  
 +#include <libavutil/imgutils.h>
 +#include <libavutil/opt.h>
++ 
  #if LIBAVCODEC_VERSION_MAJOR >= 57
  
-@@ -129,7 +131,6 @@
+ #ifdef _MSC_VER
+@@ -109,7 +112,6 @@ void ms_ffmpeg_log_callback(void *ptr, i
  
- void ms_ffmpeg_check_init(){
-       if(!avcodec_initialized){
+ void ms_ffmpeg_check_init() {
+       if (!avcodec_initialized) {
 -              avcodec_register_all();
-               avcodec_initialized=TRUE;
+               avcodec_initialized = TRUE;
  #ifdef ENABLE_LOG_FFMPEG
                av_log_set_level(AV_LOG_WARNING);
-@@ -139,8 +140,8 @@
+@@ -119,8 +121,8 @@ void ms_ffmpeg_check_init() {
  }
  
- typedef struct EncState{
+ typedef struct EncState {
 -      AVCodecContext av_context;
 -      AVCodec *av_codec;
 +      AVCodecContext *av_contextp;
 +      const AVCodec *av_codec;
-       AVFramepict;
+       AVFrame *pict;
        enum CodecID codec;
        mblk_t *comp_buf;
-@@ -243,7 +244,7 @@
-       s->qmin=2;
-       s->req_vfu=FALSE;
-       s->framenum=0;
--      s->av_context.codec=NULL;
-+      s->av_contextp->codec=NULL;
+@@ -223,7 +225,7 @@ static void enc_init(MSFilter *f, enum C
+       s->qmin = 2;
+       s->req_vfu = FALSE;
+       s->framenum = 0;
+-      s->av_context.codec = NULL;
++      s->av_contextp->codec = NULL;
        s->vconf_list = get_vconf_list(s);
-       s->vconf = ms_video_find_best_configuration_for_bitrate(s->vconf_list, 500000,ms_factory_get_cpu_count(f->factory));
-       s->pict = av_frame_alloc();
-@@ -265,11 +266,21 @@
-       enc_init(f,CODEC_ID_MJPEG);
+       s->vconf =
+           ms_video_find_best_configuration_for_bitrate(s->vconf_list, 500000, ms_factory_get_cpu_count(f->factory));
+@@ -246,11 +248,21 @@ static void enc_mjpeg_init(MSFilter *f)
+       enc_init(f, CODEC_ID_MJPEG);
  }
  
 +/*
 + * FIXME: With the ffmpeg 5.0 API this ought to return an error when
 + * allocation fails.
 + */
- static void prepare(EncState *s){
--      AVCodecContext *c=&s->av_context;
-+      AVCodecContext *c=s->av_contextp;
-       const int max_br_vbv=128000;
+ static void prepare(EncState *s) {
+-      AVCodecContext *c = &s->av_context;
++      AVCodecContext *c = s->av_contextp;
+       const int max_br_vbv = 128000;
  
 -      avcodec_get_context_defaults3(c, NULL);
 +      if (s->av_contextp != NULL)
@@ -288,99 +305,99 @@ Bug-Debian: https://bugs.debian.org/1004819
 +              ms_error("Could not allocate AVCodecContext.");
 +              return;
 +      }
-       if (s->codec==CODEC_ID_MJPEG)
-       {
-               ms_message("Codec bitrate set to %i",(int)c->bit_rate);
-@@ -327,13 +338,13 @@
+       if (s->codec == CODEC_ID_MJPEG) {
+               ms_message("Codec bitrate set to %i", (int)c->bit_rate);
+               c->width = s->vconf.vsize.width;
+@@ -306,13 +318,13 @@ static void prepare(EncState *s) {
  }
  
- static void prepare_h263(EncState *s){
--      AVCodecContext *c=&s->av_context;
-+      AVCodecContext *c=s->av_contextp;
+ static void prepare_h263(EncState *s) {
+-      AVCodecContext *c = &s->av_context;
++      AVCodecContext *c = s->av_contextp;
        /* we don't use the rtp_callback but use rtp_mode that forces ffmpeg to insert
        Start Codes as much as possible in the bitstream */
- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-         c->rtp_mode = 1;
+ #if LIBAVCODEC_VERSION_INT < ((52 << 16) + (0 << 8) + 0)
+       c->rtp_mode = 1;
  #endif
--      c->rtp_payload_size = s->mtu/2;
+-      c->rtp_payload_size = s->mtu / 2;
 +      av_opt_set_int((struct MpegEncContext *) c->priv_data, "ps", s->mtu/2, 0);
-       if (s->profile==0){
-               s->codec=CODEC_ID_H263;
-       }else{
-@@ -349,7 +360,7 @@
+       if (s->profile == 0) {
+               s->codec = CODEC_ID_H263;
+       } else {
+@@ -328,7 +340,7 @@ static void prepare_h263(EncState *s) {
  }
  
- static void prepare_mpeg4(EncState *s){
--      AVCodecContext *c=&s->av_context;
-+      AVCodecContext *c=s->av_contextp;
-       c->max_b_frames=0; /*don't use b frames*/
+ static void prepare_mpeg4(EncState *s) {
+-      AVCodecContext *c = &s->av_context;
++      AVCodecContext *c = s->av_contextp;
+       c->max_b_frames = 0; /*don't use b frames*/
  }
  
-@@ -383,22 +394,21 @@
-               ms_error("could not find encoder for codec id %i",s->codec);
+@@ -360,22 +372,21 @@ static void enc_preprocess(MSFilter *f)
+               ms_error("could not find encoder for codec id %i", s->codec);
                return;
        }
--      error=avcodec_open2(&s->av_context, s->av_codec, NULL);
-+      error=avcodec_open2(s->av_contextp, s->av_codec, NULL);
-       if (error!=0) {
-               ms_error("avcodec_open() failed: %i",error);
+-      error = avcodec_open2(&s->av_context, s->av_codec, NULL);
++      error = avcodec_open2(s->av_contextp, s->av_codec, NULL);
+       if (error != 0) {
+               ms_error("avcodec_open() failed: %i", error);
                return;
        }
        ms_video_starter_init(&s->starter);
--      ms_debug("image format is %i.",s->av_context.pix_fmt);
--      ms_message("qmin=%i qmax=%i",s->av_context.qmin,s->av_context.qmax);
-+      ms_debug("image format is %i.",s->av_contextp->pix_fmt);
-+      ms_message("qmin=%i qmax=%i",s->av_contextp->qmin,s->av_contextp->qmax);
-       s->framenum=0;
+-      ms_debug("image format is %i.", s->av_context.pix_fmt);
+-      ms_message("qmin=%i qmax=%i", s->av_context.qmin, s->av_context.qmax);
++      ms_debug("image format is %i.", s->av_contextp->pix_fmt);
++      ms_message("qmin=%i qmax=%i", s->av_contextp->qmin, s->av_contextp->qmax);
+       s->framenum = 0;
  }
  
- static void enc_postprocess(MSFilter *f){
-       EncState *s=(EncState*)f->data;
--      if (s->av_context.codec!=NULL){
+ static void enc_postprocess(MSFilter *f) {
+       EncState *s = (EncState *)f->data;
+-      if (s->av_context.codec != NULL) {
 -              avcodec_close(&s->av_context);
--              s->av_context.codec=NULL;
-+      if (s->av_contextp->codec!=NULL){
+-              s->av_context.codec = NULL;
++      if (s->av_contextp->codec != NULL) {
 +              avcodec_free_context(&s->av_contextp);
        }
-       if (s->comp_buf!=NULL)  {
+       if (s->comp_buf != NULL) {
                freemsg(s->comp_buf);
-@@ -469,7 +479,7 @@
-               /*frame->b_rptr=packet->b_wptr=packet->b_rptr+get_gbsc(packet->b_rptr, MIN(packet->b_rptr+s->mtu,frame->b_wptr));*/
+@@ -445,7 +456,7 @@ static void rfc2190_generate_packets(MSF
+                * MIN(packet->b_rptr+s->mtu,frame->b_wptr));*/
                frame->b_rptr = packet->b_wptr =
-                       packet->b_rptr + get_gbsc_bytealigned(packet->b_rptr, MIN(packet->b_rptr+s->mtu,frame->b_wptr));
--              add_rfc2190_header(&packet, &s->av_context ,is_iframe);
-+              add_rfc2190_header(&packet, s->av_contextp ,is_iframe);
-               mblk_set_timestamp_info(packet,timestamp);
-               ms_queue_put(f->outputs[0],packet);
+                   packet->b_rptr + get_gbsc_bytealigned(packet->b_rptr, MIN(packet->b_rptr + s->mtu, frame->b_wptr));
+-              add_rfc2190_header(&packet, &s->av_contextis_iframe);
++              add_rfc2190_header(&packet, s->av_contextpis_iframe);
+               mblk_set_timestamp_info(packet, timestamp);
+               ms_queue_put(f->outputs[0], packet);
        }
-@@ -805,8 +815,8 @@
- static void process_frame(MSFilter *f, mblk_t *inm){
-       EncState *s=(EncState*)f->data;
--      AVCodecContext *c=&s->av_context;
--      int error,got_packet;
-+      AVCodecContext *c=s->av_contextp;
-+      int got_packet=0;
-       mblk_t *comp_buf=s->comp_buf;
-       int comp_buf_sz= (int) (dblk_lim(comp_buf->b_datap)-dblk_base(comp_buf->b_datap));
+@@ -776,8 +787,8 @@ static void split_and_send(MSFilter *f,
+ static void process_frame(MSFilter *f, mblk_t *inm) {
+       EncState *s = (EncState *)f->data;
+-      AVCodecContext *c = &s->av_context;
+-      int error, got_packet;
++      AVCodecContext *c = s->av_contextp;
++      int got_packet = 0;
+       mblk_t *comp_buf = s->comp_buf;
+       int comp_buf_sz = (int)(dblk_lim(comp_buf->b_datap) - dblk_base(comp_buf->b_datap));
        YuvBuf yuv;
-@@ -816,7 +826,7 @@
+@@ -787,7 +798,7 @@ static void process_frame(MSFilter *f, m
        ms_yuv_buf_init_from_mblk(&yuv, inm);
        /* convert image if necessary */
        av_frame_unref(s->pict);
--      avpicture_fill((AVPicture*)s->pict,yuv.planes[0],c->pix_fmt,c->width,c->height);
+-      avpicture_fill((AVPicture *)s->pict, yuv.planes[0], c->pix_fmt, c->width, c->height);
 +      av_image_fill_arrays(s->pict->data, s->pict->linesize, yuv.planes[0],c->pix_fmt,c->width,c->height, 32);
  
        /* timestamp used by ffmpeg, unset here */
-       s->pict->pts=AV_NOPTS_VALUE;
-@@ -841,10 +851,21 @@
+       s->pict->pts = AV_NOPTS_VALUE;
+@@ -812,10 +823,21 @@ static void process_frame(MSFilter *f, m
  #endif
-       packet.data=comp_buf->b_wptr;
-       packet.size=comp_buf_sz;
--      error=avcodec_encode_video2(c, &packet, s->pict, &got_packet);
+       packet.data = comp_buf->b_wptr;
+       packet.size = comp_buf_sz;
+-      error = avcodec_encode_video2(c, &packet, s->pict, &got_packet);
 -
--      if (error<0) ms_warning("ms_AVencoder_process: error %i.",error);
--      else if (got_packet){
+-      if (error < 0) ms_warning("ms_AVencoder_process: error %i.", error);
+-      else if (got_packet) {
 +      {
 +              int ret1 = avcodec_send_frame(c, s->pict), ret2;
 +              char errmsg[AV_ERROR_MAX_STRING_SIZE];
@@ -398,28 +415,28 @@ Bug-Debian: https://bugs.debian.org/1004819
 +      if (got_packet){
                bool_t is_iframe = FALSE;
                s->framenum++;
-               if (s->framenum==1){
-@@ -867,7 +888,7 @@
- static void enc_process(MSFilter *f){
+               if (s->framenum == 1) {
+@@ -838,7 +860,7 @@ static void process_frame(MSFilter *f, m
+ static void enc_process(MSFilter *f) {
        mblk_t *inm;
-       EncState *s=(EncState*)f->data;
--      if (s->av_context.codec==NULL) {
-+      if (s->av_contextp && s->av_contextp->codec==NULL) {
+       EncState *s = (EncState *)f->data;
+-      if (s->av_context.codec == NULL) {
++      if (s->av_contextp != NULL && s->av_contextp->codec == NULL) {
                ms_queue_flush(f->inputs[0]);
                return;
        }
-@@ -894,7 +915,7 @@
+@@ -864,7 +886,7 @@ static int enc_set_configuration(MSFilte
+       if (vconf != &s->vconf) memcpy(&s->vconf, vconf, sizeof(MSVideoConfiguration));
  
-       if (s->vconf.required_bitrate > s->vconf.bitrate_limit)
-               s->vconf.required_bitrate = s->vconf.bitrate_limit;
+       if (s->vconf.required_bitrate > s->vconf.bitrate_limit) s->vconf.required_bitrate = s->vconf.bitrate_limit;
 -      if (s->av_context.codec != NULL) {
-+      if (s->av_contextp && s->av_contextp->codec != NULL) {
++      if (s->av_contextp != NULL && s->av_contextp->codec != NULL) {
                /* Do not change video size if encoder is running */
                if (!ms_video_size_equal(s->vconf.vsize, vsize)) {
-                       ms_warning("Video configuration: cannot change video size when encoder is running, actual=%dx%d, wanted=%dx%d", vsize.width, vsize.height, s->vconf.vsize.width, s->vconf.vsize.height);
---- a/src/videofilters/h264dec.cpp
-+++ b/src/videofilters/h264dec.cpp
-@@ -54,7 +54,7 @@
+                       ms_warning(
+--- mediastreamer2-5.3.29/src/videofilters/h264dec.cpp.orig    2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/src/videofilters/h264dec.cpp 2024-03-09 16:44:34.179604853 +0100
+@@ -53,7 +53,7 @@ typedef struct _DecData {
        MSVideoSize vsize;
        struct SwsContext *sws_ctx;
        MSAverageFPS fps;
@@ -428,72 +445,72 @@ Bug-Debian: https://bugs.debian.org/1004819
        unsigned int packet_num;
        uint8_t *bitstream;
        int bitstream_size;
-@@ -67,18 +67,19 @@
- static void ffmpeg_init(void){
-       static bool_t done=FALSE;
-       if (!done){
+@@ -66,18 +66,19 @@ typedef struct _DecData {
+ static void ffmpeg_init(void) {
+       static bool_t done = FALSE;
+       if (!done) {
 -              avcodec_register_all();
-               done=TRUE;
+               done = TRUE;
        }
  }
  
- static void dec_open(DecData *d){
+ static void dec_open(DecData *d) {
 -      AVCodec *codec;
-+      const AVCodec *codec=avcodec_find_decoder(CODEC_ID_H264);
        int error;
--      codec=avcodec_find_decoder(CODEC_ID_H264);
-       if (codec==NULL) ms_fatal("Could not find H264 decoder in ffmpeg.");
+-      codec = avcodec_find_decoder(CODEC_ID_H264);
++      const AVCodec *codec = avcodec_find_decoder(CODEC_ID_H264);
+       if (codec == NULL) ms_fatal("Could not find H264 decoder in ffmpeg.");
 -      avcodec_get_context_defaults3(&d->av_context, NULL);
--      error=avcodec_open2(&d->av_context,codec, NULL);
+-      error = avcodec_open2(&d->av_context, codec, NULL);
 +      d->av_contextp = avcodec_alloc_context3(codec);
 +      if (!d->av_contextp) {
 +              ms_fatal("Could not allocate AVCodecContext!");
 +      }
 +      error=avcodec_open2(d->av_contextp,codec, NULL);
-       if (error!=0){
+       if (error != 0) {
                ms_fatal("avcodec_open() failed.");
        }
-@@ -114,7 +115,7 @@
+@@ -113,7 +114,7 @@ static void dec_preprocess(MSFilter *f)
  }
  
- static void dec_reinit(DecData *d){
+ static void dec_reinit(DecData *d) {
 -      avcodec_close(&d->av_context);
 +      avcodec_free_context(&d->av_contextp);
        dec_open(d);
  }
  
-@@ -126,7 +127,7 @@
- static void dec_uninit(MSFilter *f){
-       DecData *d=(DecData*)f->data;
+@@ -125,7 +126,7 @@ static void dec_postprocess(MSFilter *f)
+ static void dec_uninit(MSFilter *f) {
+       DecData *d = (DecData *)f->data;
        delete d->unpacker;
 -      avcodec_close(&d->av_context);
 +      avcodec_free_context(&d->av_contextp);
        if (d->sps) freemsg(d->sps);
        if (d->pps) freemsg(d->pps);
        if (d->orig) av_frame_free(&d->orig);
-@@ -137,7 +138,7 @@
+@@ -136,7 +137,7 @@ static void dec_uninit(MSFilter *f) {
  }
  
- static mblk_t *get_as_yuvmsg(MSFilter *f, DecData *s, AVFrame *orig){
--      AVCodecContext *ctx=&s->av_context;
-+      AVCodecContext *ctx=s->av_contextp;
+ static mblk_t *get_as_yuvmsg(MSFilter *f, DecData *s, AVFrame *orig) {
+-      AVCodecContext *ctx = &s->av_context;
++      AVCodecContext *ctx = s->av_contextp;
        MSPicture pic = {0};
        mblk_t *yuv_msg;
  
-@@ -165,7 +166,7 @@
-               ms_error("%s: error in sws_scale().",f->desc->name);
+@@ -162,7 +163,7 @@ static mblk_t *get_as_yuvmsg(MSFilter *f
+               ms_error("%s: error in sws_scale().", f->desc->name);
        }
- #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50,43,0) // backward compatibility with Debian Squeeze (6.0)
+ #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50, 43, 0) // backward compatibility with Debian Squeeze (6.0)
 -      mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pkt_pts);
 +      mblk_set_timestamp_info(yuv_msg, (uint32_t)orig->pts);
  #endif
        return yuv_msg;
  }
-@@ -326,9 +327,25 @@
- #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50,43,0) // backward compatibility with Debian Squeeze (6.0)
+@@ -316,9 +317,25 @@ static void dec_process(MSFilter *f) {
+ #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50, 43, 0) // backward compatibility with Debian Squeeze (6.0)
                                pkt.pts = frame_ts;
  #endif
--                              len=avcodec_decode_video2(&d->av_context,d->orig,&got_picture,&pkt);
+-                              len = avcodec_decode_video2(&d->av_context, d->orig, &got_picture, &pkt);
 +                              {
 +                                      len = -1;
 +                                      char errmsg[AV_ERROR_MAX_STRING_SIZE];
@@ -512,39 +529,39 @@ Bug-Debian: https://bugs.debian.org/1004819
 +                                              }
 +                                      }
 +                              }
-                               if (len<=0) {
--                                      ms_warning("ms_AVdecoder_process: error %i.",len);
-                                       ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_DECODING_ERRORS);
+                               if (len <= 0) {
+-                                      ms_warning("ms_AVdecoder_process: error %i.", len);
+                                       ms_filter_notify_no_arg(f, MS_VIDEO_DECODER_DECODING_ERRORS);
                                        requestPLI = TRUE;
                                        break;
---- a/src/utils/jpgloader-ffmpeg.c
-+++ b/src/utils/jpgloader-ffmpeg.c
+--- mediastreamer2-5.3.29/src/utils/jpgloader-ffmpeg.c.orig    2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/src/utils/jpgloader-ffmpeg.c 2024-03-09 16:51:07.297475151 +0100
 @@ -62,7 +62,7 @@
  
- mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bufsize, MSVideoSize *reqsize){
+ mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bufsize, MSVideoSize *reqsize) {
  #if !defined(NO_FFMPEG) && !TARGET_OS_IPHONE /* this code must never be used for iOS */
 -      AVCodecContext av_context;
 +      AVCodecContext *av_contextp;
-       int got_picture=0;
+       int got_picture = 0;
        mblk_t *ret;
        struct SwsContext *sws_ctx;
-@@ -71,52 +71,77 @@
-       AVCodec *codec=avcodec_find_decoder(CODEC_ID_MJPEG);
-       AVFrameorig = av_frame_alloc();
+@@ -71,53 +71,78 @@ mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bu
+       AVCodec *codec = avcodec_find_decoder(CODEC_ID_MJPEG);
+       AVFrame *orig = av_frame_alloc();
  
 +      if (orig==NULL){
 +              ms_error("Could not allocate AVFrame.");
 +              return NULL;
 +      }
 +
-       if (codec==NULL){
+       if (codec == NULL) {
                ms_error("Could not find MJPEG decoder in ffmpeg.");
 +              av_frame_free(&orig);
                return NULL;
        }
  
--      avcodec_get_context_defaults3(&av_context,NULL);
--      if (avcodec_open2(&av_context,codec,NULL)<0){
+-      avcodec_get_context_defaults3(&av_context, NULL);
+-      if (avcodec_open2(&av_context, codec, NULL) < 0) {
 +      av_contextp = avcodec_alloc_context3(codec);
 +      if (!av_contextp) {
 +              ms_error("jpeg2yuv: avcodec_alloc_context3 failed");
@@ -558,10 +575,10 @@ Bug-Debian: https://bugs.debian.org/1004819
                return NULL;
        }
        av_init_packet(&pkt);
-       pkt.data=jpgbuf;
-       pkt.size=bufsize;
+       pkt.data = jpgbuf;
+       pkt.size = bufsize;
  
--      if (avcodec_decode_video2(&av_context,orig,&got_picture,&pkt) < 0) {
+-      if (avcodec_decode_video2(&av_context, orig, &got_picture, &pkt) < 0) {
 -              ms_error("jpeg2yuv: avcodec_decode_video failed");
 -              avcodec_close(&av_context);
 +      int ret1 = avcodec_send_packet(av_contextp, &pkt), ret2;
@@ -579,14 +596,13 @@ Bug-Debian: https://bugs.debian.org/1004819
 +                      return NULL;
 +              }
        }
-       ret=ms_yuv_buf_alloc(&dest, reqsize->width,reqsize->height);
+       ret = ms_yuv_buf_alloc(&dest, reqsize->width, reqsize->height);
        /* not using SWS_FAST_BILINEAR because it doesn't play well with
         * av_context.pix_fmt set to AV_PIX_FMT_YUVJ420P by jpeg decoder */
--      sws_ctx=sws_getContext(av_context.width,av_context.height,av_context.pix_fmt,
-+      sws_ctx=sws_getContext(av_contextp->width,av_contextp->height,av_contextp->pix_fmt,
-               reqsize->width,reqsize->height,AV_PIX_FMT_YUV420P,SWS_BILINEAR,
-                 NULL, NULL, NULL);
-       if (sws_ctx==NULL) {
+-      sws_ctx = sws_getContext(av_context.width, av_context.height, av_context.pix_fmt, reqsize->width, reqsize->height,
++      sws_ctx = sws_getContext(av_contextp->width, av_contextp->height, av_contextp->pix_fmt, reqsize->width, reqsize->height,
+                                AV_PIX_FMT_YUV420P, SWS_BILINEAR, NULL, NULL, NULL);
+       if (sws_ctx == NULL) {
                ms_error("jpeg2yuv: ms_sws_getContext() failed.");
 -              avcodec_close(&av_context);
 +              av_frame_free(&orig);
@@ -595,12 +611,14 @@ Bug-Debian: https://bugs.debian.org/1004819
                return NULL;
        }
  
- #if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
--      if (sws_scale(sws_ctx,(const uint8_t* const *)orig->data,orig->linesize,0,av_context.height,dest.planes,dest.strides)<0){
-+      if (sws_scale(sws_ctx,(const uint8_t* const *)orig->data,orig->linesize,0,av_contextp->height,dest.planes,dest.strides)<0){
+ #if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0, 9, 0)
+-      if (sws_scale(sws_ctx, (const uint8_t *const *)orig->data, orig->linesize, 0, av_context.height, dest.planes,
++      if (sws_scale(sws_ctx, (const uint8_t *const *)orig->data, orig->linesize, 0, av_contextp->height, dest.planes,
+                     dest.strides) < 0) {
  #else
--      if (sws_scale(sws_ctx,(uint8_t**)orig->data,orig->linesize,0,av_context.height,dest.planes,dest.strides)<0){
-+      if (sws_scale(sws_ctx,(uint8_t**)orig->data,orig->linesize,0,av_contextp->height,dest.planes,dest.strides)<0){
+-      if (sws_scale(sws_ctx, (uint8_t **)orig->data, orig->linesize, 0, av_context.height, dest.planes, dest.strides) <
++      if (sws_scale(sws_ctx, (uint8_t **)orig->data, orig->linesize, 0, av_contextp->height, dest.planes, dest.strides) <
+           0) {
  #endif
                ms_error("jpeg2yuv: ms_sws_scale() failed.");
                sws_freeContext(sws_ctx);
index 94d4531a514e7a54e5261633de4aabd76de1cd26..fa6ecdf88d0ef8c0e07e1e1b8c6c4e65d8954e3f 100644 (file)
@@ -1,6 +1,6 @@
---- mediastreamer2-4.4.2/src/upnp/upnp_igd.c.orig      2020-09-24 11:44:00.000000000 +0200
-+++ mediastreamer2-4.4.2/src/upnp/upnp_igd.c   2020-09-27 09:49:46.143972883 +0200
-@@ -395,7 +395,7 @@
+--- mediastreamer2-5.3.29/src/upnp/upnp_igd.c.orig     2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/src/upnp/upnp_igd.c  2024-03-08 19:56:59.058463144 +0100
+@@ -377,7 +377,7 @@ int upnp_igd_send_action(upnp_igd_contex
   *   d_event  -- event associated with the new device
   *
   ********************************************************************************/
@@ -9,7 +9,7 @@
        upnp_igd_device_node *deviceNode, *tmpdevnode;
        int found = 0;
        int ret;
-@@ -423,7 +423,7 @@
+@@ -405,7 +405,7 @@ void upnp_igd_add_device(upnp_igd_contex
        baseURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "URLBase");
        relURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "presentationURL");
  
  
        if (UPNP_E_SUCCESS != ret) {
                upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error generating presURL from %s + %s", baseURL, relURL);
-@@ -444,7 +444,7 @@
-                       if (found) {
-                               /* The device is already there, so just update  */
-                               /* the advertisement timeout field */
--                              tmpdevnode->device.advr_time_out = d_event->Expires;
-+                              tmpdevnode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
-                               upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "IGD device: %s[%s] | Update expires(%d)", friendlyName, UDN, tmpdevnode->device.advr_time_out);
-                       } else {
-                               upnp_igd_print(igd_ctxt, UPNP_IGD_MESSAGE, "Add IGD device: %s[%s]", friendlyName, UDN);
-@@ -453,12 +453,12 @@
-                               deviceNode = (upnp_igd_device_node *)  malloc(sizeof(upnp_igd_device_node));
-                               memset(deviceNode->device.services, '\0', sizeof(upnp_igd_service) * IGD_SERVICE_SERVCOUNT);
-                               strncpy(deviceNode->device.udn, UDN, sizeof(deviceNode->device.udn));
--                              strncpy(deviceNode->device.desc_doc_url, d_event->Location, sizeof(deviceNode->device.desc_doc_url));
-+                              strncpy(deviceNode->device.desc_doc_url, UpnpDiscovery_get_Location_cstr(d_event), sizeof(deviceNode->device.desc_doc_url));
-                               strncpy(deviceNode->device.friendly_name, friendlyName, sizeof(deviceNode->device.friendly_name));
-                               strncpy(deviceNode->device.model_name, modelName, sizeof(deviceNode->device.model_name));
-                               strncpy(deviceNode->device.model_number, modelNumber, sizeof(deviceNode->device.model_number));
-                               strncpy(deviceNode->device.pres_url, presURL, sizeof(deviceNode->device.pres_url));
--                              deviceNode->device.advr_time_out = d_event->Expires;
-+                              deviceNode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
-                               // Reset values
-                               serviceId = NULL;
-@@ -468,7 +468,7 @@
-                               for (service = 0; service < IGD_SERVICE_SERVCOUNT;
-                                    service++) {
--                                      if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, d_event->Location,
-+                                      if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, UpnpDiscovery_get_Location_cstr(d_event),
-                                                       IGDServiceType[service], &serviceId, &event_url, &controlURL)) {
-                                               upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribing to EventURL %s...",event_url);
-                                               ret =
-@@ -883,7 +883,7 @@
+@@ -426,7 +426,7 @@ void upnp_igd_add_device(upnp_igd_contex
+               if (found) {
+                       /* The device is already there, so just update  */
+                       /* the advertisement timeout field */
+-                      tmpdevnode->device.advr_time_out = d_event->Expires;
++                      tmpdevnode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
+                       upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "IGD device: %s[%s] | Update expires(%d)", friendlyName, UDN,
+                                      tmpdevnode->device.advr_time_out);
+               } else {
+@@ -436,12 +436,12 @@ void upnp_igd_add_device(upnp_igd_contex
+                       deviceNode = (upnp_igd_device_node *)malloc(sizeof(upnp_igd_device_node));
+                       memset(deviceNode->device.services, '\0', sizeof(upnp_igd_service) * IGD_SERVICE_SERVCOUNT);
+                       strncpy(deviceNode->device.udn, UDN, sizeof(deviceNode->device.udn));
+-                      strncpy(deviceNode->device.desc_doc_url, d_event->Location, sizeof(deviceNode->device.desc_doc_url));
++                      strncpy(deviceNode->device.desc_doc_url, UpnpDiscovery_get_Location_cstr(d_event), sizeof(deviceNode->device.desc_doc_url));
+                       strncpy(deviceNode->device.friendly_name, friendlyName, sizeof(deviceNode->device.friendly_name));
+                       strncpy(deviceNode->device.model_name, modelName, sizeof(deviceNode->device.model_name));
+                       strncpy(deviceNode->device.model_number, modelNumber, sizeof(deviceNode->device.model_number));
+                       strncpy(deviceNode->device.pres_url, presURL, sizeof(deviceNode->device.pres_url));
+-                      deviceNode->device.advr_time_out = d_event->Expires;
++                      deviceNode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
+                       // Reset values
+                       serviceId = NULL;
+@@ -450,7 +450,7 @@ void upnp_igd_add_device(upnp_igd_contex
+                       eventSID[0] = '\0';
+                       for (service = 0; service < IGD_SERVICE_SERVCOUNT; service++) {
+-                              if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, d_event->Location, IGDServiceType[service],
++                              if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, UpnpDiscovery_get_Location_cstr(d_event), IGDServiceType[service],
+                                                                       &serviceId, &event_url, &controlURL)) {
+                                       upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribing to EventURL %s...", event_url);
+                                       ret = UpnpSubscribe(igd_ctxt->upnp_handle, event_url, &IGDTimeOut[service], eventSID);
+@@ -878,7 +878,7 @@ void upnp_igd_handle_subscribe_update(up
   *   cookie     -- Optional data specified during callback registration
   *
   ********************************************************************************/
--int upnp_igd_callback(Upnp_EventType event_type, voidevent, void *cookie) {
-+int upnp_igd_callback(Upnp_EventType event_type, const voidevent, void *cookie) {
+-int upnp_igd_callback(Upnp_EventType event_type, void *event, void *cookie) {
++int upnp_igd_callback(Upnp_EventType event_type, const void *event, void *cookie) {
        int ret = 1;
-       upnp_igd_context *igd_ctxt = (upnp_igd_context*)cookie;
+       upnp_igd_context *igd_ctxt = (upnp_igd_context *)cookie;
        upnp_context_add_client(igd_ctxt);
-@@ -891,16 +891,16 @@
-       switch(event_type) {
-       case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
-       case UPNP_DISCOVERY_SEARCH_RESULT: {
--              struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
-+              UpnpDiscovery *d_event = (UpnpDiscovery *)event;
-               IXML_Document *desc_doc = NULL;
-               int ret;
--              if (d_event->ErrCode != UPNP_E_SUCCESS) {
--                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", d_event->ErrCode);
-+              if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
-+                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
-               }
--              ret = UpnpDownloadXmlDoc(d_event->Location, &desc_doc);
-+              ret = UpnpDownloadXmlDoc(UpnpDiscovery_get_Location_cstr(d_event), &desc_doc);
-               if (ret != UPNP_E_SUCCESS) {
--                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", d_event->Location, ret);
-+                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", UpnpDiscovery_get_Location_cstr(d_event), ret);
-               } else {
-                       upnp_igd_add_device(igd_ctxt, desc_doc, d_event);
-               }
-@@ -910,64 +910,64 @@
-       }
-       break;
-       case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
--              struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
--              if (d_event->ErrCode != UPNP_E_SUCCESS) {
--                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", d_event->ErrCode);
-+              UpnpDiscovery *d_event = (UpnpDiscovery *)event;
-+              if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
-+                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
-               }
--              upnp_igd_remove_device(igd_ctxt, d_event->DeviceId);
-+              upnp_igd_remove_device(igd_ctxt, UpnpDiscovery_get_DeviceID_cstr(d_event));
-       }
-       break;
-       /* SOAP Stuff */
-       case UPNP_CONTROL_ACTION_COMPLETE: {
--              struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
-+              UpnpActionComplete *a_event = (UpnpActionComplete *)event;
--              if (a_event->ErrCode != UPNP_E_SUCCESS) {
--                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", a_event->ErrCode);
-+              if (UpnpActionComplete_get_ErrCode(a_event) != UPNP_E_SUCCESS) {
-+                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", UpnpActionComplete_get_ErrCode(a_event));
-               } else {
--                      upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
-+                      upnp_igd_handle_send_action(igd_ctxt, UpnpActionComplete_get_CtrlUrl_cstr(a_event), UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event));
-               }
-       }
-       break;
-       case UPNP_CONTROL_GET_VAR_COMPLETE: {
--              struct Upnp_State_Var_Complete *sv_event = (struct Upnp_State_Var_Complete *)event;
-+              UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)event;
--              if (sv_event->ErrCode != UPNP_E_SUCCESS) {
--                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", sv_event->ErrCode);
-+              if (UpnpStateVarComplete_get_ErrCode(sv_event) != UPNP_E_SUCCESS) {
-+                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", UpnpStateVarComplete_get_ErrCode(sv_event));
-               } else {
--                      upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(sv_event->CtrlUrl), sv_event->StateVarName, sv_event->CurrentVal);
-+                      upnp_igd_handle_get_var(igd_ctxt, UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event), UpnpStateVarComplete_get_StateVarName_cstr(sv_event), UpnpStateVarComplete_get_CurrentVal(sv_event));
-               }
-       }
-       break;
-       /* GENA Stuff */
-       case UPNP_EVENT_RECEIVED: {
--              struct Upnp_Event *e_event = (struct Upnp_Event *)event;
-+              UpnpEvent *e_event = (UpnpEvent *)event;
--              upnp_igd_handle_event(igd_ctxt, e_event->Sid, e_event->EventKey, e_event->ChangedVariables);
-+              upnp_igd_handle_event(igd_ctxt, UpnpEvent_get_SID_cstr(e_event), UpnpEvent_get_EventKey(e_event), UpnpEvent_get_ChangedVariables(e_event));
-       }
-       break;
-       case UPNP_EVENT_SUBSCRIBE_COMPLETE:
-       case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
-       case UPNP_EVENT_RENEWAL_COMPLETE: {
--              struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
-+              UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)event;
--              if (es_event->ErrCode != UPNP_E_SUCCESS) {
--                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", es_event->ErrCode);
-+              if (UpnpEventSubscribe_get_ErrCode(es_event) != UPNP_E_SUCCESS) {
-+                      upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", UpnpEventSubscribe_get_ErrCode(es_event));
-               } else {
--                      upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), es_event->Sid, es_event->TimeOut);
-+                      upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), UpnpEventSubscribe_get_SID_cstr(es_event), UpnpEventSubscribe_get_TimeOut(es_event));
-               }
-       }
-       break;
-       case UPNP_EVENT_AUTORENEWAL_FAILED:
-       case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
--              struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
-+              UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)event;
-               int TimeOut = 1801;
-               Upnp_SID newSID;
-               int ret;
+@@ -886,17 +886,17 @@ int upnp_igd_callback(Upnp_EventType eve
+       switch (event_type) {
+               case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
+               case UPNP_DISCOVERY_SEARCH_RESULT: {
+-                      struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
++                      Upnp_Discovery *d_event = (Upnp_Discovery *)event;
+                       IXML_Document *desc_doc = NULL;
+                       int ret;
+-                      if (d_event->ErrCode != UPNP_E_SUCCESS) {
+-                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", d_event->ErrCode);
++                      if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
++                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
+                       }
+-                      ret = UpnpDownloadXmlDoc(d_event->Location, &desc_doc);
++                      ret = UpnpDownloadXmlDoc(UpnpDiscovery_get_Location_cstr(d_event), &desc_doc);
+                       if (ret != UPNP_E_SUCCESS) {
+                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d",
+-                                             d_event->Location, ret);
++                                             UpnpDiscovery_get_Location_cstr(d_event), ret);
+                       } else {
+                               upnp_igd_add_device(igd_ctxt, desc_doc, d_event);
+                       }
+@@ -905,62 +905,62 @@ int upnp_igd_callback(Upnp_EventType eve
+                       }
+               } break;
+               case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
+-                      struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
+-                      if (d_event->ErrCode != UPNP_E_SUCCESS) {
+-                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", d_event->ErrCode);
++                      Upnp_Discovery *d_event = (Upnp_Discovery *)event;
++                      if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
++                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
+                       }
+-                      upnp_igd_remove_device(igd_ctxt, d_event->DeviceId);
++                      upnp_igd_remove_device(igd_ctxt, UpnpDiscovery_get_DeviceID_cstr(d_event));
+               } break;
+               /* SOAP Stuff */
+               case UPNP_CONTROL_ACTION_COMPLETE: {
+-                      struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
++                      Upnp_Action_Complete *a_event = (Upnp_Action_Complete *)event;
  
--              ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(es_event->PublisherUrl), &TimeOut, newSID);
-+              ret = UpnpSubscribe(igd_ctxt->upnp_handle, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), &TimeOut, newSID);
-               if (ret == UPNP_E_SUCCESS) {
-                       upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribed to EventURL with SID=%s", newSID);
--                      upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), newSID, TimeOut);
-+                      upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), newSID, TimeOut);
-               } else {
-                       upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error Subscribing to EventURL -- %d", ret);
-               }
-@@ -996,10 +996,10 @@
-  *   cookie    -- The cookie pass in cb_fct or print_fct
-  *
+-                      if (a_event->ErrCode != UPNP_E_SUCCESS) {
+-                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", a_event->ErrCode);
++                      if (UpnpActionComplete_get_ErrCode(a_event) != UPNP_E_SUCCESS) {
++                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", UpnpActionComplete_get_ErrCode(a_event));
+                       } else {
+-                              upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest,
+-                                                          a_event->ActionResult);
++                              upnp_igd_handle_send_action(igd_ctxt, UpnpActionComplete_get_CtrlUrl_cstr(a_event), UpnpActionComplete_get_ActionRequest(a_event),
++                                                          UpnpActionComplete_get_ActionResult(a_event));
+                       }
+               } break;
+               case UPNP_CONTROL_GET_VAR_COMPLETE: {
+-                      struct Upnp_State_Var_Complete *sv_event = (struct Upnp_State_Var_Complete *)event;
++                      Upnp_State_Var_Complete *sv_event = (Upnp_State_Var_Complete *)event;
+-                      if (sv_event->ErrCode != UPNP_E_SUCCESS) {
+-                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", sv_event->ErrCode);
++                      if (UpnpStateVarComplete_get_ErrCode(sv_event) != UPNP_E_SUCCESS) {
++                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", UpnpStateVarComplete_get_ErrCode(sv_event));
+                       } else {
+-                              upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(sv_event->CtrlUrl), sv_event->StateVarName,
+-                                                      sv_event->CurrentVal);
++                              upnp_igd_handle_get_var(igd_ctxt, UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event), UpnpStateVarComplete_get_StateVarName_cstr(sv_event),
++                                                      UpnpStateVarComplete_get_CurrentVal(sv_event));
+                       }
+               } break;
+               /* GENA Stuff */
+               case UPNP_EVENT_RECEIVED: {
+-                      struct Upnp_Event *e_event = (struct Upnp_Event *)event;
++                      Upnp_Event *e_event = (Upnp_Event *)event;
+-                      upnp_igd_handle_event(igd_ctxt, e_event->Sid, e_event->EventKey, e_event->ChangedVariables);
++                      upnp_igd_handle_event(igd_ctxt, UpnpEvent_get_SID_cstr(e_event), UpnpEvent_get_EventKey(e_event), UpnpEvent_get_ChangedVariables(e_event));
+               } break;
+               case UPNP_EVENT_SUBSCRIBE_COMPLETE:
+               case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
+               case UPNP_EVENT_RENEWAL_COMPLETE: {
+-                      struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
++                      Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)event;
+-                      if (es_event->ErrCode != UPNP_E_SUCCESS) {
+-                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", es_event->ErrCode);
++                      if (UpnpEventSubscribe_get_ErrCode(es_event) != UPNP_E_SUCCESS) {
++                              upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", UpnpEventSubscribe_get_ErrCode(es_event));
+                       } else {
+-                              upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), es_event->Sid,
+-                                                               es_event->TimeOut);
++                              upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), UpnpEventSubscribe_get_SID_cstr(es_event),
++                                                               UpnpEventSubscribe_get_TimeOut(es_event));
+                       }
+               } break;
+               case UPNP_EVENT_AUTORENEWAL_FAILED:
+               case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
+-                      struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
++                      Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)event;
+                       int TimeOut = 1801;
+                       Upnp_SID newSID;
+                       int ret;
+-                      ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(es_event->PublisherUrl), &TimeOut, newSID);
++                      ret = UpnpSubscribe(igd_ctxt->upnp_handle, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), &TimeOut, newSID);
+                       if (ret == UPNP_E_SUCCESS) {
+                               upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribed to EventURL with SID=%s", newSID);
+-                              upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), newSID, TimeOut);
++                              upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), newSID, TimeOut);
+                       } else {
+                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error Subscribing to EventURL -- %d", ret);
+                       }
+@@ -989,11 +989,11 @@ int upnp_igd_callback(Upnp_EventType eve
   ********************************************************************************/
--upnp_igd_context* upnp_igd_create(upnp_igd_callback_function cb_fct, upnp_igd_print_function print_fct, const char *address, void *cookie) {
-+upnp_igd_context* upnp_igd_create(upnp_igd_callback_function cb_fct, upnp_igd_print_function print_fct, const char *interface, void *cookie) {
+ upnp_igd_context *upnp_igd_create(upnp_igd_callback_function cb_fct,
+                                   upnp_igd_print_function print_fct,
+-                                  const char *address,
++                                  const char *interface,
+                                   void *cookie) {
        int ret;
        unsigned short port = 0;
 -      const char *ip_address = address;
 +      const char *ip_address = NULL;
-       upnp_igd_context *igd_ctxt = (upnp_igd_context*)malloc(sizeof(upnp_igd_context));
+       upnp_igd_context *igd_ctxt = (upnp_igd_context *)malloc(sizeof(upnp_igd_context));
        igd_ctxt->devices = NULL;
        igd_ctxt->callback_fct = cb_fct;
-@@ -1068,9 +1068,9 @@
-               ithread_cond_init(&igd_ctxt->client_cond, NULL);
+@@ -1063,9 +1063,9 @@ upnp_igd_context *upnp_igd_create(upnp_i
        }
  
--      upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Initializing uPnP IGD with ipaddress:%s port:%u", ip_address ? ip_address : "{NULL}", port);
-+      upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Initializing uPnP IGD with interface:%s port:%u", interface ? interface : "{NULL}", port);
+       upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Initializing uPnP IGD with ipaddress:%s port:%u",
+-                     ip_address ? ip_address : "{NULL}", port);
++                     interface ? interface : "{NULL}", port);
  
 -      ret = UpnpInit(ip_address, port);
 +      ret = UpnpInit2(interface, port);
        if (ret != UPNP_E_SUCCESS) {
                upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "UpnpInit() Error: %d", ret);
                UpnpFinish();
-@@ -1085,9 +1085,7 @@
+@@ -1080,9 +1080,7 @@ upnp_igd_context *upnp_igd_create(upnp_i
                free(igd_ctxt);
                return NULL;
        }
        if (!port) {
                port = UpnpGetServerPort();
        }
---- mediastreamer2-4.4.2/src/upnp/upnp_igd_cmd.c.orig  2020-09-24 11:44:00.000000000 +0200
-+++ mediastreamer2-4.4.2/src/upnp/upnp_igd_cmd.c       2020-09-27 10:01:04.473631389 +0200
-@@ -95,7 +95,7 @@
+--- mediastreamer2-5.3.29/src/upnp/upnp_igd_cmd.c.orig 2024-03-08 20:00:36.550618221 +0100
++++ mediastreamer2-5.3.29/src/upnp/upnp_igd_cmd.c      2024-03-08 21:25:55.456220065 +0100
+@@ -104,7 +104,7 @@ int upnp_igd_port_mapping_handle_action(
        return 0;
  }
  
--int upnp_igd_port_mapping_callback(Upnp_EventType event_type, voidevent, void *cookie) {
-+int upnp_igd_port_mapping_callback(Upnp_EventType event_type, const voidevent, void *cookie) {
+-int upnp_igd_port_mapping_callback(Upnp_EventType event_type, void *event, void *cookie) {
++int upnp_igd_port_mapping_callback(Upnp_EventType event_type, const void *event, void *cookie) {
        int ret = 1;
-       upnp_igd_port_mapping_context *igd_port_mapping_ctxt = (upnp_igd_port_mapping_context*)cookie;
+       upnp_igd_port_mapping_context *igd_port_mapping_ctxt = (upnp_igd_port_mapping_context *)cookie;
        upnp_context_add_client(igd_port_mapping_ctxt->igd_ctxt);
-@@ -103,8 +103,8 @@
+@@ -112,9 +112,9 @@ int upnp_igd_port_mapping_callback(Upnp_
  
-       switch(event_type) {
+       switch (event_type) {
                case UPNP_CONTROL_ACTION_COMPLETE: {
--              struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
--                      upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, a_event->ErrCode, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
-+              UpnpActionComplete *a_event = (UpnpActionComplete *)event;
-+                      upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, UpnpActionComplete_get_ErrCode(a_event), UpnpActionComplete_get_CtrlUrl_cstr(a_event), UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event));
-               }
-               break;
---- mediastreamer2-4.4.2/include/mediastreamer2/upnp_igd.h.orig        2020-09-24 11:44:00.000000000 +0200
-+++ mediastreamer2-4.4.2/include/mediastreamer2/upnp_igd.h     2020-09-27 09:50:51.076954444 +0200
-@@ -72,7 +72,7 @@
- typedef struct _upnp_igd_context upnp_igd_context;
--MS2_PUBLIC upnp_igd_context* upnp_igd_create(upnp_igd_callback_function cb_fct, upnp_igd_print_function print_fct, const char* address, void *cookie);
-+MS2_PUBLIC upnp_igd_context* upnp_igd_create(upnp_igd_callback_function cb_fct, upnp_igd_print_function print_fct, const char* interface, void *cookie);
- MS2_PUBLIC int upnp_igd_start(upnp_igd_context*igd_ctxt);
+-                      struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
+-                      upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, a_event->ErrCode, UPNP_STRING(a_event->CtrlUrl),
+-                                                          a_event->ActionRequest, a_event->ActionResult);
++                      Upnp_Action_Complete *a_event = (Upnp_Action_Complete *)event;
++                      upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, UpnpActionComplete_get_ErrCode(a_event), UpnpActionComplete_get_CtrlUrl_cstr(a_event),
++                                                          UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event);
+               } break;
+               default:
+--- mediastreamer2-5.3.29/include/mediastreamer2/upnp_igd.h.orig       2024-03-08 21:44:02.873662353 +0100
++++ mediastreamer2-5.3.29/include/mediastreamer2/upnp_igd.h    2024-03-08 21:50:16.351639049 +0100
+@@ -72,7 +72,7 @@ typedef struct _upnp_igd_context upnp_ig
+ MS2_PUBLIC upnp_igd_context *upnp_igd_create(upnp_igd_callback_function cb_fct,
+                                              upnp_igd_print_function print_fct,
+-                                             const char *address,
++                                             const char *interface,
+                                              void *cookie);
+ MS2_PUBLIC int upnp_igd_start(upnp_igd_context *igd_ctxt);
  int upnp_igd_is_started(upnp_igd_context *igd_ctxt);
- int upnp_igd_stop(upnp_igd_context*igd_ctxt);
---- mediastreamer2-4.4.2/src/upnp/upnp_igd_private.h.orig      2020-09-24 11:44:00.000000000 +0200
-+++ mediastreamer2-4.4.2/src/upnp/upnp_igd_private.h   2020-09-27 09:42:32.032991330 +0200
-@@ -144,7 +144,7 @@
+--- mediastreamer2-5.3.29/src/upnp/upnp_igd_private.h.orig     2024-03-08 21:50:41.568169106 +0100
++++ mediastreamer2-5.3.29/src/upnp/upnp_igd_private.h  2024-03-08 21:56:05.019750152 +0100
+@@ -140,7 +140,7 @@ void upnp_context_add_callback(upnp_igd_
  void upnp_context_handle_callbacks(upnp_igd_context *igd_ctx);
  void upnp_context_free_callbacks(upnp_igd_context *igd_ctx);
  
--int upnp_igd_callback(Upnp_EventType event_type, voidevent, void *cookie);
-+int upnp_igd_callback(Upnp_EventType event_type, const voidevent, void *cookie);
- int upnp_igd_send_action(upnp_igd_context* igd_ctxt, upnp_igd_device_node *device_node, int service,
-               const char *actionname, const char **param_name, const char **param_val, int param_count,
-               Upnp_FunPtr fun, const void *cookie);
---- mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.c.orig        2020-09-24 11:44:00.000000000 +0200
-+++ mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.c     2020-09-27 10:57:56.005149537 +0200
-@@ -178,7 +178,7 @@
-       }
- }
--void upnp_igd_print_event(upnp_igd_context *igd_ctxt, upnp_igd_print_level level, Upnp_EventType EventType, void *Event) {
-+void upnp_igd_print_event(upnp_igd_context *igd_ctxt, upnp_igd_print_level level, Upnp_EventType EventType, const void *Event) {
+-int upnp_igd_callback(Upnp_EventType event_type, void *event, void *cookie);
++int upnp_igd_callback(Upnp_EventType event_type, const void *event, void *cookie);
+ int upnp_igd_send_action(upnp_igd_context *igd_ctxt,
+                          upnp_igd_device_node *device_node,
+                          int service,
+--- mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.c.orig       2024-03-08 21:56:32.842932754 +0100
++++ mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.c    2024-03-09 07:20:10.043062611 +0100
+@@ -182,7 +182,7 @@ void upnp_igd_print_event_type(upnp_igd_
+ void upnp_igd_print_event(upnp_igd_context *igd_ctxt,
+                           upnp_igd_print_level level,
+                           Upnp_EventType EventType,
+-                          void *Event) {
++                          const void *Event) {
        ithread_mutex_lock(&igd_ctxt->print_mutex);
  
        upnp_igd_print(igd_ctxt, level, "======================================================================");
-@@ -188,18 +188,18 @@
-       case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
-       case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
-       case UPNP_DISCOVERY_SEARCH_RESULT: {
--              struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)Event;
-+              UpnpDiscovery *d_event = (UpnpDiscovery *)Event;
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(d_event->ErrCode), d_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "Expires     =  %d",  d_event->Expires);
--              upnp_igd_print(igd_ctxt, level, "DeviceId    =  %s",  d_event->DeviceId);
--              upnp_igd_print(igd_ctxt, level, "DeviceType  =  %s",  d_event->DeviceType);
--              upnp_igd_print(igd_ctxt, level, "ServiceType =  %s",  d_event->ServiceType);
--              upnp_igd_print(igd_ctxt, level, "ServiceVer  =  %s",  d_event->ServiceVer);
--              upnp_igd_print(igd_ctxt, level, "Location    =  %s",  d_event->Location);
--              upnp_igd_print(igd_ctxt, level, "OS          =  %s",  d_event->Os);
--              upnp_igd_print(igd_ctxt, level, "Ext         =  %s",  d_event->Ext);
-+                      UpnpGetErrorMessage(UpnpDiscovery_get_ErrCode(d_event)), UpnpDiscovery_get_ErrCode(d_event));
-+              upnp_igd_print(igd_ctxt, level, "Expires     =  %d",  UpnpDiscovery_get_Expires(d_event));
-+              upnp_igd_print(igd_ctxt, level, "DeviceId    =  %s",  UpnpDiscovery_get_DeviceID_cstr(d_event));
-+              upnp_igd_print(igd_ctxt, level, "DeviceType  =  %s",  UpnpDiscovery_get_DeviceType_cstr(d_event));
-+              upnp_igd_print(igd_ctxt, level, "ServiceType =  %s",  UpnpDiscovery_get_ServiceType_cstr(d_event));
-+              upnp_igd_print(igd_ctxt, level, "ServiceVer  =  %s",  UpnpDiscovery_get_ServiceVer_cstr(d_event));
-+              upnp_igd_print(igd_ctxt, level, "Location    =  %s",  UpnpDiscovery_get_Location_cstr(d_event));
-+              upnp_igd_print(igd_ctxt, level, "OS          =  %s",  UpnpDiscovery_get_Os_cstr(d_event));
-+              upnp_igd_print(igd_ctxt, level, "Ext         =  %s",  UpnpDiscovery_get_Ext_cstr(d_event));
-               break;
-       }
-       case UPNP_DISCOVERY_SEARCH_TIMEOUT:
-@@ -207,18 +207,17 @@
-               break;
-       /* SOAP */
-       case UPNP_CONTROL_ACTION_REQUEST: {
--              struct Upnp_Action_Request *a_event =
--                      (struct Upnp_Action_Request *)Event;
-+              UpnpActionRequest *a_event = (UpnpActionRequest *)Event;
-               char *xmlbuff = NULL;
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(a_event->ErrCode), a_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", a_event->ErrStr);
--              upnp_igd_print(igd_ctxt, level, "ActionName  =  %s", a_event->ActionName);
--              upnp_igd_print(igd_ctxt, level, "UDN         =  %s", a_event->DevUDN);
--              upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", a_event->ServiceID);
--              if (a_event->ActionRequest) {
--                      xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
-+                      UpnpGetErrorMessage(UpnpActionRequest_get_ErrCode(a_event)), UpnpActionRequest_get_ErrCode(a_event));
-+              upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", UpnpActionRequest_get_ErrStr_cstr(a_event));
-+              upnp_igd_print(igd_ctxt, level, "ActionName  =  %s", UpnpActionRequest_get_ActionName_cstr(a_event));
-+              upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpActionRequest_get_DevUDN_cstr(a_event));
-+              upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpActionRequest_get_ServiceID_cstr(a_event));
-+              if (UpnpActionRequest_get_ActionRequest(a_event)) {
-+                      xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionRequest(a_event));
-                       if (xmlbuff) {
-                               upnp_igd_print(igd_ctxt, level, "ActRequest  =  %s", xmlbuff);
-                               ixmlFreeDOMString(xmlbuff);
-@@ -227,8 +226,8 @@
-               } else {
-                       upnp_igd_print(igd_ctxt, level, "ActRequest  =  (null)");
+@@ -192,18 +192,18 @@ void upnp_igd_print_event(upnp_igd_conte
+               case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
+               case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
+               case UPNP_DISCOVERY_SEARCH_RESULT: {
+-                      struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)Event;
++                      Upnp_Discovery *d_event = (Upnp_Discovery *)Event;
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(d_event->ErrCode),
+-                                     d_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "Expires     =  %d", d_event->Expires);
+-                      upnp_igd_print(igd_ctxt, level, "DeviceId    =  %s", d_event->DeviceId);
+-                      upnp_igd_print(igd_ctxt, level, "DeviceType  =  %s", d_event->DeviceType);
+-                      upnp_igd_print(igd_ctxt, level, "ServiceType =  %s", d_event->ServiceType);
+-                      upnp_igd_print(igd_ctxt, level, "ServiceVer  =  %s", d_event->ServiceVer);
+-                      upnp_igd_print(igd_ctxt, level, "Location    =  %s", d_event->Location);
+-                      upnp_igd_print(igd_ctxt, level, "OS          =  %s", d_event->Os);
+-                      upnp_igd_print(igd_ctxt, level, "Ext         =  %s", d_event->Ext);
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpDiscovery_get_ErrCode(d_event)),
++                                     UpnpDiscovery_get_ErrCode(d_event));
++                      upnp_igd_print(igd_ctxt, level, "Expires     =  %d", UpnpDiscovery_get_Expires(d_event));
++                      upnp_igd_print(igd_ctxt, level, "DeviceId    =  %s", UpnpDiscovery_get_DeviceID_cstr(d_event));
++                      upnp_igd_print(igd_ctxt, level, "DeviceType  =  %s", UpnpDiscovery_get_DeviceType_cstr(d_event));
++                      upnp_igd_print(igd_ctxt, level, "ServiceType =  %s", UpnpDiscovery_get_ServiceType_cstr(d_event));
++                      upnp_igd_print(igd_ctxt, level, "ServiceVer  =  %s", UpnpDiscovery_get_ServiceVer_cstr(d_event));
++                      upnp_igd_print(igd_ctxt, level, "Location    =  %s", UpnpDiscovery_get_Location_cstr(d_event));
++                      upnp_igd_print(igd_ctxt, level, "OS          =  %s", UpnpDiscovery_get_Os_cstr(d_event));
++                      upnp_igd_print(igd_ctxt, level, "Ext         =  %s", UpnpDiscovery_get_Ext_cstr(d_event));
+                       break;
                }
--              if (a_event->ActionResult) {
--                      xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
-+              if (UpnpActionRequest_get_ActionResult(a_event)) {
-+                      xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionResult(a_event));
-                       if (xmlbuff) {
-                               upnp_igd_print(igd_ctxt, level, "ActResult   =  %s", xmlbuff);
-                               ixmlFreeDOMString(xmlbuff);
-@@ -240,15 +239,14 @@
-               break;
-       }
-       case UPNP_CONTROL_ACTION_COMPLETE: {
--              struct Upnp_Action_Complete *a_event =
--                      (struct Upnp_Action_Complete *)Event;
-+              UpnpActionComplete *a_event = (UpnpActionComplete *)Event;
-               char *xmlbuff = NULL;
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(a_event->ErrCode), a_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", a_event->CtrlUrl);
--              if (a_event->ActionRequest) {
--                      xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
-+                      UpnpGetErrorMessage(UpnpActionComplete_get_ErrCode(a_event)), UpnpActionComplete_get_ErrCode(a_event));
-+              upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", UpnpActionComplete_get_CtrlUrl_cstr(a_event));
-+              if (UpnpActionComplete_get_ActionRequest(a_event)) {
-+                      xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionRequest(a_event));
-                       if (xmlbuff) {
-                               upnp_igd_print(igd_ctxt, level, "ActRequest  =  %s", xmlbuff);
-                               ixmlFreeDOMString(xmlbuff);
-@@ -257,8 +255,8 @@
-               } else {
-                       upnp_igd_print(igd_ctxt, level, "ActRequest  =  (null)");
+               case UPNP_DISCOVERY_SEARCH_TIMEOUT:
+@@ -211,17 +211,17 @@ void upnp_igd_print_event(upnp_igd_conte
+                       break;
+               /* SOAP */
+               case UPNP_CONTROL_ACTION_REQUEST: {
+-                      struct Upnp_Action_Request *a_event = (struct Upnp_Action_Request *)Event;
++                      Upnp_Action_Request *a_event = (Upnp_Action_Request *)Event;
+                       char *xmlbuff = NULL;
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(a_event->ErrCode),
+-                                     a_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", a_event->ErrStr);
+-                      upnp_igd_print(igd_ctxt, level, "ActionName  =  %s", a_event->ActionName);
+-                      upnp_igd_print(igd_ctxt, level, "UDN         =  %s", a_event->DevUDN);
+-                      upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", a_event->ServiceID);
+-                      if (a_event->ActionRequest) {
+-                              xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpActionRequest_get_ErrCode(a_event)),
++                                     UpnpActionRequest_get_ErrCode(a_event));
++                      upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", UpnpActionRequest_get_ErrStr_cstr(a_event));
++                      upnp_igd_print(igd_ctxt, level, "ActionName  =  %s", UpnpActionRequest_get_ActionName_cstr(a_event));
++                      upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpActionRequest_get_DevUDN_cstr(a_event));
++                      upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpActionRequest_get_ServiceID_cstr(a_event));
++                      if (UpnpActionRequest_get_ActionRequest(a_event)) {
++                              xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionRequest(a_event));
+                               if (xmlbuff) {
+                                       upnp_igd_print(igd_ctxt, level, "ActRequest  =  %s", xmlbuff);
+                                       ixmlFreeDOMString(xmlbuff);
+@@ -230,8 +230,8 @@ void upnp_igd_print_event(upnp_igd_conte
+                       } else {
+                               upnp_igd_print(igd_ctxt, level, "ActRequest  =  (null)");
+                       }
+-                      if (a_event->ActionResult) {
+-                              xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
++                      if (UpnpActionRequest_get_ActionResult(a_event)) {
++                              xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionResult(a_event));
+                               if (xmlbuff) {
+                                       upnp_igd_print(igd_ctxt, level, "ActResult   =  %s", xmlbuff);
+                                       ixmlFreeDOMString(xmlbuff);
+@@ -243,14 +243,14 @@ void upnp_igd_print_event(upnp_igd_conte
+                       break;
+               }
+               case UPNP_CONTROL_ACTION_COMPLETE: {
+-                      struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)Event;
++                      Upnp_Action_Complete *a_event = (Upnp_Action_Complete *)Event;
+                       char *xmlbuff = NULL;
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(a_event->ErrCode),
+-                                     a_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", a_event->CtrlUrl);
+-                      if (a_event->ActionRequest) {
+-                              xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpActionComplete_get_ErrCode(a_event)),
++                                     UpnpActionComplete_get_ErrCode(a_event));
++                      upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", UpnpActionComplete_get_CtrlUrl_cstr(a_event));
++                      if (UpnpActionComplete_get_ActionRequest(a_event)) {
++                              xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionRequest(a_event));
+                               if (xmlbuff) {
+                                       upnp_igd_print(igd_ctxt, level, "ActRequest  =  %s", xmlbuff);
+                                       ixmlFreeDOMString(xmlbuff);
+@@ -259,8 +259,8 @@ void upnp_igd_print_event(upnp_igd_conte
+                       } else {
+                               upnp_igd_print(igd_ctxt, level, "ActRequest  =  (null)");
+                       }
+-                      if (a_event->ActionResult) {
+-                              xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
++                      if (UpnpActionComplete_get_ActionResult(a_event)) {
++                              xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionResult(a_event));
+                               if (xmlbuff) {
+                                       upnp_igd_print(igd_ctxt, level, "ActResult   =  %s", xmlbuff);
+                                       ixmlFreeDOMString(xmlbuff);
+@@ -272,77 +272,77 @@ void upnp_igd_print_event(upnp_igd_conte
+                       break;
+               }
+               case UPNP_CONTROL_GET_VAR_REQUEST: {
+-                      struct Upnp_State_Var_Request *sv_event = (struct Upnp_State_Var_Request *)Event;
++                      Upnp_State_Var_Request *sv_event = (Upnp_State_Var_Request *)Event;
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(sv_event->ErrCode),
+-                                     sv_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", sv_event->ErrStr);
+-                      upnp_igd_print(igd_ctxt, level, "UDN         =  %s", sv_event->DevUDN);
+-                      upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", sv_event->ServiceID);
+-                      upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", sv_event->StateVarName);
+-                      upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", sv_event->CurrentVal);
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpStateVarRequest_get_ErrCode(sv_event)),
++                                     UpnpStateVarRequest_get_ErrCode(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", UpnpStateVarRequest_get_ErrStr_cstr(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpStateVarRequest_get_DevUDN_cstr(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpStateVarRequest_get_ServiceID_cstr(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", UpnpStateVarRequest_get_StateVarName_cstr(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", UpnpStateVarRequest_get_CurrentVal_cstr(sv_event));
+                       break;
+               }
+               case UPNP_CONTROL_GET_VAR_COMPLETE: {
+-                      struct Upnp_State_Var_Complete *sv_event = (struct Upnp_State_Var_Complete *)Event;
++                      Upnp_State_Var_Complete *sv_event = (Upnp_State_Var_Complete *)Event;
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(sv_event->ErrCode),
+-                                     sv_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", sv_event->CtrlUrl);
+-                      upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", sv_event->StateVarName);
+-                      upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", sv_event->CurrentVal);
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpStateVarComplete_get_ErrCode(sv_event)),
++                                     UpnpStateVarComplete_get_ErrCode(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", UpnpStateVarComplete_get_StateVarName_cstr(sv_event));
++                      upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", UpnpStateVarComplete_get_CurrentVal_cstr(sv_event));
+                       break;
+               }
+               /* GENA */
+               case UPNP_EVENT_SUBSCRIPTION_REQUEST: {
+-                      struct Upnp_Subscription_Request *sr_event = (struct Upnp_Subscription_Request *)Event;
++                      Upnp_Subscription_Request *sr_event = (Upnp_Subscription_Request *)Event;
+-                      upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", sr_event->ServiceId);
+-                      upnp_igd_print(igd_ctxt, level, "UDN         =  %s", sr_event->UDN);
+-                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", sr_event->Sid);
++                      upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpSubscriptionRequest_get_ServiceId_cstr(sr_event));
++                      upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpSubscriptionRequest_get_UDN_cstr(sr_event));
++                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpSubscriptionRequest_get_SID_cstr(sr_event));
+                       break;
+               }
+               case UPNP_EVENT_RECEIVED: {
+-                      struct Upnp_Event *e_event = (struct Upnp_Event *)Event;
++                      Upnp_Event *e_event = (Upnp_Event *)Event;
+                       char *xmlbuff = NULL;
+-                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", e_event->Sid);
+-                      upnp_igd_print(igd_ctxt, level, "EventKey    =  %d", e_event->EventKey);
+-                      xmlbuff = ixmlPrintNode((IXML_Node *)e_event->ChangedVariables);
++                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEvent_get_SID_cstr(e_event));
++                      upnp_igd_print(igd_ctxt, level, "EventKey    =  %d", UpnpEvent_get_EventKey(e_event));
++                      xmlbuff = ixmlPrintNode((IXML_Node *)UpnpEvent_get_ChangedVariables(e_event));
+                       upnp_igd_print(igd_ctxt, level, "ChangedVars =  %s", xmlbuff);
+                       ixmlFreeDOMString(xmlbuff);
+                       xmlbuff = NULL;
+                       break;
+               }
+               case UPNP_EVENT_RENEWAL_COMPLETE: {
+-                      struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)Event;
++                      Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)Event;
+-                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(es_event->ErrCode),
+-                                     es_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
++                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)),
++                                     UpnpEventSubscribe_get_ErrCode(es_event));
++                      upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
+                       break;
+               }
+               case UPNP_EVENT_SUBSCRIBE_COMPLETE:
+               case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: {
+-                      struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)Event;
++                      Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)Event;
+-                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(es_event->ErrCode),
+-                                     es_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", es_event->PublisherUrl);
+-                      upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
++                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)),
++                                     UpnpEventSubscribe_get_ErrCode(es_event));
++                      upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
++                      upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
+                       break;
+               }
+               case UPNP_EVENT_AUTORENEWAL_FAILED:
+               case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
+-                      struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)Event;
++                      Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)Event;
+-                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
+-                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(es_event->ErrCode),
+-                                     es_event->ErrCode);
+-                      upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", es_event->PublisherUrl);
+-                      upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
++                      upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
++                      upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)),
++                                     UpnpEventSubscribe_get_ErrCode(es_event));
++                      upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
++                      upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
+                       break;
                }
--              if (a_event->ActionResult) {
--                      xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
-+              if (UpnpActionComplete_get_ActionResult(a_event)) {
-+                      xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionResult(a_event));
-                       if (xmlbuff) {
-                               upnp_igd_print(igd_ctxt, level, "ActResult   =  %s", xmlbuff);
-                               ixmlFreeDOMString(xmlbuff);
-@@ -270,83 +268,77 @@
-               break;
-       }
-       case UPNP_CONTROL_GET_VAR_REQUEST: {
--              struct Upnp_State_Var_Request *sv_event =
--                      (struct Upnp_State_Var_Request *)Event;
-+              UpnpStateVarRequest *sv_event = (UpnpStateVarRequest *)Event;
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(sv_event->ErrCode), sv_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", sv_event->ErrStr);
--              upnp_igd_print(igd_ctxt, level, "UDN         =  %s", sv_event->DevUDN);
--              upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", sv_event->ServiceID);
--              upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", sv_event->StateVarName);
--              upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", sv_event->CurrentVal);
-+                      UpnpGetErrorMessage(UpnpStateVarRequest_get_ErrCode(sv_event)), UpnpStateVarRequest_get_ErrCode(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", UpnpStateVarRequest_get_ErrStr_cstr(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpStateVarRequest_get_DevUDN_cstr(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpStateVarRequest_get_ServiceID_cstr(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", UpnpStateVarRequest_get_StateVarName_cstr(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", UpnpStateVarRequest_get_CurrentVal_cstr(sv_event));
-               break;
-       }
-       case UPNP_CONTROL_GET_VAR_COMPLETE: {
--              struct Upnp_State_Var_Complete *sv_event =
--                      (struct Upnp_State_Var_Complete *)Event;
-+              UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event;
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(sv_event->ErrCode), sv_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", sv_event->CtrlUrl);
--              upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", sv_event->StateVarName);
--              upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", sv_event->CurrentVal);
-+                      UpnpGetErrorMessage(UpnpStateVarComplete_get_ErrCode(sv_event)), UpnpStateVarComplete_get_ErrCode(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", UpnpStateVarComplete_get_StateVarName_cstr(sv_event));
-+              upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", UpnpStateVarComplete_get_CurrentVal_cstr(sv_event));
-               break;
-       }
-       /* GENA */
-       case UPNP_EVENT_SUBSCRIPTION_REQUEST: {
--              struct Upnp_Subscription_Request *sr_event =
--                      (struct Upnp_Subscription_Request *)Event;
-+              UpnpSubscriptionRequest *sr_event = (UpnpSubscriptionRequest *)Event;
--              upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", sr_event->ServiceId);
--              upnp_igd_print(igd_ctxt, level, "UDN         =  %s", sr_event->UDN);
--              upnp_igd_print(igd_ctxt, level, "SID         =  %s", sr_event->Sid);
-+              upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpSubscriptionRequest_get_ServiceId_cstr(sr_event));
-+              upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpSubscriptionRequest_get_UDN_cstr(sr_event));
-+              upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpSubscriptionRequest_get_SID_cstr(sr_event));
-               break;
-       }
-       case UPNP_EVENT_RECEIVED: {
--              struct Upnp_Event *e_event = (struct Upnp_Event *)Event;
-+              UpnpEvent *e_event = (UpnpEvent *)Event;
-               char *xmlbuff = NULL;
--              upnp_igd_print(igd_ctxt, level, "SID         =  %s", e_event->Sid);
--              upnp_igd_print(igd_ctxt, level, "EventKey    =  %d",    e_event->EventKey);
--              xmlbuff = ixmlPrintNode((IXML_Node *)e_event->ChangedVariables);
-+              upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEvent_get_SID_cstr(e_event));
-+              upnp_igd_print(igd_ctxt, level, "EventKey    =  %d", UpnpEvent_get_EventKey(e_event));
-+              xmlbuff = ixmlPrintNode((IXML_Node *)UpnpEvent_get_ChangedVariables(e_event));
-               upnp_igd_print(igd_ctxt, level, "ChangedVars =  %s", xmlbuff);
-               ixmlFreeDOMString(xmlbuff);
-               xmlbuff = NULL;
-               break;
-       }
-       case UPNP_EVENT_RENEWAL_COMPLETE: {
--              struct Upnp_Event_Subscribe *es_event =
--                      (struct Upnp_Event_Subscribe *)Event;
-+              UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
--              upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
-+              upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
-+                      UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
-+              upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
-               break;
-       }
-       case UPNP_EVENT_SUBSCRIBE_COMPLETE:
-       case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: {
--              struct Upnp_Event_Subscribe *es_event =
--                      (struct Upnp_Event_Subscribe *)Event;
-+              UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
--              upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
-+              upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", es_event->PublisherUrl);
--              upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
-+                      UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
-+              upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
-+              upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
-               break;
-       }
-       case UPNP_EVENT_AUTORENEWAL_FAILED:
-       case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
--              struct Upnp_Event_Subscribe *es_event =
--                      (struct Upnp_Event_Subscribe *)Event;
-+              UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
--              upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
-+              upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
-               upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)",
--                      UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
--              upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", es_event->PublisherUrl);
--              upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
-+                      UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
-+              upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
-+              upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
-               break;
-       }
        }
---- mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.h.orig        2020-09-24 11:44:00.000000000 +0200
-+++ mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.h     2020-09-27 09:51:21.930120631 +0200
-@@ -39,7 +39,7 @@
+--- mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.h.orig       2024-03-09 07:20:50.729508861 +0100
++++ mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.h    2024-03-09 07:21:11.766061563 +0100
+@@ -39,7 +39,7 @@ char *upnp_igd_strncpy(char *destination
  
  void upnp_igd_print(upnp_igd_context *uIGD, upnp_igd_print_level level, const char *fmt, ...);
  void upnp_igd_print_event_type(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType S);
 +void upnp_igd_print_event(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType EventType, const void *Event);
  char *upnp_igd_get_first_document_item(upnp_igd_context *uIGD, IXML_Document *doc, const char *item);
  char *upnp_igd_get_element_value(upnp_igd_context *uIGD, IXML_Element *element);
- char *upnp_igd_get_first_element_item(upnp_igd_context *uIGD,IXML_Element *element, const char *item);
+ char *upnp_igd_get_first_element_item(upnp_igd_context *uIGD, IXML_Element *element, const char *item);
 --- mediastreamer2-4.4.2/configure.ac.orig     2021-07-05 06:50:46.295451589 +0200
 +++ mediastreamer2-4.4.2/configure.ac  2021-07-05 17:16:33.665373367 +0200
 @@ -717,7 +717,7 @@ AC_ARG_ENABLE(upnp,
index 2406db15c63e61923bb648b46d38b98a93736456..5310c783ace1f8614b4823bbc2d1c3b65c8b9bd3 100644 (file)
@@ -1,7 +1,7 @@
---- mediastreamer2-5.1.72/CMakeLists.txt.orig  2023-04-10 18:45:22.718792262 +0200
-+++ mediastreamer2-5.1.72/CMakeLists.txt       2023-04-10 19:00:27.760555896 +0200
-@@ -325,7 +325,13 @@ if(NOT APPLE AND NOT ANDROID AND OPENGL_
-               set(MS2_USE_OLD_OPENGL_PROTOTYPE TRUE)#Before 1.11, Glew have few different headers from OpenGL Specs
+--- mediastreamer2-5.3.29/CMakeLists.txt.orig  2024-03-09 07:26:07.891123982 +0100
++++ mediastreamer2-5.3.29/CMakeLists.txt       2024-03-09 07:28:42.010289047 +0100
+@@ -297,7 +297,13 @@ if(NOT APPLE AND NOT ANDROID AND OPENGL_
+               set(MS2_USE_OLD_OPENGL_PROTOTYPE TRUE) # Before 1.11, Glew have few different headers from OpenGL Specs
        endif()
  endif()
 -# TODO: Handle SDL option
 +endif()
  if(ENABLE_THEORA)
        find_package(Theora)
-       if(NOT THEORA_FOUND)
-@@ -498,6 +504,9 @@ if(GLEW_FOUND)
      list(APPEND LINK_LIBS GLEW)
-       list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${GLEW_INCLUDE_DIRS})
+       if(NOT Theora_FOUND)
+@@ -462,6 +468,9 @@ endif()
if(GLEW_FOUND)
+       list(APPEND LINK_LIBS GLEW::GLEW)
  endif()
 +if(SDL_FOUND)
 +      list(APPEND LINK_LIBS SDL)
 +endif()
- if(THEORA_FOUND)
-       list(APPEND LINK_LIBS theora)
+ if(Theora_FOUND)
+       list(APPEND LINK_LIBS ${Theora_TARGET})
  endif()
diff --git a/mediastreamer-cmake-find.patch b/mediastreamer-cmake-find.patch
new file mode 100644 (file)
index 0000000..4f1e357
--- /dev/null
@@ -0,0 +1,61 @@
+--- mediastreamer2-5.3.29/cmake/FindGSM.cmake.orig     2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/cmake/FindGSM.cmake  2024-03-09 20:16:25.064077414 +0100
+@@ -58,7 +58,7 @@ else()
+       set(_GSM_ROOT_PATHS ${CMAKE_INSTALL_PREFIX})
+       find_path(_GSM_INCLUDE_DIRS
+-              NAMES gsm/gsm.h
++              NAMES gsm.h gsm/gsm.h
+               HINTS ${_GSM_ROOT_PATHS}
+               PATH_SUFFIXES include
+       )
+--- mediastreamer2-5.3.29/cmake/FindDav1d.cmake.orig   2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/cmake/FindDav1d.cmake        2024-03-09 20:44:17.671682787 +0100
+@@ -65,17 +65,17 @@ else()
+               PATH_SUFFIXES bin lib lib/Win32
+       )
+-      if(_Dav1d_INCLUDE_DIRS AND _Dav1d_LIBRARY)
++      if(Dav1d_INCLUDE_DIRS AND Dav1d_LIBRARY)
+               add_library(libdav1d UNKNOWN IMPORTED)
+               if(WIN32)
+                       set_target_properties(libdav1d PROPERTIES
+-                              INTERFACE_INCLUDE_DIRECTORIES "${_Dav1d_INCLUDE_DIRS}"
+-                              IMPORTED_IMPLIB "${_Dav1d_LIBRARY}"
++                              INTERFACE_INCLUDE_DIRECTORIES "${Dav1d_INCLUDE_DIRS}"
++                              IMPORTED_IMPLIB "${Dav1d_LIBRARY}"
+                       )
+               else()
+                       set_target_properties(libdav1d PROPERTIES
+-                              INTERFACE_INCLUDE_DIRECTORIES "${_Dav1d_INCLUDE_DIRS}"
+-                              IMPORTED_LOCATION "${_Dav1d_LIBRARY}"
++                              INTERFACE_INCLUDE_DIRECTORIES "${Dav1d_INCLUDE_DIRS}"
++                              IMPORTED_LOCATION "${Dav1d_LIBRARY}"
+                       )
+               endif()
+--- mediastreamer2-5.3.29/cmake/FindAom.cmake.orig     2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/cmake/FindAom.cmake  2024-03-09 20:45:16.931361750 +0100
+@@ -65,17 +65,17 @@ else()
+               PATH_SUFFIXES bin lib lib/Win32
+       )
+-      if(_Aom_INCLUDE_DIRS AND _Aom_LIBRARY)
++      if(Aom_INCLUDE_DIRS AND Aom_LIBRARY)
+               add_library(aom UNKNOWN IMPORTED)
+               if(WIN32)
+                       set_target_properties(aom PROPERTIES
+-                              INTERFACE_INCLUDE_DIRECTORIES "${_Aom_INCLUDE_DIRS}"
+-                              IMPORTED_IMPLIB "${_Aom_LIBRARY}"
++                              INTERFACE_INCLUDE_DIRECTORIES "${Aom_INCLUDE_DIRS}"
++                              IMPORTED_IMPLIB "${Aom_LIBRARY}"
+                       )
+               else()
+                       set_target_properties(aom PROPERTIES
+-                              INTERFACE_INCLUDE_DIRECTORIES "${_Aom_INCLUDE_DIRS}"
+-                              IMPORTED_LOCATION "${_Aom_LIBRARY}"
++                              INTERFACE_INCLUDE_DIRECTORIES "${Aom_INCLUDE_DIRS}"
++                              IMPORTED_LOCATION "${Aom_LIBRARY}"
+                       )
+               endif()
index 03882297d4f7f87e8c59d86dfe030876e8b0993a..eae05cd190209339955ce89bbff7c2ee0e7c20a4 100644 (file)
@@ -11,11 +11,9 @@ Last-Update: 2020-12-31
  mediastreamer.pc.in | 2 +-
  2 files changed, 10 insertions(+), 1 deletion(-)
 
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 022b83113..3092755bb 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -682,8 +682,12 @@ else()
+--- mediastreamer2-5.3.29/CMakeLists.txt.orig  2024-02-21 12:02:03.000000000 +0100
++++ mediastreamer2-5.3.29/CMakeLists.txt       2024-03-09 07:25:29.228000105 +0100
+@@ -697,8 +697,12 @@ else()
        set(PACKAGE_DATA_DIR "${CMAKE_INSTALL_DATADIR}")
  endif()
  
@@ -28,18 +26,18 @@ index 022b83113..3092755bb 100644
  add_definitions("-DHAVE_CONFIG_H")
  
  if(ENABLE_DOC)
-@@ -715,6 +719,11 @@ configure_package_config_file(cmake/Mediastreamer2Config.cmake.in
-       NO_SET_AND_CHECK_MACRO
- )
+@@ -795,6 +799,11 @@ if(ZXing_FOUND)
+       install(FILES "cmake/FindZXing.cmake" DESTINATION ${CMAKE_MODULES_INSTALL_DIR})
endif()
  
 +install(FILES
 +      "${CMAKE_CURRENT_BINARY_DIR}/mediastreamer.pc"
 +      DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
 +)
 +
- install(EXPORT ${EXPORT_TARGETS_NAME}Targets
-       FILE Mediastreamer2Targets.cmake
-       DESTINATION ${CONFIG_PACKAGE_LOCATION}
+ install(EXPORT ${PROJECT_NAME}Targets
+       FILE "${PROJECT_NAME}Targets.cmake"
+       DESTINATION ${CMAKE_MODULES_INSTALL_DIR}
 diff --git a/mediastreamer.pc.in b/mediastreamer.pc.in
 index 3870fda82..480bb1686 100644
 --- a/mediastreamer.pc.in
index fbb83161a9e36059d31350b4b31b55298f7eb1a8..13ce434eb92ffe2bccb86137a4cbdf0453855c92 100644 (file)
@@ -1,20 +1,12 @@
---- mediastreamer2-5.1.72/CMakeLists.txt.orig  2022-11-18 15:22:23.000000000 +0100
-+++ mediastreamer2-5.1.72/CMakeLists.txt       2023-04-10 18:45:02.855566537 +0200
-@@ -418,7 +418,7 @@ include_directories(
- )
+--- mediastreamer2-5.3.29/src/CMakeLists.txt.orig      2024-03-09 18:09:20.452050150 +0100
++++ mediastreamer2-5.3.29/src/CMakeLists.txt   2024-03-09 18:54:37.470664130 +0100
+@@ -614,8 +614,8 @@ if(BUILD_SHARED_LIBS)
+                       set_target_properties(mediastreamer2 PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,libvpx.a")
+               endif()
+               # Do not version shared library on Android
+-              set_target_properties(mediastreamer2 PROPERTIES SOVERSION ${MEDIASTREAMER_SO_VERSION})
+       else()
++              set_target_properties(mediastreamer2 PROPERTIES SOVERSION ${MEDIASTREAMER_SO_VERSION})
  
- set(MEDIASTREAMER2_INCLUDE_DIRS )
--set(LINK_LIBS bctoolbox ortp)
-+set(LINK_LIBS bctoolbox ortp pthread)
- if(WIN32)
-       if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
-               list(APPEND LINK_LIBS ole32 oleaut32 uuid Winmm Ws2_32)
-@@ -487,7 +487,7 @@ if(X11_FOUND)
-       list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${X11_INCLUDE_DIRS})
- endif()
- if(XV_FOUND)
--      list(APPEND LINK_LIBS Xv)
-+      list(APPEND LINK_LIBS Xv Xext)
-       list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${XV_INCLUDE_DIRS})
- endif()
- if(GLX_FOUND)
+               #Workaround for the Debian 11 issue with conflict between libc and libtirpc
diff --git a/mediastreamer-gcc.patch b/mediastreamer-gcc.patch
deleted file mode 100644 (file)
index e1d4850..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- mediastreamer2-4.5.22/src/utils/mkv_reader.cpp.orig        2021-06-24 23:55:04.000000000 +0200
-+++ mediastreamer2-4.5.22/src/utils/mkv_reader.cpp     2021-07-18 09:55:27.905014183 +0200
-@@ -20,6 +20,7 @@
- #include <algorithm>
- #include <array>
- #include <cwchar>
-+#include <limits>
- #include <list>
- #include <memory>
- #include <vector>
index 02256f18dcd5f1472f18d5e03c291281dd74c532..bb23cfbe320c104f3669688be9fbb6fc62316698 100644 (file)
@@ -1,29 +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{
+--- mediastreamer2-5.3.29/src/videofilters/videoout.c.orig     2024-03-09 07:29:22.956733888 +0100
++++ mediastreamer2-5.3.29/src/videofilters/videoout.c  2024-03-09 08:18:42.107369462 +0100
+@@ -147,7 +147,7 @@ typedef struct _SdlDisplay {
  
  #include <SDL/SDL_syswm.h>
  
--static long sdl_get_native_window_id(){
-+static long sdl_get_native_window_id(void){
+-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
+       if (SDL_GetWMInfo(&info)) {
+@@ -184,7 +184,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)
+-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]));
+ #endif
+@@ -241,7 +241,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__
index aa59bb45862a68a2f6ec9058c0fff6151ceaa3f1..abb13d56bf1d73b5d0843fcca18a83b073997427 100644 (file)
 %bcond_without sdl             # SDL support
 # video codecs
 %bcond_without matroska        # Matroska support via bcmatroska2
-%bcond_without zxing           # QRcode support via zxing-cpp
+%bcond_without zxing           # QRcode support via zxing-cpp-nu
 #
 Summary:       Audio/Video real-time streaming
 Summary(pl.UTF-8):     PrzesyƂanie strumieni audio/video w czasie rzeczywistym 
 Name:          mediastreamer
-# note: 5.2.x is AGPL-licensed; see DEVEL-5.2 branch
-Version:       5.2.109
+Version:       5.3.29
 Release:       1
-License:       GPL v3+
+License:       AGPL v3+
 Group:         Libraries
 #Source0Download: https://gitlab.linphone.org/BC/public/mediastreamer2/tags
 Source0:       https://gitlab.linphone.org/BC/public/mediastreamer2/-/archive/%{version}/mediastreamer2-%{version}.tar.bz2
-# Source0-md5: fb37d1ea973015e3c648d219d2ff3dda
+# Source0-md5: 582b4e2563297e7737b7b899b66c1edb
 Patch0:                build.patch
 Patch1:                %{name}-cmake-link.patch
 Patch2:                libupnp-1.14.patch
@@ -40,36 +39,38 @@ Patch3:             %{name}-cmake-datadir.patch
 Patch4:                %{name}-cmake-install-pkgconfig.patch
 Patch5:                %{name}-cmake-SDL.patch
 Patch6:                %{name}-types.patch
-Patch10:       %{name}-gcc.patch
-Patch11:       ffmpeg_5_0_fixes.patch
-URL:           http://www.linphone.org/technical-corner/mediastreamer2/overview
+Patch7:                ffmpeg_5_0_fixes.patch
+Patch8:                %{name}-cmake-find.patch
+URL:           https://www.linphone.org/technical-corner/mediastreamer2-ortp
 %{?with_opengl:BuildRequires:  OpenGL-GLX-devel}
 %{?with_sdl:BuildRequires:     SDL-devel >= 1.2.0}
 %{?with_alsa:BuildRequires:    alsa-lib-devel}
 %{?with_arts:BuildRequires:    artsc-devel}
-%{?with_bcg729:BuildRequires:  bcg729-devel >= 1.1.1-1}
-%{?with_matroska:BuildRequires:        bcmatroska2-devel >= 5.1}
-BuildRequires: bctoolbox-devel >= 0.4.0
+%{?with_bcg729:BuildRequires:  bcg729-devel >= 1.1.1-2}
+%{?with_matroska:BuildRequires:        bcmatroska2-devel >= 5.3}
+BuildRequires: bctoolbox-devel >= 5.3.0
 %{?with_bv16:BuildRequires:    bv16-floatingpoint-devel}
-%{?with_zrtp:BuildRequires:    bzrtp-devel >= 5.2.51}
-BuildRequires: cmake >= 3.1
+%{?with_zrtp:BuildRequires:    bzrtp-devel >= 5.3.0}
+BuildRequires: cmake >= 3.22
+BuildRequires: dav1d-devel
 BuildRequires: doxygen
 # libavcodec >= 51.0.0, libswscale >= 0.7.0
-BuildRequires: ffmpeg-devel
+BuildRequires: ffmpeg-devel >= 4.4
 BuildRequires: gettext-tools
 %{?with_opengl:BuildRequires:  glew-devel >= 1.5}
 BuildRequires: intltool >= 0.40
 BuildRequires: libgsm-devel
 BuildRequires: libjpeg-turbo-devel
 %{?with_pcap:BuildRequires:    libpcap-devel}
-BuildRequires: libstdc++-devel >= 6:5
+%{?with_srtp:BuildRequires:    libsrtp2-devel >= 2}
+BuildRequires: libstdc++-devel >= 6:7
 BuildRequires: libtheora-devel >= 1.0-0.alpha7
 BuildRequires: libupnp-devel >= 1.8
 BuildRequires: libv4l-devel
 BuildRequires: libvpx-devel >= 0.9.6
 BuildRequires: libyuv-devel
 BuildRequires: opus-devel >= 0.9.0
-BuildRequires: ortp-devel >= 5.1
+BuildRequires: ortp-devel >= 5.3.0
 BuildRequires: pkgconfig
 %{?with_portaudio:BuildRequires:       portaudio-devel}
 %{?with_pulseaudio:BuildRequires:      pulseaudio-devel >= 0.9.21}
@@ -79,19 +80,18 @@ BuildRequires:      sed >= 4.0
 %{?with_spandsp:BuildRequires: spandsp-devel >= 0.0.6}
 BuildRequires: speex-devel >= 1:1.2-beta3
 BuildRequires: speexdsp-devel >= 1.2-beta3
-%{?with_srtp:BuildRequires:    libsrtp2-devel}
 BuildRequires: xorg-lib-libX11-devel
 BuildRequires: xorg-lib-libXv-devel
-%{?with_zxing:BuildRequires:   zxing-cpp-devel}
-%{?with_bcg729:Requires:       bcg729 >= 1.1.1-1}
-%{?with_matroska:Requires:     bcmatroska2 >= 5.1}
-Requires:      bctoolbox >= 0.4.0
-%{?with_zrtp:Requires: bzrtp >= 5.2.109}
+%{?with_zxing:BuildRequires:   zxing-cpp-nu-devel}
+%{?with_bcg729:Requires:       bcg729 >= 1.1.1-2}
+%{?with_matroska:Requires:     bcmatroska2 >= 5.3}
+Requires:      bctoolbox >= 5.3.0
+%{?with_zrtp:Requires: bzrtp >= 5.3.0}
 %{?with_opengl:Requires:       glew >= 1.5}
 Requires:      libtheora >= 1.0-0.alpha7
 Requires:      libvpx >= 0.9.6
 Requires:      opus >= 0.9.0
-Requires:      ortp >= 5.2.109
+Requires:      ortp >= 5.3.0
 %{?with_pulseaudio:Requires:   pulseaudio-libs >= 0.9.21}
 Requires:      spandsp >= 0.0.6
 Requires:      speex >= 1:1.2-beta3
@@ -116,25 +116,25 @@ Group:            Development/Libraries
 Requires:      %{name} = %{version}-%{release}
 %{?with_opengl:Requires:       OpenGL-devel}
 %{?with_alsa:Requires: alsa-lib-devel}
-%{?with_bcg729:Requires:       bcg729-devel >= 1.1.1-1}
-%{?with_matroska:Requires:     bcmatroska2-devel >= 5.1}
-Requires:      bctoolbox-devel >= 0.4.0
+%{?with_bcg729:Requires:       bcg729-devel >= 1.1.1-2}
+%{?with_matroska:Requires:     bcmatroska2-devel >= 5.3}
+Requires:      bctoolbox-devel >= 5.3.0
 %{?with_bv16:Requires: bv16-floatingpoint-devel}
-%{?with_zrtp:Requires: bzrtp-devel >= 5.2.51}
-Requires:      ffmpeg-devel
+%{?with_zrtp:Requires: bzrtp-devel >= 5.3.0}
+Requires:      ffmpeg-devel >= 4.4
 %{?with_opengl:Requires:       glew-devel >= 1.5}
+%{?with_srtp:Requires: libsrtp2-devel >= 2}
 Requires:      libtheora-devel >= 1.0-0.alpha7
 Requires:      libupnp-devel >= 1.8
 Requires:      libv4l-devel
 Requires:      libvpx-devel >= 0.9.6
 Requires:      opus-devel >= 0.9.0
-Requires:      ortp-devel >= 5.1
+Requires:      ortp-devel >= 5.3.0
 %{?with_portaudio:Requires:    portaudio-devel}
 %{?with_pulseaudio:Requires:   pulseaudio-devel >= 0.9.21}
 Requires:      spandsp-devel >= 0.0.6
 Requires:      speex-devel >= 1:1.2-beta3
 Requires:      speexdsp-devel >= 1.2-beta3
-%{?with_srtp:Requires: libsrtp2-devel}
 Requires:      xorg-lib-libX11-devel
 Requires:      xorg-lib-libXv-devel
 
@@ -166,8 +166,8 @@ Statyczne biblioteki mediastreamer.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
-%patch10 -p1
-%patch11 -p1
+%patch7 -p1
+%patch8 -p1
 
 # cmake checks for python3, so don't require python 2 as well
 %{__sed} -i -e '1s,/usr/bin/python$,%{__python3},' tools/xxd.py
@@ -175,15 +175,14 @@ Statyczne biblioteki mediastreamer.
 %{__sed} -i -e 's/"-Werror" /"-Werror" "-Wno-error=address" "-Wno-error=unused-parameter"/' CMakeLists.txt
 
 %build
-install -d builddir
-cd builddir
-# NLS missing in cmake
-CPPFLAGS="%{rpmcppflags} -DENABLE_NLS=1 -DGETTEXT_PACKAGE=\"mediastreamer\" -DLOCALEDIR=\"%{_localedir}\""
-# note: NON_FREE_CODECS refer to H263, H264, MPEG4 via libavcodec
-%cmake .. \
+configure() {
+set -x
+builddir="$1"
+shift
+# note: NON_FREE_FEATURES refer to H263, H264, MPEG4 via libavcodec
+%cmake -B "$builddir" \
        -DCMAKE_INSTALL_INCLUDEDIR=include \
        -DCMAKE_INSTALL_LIBDIR=%{_lib} \
-       -DDISABLE_BC_PACKAGE_SEARCH:BOOL=OFF \
        %{!?with_alsa:-DENABLE_ALSA=OFF} \
        %{?with_arts:-DENABLE_ARTSC=ON} \
        %{!?with_bv16:-DENABLE_BV16=OFF} \
@@ -193,7 +192,7 @@ CPPFLAGS="%{rpmcppflags} -DENABLE_NLS=1 -DGETTEXT_PACKAGE=\"mediastreamer\" -DLO
        %{!?with_opengl:-DENABLE_GL=OFF} \
        %{!?with_opengl:-DENABLE_GLX=OFF} \
        %{!?with_matroska:-DENABLE_MKV=OFF} \
-       -DENABLE_NON_FREE_CODECS=ON \
+       -DENABLE_NON_FREE_FEATURES=ON \
        %{?with_oss:-DENABLE_OSS=ON} \
        %{?with_pcap:-DENABLE_PCAP=ON} \
        %{?with_portaudio:-DENABLE_PORTAUDIO=ON} \
@@ -201,25 +200,44 @@ CPPFLAGS="%{rpmcppflags} -DENABLE_NLS=1 -DGETTEXT_PACKAGE=\"mediastreamer\" -DLO
        %{!?with_zxing:-DENABLE_QRCODE=OFF} \
        %{?with_sdl:-DENABLE_SDL=ON} \
        %{!?with_srtp:-DENABLE_SRTP=OFF} \
-       %{!?with_static_libs:-DENABLE_STATIC=OFF} \
        -DENABLE_UNIT_TESTS=OFF \
-       %{!?with_zrtp:-DENABLE_ZRTP=OFF}
+       %{!?with_zrtp:-DENABLE_ZRTP=OFF} \
+       "$@"
+}
+
+# NLS missing in cmake
+# GSM_USE_BUILD_INTERFACE to include <gsm.h> instead of <gsm/gsm.h>
+CPPFLAGS="%{rpmcppflags} -DENABLE_NLS=1 -DGETTEXT_PACKAGE=\\\"mediastreamer\\\" -DLOCALEDIR=\\\"%{_localedir}\\\" -DGSM_USE_BUILD_INTERFACE=1"
+# CPPFLAGS are not used, so append
+CFLAGS="%{rpmcflags} $CPPFLAGS"
+CXXFLAGS="%{rpmcxxflags} $CPPFLAGS"
+
+%if %{with static_libs}
+configure builddir-static \
+       -DBUILD_SHARED_LIBS=OFF
+
+%{__make} -C builddir-static
+%endif
+
+configure builddir
 
-%{__make}
+%{__make} -C builddir
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} -C builddir install \
+%if %{with static_libs}
+%{__make} -C builddir-static install \
        DESTDIR=$RPM_BUILD_ROOT
+%endif
 
-# disable completeness check incompatible with split packaging
-%{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_datadir}/Mediastreamer2/cmake/Mediastreamer2Targets.cmake
+%{__make} -C builddir install \
+       DESTDIR=$RPM_BUILD_ROOT
 
 # missing from install in cmake
-install builddir/tools/msaudiocmp $RPM_BUILD_ROOT%{_bindir}
+install builddir/tools/mediastreamer2-msaudiocmp $RPM_BUILD_ROOT%{_bindir}
 %if %{with pcap}
-install builddir/tools/pcap_playback $RPM_BUILD_ROOT%{_bindir}
+install builddir/tools/mediastreamer2-pcap_playback $RPM_BUILD_ROOT%{_bindir}
 %endif
 for f in po/*.po ; do
        lang=$(basename "$f" .po)
@@ -233,7 +251,7 @@ install -d $RPM_BUILD_ROOT%{_libdir}/mediastreamer/plugins
 # we don't need another copy
 %{__rm} -r $RPM_BUILD_ROOT%{_includedir}/OpenGL
 # Remove duplicated documentation
-%{__rm} -r $RPM_BUILD_ROOT/usr/share/doc/mediastreamer2-5.2.0/html
+%{__rm} -r $RPM_BUILD_ROOT/usr/share/doc/mediastreamer2-5.3.0/html
 
 %find_lang %{name}
 
@@ -246,11 +264,13 @@ rm -rf $RPM_BUILD_ROOT
 %files -f %{name}.lang
 %defattr(644,root,root,755)
 %doc CHANGELOG.md README.md
-%attr(755,root,root) %{_bindir}/mediastream
-%attr(755,root,root) %{_bindir}/mkvstream
-%attr(755,root,root) %{_bindir}/msaudiocmp
-%{?with_pcap:%attr(755,root,root) %{_bindir}/pcap_playback}
-%attr(755,root,root) %{_libdir}/libmediastreamer.so.11
+%attr(755,root,root) %{_bindir}/mediastreamer2-mediastream
+%attr(755,root,root) %{_bindir}/mediastreamer2-mkvstream
+%attr(755,root,root) %{_bindir}/mediastreamer2-msaudiocmp
+%if %{with pcap}
+%attr(755,root,root) %{_bindir}/mediastreamer2-pcap-playback
+%endif
+%attr(755,root,root) %{_libdir}/libmediastreamer2.so.11
 %dir %{_libdir}/mediastreamer
 %dir %{_libdir}/mediastreamer/plugins
 %{_datadir}/mediastreamer
@@ -258,7 +278,7 @@ rm -rf $RPM_BUILD_ROOT
 %files devel
 %defattr(644,root,root,755)
 %doc builddir/help/doc/html/*.{css,html,js,png}
-%attr(755,root,root) %{_libdir}/libmediastreamer.so
+%attr(755,root,root) %{_libdir}/libmediastreamer2.so
 %{_includedir}/mediastreamer2
 %{_pkgconfigdir}/mediastreamer.pc
 %dir %{_datadir}/Mediastreamer2
@@ -267,5 +287,5 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/libmediastreamer.a
+%{_libdir}/libmediastreamer2.a
 %endif
This page took 0.450635 seconds and 4 git commands to generate.