1 diff -ur mediastreamer-2.16.1/src/upnp/upnp_igd.c mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd.c
2 --- mediastreamer-2.16.1/src/upnp/upnp_igd.c 2017-04-06 11:27:56.000000000 +0200
3 +++ mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd.c 2020-10-24 09:56:24.947219573 +0200
5 * d_event -- event associated with the new device
7 ********************************************************************************/
8 -void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, struct Upnp_Discovery *d_event) {
9 +void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, UpnpDiscovery *d_event) {
10 upnp_igd_device_node *deviceNode, *tmpdevnode;
14 baseURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "URLBase");
15 relURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "presentationURL");
17 - ret = UpnpResolveURL((baseURL ? baseURL : d_event->Location), relURL, presURL);
18 + ret = UpnpResolveURL((baseURL ? baseURL : UpnpDiscovery_get_Location_cstr(d_event)), relURL, presURL);
20 if (UPNP_E_SUCCESS != ret) {
21 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error generating presURL from %s + %s", baseURL, relURL);
24 /* The device is already there, so just update */
25 /* the advertisement timeout field */
26 - tmpdevnode->device.advr_time_out = d_event->Expires;
27 + tmpdevnode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
28 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "IGD device: %s[%s] | Update expires(%d)", friendlyName, UDN, tmpdevnode->device.advr_time_out);
30 upnp_igd_print(igd_ctxt, UPNP_IGD_MESSAGE, "Add IGD device: %s[%s]", friendlyName, UDN);
32 deviceNode = (upnp_igd_device_node *) malloc(sizeof(upnp_igd_device_node));
33 memset(deviceNode->device.services, '\0', sizeof(upnp_igd_service) * IGD_SERVICE_SERVCOUNT);
34 strncpy(deviceNode->device.udn, UDN, sizeof(deviceNode->device.udn));
35 - strncpy(deviceNode->device.desc_doc_url, d_event->Location, sizeof(deviceNode->device.desc_doc_url));
36 + strncpy(deviceNode->device.desc_doc_url, UpnpDiscovery_get_Location_cstr(d_event), sizeof(deviceNode->device.desc_doc_url));
37 strncpy(deviceNode->device.friendly_name, friendlyName, sizeof(deviceNode->device.friendly_name));
38 strncpy(deviceNode->device.model_name, modelName, sizeof(deviceNode->device.model_name));
39 strncpy(deviceNode->device.model_number, modelNumber, sizeof(deviceNode->device.model_number));
40 strncpy(deviceNode->device.pres_url, presURL, sizeof(deviceNode->device.pres_url));
41 - deviceNode->device.advr_time_out = d_event->Expires;
42 + deviceNode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
48 for (service = 0; service < IGD_SERVICE_SERVCOUNT;
50 - if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, d_event->Location,
51 + if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, UpnpDiscovery_get_Location_cstr(d_event),
52 IGDServiceType[service], &serviceId, &event_url, &controlURL)) {
53 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribing to EventURL %s...",event_url);
56 * cookie -- Optional data specified during callback registration
58 ********************************************************************************/
59 -int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
60 +int upnp_igd_callback(Upnp_EventType event_type, const void* event, void *cookie) {
62 upnp_igd_context *igd_ctxt = (upnp_igd_context*)cookie;
63 upnp_context_add_client(igd_ctxt);
66 case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
67 case UPNP_DISCOVERY_SEARCH_RESULT: {
68 - struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
69 + UpnpDiscovery *d_event = (UpnpDiscovery *)event;
70 IXML_Document *desc_doc = NULL;
73 - if (d_event->ErrCode != UPNP_E_SUCCESS) {
74 - upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", d_event->ErrCode);
75 + if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
76 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
78 - ret = UpnpDownloadXmlDoc(d_event->Location, &desc_doc);
79 + ret = UpnpDownloadXmlDoc(UpnpDiscovery_get_Location_cstr(d_event), &desc_doc);
80 if (ret != UPNP_E_SUCCESS) {
81 - upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", d_event->Location, ret);
82 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", UpnpDiscovery_get_Location_cstr(d_event), ret);
84 upnp_igd_add_device(igd_ctxt, desc_doc, d_event);
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 + UpnpDiscovery *d_event = (UpnpDiscovery *)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));
97 - upnp_igd_remove_device(igd_ctxt, d_event->DeviceId);
98 + upnp_igd_remove_device(igd_ctxt, UpnpDiscovery_get_DeviceID_cstr(d_event));
102 case UPNP_CONTROL_ACTION_COMPLETE: {
103 - struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
104 + UpnpActionComplete *a_event = (UpnpActionComplete *)event;
106 - if (a_event->ErrCode != UPNP_E_SUCCESS) {
107 - upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Action Complete Callback -- %d", a_event->ErrCode);
108 + if (UpnpActionComplete_get_ErrCode(a_event) != UPNP_E_SUCCESS) {
109 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Action Complete Callback -- %d", UpnpActionComplete_get_ErrCode(a_event));
111 - upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
112 + upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(UpnpActionComplete_get_CtrlUrl(a_event)), UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event));
116 case UPNP_CONTROL_GET_VAR_COMPLETE: {
117 - struct Upnp_State_Var_Complete *sv_event = (struct Upnp_State_Var_Complete *)event;
118 + UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)event;
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));
125 - upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(sv_event->CtrlUrl), sv_event->StateVarName, sv_event->CurrentVal);
126 + upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(UpnpStateVarComplete_get_CtrlUrl(sv_event)), UpnpStateVarComplete_get_StateVarName_cstr(sv_event), UpnpStateVarComplete_get_CurrentVal_cstr(sv_event));
131 case UPNP_EVENT_RECEIVED: {
132 - struct Upnp_Event *e_event = (struct Upnp_Event *)event;
133 + UpnpEvent *e_event = (UpnpEvent *)event;
135 - upnp_igd_handle_event(igd_ctxt, e_event->Sid, e_event->EventKey, e_event->ChangedVariables);
136 + upnp_igd_handle_event(igd_ctxt, UpnpEvent_get_SID_cstr(e_event), UpnpEvent_get_EventKey(e_event), UpnpEvent_get_ChangedVariables(e_event));
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 + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)event;
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));
150 - upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), es_event->Sid, es_event->TimeOut);
151 + upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(UpnpEventSubscribe_get_PublisherUrl(es_event)), UpnpEventSubscribe_get_SID_cstr(es_event), UpnpEventSubscribe_get_TimeOut(es_event));
155 case UPNP_EVENT_AUTORENEWAL_FAILED:
156 case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
157 - struct Upnp_Event_Subscribe *es_event = (struct Upnp_Event_Subscribe *)event;
158 + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)event;
163 - ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(es_event->PublisherUrl), &TimeOut, newSID);
164 + ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(UpnpEventSubscribe_get_PublisherUrl(es_event)), &TimeOut, newSID);
165 if (ret == UPNP_E_SUCCESS) {
166 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribed to EventURL with SID=%s", newSID);
167 - upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), newSID, TimeOut);
168 + upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(UpnpEventSubscribe_get_PublisherUrl(es_event)), newSID, TimeOut);
170 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error Subscribing to EventURL -- %d", ret);
172 @@ -1070,9 +1070,9 @@
174 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Initializing uPnP IGD with ipaddress:%s port:%u", ip_address ? ip_address : "{NULL}", port);
176 - ret = UpnpInit(ip_address, port);
177 + ret = UpnpInit2(ip_address, port);
178 if (ret != UPNP_E_SUCCESS) {
179 - upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "UpnpInit() Error: %d", ret);
180 + upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "UpnpInit2() Error: %d", ret);
182 ithread_mutex_destroy(&igd_ctxt->print_mutex);
183 ithread_mutex_destroy(&igd_ctxt->devices_mutex);
184 diff -ur mediastreamer-2.16.1/src/upnp/upnp_igd_cmd.c mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_cmd.c
185 --- mediastreamer-2.16.1/src/upnp/upnp_igd_cmd.c 2017-04-06 11:27:56.000000000 +0200
186 +++ mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_cmd.c 2020-10-24 09:59:22.519393813 +0200
190 case UPNP_CONTROL_ACTION_COMPLETE: {
191 - struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
192 - upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, a_event->ErrCode, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
193 + struct UpnpActionComplete *a_event = (UpnpActionComplete *)event;
194 + upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, UpnpActionComplete_get_ErrCode(a_event), UPNP_STRING(UpnpActionComplete_get_CtrlUrl(a_event)), UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event));
198 diff -ur mediastreamer-2.16.1/src/upnp/upnp_igd_private.h mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_private.h
199 --- mediastreamer-2.16.1/src/upnp/upnp_igd_private.h 2017-04-06 11:27:56.000000000 +0200
200 +++ mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_private.h 2020-10-24 09:56:45.997524838 +0200
202 void upnp_context_handle_callbacks(upnp_igd_context *igd_ctx);
203 void upnp_context_free_callbacks(upnp_igd_context *igd_ctx);
205 -int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie);
206 +int upnp_igd_callback(Upnp_EventType event_type, const void* event, void *cookie);
207 int upnp_igd_send_action(upnp_igd_context* igd_ctxt, upnp_igd_device_node *device_node, int service,
208 const char *actionname, const char **param_name, const char **param_val, int param_count,
209 Upnp_FunPtr fun, const void *cookie);
210 diff -ur mediastreamer-2.16.1/src/upnp/upnp_igd_utils.c mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_utils.c
211 --- mediastreamer-2.16.1/src/upnp/upnp_igd_utils.c 2017-04-06 11:27:56.000000000 +0200
212 +++ mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_utils.c 2020-10-24 10:41:27.658376656 +0200
217 -void upnp_igd_print_event(upnp_igd_context *igd_ctxt, upnp_igd_print_level level, Upnp_EventType EventType, void *Event) {
218 +void upnp_igd_print_event(upnp_igd_context *igd_ctxt, upnp_igd_print_level level, Upnp_EventType EventType, const void *Event) {
219 ithread_mutex_lock(&igd_ctxt->print_mutex);
221 upnp_igd_print(igd_ctxt, level, "======================================================================");
222 @@ -188,18 +188,18 @@
223 case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
224 case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
225 case UPNP_DISCOVERY_SEARCH_RESULT: {
226 - struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)Event;
227 + UpnpDiscovery *d_event = (UpnpDiscovery *)Event;
229 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
230 - UpnpGetErrorMessage(d_event->ErrCode), d_event->ErrCode);
231 - upnp_igd_print(igd_ctxt, level, "Expires = %d", d_event->Expires);
232 - upnp_igd_print(igd_ctxt, level, "DeviceId = %s", d_event->DeviceId);
233 - upnp_igd_print(igd_ctxt, level, "DeviceType = %s", d_event->DeviceType);
234 - upnp_igd_print(igd_ctxt, level, "ServiceType = %s", d_event->ServiceType);
235 - upnp_igd_print(igd_ctxt, level, "ServiceVer = %s", d_event->ServiceVer);
236 - upnp_igd_print(igd_ctxt, level, "Location = %s", d_event->Location);
237 - upnp_igd_print(igd_ctxt, level, "OS = %s", d_event->Os);
238 - upnp_igd_print(igd_ctxt, level, "Ext = %s", d_event->Ext);
239 + UpnpGetErrorMessage(UpnpDiscovery_get_ErrCode(d_event)), UpnpDiscovery_get_ErrCode(d_event));
240 + upnp_igd_print(igd_ctxt, level, "Expires = %d", UpnpDiscovery_get_Expires(d_event));
241 + upnp_igd_print(igd_ctxt, level, "DeviceId = %s", UpnpDiscovery_get_DeviceID_cstr(d_event));
242 + upnp_igd_print(igd_ctxt, level, "DeviceType = %s", UpnpDiscovery_get_DeviceType_cstr(d_event));
243 + upnp_igd_print(igd_ctxt, level, "ServiceType = %s", UpnpDiscovery_get_ServiceType_cstr(d_event));
244 + upnp_igd_print(igd_ctxt, level, "ServiceVer = %s", UpnpDiscovery_get_ServiceVer_cstr(d_event));
245 + upnp_igd_print(igd_ctxt, level, "Location = %s", UpnpDiscovery_get_Location_cstr(d_event));
246 + upnp_igd_print(igd_ctxt, level, "OS = %s", UpnpDiscovery_get_Os_cstr(d_event));
247 + upnp_igd_print(igd_ctxt, level, "Ext = %s", UpnpDiscovery_get_Ext_cstr(d_event));
250 case UPNP_DISCOVERY_SEARCH_TIMEOUT:
251 @@ -207,18 +207,18 @@
254 case UPNP_CONTROL_ACTION_REQUEST: {
255 - struct Upnp_Action_Request *a_event =
256 - (struct Upnp_Action_Request *)Event;
257 + UpnpActionRequest *a_event =
258 + (UpnpActionRequest *)Event;
259 char *xmlbuff = NULL;
261 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
262 - UpnpGetErrorMessage(a_event->ErrCode), a_event->ErrCode);
263 - upnp_igd_print(igd_ctxt, level, "ErrStr = %s", a_event->ErrStr);
264 - upnp_igd_print(igd_ctxt, level, "ActionName = %s", a_event->ActionName);
265 - upnp_igd_print(igd_ctxt, level, "UDN = %s", a_event->DevUDN);
266 - upnp_igd_print(igd_ctxt, level, "ServiceID = %s", a_event->ServiceID);
267 - if (a_event->ActionRequest) {
268 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
269 + UpnpGetErrorMessage(UpnpActionRequest_get_ErrCode(a_event)), UpnpActionRequest_get_ErrCode(a_event));
270 + upnp_igd_print(igd_ctxt, level, "ErrStr = %s", UpnpActionRequest_get_ErrStr_cstr(a_event));
271 + upnp_igd_print(igd_ctxt, level, "ActionName = %s", UpnpActionRequest_get_ActionName(a_event));
272 + upnp_igd_print(igd_ctxt, level, "UDN = %s", UpnpActionRequest_get_DevUDN_cstr(a_event));
273 + upnp_igd_print(igd_ctxt, level, "ServiceID = %s", UpnpActionRequest_get_ServiceID_cstr(a_event));
274 + if (UpnpActionRequest_get_ActionRequest(a_event)) {
275 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionRequest(a_event));
277 upnp_igd_print(igd_ctxt, level, "ActRequest = %s", xmlbuff);
278 ixmlFreeDOMString(xmlbuff);
281 upnp_igd_print(igd_ctxt, level, "ActRequest = (null)");
283 - if (a_event->ActionResult) {
284 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
285 + if (UpnpActionRequest_get_ActionResult(a_event)) {
286 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionRequest_get_ActionResult(a_event));
288 upnp_igd_print(igd_ctxt, level, "ActResult = %s", xmlbuff);
289 ixmlFreeDOMString(xmlbuff);
290 @@ -240,15 +240,15 @@
293 case UPNP_CONTROL_ACTION_COMPLETE: {
294 - struct Upnp_Action_Complete *a_event =
295 - (struct Upnp_Action_Complete *)Event;
296 + UpnpActionComplete *a_event =
297 + (UpnpActionComplete *)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, "CtrlUrl = %s", a_event->CtrlUrl);
303 - if (a_event->ActionRequest) {
304 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionRequest);
305 + UpnpGetErrorMessage(UpnpActionComplete_get_ErrCode(a_event)), UpnpActionComplete_get_ErrCode(a_event));
306 + upnp_igd_print(igd_ctxt, level, "CtrlUrl = %s", UpnpActionComplete_get_CtrlUrl_cstr(a_event));
307 + if (UpnpActionComplete_get_ActionRequest(a_event)) {
308 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionRequest(a_event));
310 upnp_igd_print(igd_ctxt, level, "ActRequest = %s", xmlbuff);
311 ixmlFreeDOMString(xmlbuff);
314 upnp_igd_print(igd_ctxt, level, "ActRequest = (null)");
316 - if (a_event->ActionResult) {
317 - xmlbuff = ixmlPrintNode((IXML_Node *)a_event->ActionResult);
318 + if (UpnpActionComplete_get_ActionResult(a_event)) {
319 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpActionComplete_get_ActionResult(a_event));
321 upnp_igd_print(igd_ctxt, level, "ActResult = %s", xmlbuff);
322 ixmlFreeDOMString(xmlbuff);
323 @@ -270,83 +270,83 @@
326 case UPNP_CONTROL_GET_VAR_REQUEST: {
327 - struct Upnp_State_Var_Request *sv_event =
328 - (struct Upnp_State_Var_Request *)Event;
329 + UpnpStateVarRequest *sv_event =
330 + (UpnpStateVarRequest *)Event;
332 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
333 - UpnpGetErrorMessage(sv_event->ErrCode), sv_event->ErrCode);
334 - upnp_igd_print(igd_ctxt, level, "ErrStr = %s", sv_event->ErrStr);
335 - upnp_igd_print(igd_ctxt, level, "UDN = %s", sv_event->DevUDN);
336 - upnp_igd_print(igd_ctxt, level, "ServiceID = %s", sv_event->ServiceID);
337 - upnp_igd_print(igd_ctxt, level, "StateVarName= %s", sv_event->StateVarName);
338 - upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", sv_event->CurrentVal);
339 + UpnpGetErrorMessage(UpnpStateVarRequest_get_ErrCode(sv_event)), UpnpStateVarRequest_get_ErrCode(sv_event));
340 + upnp_igd_print(igd_ctxt, level, "ErrStr = %s", UpnpStateVarRequest_get_ErrStr_cstr(sv_event));
341 + upnp_igd_print(igd_ctxt, level, "UDN = %s", UpnpStateVarRequest_get_DevUDN_cstr(sv_event));
342 + upnp_igd_print(igd_ctxt, level, "ServiceID = %s", UpnpStateVarRequest_get_ServiceID_cstr(sv_event));
343 + upnp_igd_print(igd_ctxt, level, "StateVarName= %s", UpnpStateVarRequest_get_StateVarName_cstr(sv_event));
344 + upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", UpnpStateVarRequest_get_CurrentVal_cstr(sv_event));
347 case UPNP_CONTROL_GET_VAR_COMPLETE: {
348 - struct Upnp_State_Var_Complete *sv_event =
349 - (struct Upnp_State_Var_Complete *)Event;
350 + UpnpStateVarComplete *sv_event =
351 + (UpnpStateVarComplete *)Event;
353 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
354 - UpnpGetErrorMessage(sv_event->ErrCode), sv_event->ErrCode);
355 - upnp_igd_print(igd_ctxt, level, "CtrlUrl = %s", sv_event->CtrlUrl);
356 - upnp_igd_print(igd_ctxt, level, "StateVarName= %s", sv_event->StateVarName);
357 - upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", sv_event->CurrentVal);
358 + UpnpGetErrorMessage(UpnpStateVarComplete_get_ErrCode(sv_event)), UpnpStateVarComplete_get_ErrCode(sv_event));
359 + upnp_igd_print(igd_ctxt, level, "CtrlUrl = %s", UpnpStateVarComplete_get_CtrlUrl_cstr(sv_event));
360 + upnp_igd_print(igd_ctxt, level, "StateVarName= %s", UpnpStateVarComplete_get_StateVarName_cstr(sv_event));
361 + upnp_igd_print(igd_ctxt, level, "CurrentVal = %s", UpnpStateVarComplete_get_CurrentVal_cstr(sv_event));
365 case UPNP_EVENT_SUBSCRIPTION_REQUEST: {
366 - struct Upnp_Subscription_Request *sr_event =
367 - (struct Upnp_Subscription_Request *)Event;
368 + UpnpSubscriptionRequest *sr_event =
369 + (UpnpSubscriptionRequest *)Event;
371 - upnp_igd_print(igd_ctxt, level, "ServiceID = %s", sr_event->ServiceId);
372 - upnp_igd_print(igd_ctxt, level, "UDN = %s", sr_event->UDN);
373 - upnp_igd_print(igd_ctxt, level, "SID = %s", sr_event->Sid);
374 + upnp_igd_print(igd_ctxt, level, "ServiceID = %s", UpnpSubscriptionRequest_get_ServiceId_cstr(sr_event));
375 + upnp_igd_print(igd_ctxt, level, "UDN = %s", UpnpSubscriptionRequest_get_UDN_cstr(sr_event));
376 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpSubscriptionRequest_get_SID_cstr(sr_event));
379 case UPNP_EVENT_RECEIVED: {
380 - struct Upnp_Event *e_event = (struct Upnp_Event *)Event;
381 + UpnpEvent *e_event = (UpnpEvent *)Event;
382 char *xmlbuff = NULL;
384 - upnp_igd_print(igd_ctxt, level, "SID = %s", e_event->Sid);
385 - upnp_igd_print(igd_ctxt, level, "EventKey = %d", e_event->EventKey);
386 - xmlbuff = ixmlPrintNode((IXML_Node *)e_event->ChangedVariables);
387 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpEvent_get_SID_cstr(e_event));
388 + upnp_igd_print(igd_ctxt, level, "EventKey = %d", UpnpEvent_get_EventKey(e_event));
389 + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpEvent_get_ChangedVariables(e_event));
390 upnp_igd_print(igd_ctxt, level, "ChangedVars = %s", xmlbuff);
391 ixmlFreeDOMString(xmlbuff);
395 case UPNP_EVENT_RENEWAL_COMPLETE: {
396 - struct Upnp_Event_Subscribe *es_event =
397 - (struct Upnp_Event_Subscribe *)Event;
398 + UpnpEventSubscribe *es_event =
399 + (UpnpEventSubscribe *)Event;
401 - upnp_igd_print(igd_ctxt, level, "SID = %s", es_event->Sid);
402 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpEventSubscribe_get_SID_cstr(es_event));
403 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
404 - UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
405 - upnp_igd_print(igd_ctxt, level, "TimeOut = %d", es_event->TimeOut);
406 + UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
407 + upnp_igd_print(igd_ctxt, level, "TimeOut = %d", UpnpEventSubscribe_get_TimeOut(es_event));
410 case UPNP_EVENT_SUBSCRIBE_COMPLETE:
411 case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: {
412 - struct Upnp_Event_Subscribe *es_event =
413 - (struct Upnp_Event_Subscribe *)Event;
414 + UpnpEventSubscribe *es_event =
415 + (UpnpEventSubscribe *)Event;
417 - upnp_igd_print(igd_ctxt, level, "SID = %s", es_event->Sid);
418 + upnp_igd_print(igd_ctxt, level, "SID = %s", UpnpEventSubscribe_get_SID_cstr(es_event));
419 upnp_igd_print(igd_ctxt, level, "ErrCode = %s(%d)",
420 - UpnpGetErrorMessage(es_event->ErrCode), es_event->ErrCode);
421 - upnp_igd_print(igd_ctxt, level, "PublisherURL= %s", es_event->PublisherUrl);
422 - upnp_igd_print(igd_ctxt, level, "TimeOut = %d", es_event->TimeOut);
423 + UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
424 + upnp_igd_print(igd_ctxt, level, "PublisherURL= %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
425 + upnp_igd_print(igd_ctxt, level, "TimeOut = %d", UpnpEventSubscribe_get_TimeOut(es_event));
428 case UPNP_EVENT_AUTORENEWAL_FAILED:
429 case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
430 - struct Upnp_Event_Subscribe *es_event =
431 - (struct Upnp_Event_Subscribe *)Event;
432 + UpnpEventSubscribe *es_event =
433 + (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, "PublisherURL= %s", es_event->PublisherUrl);
440 - upnp_igd_print(igd_ctxt, level, "TimeOut = %d", es_event->TimeOut);
441 + UpnpGetErrorMessage(UpnpEventSubscribe_get_ErrCode(es_event)), UpnpEventSubscribe_get_ErrCode(es_event));
442 + upnp_igd_print(igd_ctxt, level, "PublisherURL= %s", UpnpEventSubscribe_get_PublisherUrl_cstr(es_event));
443 + upnp_igd_print(igd_ctxt, level, "TimeOut = %d", UpnpEventSubscribe_get_TimeOut(es_event));
447 diff -ur mediastreamer-2.16.1/src/upnp/upnp_igd_utils.h mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_utils.h
448 --- mediastreamer-2.16.1/src/upnp/upnp_igd_utils.h 2017-04-06 11:27:56.000000000 +0200
449 +++ mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd_utils.h 2020-10-24 09:57:35.918190644 +0200
452 void upnp_igd_print(upnp_igd_context *uIGD, upnp_igd_print_level level, const char *fmt, ...);
453 void upnp_igd_print_event_type(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType S);
454 -void upnp_igd_print_event(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType EventType, void *Event);
455 +void upnp_igd_print_event(upnp_igd_context *uIGD, upnp_igd_print_level level, Upnp_EventType EventType, const void *Event);
456 char *upnp_igd_get_first_document_item(upnp_igd_context *uIGD, IXML_Document *doc, const char *item);
457 char *upnp_igd_get_element_value(upnp_igd_context *uIGD, IXML_Element *element);
458 char *upnp_igd_get_first_element_item(upnp_igd_context *uIGD,IXML_Element *element, const char *item);
459 --- mediastreamer2-4.4.2/configure.ac.orig 2021-07-05 06:50:46.295451589 +0200
460 +++ mediastreamer2-4.4.2/configure.ac 2021-07-05 17:16:33.665373367 +0200
461 @@ -717,7 +717,7 @@ AC_ARG_ENABLE(upnp,
463 if test "$build_upnp" != "false" ; then
464 PKG_CHECK_MODULES([LIBUPNP], [libupnp],
465 - [if pkg-config --atleast-version=1.6 "libupnp < 1.7"; then
466 + [if pkg-config --atleast-version=1.8 "libupnp"; then
469 CFLAGS="$CFLAGS $LIBUPNP_CFLAGS -Werror -Wno-error=unused-variable"
470 @@ -730,7 +730,7 @@ if test "$build_upnp" != "false" ; then
471 AC_DEFINE(USE_PATCHED_UPNP, 1, [Define if upnp is patched]))
474 - AC_MSG_ERROR([libupnp >= 1.6 < 1.5 required.])
475 + AC_MSG_ERROR([libupnp >= 1.8 required.])
477 [if test "$build_upnp" == "true" ; then
478 AC_MSG_ERROR([libupnp not found.])