]>
Commit | Line | Data |
---|---|---|
dcc4ee79 JB |
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 | |
0e8932cc JR |
3 | @@ -395,7 +395,7 @@ |
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 | @@ -423,7 +423,7 @@ | |
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 | @@ -444,7 +444,7 @@ | |
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, tmpdevnode->device.advr_time_out); | |
28 | } else { | |
29 | upnp_igd_print(igd_ctxt, UPNP_IGD_MESSAGE, "Add IGD device: %s[%s]", friendlyName, UDN); | |
30 | @@ -453,12 +453,12 @@ | |
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 | @@ -468,7 +468,7 @@ | |
46 | ||
47 | for (service = 0; service < IGD_SERVICE_SERVCOUNT; | |
48 | service++) { | |
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); | |
53 | ret = | |
d8296b8a JR |
54 | @@ -883,7 +883,7 @@ |
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); | |
0e8932cc JR |
63 | @@ -891,16 +891,16 @@ |
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 | + UpnpDiscovery *d_event = (UpnpDiscovery *)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", 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); | |
82 | } else { | |
83 | upnp_igd_add_device(igd_ctxt, desc_doc, d_event); | |
84 | } | |
d8296b8a | 85 | @@ -910,64 +910,64 @@ |
0e8932cc JR |
86 | } |
87 | break; | |
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)); | |
95 | } | |
96 | - upnp_igd_remove_device(igd_ctxt, d_event->DeviceId); | |
97 | + upnp_igd_remove_device(igd_ctxt, UpnpDiscovery_get_DeviceID_cstr(d_event)); | |
98 | } | |
99 | break; | |
100 | /* SOAP Stuff */ | |
d8296b8a JR |
101 | case UPNP_CONTROL_ACTION_COMPLETE: { |
102 | - struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event; | |
103 | + UpnpActionComplete *a_event = (UpnpActionComplete *)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, a_event->ActionResult); | |
dcc4ee79 | 111 | + upnp_igd_handle_send_action(igd_ctxt, UpnpActionComplete_get_CtrlUrl_cstr(a_event), UpnpActionComplete_get_ActionRequest(a_event), UpnpActionComplete_get_ActionResult(a_event)); |
d8296b8a JR |
112 | } |
113 | } | |
114 | break; | |
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; | |
118 | ||
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)); | |
123 | } else { | |
124 | - upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(sv_event->CtrlUrl), sv_event->StateVarName, sv_event->CurrentVal); | |
dcc4ee79 | 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)); |
d8296b8a JR |
126 | } |
127 | } | |
128 | break; | |
129 | /* GENA Stuff */ | |
130 | case UPNP_EVENT_RECEIVED: { | |
131 | - struct Upnp_Event *e_event = (struct Upnp_Event *)event; | |
132 | + UpnpEvent *e_event = (UpnpEvent *)event; | |
133 | ||
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)); | |
136 | } | |
137 | break; | |
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; | |
143 | ||
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)); | |
148 | } else { | |
149 | - upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), es_event->Sid, es_event->TimeOut); | |
dcc4ee79 | 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)); |
d8296b8a JR |
151 | } |
152 | } | |
153 | break; | |
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; | |
158 | int TimeOut = 1801; | |
159 | Upnp_SID newSID; | |
160 | int ret; | |
161 | ||
162 | - ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(es_event->PublisherUrl), &TimeOut, newSID); | |
dcc4ee79 | 163 | + ret = UpnpSubscribe(igd_ctxt->upnp_handle, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), &TimeOut, newSID); |
d8296b8a JR |
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); | |
dcc4ee79 | 167 | + upnp_igd_handle_subscribe_update(igd_ctxt, UpnpEventSubscribe_get_PublisherUrl_cstr(es_event), newSID, TimeOut); |
d8296b8a JR |
168 | } else { |
169 | upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error Subscribing to EventURL -- %d", ret); | |
170 | } | |
dcc4ee79 JB |
171 | @@ -996,10 +996,10 @@ |
172 | * cookie -- The cookie pass in cb_fct or print_fct | |
173 | * | |
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) { | |
177 | int ret; | |
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); | |
186 | } | |
d8296b8a | 187 | |
dcc4ee79 JB |
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); | |
d8296b8a JR |
190 | |
191 | - ret = UpnpInit(ip_address, port); | |
dcc4ee79 | 192 | + ret = UpnpInit2(interface, port); |
d8296b8a | 193 | if (ret != UPNP_E_SUCCESS) { |
dcc4ee79 | 194 | upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "UpnpInit() Error: %d", ret); |
d8296b8a | 195 | UpnpFinish(); |
dcc4ee79 JB |
196 | @@ -1085,9 +1085,7 @@ |
197 | free(igd_ctxt); | |
198 | return NULL; | |
199 | } | |
200 | - if (!ip_address) { | |
201 | - ip_address = UpnpGetServerIpAddress(); | |
202 | - } | |
203 | + ip_address = UpnpGetServerIp6Address(); | |
204 | if (!port) { | |
205 | port = UpnpGetServerPort(); | |
206 | } | |
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 | |
209 | @@ -95,7 +95,7 @@ | |
210 | return 0; | |
211 | } | |
212 | ||
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) { | |
215 | int ret = 1; | |
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); | |
d8296b8a JR |
218 | @@ -103,8 +103,8 @@ |
219 | ||
220 | switch(event_type) { | |
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); | |
dcc4ee79 JB |
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)); | |
d8296b8a JR |
226 | } |
227 | break; | |
228 | ||
dcc4ee79 JB |
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 | |
231 | @@ -72,7 +72,7 @@ | |
232 | ||
233 | typedef struct _upnp_igd_context upnp_igd_context; | |
234 | ||
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 | |
d8296b8a JR |
242 | @@ -144,7 +144,7 @@ |
243 | void upnp_context_handle_callbacks(upnp_igd_context *igd_ctx); | |
244 | void upnp_context_free_callbacks(upnp_igd_context *igd_ctx); | |
245 | ||
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); | |
dcc4ee79 JB |
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 | |
d8296b8a JR |
253 | @@ -178,7 +178,7 @@ |
254 | } | |
255 | } | |
256 | ||
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); | |
260 | ||
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; | |
268 | ||
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)); | |
288 | break; | |
289 | } | |
290 | case UPNP_DISCOVERY_SEARCH_TIMEOUT: | |
dcc4ee79 | 291 | @@ -207,18 +207,17 @@ |
d8296b8a JR |
292 | break; |
293 | /* SOAP */ | |
294 | case UPNP_CONTROL_ACTION_REQUEST: { | |
295 | - struct Upnp_Action_Request *a_event = | |
296 | - (struct Upnp_Action_Request *)Event; | |
dcc4ee79 | 297 | + UpnpActionRequest *a_event = (UpnpActionRequest *)Event; |
d8296b8a JR |
298 | char *xmlbuff = NULL; |
299 | ||
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)); | |
dcc4ee79 | 310 | + upnp_igd_print(igd_ctxt, level, "ActionName = %s", UpnpActionRequest_get_ActionName_cstr(a_event)); |
d8296b8a JR |
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)); | |
315 | if (xmlbuff) { | |
316 | upnp_igd_print(igd_ctxt, level, "ActRequest = %s", xmlbuff); | |
317 | ixmlFreeDOMString(xmlbuff); | |
dcc4ee79 | 318 | @@ -227,8 +226,8 @@ |
d8296b8a JR |
319 | } else { |
320 | upnp_igd_print(igd_ctxt, level, "ActRequest = (null)"); | |
321 | } | |
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)); | |
326 | if (xmlbuff) { | |
327 | upnp_igd_print(igd_ctxt, level, "ActResult = %s", xmlbuff); | |
328 | ixmlFreeDOMString(xmlbuff); | |
dcc4ee79 | 329 | @@ -240,15 +239,14 @@ |
d8296b8a JR |
330 | break; |
331 | } | |
332 | case UPNP_CONTROL_ACTION_COMPLETE: { | |
333 | - struct Upnp_Action_Complete *a_event = | |
334 | - (struct Upnp_Action_Complete *)Event; | |
dcc4ee79 | 335 | + UpnpActionComplete *a_event = (UpnpActionComplete *)Event; |
d8296b8a JR |
336 | char *xmlbuff = NULL; |
337 | ||
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)); | |
347 | if (xmlbuff) { | |
348 | upnp_igd_print(igd_ctxt, level, "ActRequest = %s", xmlbuff); | |
349 | ixmlFreeDOMString(xmlbuff); | |
dcc4ee79 | 350 | @@ -257,8 +255,8 @@ |
d8296b8a JR |
351 | } else { |
352 | upnp_igd_print(igd_ctxt, level, "ActRequest = (null)"); | |
353 | } | |
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)); | |
358 | if (xmlbuff) { | |
359 | upnp_igd_print(igd_ctxt, level, "ActResult = %s", xmlbuff); | |
360 | ixmlFreeDOMString(xmlbuff); | |
dcc4ee79 | 361 | @@ -270,83 +268,77 @@ |
d8296b8a JR |
362 | break; |
363 | } | |
364 | case UPNP_CONTROL_GET_VAR_REQUEST: { | |
365 | - struct Upnp_State_Var_Request *sv_event = | |
366 | - (struct Upnp_State_Var_Request *)Event; | |
dcc4ee79 | 367 | + UpnpStateVarRequest *sv_event = (UpnpStateVarRequest *)Event; |
d8296b8a JR |
368 | |
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)); | |
382 | break; | |
383 | } | |
384 | case UPNP_CONTROL_GET_VAR_COMPLETE: { | |
385 | - struct Upnp_State_Var_Complete *sv_event = | |
386 | - (struct Upnp_State_Var_Complete *)Event; | |
dcc4ee79 | 387 | + UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event; |
d8296b8a JR |
388 | |
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)); | |
398 | break; | |
399 | } | |
400 | /* GENA */ | |
401 | case UPNP_EVENT_SUBSCRIPTION_REQUEST: { | |
402 | - struct Upnp_Subscription_Request *sr_event = | |
403 | - (struct Upnp_Subscription_Request *)Event; | |
dcc4ee79 | 404 | + UpnpSubscriptionRequest *sr_event = (UpnpSubscriptionRequest *)Event; |
d8296b8a JR |
405 | |
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)); | |
412 | break; | |
413 | } | |
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; | |
418 | ||
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)); | |
dcc4ee79 | 423 | + upnp_igd_print(igd_ctxt, level, "EventKey = %d", UpnpEvent_get_EventKey(e_event)); |
d8296b8a JR |
424 | + xmlbuff = ixmlPrintNode((IXML_Node *)UpnpEvent_get_ChangedVariables(e_event)); |
425 | upnp_igd_print(igd_ctxt, level, "ChangedVars = %s", xmlbuff); | |
426 | ixmlFreeDOMString(xmlbuff); | |
427 | xmlbuff = NULL; | |
428 | break; | |
429 | } | |
430 | case UPNP_EVENT_RENEWAL_COMPLETE: { | |
431 | - struct Upnp_Event_Subscribe *es_event = | |
432 | - (struct Upnp_Event_Subscribe *)Event; | |
dcc4ee79 | 433 | + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event; |
d8296b8a JR |
434 | |
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)); | |
442 | break; | |
443 | } | |
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; | |
dcc4ee79 | 448 | + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event; |
d8296b8a JR |
449 | |
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)); | |
459 | break; | |
460 | } | |
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; | |
dcc4ee79 | 465 | + UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event; |
d8296b8a JR |
466 | |
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)); | |
476 | break; | |
477 | } | |
478 | } | |
dcc4ee79 JB |
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 | |
d8296b8a JR |
481 | @@ -39,7 +39,7 @@ |
482 | ||
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); | |
348172d7 JB |
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, | |
493 | ||
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 | |
498 | build_upnp=true | |
499 | old_CFLAGS="$CFLAGS" | |
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])) | |
503 | CFLAGS="$old_CFLAGS" | |
504 | else | |
505 | - AC_MSG_ERROR([libupnp >= 1.6 < 1.5 required.]) | |
506 | + AC_MSG_ERROR([libupnp >= 1.8 required.]) | |
507 | fi], | |
508 | [if test "$build_upnp" == "true" ; then | |
509 | AC_MSG_ERROR([libupnp not found.]) |