]> git.pld-linux.org Git - packages/mediastreamer.git/blob - libupnp-1.14.patch
- updated to 5.3.41
[packages/mediastreamer.git] / libupnp-1.14.patch
1 --- mediastreamer2-5.3.29/src/upnp/upnp_igd.c.orig      2024-02-21 12:02:03.000000000 +0100
2 +++ mediastreamer2-5.3.29/src/upnp/upnp_igd.c   2024-03-08 19:56:59.058463144 +0100
3 @@ -377,7 +377,7 @@ int upnp_igd_send_action(upnp_igd_contex
4   *   d_event  -- event associated with the new device
5   *
6   ********************************************************************************/
7 -void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, struct Upnp_Discovery *d_event) {
8 +void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, UpnpDiscovery *d_event) {
9         upnp_igd_device_node *deviceNode, *tmpdevnode;
10         int found = 0;
11         int ret;
12 @@ -405,7 +405,7 @@ void upnp_igd_add_device(upnp_igd_contex
13         baseURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "URLBase");
14         relURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "presentationURL");
15  
16 -       ret = UpnpResolveURL((baseURL ? baseURL : d_event->Location), relURL, presURL);
17 +       ret = UpnpResolveURL((baseURL ? baseURL : UpnpDiscovery_get_Location_cstr(d_event)), relURL, presURL);
18  
19         if (UPNP_E_SUCCESS != ret) {
20                 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error generating presURL from %s + %s", baseURL, relURL);
21 @@ -426,7 +426,7 @@ void upnp_igd_add_device(upnp_igd_contex
22                 if (found) {
23                         /* The device is already there, so just update  */
24                         /* the advertisement timeout field */
25 -                       tmpdevnode->device.advr_time_out = d_event->Expires;
26 +                       tmpdevnode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
27                         upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "IGD device: %s[%s] | Update expires(%d)", friendlyName, UDN,
28                                        tmpdevnode->device.advr_time_out);
29                 } else {
30 @@ -436,12 +436,12 @@ void upnp_igd_add_device(upnp_igd_contex
31                         deviceNode = (upnp_igd_device_node *)malloc(sizeof(upnp_igd_device_node));
32                         memset(deviceNode->device.services, '\0', sizeof(upnp_igd_service) * IGD_SERVICE_SERVCOUNT);
33                         strncpy(deviceNode->device.udn, UDN, sizeof(deviceNode->device.udn));
34 -                       strncpy(deviceNode->device.desc_doc_url, d_event->Location, sizeof(deviceNode->device.desc_doc_url));
35 +                       strncpy(deviceNode->device.desc_doc_url, UpnpDiscovery_get_Location_cstr(d_event), sizeof(deviceNode->device.desc_doc_url));
36                         strncpy(deviceNode->device.friendly_name, friendlyName, sizeof(deviceNode->device.friendly_name));
37                         strncpy(deviceNode->device.model_name, modelName, sizeof(deviceNode->device.model_name));
38                         strncpy(deviceNode->device.model_number, modelNumber, sizeof(deviceNode->device.model_number));
39                         strncpy(deviceNode->device.pres_url, presURL, sizeof(deviceNode->device.pres_url));
40 -                       deviceNode->device.advr_time_out = d_event->Expires;
41 +                       deviceNode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
42  
43                         // Reset values
44                         serviceId = NULL;
45 @@ -450,7 +450,7 @@ void upnp_igd_add_device(upnp_igd_contex
46                         eventSID[0] = '\0';
47  
48                         for (service = 0; service < IGD_SERVICE_SERVCOUNT; service++) {
49 -                               if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, d_event->Location, IGDServiceType[service],
50 +                               if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, UpnpDiscovery_get_Location_cstr(d_event), IGDServiceType[service],
51                                                                         &serviceId, &event_url, &controlURL)) {
52                                         upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribing to EventURL %s...", event_url);
53                                         ret = UpnpSubscribe(igd_ctxt->upnp_handle, event_url, &IGDTimeOut[service], eventSID);
54 @@ -878,7 +878,7 @@ void upnp_igd_handle_subscribe_update(up
55   *   cookie     -- Optional data specified during callback registration
56   *
57   ********************************************************************************/
58 -int upnp_igd_callback(Upnp_EventType event_type, void *event, void *cookie) {
59 +int upnp_igd_callback(Upnp_EventType event_type, const void *event, void *cookie) {
60         int ret = 1;
61         upnp_igd_context *igd_ctxt = (upnp_igd_context *)cookie;
62         upnp_context_add_client(igd_ctxt);
63 @@ -886,17 +886,17 @@ int upnp_igd_callback(Upnp_EventType eve
64         switch (event_type) {
65                 case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
66                 case UPNP_DISCOVERY_SEARCH_RESULT: {
67 -                       struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
68 +                       Upnp_Discovery *d_event = (Upnp_Discovery *)event;
69                         IXML_Document *desc_doc = NULL;
70                         int ret;
71  
72 -                       if (d_event->ErrCode != UPNP_E_SUCCESS) {
73 -                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", d_event->ErrCode);
74 +                       if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
75 +                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
76                         }
77 -                       ret = UpnpDownloadXmlDoc(d_event->Location, &desc_doc);
78 +                       ret = UpnpDownloadXmlDoc(UpnpDiscovery_get_Location_cstr(d_event), &desc_doc);
79                         if (ret != UPNP_E_SUCCESS) {
80                                 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d",
81 -                                              d_event->Location, ret);
82 +                                              UpnpDiscovery_get_Location_cstr(d_event), ret);
83                         } else {
84                                 upnp_igd_add_device(igd_ctxt, desc_doc, d_event);
85                         }
86 @@ -905,62 +905,62 @@ int upnp_igd_callback(Upnp_EventType eve
87                         }
88                 } break;
89                 case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
90 -                       struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
91 -                       if (d_event->ErrCode != UPNP_E_SUCCESS) {
92 -                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", d_event->ErrCode);
93 +                       Upnp_Discovery *d_event = (Upnp_Discovery *)event;
94 +                       if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
95 +                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
96                         }
97 -                       upnp_igd_remove_device(igd_ctxt, d_event->DeviceId);
98 +                       upnp_igd_remove_device(igd_ctxt, UpnpDiscovery_get_DeviceID_cstr(d_event));
99                 } break;
100                 /* SOAP Stuff */
101                 case UPNP_CONTROL_ACTION_COMPLETE: {
102 -                       struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
103 +                       Upnp_Action_Complete *a_event = (Upnp_Action_Complete *)event;
104  
105 -                       if (a_event->ErrCode != UPNP_E_SUCCESS) {
106 -                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", a_event->ErrCode);
107 +                       if (UpnpActionComplete_get_ErrCode(a_event) != UPNP_E_SUCCESS) {
108 +                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in  Action Complete Callback -- %d", UpnpActionComplete_get_ErrCode(a_event));
109                         } else {
110 -                               upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest,
111 -                                                           a_event->ActionResult);
112 +                               upnp_igd_handle_send_action(igd_ctxt, UpnpActionComplete_get_CtrlUrl_cstr(a_event), UpnpActionComplete_get_ActionRequest(a_event),
113 +                                                           UpnpActionComplete_get_ActionResult(a_event));
114                         }
115                 } break;
116                 case UPNP_CONTROL_GET_VAR_COMPLETE: {
117 -                       struct Upnp_State_Var_Complete *sv_event = (struct Upnp_State_Var_Complete *)event;
118 +                       Upnp_State_Var_Complete *sv_event = (Upnp_State_Var_Complete *)event;
119  
120 -                       if (sv_event->ErrCode != UPNP_E_SUCCESS) {
121 -                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", sv_event->ErrCode);
122 +                       if (UpnpStateVarComplete_get_ErrCode(sv_event) != UPNP_E_SUCCESS) {
123 +                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", UpnpStateVarComplete_get_ErrCode(sv_event));
124                         } else {
125 -                               upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(sv_event->CtrlUrl), sv_event->StateVarName,
126 -                                                       sv_event->CurrentVal);
127 +                               upnp_igd_handle_get_var(igd_ctxt, UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event), UpnpStateVarComplete_get_StateVarName_cstr(sv_event),
128 +                                                       UpnpStateVarComplete_get_CurrentVal(sv_event));
129                         }
130                 } break;
131                 /* GENA Stuff */
132                 case UPNP_EVENT_RECEIVED: {
133 -                       struct Upnp_Event *e_event = (struct Upnp_Event *)event;
134 +                       Upnp_Event *e_event = (Upnp_Event *)event;
135  
136 -                       upnp_igd_handle_event(igd_ctxt, e_event->Sid, e_event->EventKey, e_event->ChangedVariables);
137 +                       upnp_igd_handle_event(igd_ctxt, UpnpEvent_get_SID_cstr(e_event), UpnpEvent_get_EventKey(e_event), UpnpEvent_get_ChangedVariables(e_event));
138                 } break;
139                 case UPNP_EVENT_SUBSCRIBE_COMPLETE:
140                 case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
141                 case UPNP_EVENT_RENEWAL_COMPLETE: {
142 -                       struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
143 +                       Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)event;
144  
145 -                       if (es_event->ErrCode != UPNP_E_SUCCESS) {
146 -                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", es_event->ErrCode);
147 +                       if (UpnpEventSubscribe_get_ErrCode(es_event) != UPNP_E_SUCCESS) {
148 +                               upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", UpnpEventSubscribe_get_ErrCode(es_event));
149                         } else {
150 -                               upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), es_event->Sid,
151 -                                                                es_event->TimeOut);
152 +                               upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), UpnpEventSubscribe_get_SID_cstr(es_event),
153 +                                                                UpnpEventSubscribe_get_TimeOut(es_event));
154                         }
155                 } break;
156                 case UPNP_EVENT_AUTORENEWAL_FAILED:
157                 case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
158 -                       struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
159 +                       Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)event;
160                         int TimeOut = 1801;
161                         Upnp_SID newSID;
162                         int ret;
163  
164 -                       ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(es_event->PublisherUrl), &TimeOut, newSID);
165 +                       ret = UpnpSubscribe(igd_ctxt->upnp_handle, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), &TimeOut, newSID);
166                         if (ret == UPNP_E_SUCCESS) {
167                                 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribed to EventURL with SID=%s", newSID);
168 -                               upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), newSID, TimeOut);
169 +                               upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), newSID, TimeOut);
170                         } else {
171                                 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error Subscribing to EventURL -- %d", ret);
172                         }
173 @@ -989,11 +989,11 @@ int upnp_igd_callback(Upnp_EventType eve
174   ********************************************************************************/
175  upnp_igd_context *upnp_igd_create(upnp_igd_callback_function cb_fct,
176                                    upnp_igd_print_function print_fct,
177 -                                  const char *address,
178 +                                  const char *interface,
179                                    void *cookie) {
180         int ret;
181         unsigned short port = 0;
182 -       const char *ip_address = address;
183 +       const char *ip_address = NULL;
184         upnp_igd_context *igd_ctxt = (upnp_igd_context *)malloc(sizeof(upnp_igd_context));
185         igd_ctxt->devices = NULL;
186         igd_ctxt->callback_fct = cb_fct;
187 @@ -1063,9 +1063,9 @@ upnp_igd_context *upnp_igd_create(upnp_i
188         }
189  
190         upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Initializing uPnP IGD with ipaddress:%s port:%u",
191 -                      ip_address ? ip_address : "{NULL}", port);
192 +                      interface ? interface : "{NULL}", port);
193  
194 -       ret = UpnpInit(ip_address, port);
195 +       ret = UpnpInit2(interface, port);
196         if (ret != UPNP_E_SUCCESS) {
197                 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "UpnpInit() Error: %d", ret);
198                 UpnpFinish();
199 @@ -1080,9 +1080,7 @@ upnp_igd_context *upnp_igd_create(upnp_i
200                 free(igd_ctxt);
201                 return NULL;
202         }
203 -       if (!ip_address) {
204 -               ip_address = UpnpGetServerIpAddress();
205 -       }
206 +       ip_address = UpnpGetServerIp6Address();
207         if (!port) {
208                 port = UpnpGetServerPort();
209         }
210 --- mediastreamer2-5.3.29/src/upnp/upnp_igd_cmd.c.orig  2024-03-08 20:00:36.550618221 +0100
211 +++ mediastreamer2-5.3.29/src/upnp/upnp_igd_cmd.c       2024-03-08 21:25:55.456220065 +0100
212 @@ -104,7 +104,7 @@ int upnp_igd_port_mapping_handle_action(
213         return 0;
214  }
215  
216 -int upnp_igd_port_mapping_callback(Upnp_EventType event_type, void *event, void *cookie) {
217 +int upnp_igd_port_mapping_callback(Upnp_EventType event_type, const void *event, void *cookie) {
218         int ret = 1;
219         upnp_igd_port_mapping_context *igd_port_mapping_ctxt = (upnp_igd_port_mapping_context *)cookie;
220         upnp_context_add_client(igd_port_mapping_ctxt->igd_ctxt);
221 @@ -112,9 +112,9 @@ int upnp_igd_port_mapping_callback(Upnp_
222  
223         switch (event_type) {
224                 case UPNP_CONTROL_ACTION_COMPLETE: {
225 -                       struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
226 -                       upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, a_event->ErrCode, UPNP_STRING(a_event->CtrlUrl),
227 -                                                           a_event->ActionRequest, a_event->ActionResult);
228 +                       Upnp_Action_Complete *a_event = (Upnp_Action_Complete *)event;
229 +                       upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, UpnpActionComplete_get_ErrCode(a_event), UpnpActionComplete_get_CtrlUrl_cstr(a_event),
230 +                                                           UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event);
231                 } break;
232  
233                 default:
234 --- mediastreamer2-5.3.29/include/mediastreamer2/upnp_igd.h.orig        2024-03-08 21:44:02.873662353 +0100
235 +++ mediastreamer2-5.3.29/include/mediastreamer2/upnp_igd.h     2024-03-08 21:50:16.351639049 +0100
236 @@ -72,7 +72,7 @@ typedef struct _upnp_igd_context upnp_ig
237  
238  MS2_PUBLIC upnp_igd_context *upnp_igd_create(upnp_igd_callback_function cb_fct,
239                                               upnp_igd_print_function print_fct,
240 -                                             const char *address,
241 +                                             const char *interface,
242                                               void *cookie);
243  MS2_PUBLIC int upnp_igd_start(upnp_igd_context *igd_ctxt);
244  int upnp_igd_is_started(upnp_igd_context *igd_ctxt);
245 --- mediastreamer2-5.3.29/src/upnp/upnp_igd_private.h.orig      2024-03-08 21:50:41.568169106 +0100
246 +++ mediastreamer2-5.3.29/src/upnp/upnp_igd_private.h   2024-03-08 21:56:05.019750152 +0100
247 @@ -140,7 +140,7 @@ void upnp_context_add_callback(upnp_igd_
248  void upnp_context_handle_callbacks(upnp_igd_context *igd_ctx);
249  void upnp_context_free_callbacks(upnp_igd_context *igd_ctx);
250  
251 -int upnp_igd_callback(Upnp_EventType event_type, void *event, void *cookie);
252 +int upnp_igd_callback(Upnp_EventType event_type, const void *event, void *cookie);
253  int upnp_igd_send_action(upnp_igd_context *igd_ctxt,
254                           upnp_igd_device_node *device_node,
255                           int service,
256 --- mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.c.orig        2024-03-08 21:56:32.842932754 +0100
257 +++ mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.c     2024-03-09 07:20:10.043062611 +0100
258 @@ -182,7 +182,7 @@ void upnp_igd_print_event_type(upnp_igd_
259  void upnp_igd_print_event(upnp_igd_context *igd_ctxt,
260                            upnp_igd_print_level level,
261                            Upnp_EventType EventType,
262 -                          void *Event) {
263 +                          const void *Event) {
264         ithread_mutex_lock(&igd_ctxt->print_mutex);
265  
266         upnp_igd_print(igd_ctxt, level, "======================================================================");
267 @@ -192,18 +192,18 @@ void upnp_igd_print_event(upnp_igd_conte
268                 case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
269                 case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
270                 case UPNP_DISCOVERY_SEARCH_RESULT: {
271 -                       struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)Event;
272 +                       Upnp_Discovery *d_event = (Upnp_Discovery *)Event;
273  
274 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(d_event->ErrCode),
275 -                                      d_event->ErrCode);
276 -                       upnp_igd_print(igd_ctxt, level, "Expires     =  %d", d_event->Expires);
277 -                       upnp_igd_print(igd_ctxt, level, "DeviceId    =  %s", d_event->DeviceId);
278 -                       upnp_igd_print(igd_ctxt, level, "DeviceType  =  %s", d_event->DeviceType);
279 -                       upnp_igd_print(igd_ctxt, level, "ServiceType =  %s", d_event->ServiceType);
280 -                       upnp_igd_print(igd_ctxt, level, "ServiceVer  =  %s", d_event->ServiceVer);
281 -                       upnp_igd_print(igd_ctxt, level, "Location    =  %s", d_event->Location);
282 -                       upnp_igd_print(igd_ctxt, level, "OS          =  %s", d_event->Os);
283 -                       upnp_igd_print(igd_ctxt, level, "Ext         =  %s", d_event->Ext);
284 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpDiscovery_get_ErrCode(d_event)),
285 +                                      UpnpDiscovery_get_ErrCode(d_event));
286 +                       upnp_igd_print(igd_ctxt, level, "Expires     =  %d", UpnpDiscovery_get_Expires(d_event));
287 +                       upnp_igd_print(igd_ctxt, level, "DeviceId    =  %s", UpnpDiscovery_get_DeviceID_cstr(d_event));
288 +                       upnp_igd_print(igd_ctxt, level, "DeviceType  =  %s", UpnpDiscovery_get_DeviceType_cstr(d_event));
289 +                       upnp_igd_print(igd_ctxt, level, "ServiceType =  %s", UpnpDiscovery_get_ServiceType_cstr(d_event));
290 +                       upnp_igd_print(igd_ctxt, level, "ServiceVer  =  %s", UpnpDiscovery_get_ServiceVer_cstr(d_event));
291 +                       upnp_igd_print(igd_ctxt, level, "Location    =  %s", UpnpDiscovery_get_Location_cstr(d_event));
292 +                       upnp_igd_print(igd_ctxt, level, "OS          =  %s", UpnpDiscovery_get_Os_cstr(d_event));
293 +                       upnp_igd_print(igd_ctxt, level, "Ext         =  %s", UpnpDiscovery_get_Ext_cstr(d_event));
294                         break;
295                 }
296                 case UPNP_DISCOVERY_SEARCH_TIMEOUT:
297 @@ -211,17 +211,17 @@ void upnp_igd_print_event(upnp_igd_conte
298                         break;
299                 /* SOAP */
300                 case UPNP_CONTROL_ACTION_REQUEST: {
301 -                       struct Upnp_Action_Request *a_event = (struct Upnp_Action_Request *)Event;
302 +                       Upnp_Action_Request *a_event = (Upnp_Action_Request *)Event;
303                         char *xmlbuff = NULL;
304  
305 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(a_event->ErrCode),
306 -                                      a_event->ErrCode);
307 -                       upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", a_event->ErrStr);
308 -                       upnp_igd_print(igd_ctxt, level, "ActionName  =  %s", a_event->ActionName);
309 -                       upnp_igd_print(igd_ctxt, level, "UDN         =  %s", a_event->DevUDN);
310 -                       upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", a_event->ServiceID);
311 -                       if (a_event->ActionRequest) {
312 -                               xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
313 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpActionRequest_get_ErrCode(a_event)),
314 +                                      UpnpActionRequest_get_ErrCode(a_event));
315 +                       upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", UpnpActionRequest_get_ErrStr_cstr(a_event));
316 +                       upnp_igd_print(igd_ctxt, level, "ActionName  =  %s", UpnpActionRequest_get_ActionName_cstr(a_event));
317 +                       upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpActionRequest_get_DevUDN_cstr(a_event));
318 +                       upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpActionRequest_get_ServiceID_cstr(a_event));
319 +                       if (UpnpActionRequest_get_ActionRequest(a_event)) {
320 +                               xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionRequest(a_event));
321                                 if (xmlbuff) {
322                                         upnp_igd_print(igd_ctxt, level, "ActRequest  =  %s", xmlbuff);
323                                         ixmlFreeDOMString(xmlbuff);
324 @@ -230,8 +230,8 @@ void upnp_igd_print_event(upnp_igd_conte
325                         } else {
326                                 upnp_igd_print(igd_ctxt, level, "ActRequest  =  (null)");
327                         }
328 -                       if (a_event->ActionResult) {
329 -                               xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
330 +                       if (UpnpActionRequest_get_ActionResult(a_event)) {
331 +                               xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionResult(a_event));
332                                 if (xmlbuff) {
333                                         upnp_igd_print(igd_ctxt, level, "ActResult   =  %s", xmlbuff);
334                                         ixmlFreeDOMString(xmlbuff);
335 @@ -243,14 +243,14 @@ void upnp_igd_print_event(upnp_igd_conte
336                         break;
337                 }
338                 case UPNP_CONTROL_ACTION_COMPLETE: {
339 -                       struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)Event;
340 +                       Upnp_Action_Complete *a_event = (Upnp_Action_Complete *)Event;
341                         char *xmlbuff = NULL;
342  
343 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(a_event->ErrCode),
344 -                                      a_event->ErrCode);
345 -                       upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", a_event->CtrlUrl);
346 -                       if (a_event->ActionRequest) {
347 -                               xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
348 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpActionComplete_get_ErrCode(a_event)),
349 +                                      UpnpActionComplete_get_ErrCode(a_event));
350 +                       upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", UpnpActionComplete_get_CtrlUrl_cstr(a_event));
351 +                       if (UpnpActionComplete_get_ActionRequest(a_event)) {
352 +                               xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionRequest(a_event));
353                                 if (xmlbuff) {
354                                         upnp_igd_print(igd_ctxt, level, "ActRequest  =  %s", xmlbuff);
355                                         ixmlFreeDOMString(xmlbuff);
356 @@ -259,8 +259,8 @@ void upnp_igd_print_event(upnp_igd_conte
357                         } else {
358                                 upnp_igd_print(igd_ctxt, level, "ActRequest  =  (null)");
359                         }
360 -                       if (a_event->ActionResult) {
361 -                               xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
362 +                       if (UpnpActionComplete_get_ActionResult(a_event)) {
363 +                               xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionResult(a_event));
364                                 if (xmlbuff) {
365                                         upnp_igd_print(igd_ctxt, level, "ActResult   =  %s", xmlbuff);
366                                         ixmlFreeDOMString(xmlbuff);
367 @@ -272,77 +272,77 @@ void upnp_igd_print_event(upnp_igd_conte
368                         break;
369                 }
370                 case UPNP_CONTROL_GET_VAR_REQUEST: {
371 -                       struct Upnp_State_Var_Request *sv_event = (struct Upnp_State_Var_Request *)Event;
372 +                       Upnp_State_Var_Request *sv_event = (Upnp_State_Var_Request *)Event;
373  
374 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(sv_event->ErrCode),
375 -                                      sv_event->ErrCode);
376 -                       upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", sv_event->ErrStr);
377 -                       upnp_igd_print(igd_ctxt, level, "UDN         =  %s", sv_event->DevUDN);
378 -                       upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", sv_event->ServiceID);
379 -                       upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", sv_event->StateVarName);
380 -                       upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", sv_event->CurrentVal);
381 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpStateVarRequest_get_ErrCode(sv_event)),
382 +                                      UpnpStateVarRequest_get_ErrCode(sv_event));
383 +                       upnp_igd_print(igd_ctxt, level, "ErrStr      =  %s", UpnpStateVarRequest_get_ErrStr_cstr(sv_event));
384 +                       upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpStateVarRequest_get_DevUDN_cstr(sv_event));
385 +                       upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpStateVarRequest_get_ServiceID_cstr(sv_event));
386 +                       upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", UpnpStateVarRequest_get_StateVarName_cstr(sv_event));
387 +                       upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", UpnpStateVarRequest_get_CurrentVal_cstr(sv_event));
388                         break;
389                 }
390                 case UPNP_CONTROL_GET_VAR_COMPLETE: {
391 -                       struct Upnp_State_Var_Complete *sv_event = (struct Upnp_State_Var_Complete *)Event;
392 +                       Upnp_State_Var_Complete *sv_event = (Upnp_State_Var_Complete *)Event;
393  
394 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(sv_event->ErrCode),
395 -                                      sv_event->ErrCode);
396 -                       upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", sv_event->CtrlUrl);
397 -                       upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", sv_event->StateVarName);
398 -                       upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", sv_event->CurrentVal);
399 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpStateVarComplete_get_ErrCode(sv_event)),
400 +                                      UpnpStateVarComplete_get_ErrCode(sv_event));
401 +                       upnp_igd_print(igd_ctxt, level, "CtrlUrl     =  %s", UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event));
402 +                       upnp_igd_print(igd_ctxt, level, "StateVarName=  %s", UpnpStateVarComplete_get_StateVarName_cstr(sv_event));
403 +                       upnp_igd_print(igd_ctxt, level, "CurrentVal  =  %s", UpnpStateVarComplete_get_CurrentVal_cstr(sv_event));
404                         break;
405                 }
406                 /* GENA */
407                 case UPNP_EVENT_SUBSCRIPTION_REQUEST: {
408 -                       struct Upnp_Subscription_Request *sr_event = (struct Upnp_Subscription_Request *)Event;
409 +                       Upnp_Subscription_Request *sr_event = (Upnp_Subscription_Request *)Event;
410  
411 -                       upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", sr_event->ServiceId);
412 -                       upnp_igd_print(igd_ctxt, level, "UDN         =  %s", sr_event->UDN);
413 -                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", sr_event->Sid);
414 +                       upnp_igd_print(igd_ctxt, level, "ServiceID   =  %s", UpnpSubscriptionRequest_get_ServiceId_cstr(sr_event));
415 +                       upnp_igd_print(igd_ctxt, level, "UDN         =  %s", UpnpSubscriptionRequest_get_UDN_cstr(sr_event));
416 +                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpSubscriptionRequest_get_SID_cstr(sr_event));
417                         break;
418                 }
419                 case UPNP_EVENT_RECEIVED: {
420 -                       struct Upnp_Event *e_event = (struct Upnp_Event *)Event;
421 +                       Upnp_Event *e_event = (Upnp_Event *)Event;
422                         char *xmlbuff = NULL;
423  
424 -                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", e_event->Sid);
425 -                       upnp_igd_print(igd_ctxt, level, "EventKey    =  %d", e_event->EventKey);
426 -                       xmlbuff = ixmlPrintNode((IXML_Node *)e_event->ChangedVariables);
427 +                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEvent_get_SID_cstr(e_event));
428 +                       upnp_igd_print(igd_ctxt, level, "EventKey    =  %d", UpnpEvent_get_EventKey(e_event));
429 +                       xmlbuff = ixmlPrintNode((IXML_Node *)UpnpEvent_get_ChangedVariables(e_event));
430                         upnp_igd_print(igd_ctxt, level, "ChangedVars =  %s", xmlbuff);
431                         ixmlFreeDOMString(xmlbuff);
432                         xmlbuff = NULL;
433                         break;
434                 }
435                 case UPNP_EVENT_RENEWAL_COMPLETE: {
436 -                       struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)Event;
437 +                       Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)Event;
438  
439 -                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
440 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(es_event->ErrCode),
441 -                                      es_event->ErrCode);
442 -                       upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
443 +                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
444 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)),
445 +                                      UpnpEventSubscribe_get_ErrCode(es_event));
446 +                       upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
447                         break;
448                 }
449                 case UPNP_EVENT_SUBSCRIBE_COMPLETE:
450                 case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: {
451 -                       struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)Event;
452 +                       Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)Event;
453  
454 -                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
455 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(es_event->ErrCode),
456 -                                      es_event->ErrCode);
457 -                       upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", es_event->PublisherUrl);
458 -                       upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
459 +                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
460 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)),
461 +                                      UpnpEventSubscribe_get_ErrCode(es_event));
462 +                       upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
463 +                       upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
464                         break;
465                 }
466                 case UPNP_EVENT_AUTORENEWAL_FAILED:
467                 case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
468 -                       struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)Event;
469 +                       Upnp_Event_Subscribe *es_event = (Upnp_Event_Subscribe *)Event;
470  
471 -                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", es_event->Sid);
472 -                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(es_event->ErrCode),
473 -                                      es_event->ErrCode);
474 -                       upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", es_event->PublisherUrl);
475 -                       upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", es_event->TimeOut);
476 +                       upnp_igd_print(igd_ctxt, level, "SID         =  %s", UpnpEventSubscribe_get_SID_cstr(es_event));
477 +                       upnp_igd_print(igd_ctxt, level, "ErrCode     =  %s(%d)", UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)),
478 +                                      UpnpEventSubscribe_get_ErrCode(es_event));
479 +                       upnp_igd_print(igd_ctxt, level, "PublisherURL=  %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
480 +                       upnp_igd_print(igd_ctxt, level, "TimeOut     =  %d", UpnpEventSubscribe_get_TimeOut(es_event));
481                         break;
482                 }
483         }
484 --- mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.h.orig        2024-03-09 07:20:50.729508861 +0100
485 +++ mediastreamer2-5.3.29/src/upnp/upnp_igd_utils.h     2024-03-09 07:21:11.766061563 +0100
486 @@ -39,7 +39,7 @@ char *upnp_igd_strncpy(char *destination
487  
488  void upnp_igd_print(upnp_igd_context *uIGD, upnp_igd_print_level level, const char *fmt, ...);
489  void upnp_igd_print_event_type(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType S);
490 -void upnp_igd_print_event(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType EventType, void *Event);
491 +void upnp_igd_print_event(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType EventType, const void *Event);
492  char *upnp_igd_get_first_document_item(upnp_igd_context *uIGD, IXML_Document *doc, const char *item);
493  char *upnp_igd_get_element_value(upnp_igd_context *uIGD, IXML_Element *element);
494  char *upnp_igd_get_first_element_item(upnp_igd_context *uIGD, IXML_Element *element, const char *item);
495 --- mediastreamer2-4.4.2/configure.ac.orig      2021-07-05 06:50:46.295451589 +0200
496 +++ mediastreamer2-4.4.2/configure.ac   2021-07-05 17:16:33.665373367 +0200
497 @@ -717,7 +717,7 @@ AC_ARG_ENABLE(upnp,
498  
499  if test "$build_upnp" != "false" ; then
500         PKG_CHECK_MODULES([LIBUPNP], [libupnp],
501 -               [if  pkg-config --atleast-version=1.6 "libupnp < 1.7"; then
502 +               [if  pkg-config --atleast-version=1.8 "libupnp"; then
503                         build_upnp=true
504                         old_CFLAGS="$CFLAGS"
505                         CFLAGS="$CFLAGS $LIBUPNP_CFLAGS -Werror -Wno-error=unused-variable"
506 @@ -730,7 +730,7 @@ if test "$build_upnp" != "false" ; then
507                         AC_DEFINE(USE_PATCHED_UPNP, 1, [Define if upnp is patched]))
508                         CFLAGS="$old_CFLAGS"
509                 else
510 -                       AC_MSG_ERROR([libupnp >= 1.6 < 1.5 required.])
511 +                       AC_MSG_ERROR([libupnp >= 1.8 required.])
512                 fi],
513                 [if test "$build_upnp" == "true" ; then
514                         AC_MSG_ERROR([libupnp not found.])
This page took 0.190891 seconds and 4 git commands to generate.