1 --- mediastreamer2-4.4.2/src/upnp/upnp_igd.c.orig 2020-09-24 11:44:00.000000000 +0200
2 +++ mediastreamer2-4.4.2/src/upnp/upnp_igd.c 2020-09-27 09:49:46.143972883 +0200
4 * d_event -- event associated with the new device
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;
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");
16 - ret = UpnpResolveURL((baseURL ? baseURL : d_event->Location), relURL, presURL);
17 + ret = UpnpResolveURL((baseURL ? baseURL : UpnpDiscovery_get_Location_cstr(d_event)), relURL, presURL);
19 if (UPNP_E_SUCCESS != ret) {
20 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error generating presURL from %s + %s", baseURL, relURL);
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, tmpdevnode->device.advr_time_out);
29 upnp_igd_print(igd_ctxt, UPNP_IGD_MESSAGE, "Add IGD device: %s[%s]", friendlyName, UDN);
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);
47 for (service = 0; service < IGD_SERVICE_SERVCOUNT;
49 - if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, d_event->Location,
50 + if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, UpnpDiscovery_get_Location_cstr(d_event),
51 IGDServiceType[service], &serviceId, &event_url, &controlURL)) {
52 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribing to EventURL %s...",event_url);
55 * cookie -- Optional data specified during callback registration
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) {
61 upnp_igd_context *igd_ctxt = (upnp_igd_context*)cookie;
62 upnp_context_add_client(igd_ctxt);
65 case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
66 case UPNP_DISCOVERY_SEARCH_RESULT: {
67 - struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
68 + UpnpDiscovery *d_event = (UpnpDiscovery *)event;
69 IXML_Document *desc_doc = NULL;
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));
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", d_event->Location, ret);
81 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", UpnpDiscovery_get_Location_cstr(d_event), ret);
83 upnp_igd_add_device(igd_ctxt, desc_doc, d_event);
88 case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
89 - struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
90 - if (d_event->ErrCode != UPNP_E_SUCCESS) {
91 - upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", d_event->ErrCode);
92 + UpnpDiscovery *d_event = (UpnpDiscovery *)event;
93 + if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
94 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
96 - upnp_igd_remove_device(igd_ctxt, d_event->DeviceId);
97 + upnp_igd_remove_device(igd_ctxt, UpnpDiscovery_get_DeviceID_cstr(d_event));
101 case UPNP_CONTROL_ACTION_COMPLETE: {
102 - struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
103 + UpnpActionComplete *a_event = (UpnpActionComplete *)event;
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));
110 - upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
111 + upnp_igd_handle_send_action(igd_ctxt, UpnpActionComplete_get_CtrlUrl_cstr(a_event), UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event));
115 case UPNP_CONTROL_GET_VAR_COMPLETE: {
116 - struct Upnp_State_Var_Complete *sv_event = (struct Upnp_State_Var_Complete *)event;
117 + UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)event;
119 - if (sv_event->ErrCode != UPNP_E_SUCCESS) {
120 - upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", sv_event->ErrCode);
121 + if (UpnpStateVarComplete_get_ErrCode(sv_event) != UPNP_E_SUCCESS) {
122 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", UpnpStateVarComplete_get_ErrCode(sv_event));
124 - upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(sv_event->CtrlUrl), sv_event->StateVarName, sv_event->CurrentVal);
125 + upnp_igd_handle_get_var(igd_ctxt, UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event), UpnpStateVarComplete_get_StateVarName_cstr(sv_event), UpnpStateVarComplete_get_CurrentVal(sv_event));
130 case UPNP_EVENT_RECEIVED: {
131 - struct Upnp_Event *e_event = (struct Upnp_Event *)event;
132 + UpnpEvent *e_event = (UpnpEvent *)event;
134 - upnp_igd_handle_event(igd_ctxt, e_event->Sid, e_event->EventKey, e_event->ChangedVariables);
135 + upnp_igd_handle_event(igd_ctxt, UpnpEvent_get_SID_cstr(e_event), UpnpEvent_get_EventKey(e_event), UpnpEvent_get_ChangedVariables(e_event));
138 case UPNP_EVENT_SUBSCRIBE_COMPLETE:
139 case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
140 case UPNP_EVENT_RENEWAL_COMPLETE: {
141 - struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
142 + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)event;
144 - if (es_event->ErrCode != UPNP_E_SUCCESS) {
145 - upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", es_event->ErrCode);
146 + if (UpnpEventSubscribe_get_ErrCode(es_event) != UPNP_E_SUCCESS) {
147 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", UpnpEventSubscribe_get_ErrCode(es_event));
149 - upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), es_event->Sid, es_event->TimeOut);
150 + upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), UpnpEventSubscribe_get_SID_cstr(es_event), UpnpEventSubscribe_get_TimeOut(es_event));
154 case UPNP_EVENT_AUTORENEWAL_FAILED:
155 case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
156 - struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
157 + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)event;
162 - ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(es_event->PublisherUrl), &TimeOut, newSID);
163 + ret = UpnpSubscribe(igd_ctxt->upnp_handle, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), &TimeOut, newSID);
164 if (ret == UPNP_E_SUCCESS) {
165 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribed to EventURL with SID=%s", newSID);
166 - upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), newSID, TimeOut);
167 + upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), newSID, TimeOut);
169 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error Subscribing to EventURL -- %d", ret);
171 @@ -996,10 +996,10 @@
172 * cookie -- The cookie pass in cb_fct or print_fct
174 ********************************************************************************/
175 -upnp_igd_context* upnp_igd_create(upnp_igd_callback_function cb_fct, upnp_igd_print_function print_fct, const char *address, void *cookie) {
176 +upnp_igd_context* upnp_igd_create(upnp_igd_callback_function cb_fct, upnp_igd_print_function print_fct, const char *interface, void *cookie) {
178 unsigned short port = 0;
179 - const char *ip_address = address;
180 + const char *ip_address = NULL;
181 upnp_igd_context *igd_ctxt = (upnp_igd_context*)malloc(sizeof(upnp_igd_context));
182 igd_ctxt->devices = NULL;
183 igd_ctxt->callback_fct = cb_fct;
184 @@ -1068,9 +1068,9 @@
185 ithread_cond_init(&igd_ctxt->client_cond, NULL);
188 - upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Initializing uPnP IGD with ipaddress:%s port:%u", ip_address ? ip_address : "{NULL}", port);
189 + upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Initializing uPnP IGD with interface:%s port:%u", interface ? interface : "{NULL}", port);
191 - ret = UpnpInit(ip_address, port);
192 + ret = UpnpInit2(interface, port);
193 if (ret != UPNP_E_SUCCESS) {
194 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "UpnpInit() Error: %d", ret);
196 @@ -1085,9 +1085,7 @@
201 - ip_address = UpnpGetServerIpAddress();
203 + ip_address = UpnpGetServerIp6Address();
205 port = UpnpGetServerPort();
207 --- mediastreamer2-4.4.2/src/upnp/upnp_igd_cmd.c.orig 2020-09-24 11:44:00.000000000 +0200
208 +++ mediastreamer2-4.4.2/src/upnp/upnp_igd_cmd.c 2020-09-27 10:01:04.473631389 +0200
213 -int upnp_igd_port_mapping_callback(Upnp_EventType event_type, void* event, void *cookie) {
214 +int upnp_igd_port_mapping_callback(Upnp_EventType event_type, const void* event, void *cookie) {
216 upnp_igd_port_mapping_context *igd_port_mapping_ctxt = (upnp_igd_port_mapping_context*)cookie;
217 upnp_context_add_client(igd_port_mapping_ctxt->igd_ctxt);
221 case UPNP_CONTROL_ACTION_COMPLETE: {
222 - struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
223 - upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, a_event->ErrCode, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
224 + UpnpActionComplete *a_event = (UpnpActionComplete *)event;
225 + 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));
229 --- mediastreamer2-4.4.2/include/mediastreamer2/upnp_igd.h.orig 2020-09-24 11:44:00.000000000 +0200
230 +++ mediastreamer2-4.4.2/include/mediastreamer2/upnp_igd.h 2020-09-27 09:50:51.076954444 +0200
233 typedef struct _upnp_igd_context upnp_igd_context;
235 -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);
236 +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);
237 MS2_PUBLIC int upnp_igd_start(upnp_igd_context*igd_ctxt);
238 int upnp_igd_is_started(upnp_igd_context *igd_ctxt);
239 int upnp_igd_stop(upnp_igd_context*igd_ctxt);
240 --- mediastreamer2-4.4.2/src/upnp/upnp_igd_private.h.orig 2020-09-24 11:44:00.000000000 +0200
241 +++ mediastreamer2-4.4.2/src/upnp/upnp_igd_private.h 2020-09-27 09:42:32.032991330 +0200
243 void upnp_context_handle_callbacks(upnp_igd_context *igd_ctx);
244 void upnp_context_free_callbacks(upnp_igd_context *igd_ctx);
246 -int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie);
247 +int upnp_igd_callback(Upnp_EventType event_type, const void* event, void *cookie);
248 int upnp_igd_send_action(upnp_igd_context* igd_ctxt, upnp_igd_device_node *device_node, int service,
249 const char *actionname, const char **param_name, const char **param_val, int param_count,
250 Upnp_FunPtr fun, const void *cookie);
251 --- mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.c.orig 2020-09-24 11:44:00.000000000 +0200
252 +++ mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.c 2020-09-27 10:57:56.005149537 +0200
257 -void upnp_igd_print_event(upnp_igd_context *igd_ctxt, upnp_igd_print_level level, Upnp_EventType EventType, void *Event) {
258 +void upnp_igd_print_event(upnp_igd_context *igd_ctxt, upnp_igd_print_level level, Upnp_EventType EventType, const void *Event) {
259 ithread_mutex_lock(&igd_ctxt->print_mutex);
261 upnp_igd_print(igd_ctxt, level, "======================================================================");
262 @@ -188,18 +188,18 @@
263 case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
264 case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
265 case UPNP_DISCOVERY_SEARCH_RESULT: {
266 - struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)Event;
267 + UpnpDiscovery *d_event = (UpnpDiscovery *)Event;
269 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
270 - UpnpGetErrorMessage(d_event->ErrCode), d_event->ErrCode);
271 - upnp_igd_print(igd_ctxt, level, "Expires = %d", d_event->Expires);
272 - upnp_igd_print(igd_ctxt, level, "DeviceId = %s", d_event->DeviceId);
273 - upnp_igd_print(igd_ctxt, level, "DeviceType = %s", d_event->DeviceType);
274 - upnp_igd_print(igd_ctxt, level, "ServiceType = %s", d_event->ServiceType);
275 - upnp_igd_print(igd_ctxt, level, "ServiceVer = %s", d_event->ServiceVer);
276 - upnp_igd_print(igd_ctxt, level, "Location = %s", d_event->Location);
277 - upnp_igd_print(igd_ctxt, level, "OS = %s", d_event->Os);
278 - upnp_igd_print(igd_ctxt, level, "Ext = %s", d_event->Ext);
279 + UpnpGetErrorMessage(UpnpDiscovery_get_ErrCode(d_event)), UpnpDiscovery_get_ErrCode(d_event));
280 + upnp_igd_print(igd_ctxt, level, "Expires = %d", UpnpDiscovery_get_Expires(d_event));
281 + upnp_igd_print(igd_ctxt, level, "DeviceId = %s", UpnpDiscovery_get_DeviceID_cstr(d_event));
282 + upnp_igd_print(igd_ctxt, level, "DeviceType = %s", UpnpDiscovery_get_DeviceType_cstr(d_event));
283 + upnp_igd_print(igd_ctxt, level, "ServiceType = %s", UpnpDiscovery_get_ServiceType_cstr(d_event));
284 + upnp_igd_print(igd_ctxt, level, "ServiceVer = %s", UpnpDiscovery_get_ServiceVer_cstr(d_event));
285 + upnp_igd_print(igd_ctxt, level, "Location = %s", UpnpDiscovery_get_Location_cstr(d_event));
286 + upnp_igd_print(igd_ctxt, level, "OS = %s", UpnpDiscovery_get_Os_cstr(d_event));
287 + upnp_igd_print(igd_ctxt, level, "Ext = %s", UpnpDiscovery_get_Ext_cstr(d_event));
290 case UPNP_DISCOVERY_SEARCH_TIMEOUT:
291 @@ -207,18 +207,17 @@
294 case UPNP_CONTROL_ACTION_REQUEST: {
295 - struct Upnp_Action_Request *a_event =
296 - (struct Upnp_Action_Request *)Event;
297 + UpnpActionRequest *a_event = (UpnpActionRequest *)Event;
298 char *xmlbuff = NULL;
300 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
301 - UpnpGetErrorMessage(a_event->ErrCode), a_event->ErrCode);
302 - upnp_igd_print(igd_ctxt, level, "ErrStr = %s", a_event->ErrStr);
303 - upnp_igd_print(igd_ctxt, level, "ActionName = %s", a_event->ActionName);
304 - upnp_igd_print(igd_ctxt, level, "UDN = %s", a_event->DevUDN);
305 - upnp_igd_print(igd_ctxt, level, "ServiceID = %s", a_event->ServiceID);
306 - if (a_event->ActionRequest) {
307 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
308 + UpnpGetErrorMessage(UpnpActionRequest_get_ErrCode(a_event)), UpnpActionRequest_get_ErrCode(a_event));
309 + upnp_igd_print(igd_ctxt, level, "ErrStr = %s", UpnpActionRequest_get_ErrStr_cstr(a_event));
310 + upnp_igd_print(igd_ctxt, level, "ActionName = %s", UpnpActionRequest_get_ActionName_cstr(a_event));
311 + upnp_igd_print(igd_ctxt, level, "UDN = %s", UpnpActionRequest_get_DevUDN_cstr(a_event));
312 + upnp_igd_print(igd_ctxt, level, "ServiceID = %s", UpnpActionRequest_get_ServiceID_cstr(a_event));
313 + if (UpnpActionRequest_get_ActionRequest(a_event)) {
314 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionRequest(a_event));
316 upnp_igd_print(igd_ctxt, level, "ActRequest = %s", xmlbuff);
317 ixmlFreeDOMString(xmlbuff);
320 upnp_igd_print(igd_ctxt, level, "ActRequest = (null)");
322 - if (a_event->ActionResult) {
323 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
324 + if (UpnpActionRequest_get_ActionResult(a_event)) {
325 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionResult(a_event));
327 upnp_igd_print(igd_ctxt, level, "ActResult = %s", xmlbuff);
328 ixmlFreeDOMString(xmlbuff);
329 @@ -240,15 +239,14 @@
332 case UPNP_CONTROL_ACTION_COMPLETE: {
333 - struct Upnp_Action_Complete *a_event =
334 - (struct Upnp_Action_Complete *)Event;
335 + UpnpActionComplete *a_event = (UpnpActionComplete *)Event;
336 char *xmlbuff = NULL;
338 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
339 - UpnpGetErrorMessage(a_event->ErrCode), a_event->ErrCode);
340 - upnp_igd_print(igd_ctxt, level, "CtrlUrl = %s", a_event->CtrlUrl);
341 - if (a_event->ActionRequest) {
342 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
343 + UpnpGetErrorMessage(UpnpActionComplete_get_ErrCode(a_event)), UpnpActionComplete_get_ErrCode(a_event));
344 + upnp_igd_print(igd_ctxt, level, "CtrlUrl = %s", UpnpActionComplete_get_CtrlUrl_cstr(a_event));
345 + if (UpnpActionComplete_get_ActionRequest(a_event)) {
346 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionRequest(a_event));
348 upnp_igd_print(igd_ctxt, level, "ActRequest = %s", xmlbuff);
349 ixmlFreeDOMString(xmlbuff);
352 upnp_igd_print(igd_ctxt, level, "ActRequest = (null)");
354 - if (a_event->ActionResult) {
355 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
356 + if (UpnpActionComplete_get_ActionResult(a_event)) {
357 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionResult(a_event));
359 upnp_igd_print(igd_ctxt, level, "ActResult = %s", xmlbuff);
360 ixmlFreeDOMString(xmlbuff);
361 @@ -270,83 +268,77 @@
364 case UPNP_CONTROL_GET_VAR_REQUEST: {
365 - struct Upnp_State_Var_Request *sv_event =
366 - (struct Upnp_State_Var_Request *)Event;
367 + UpnpStateVarRequest *sv_event = (UpnpStateVarRequest *)Event;
369 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
370 - UpnpGetErrorMessage(sv_event->ErrCode), sv_event->ErrCode);
371 - upnp_igd_print(igd_ctxt, level, "ErrStr = %s", sv_event->ErrStr);
372 - upnp_igd_print(igd_ctxt, level, "UDN = %s", sv_event->DevUDN);
373 - upnp_igd_print(igd_ctxt, level, "ServiceID = %s", sv_event->ServiceID);
374 - upnp_igd_print(igd_ctxt, level, "StateVarName= %s", sv_event->StateVarName);
375 - upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", sv_event->CurrentVal);
376 + UpnpGetErrorMessage(UpnpStateVarRequest_get_ErrCode(sv_event)), UpnpStateVarRequest_get_ErrCode(sv_event));
377 + upnp_igd_print(igd_ctxt, level, "ErrStr = %s", UpnpStateVarRequest_get_ErrStr_cstr(sv_event));
378 + upnp_igd_print(igd_ctxt, level, "UDN = %s", UpnpStateVarRequest_get_DevUDN_cstr(sv_event));
379 + upnp_igd_print(igd_ctxt, level, "ServiceID = %s", UpnpStateVarRequest_get_ServiceID_cstr(sv_event));
380 + upnp_igd_print(igd_ctxt, level, "StateVarName= %s", UpnpStateVarRequest_get_StateVarName_cstr(sv_event));
381 + upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", UpnpStateVarRequest_get_CurrentVal_cstr(sv_event));
384 case UPNP_CONTROL_GET_VAR_COMPLETE: {
385 - struct Upnp_State_Var_Complete *sv_event =
386 - (struct Upnp_State_Var_Complete *)Event;
387 + UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event;
389 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
390 - UpnpGetErrorMessage(sv_event->ErrCode), sv_event->ErrCode);
391 - upnp_igd_print(igd_ctxt, level, "CtrlUrl = %s", sv_event->CtrlUrl);
392 - upnp_igd_print(igd_ctxt, level, "StateVarName= %s", sv_event->StateVarName);
393 - upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", sv_event->CurrentVal);
394 + UpnpGetErrorMessage(UpnpStateVarComplete_get_ErrCode(sv_event)), UpnpStateVarComplete_get_ErrCode(sv_event));
395 + upnp_igd_print(igd_ctxt, level, "CtrlUrl = %s", UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event));
396 + upnp_igd_print(igd_ctxt, level, "StateVarName= %s", UpnpStateVarComplete_get_StateVarName_cstr(sv_event));
397 + upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", UpnpStateVarComplete_get_CurrentVal_cstr(sv_event));
401 case UPNP_EVENT_SUBSCRIPTION_REQUEST: {
402 - struct Upnp_Subscription_Request *sr_event =
403 - (struct Upnp_Subscription_Request *)Event;
404 + UpnpSubscriptionRequest *sr_event = (UpnpSubscriptionRequest *)Event;
406 - upnp_igd_print(igd_ctxt, level, "ServiceID = %s", sr_event->ServiceId);
407 - upnp_igd_print(igd_ctxt, level, "UDN = %s", sr_event->UDN);
408 - upnp_igd_print(igd_ctxt, level, "SID = %s", sr_event->Sid);
409 + upnp_igd_print(igd_ctxt, level, "ServiceID = %s", UpnpSubscriptionRequest_get_ServiceId_cstr(sr_event));
410 + upnp_igd_print(igd_ctxt, level, "UDN = %s", UpnpSubscriptionRequest_get_UDN_cstr(sr_event));
411 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpSubscriptionRequest_get_SID_cstr(sr_event));
414 case UPNP_EVENT_RECEIVED: {
415 - struct Upnp_Event *e_event = (struct Upnp_Event *)Event;
416 + UpnpEvent *e_event = (UpnpEvent *)Event;
417 char *xmlbuff = NULL;
419 - upnp_igd_print(igd_ctxt, level, "SID = %s", e_event->Sid);
420 - upnp_igd_print(igd_ctxt, level, "EventKey = %d", e_event->EventKey);
421 - xmlbuff = ixmlPrintNode((IXML_Node *)e_event->ChangedVariables);
422 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpEvent_get_SID_cstr(e_event));
423 + upnp_igd_print(igd_ctxt, level, "EventKey = %d", UpnpEvent_get_EventKey(e_event));
424 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpEvent_get_ChangedVariables(e_event));
425 upnp_igd_print(igd_ctxt, level, "ChangedVars = %s", xmlbuff);
426 ixmlFreeDOMString(xmlbuff);
430 case UPNP_EVENT_RENEWAL_COMPLETE: {
431 - struct Upnp_Event_Subscribe *es_event =
432 - (struct Upnp_Event_Subscribe *)Event;
433 + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
435 - upnp_igd_print(igd_ctxt, level, "SID = %s", es_event->Sid);
436 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpEventSubscribe_get_SID_cstr(es_event));
437 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
438 - UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
439 - upnp_igd_print(igd_ctxt, level, "TimeOut = %d", es_event->TimeOut);
440 + UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
441 + upnp_igd_print(igd_ctxt, level, "TimeOut = %d", UpnpEventSubscribe_get_TimeOut(es_event));
444 case UPNP_EVENT_SUBSCRIBE_COMPLETE:
445 case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: {
446 - struct Upnp_Event_Subscribe *es_event =
447 - (struct Upnp_Event_Subscribe *)Event;
448 + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
450 - upnp_igd_print(igd_ctxt, level, "SID = %s", es_event->Sid);
451 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpEventSubscribe_get_SID_cstr(es_event));
452 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
453 - UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
454 - upnp_igd_print(igd_ctxt, level, "PublisherURL= %s", es_event->PublisherUrl);
455 - upnp_igd_print(igd_ctxt, level, "TimeOut = %d", es_event->TimeOut);
456 + UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
457 + upnp_igd_print(igd_ctxt, level, "PublisherURL= %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
458 + upnp_igd_print(igd_ctxt, level, "TimeOut = %d", UpnpEventSubscribe_get_TimeOut(es_event));
461 case UPNP_EVENT_AUTORENEWAL_FAILED:
462 case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
463 - struct Upnp_Event_Subscribe *es_event =
464 - (struct Upnp_Event_Subscribe *)Event;
465 + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
467 - upnp_igd_print(igd_ctxt, level, "SID = %s", es_event->Sid);
468 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpEventSubscribe_get_SID_cstr(es_event));
469 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
470 - UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
471 - upnp_igd_print(igd_ctxt, level, "PublisherURL= %s", es_event->PublisherUrl);
472 - upnp_igd_print(igd_ctxt, level, "TimeOut = %d", es_event->TimeOut);
473 + UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
474 + upnp_igd_print(igd_ctxt, level, "PublisherURL= %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
475 + upnp_igd_print(igd_ctxt, level, "TimeOut = %d", UpnpEventSubscribe_get_TimeOut(es_event));
479 --- mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.h.orig 2020-09-24 11:44:00.000000000 +0200
480 +++ mediastreamer2-4.4.2/src/upnp/upnp_igd_utils.h 2020-09-27 09:51:21.930120631 +0200
483 void upnp_igd_print(upnp_igd_context *uIGD, upnp_igd_print_level level, const char *fmt, ...);
484 void upnp_igd_print_event_type(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType S);
485 -void upnp_igd_print_event(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType EventType, void *Event);
486 +void upnp_igd_print_event(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType EventType, const void *Event);
487 char *upnp_igd_get_first_document_item(upnp_igd_context *uIGD, IXML_Document *doc, const char *item);
488 char *upnp_igd_get_element_value(upnp_igd_context *uIGD, IXML_Element *element);
489 char *upnp_igd_get_first_element_item(upnp_igd_context *uIGD,IXML_Element *element, const char *item);
490 --- mediastreamer2-4.4.2/configure.ac.orig 2021-07-05 06:50:46.295451589 +0200
491 +++ mediastreamer2-4.4.2/configure.ac 2021-07-05 17:16:33.665373367 +0200
492 @@ -717,7 +717,7 @@ AC_ARG_ENABLE(upnp,
494 if test "$build_upnp" != "false" ; then
495 PKG_CHECK_MODULES([LIBUPNP], [libupnp],
496 - [if pkg-config --atleast-version=1.6 "libupnp < 1.7"; then
497 + [if pkg-config --atleast-version=1.8 "libupnp"; then
500 CFLAGS="$CFLAGS $LIBUPNP_CFLAGS -Werror -Wno-error=unused-variable"
501 @@ -730,7 +730,7 @@ if test "$build_upnp" != "false" ; then
502 AC_DEFINE(USE_PATCHED_UPNP, 1, [Define if upnp is patched]))
505 - AC_MSG_ERROR([libupnp >= 1.6 < 1.5 required.])
506 + AC_MSG_ERROR([libupnp >= 1.8 required.])
508 [if test "$build_upnp" == "true" ; then
509 AC_MSG_ERROR([libupnp not found.])