Commit b6e90f61 authored by Yann Diorcet's avatar Yann Diorcet
Browse files

Revert "Create macro for use old and new version of libupnp"

This reverts commit b21f3042.
parent 519e6803
......@@ -2,7 +2,6 @@
#include "upnp_igd_utils.h"
#include "upnp_igd_private.h"
#include <string.h>
#include <stdlib.h>
#include <upnp.h>
#include <upnptools.h>
......@@ -873,7 +872,7 @@ int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
if (a_event->ErrCode != UPNP_E_SUCCESS) {
upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Action Complete Callback -- %d", a_event->ErrCode);
} else {
upnp_igd_handle_send_action(igd_ctxt, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
upnp_igd_handle_send_action(igd_ctxt, a_event->CtrlUrl, a_event->ActionRequest, a_event->ActionResult);
}
}
break;
......@@ -883,7 +882,7 @@ int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
if (sv_event->ErrCode != UPNP_E_SUCCESS) {
upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Get Var Complete Callback -- %d", sv_event->ErrCode);
} else {
upnp_igd_handle_get_var(igd_ctxt, UPNP_STRING(sv_event->CtrlUrl), sv_event->StateVarName, sv_event->CurrentVal);
upnp_igd_handle_get_var(igd_ctxt, sv_event->CtrlUrl, sv_event->StateVarName, sv_event->CurrentVal);
}
}
break;
......@@ -902,7 +901,7 @@ int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
if (es_event->ErrCode != UPNP_E_SUCCESS) {
upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Event Subscribe Callback -- %d", es_event->ErrCode);
} else {
upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), es_event->Sid, es_event->TimeOut);
upnp_igd_handle_subscribe_update(igd_ctxt, es_event->PublisherUrl, es_event->Sid, es_event->TimeOut);
}
}
break;
......@@ -913,10 +912,10 @@ int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
Upnp_SID newSID;
int ret;
ret = UpnpSubscribe(igd_ctxt->upnp_handle, UPNP_STRING(es_event->PublisherUrl), &TimeOut, newSID);
ret = UpnpSubscribe(igd_ctxt->upnp_handle, es_event->PublisherUrl, &TimeOut, newSID);
if (ret == UPNP_E_SUCCESS) {
upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribed to EventURL with SID=%s", newSID);
upnp_igd_handle_subscribe_update(igd_ctxt, UPNP_STRING(es_event->PublisherUrl), newSID, TimeOut);
upnp_igd_handle_subscribe_update(igd_ctxt, es_event->PublisherUrl, newSID, TimeOut);
} else {
upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error Subscribing to EventURL -- %d", ret);
}
......@@ -952,7 +951,7 @@ upnp_igd_context* upnp_igd_create(upnp_igd_callback_function cb_fct, upnp_igd_pr
igd_ctxt->callback_fct = cb_fct;
igd_ctxt->cookie = cookie;
igd_ctxt->upnp_handle = -1;
igd_ctxt->timer_thread = (ithread_t)NULL;
igd_ctxt->timer_thread = NULL;
/* Initialize print mutex */
{
......
#include "mediastreamer2/upnp_igd.h"
#include "upnp_igd_private.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
typedef struct _upnp_igd_port_mapping_context {
upnp_igd_context *igd_ctxt;
......@@ -73,7 +72,7 @@ int upnp_igd_port_mapping_callback(Upnp_EventType event_type, void* event, void
switch(event_type) {
case UPNP_CONTROL_ACTION_COMPLETE: {
struct Upnp_Action_Complete *a_event = (struct Upnp_Action_Complete *)event;
upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, a_event->ErrCode, UPNP_STRING(a_event->CtrlUrl), a_event->ActionRequest, a_event->ActionResult);
upnp_igd_port_mapping_handle_action(igd_port_mapping_ctxt, a_event->ErrCode, a_event->CtrlUrl, a_event->ActionRequest, a_event->ActionResult);
}
break;
......
......@@ -62,12 +62,6 @@ struct _upnp_igd_context {
};
#if UPNP_VERSION <= 10606
#define UPNP_STRING(x) (x)
#else
#define UPNP_STRING(x) UpnpString_get_String(x)
#endif
extern const char *IGDDeviceType;
extern const char *IGDServiceType[];
extern const char *IGDServiceName[];
......
......@@ -32,7 +32,6 @@
#include "upnp_igd_utils.h"
#include "upnp_igd_private.h"
#include <upnptools.h>
#include <string.h>
#include <stdlib.h>
void upnp_igd_print(upnp_igd_context *uIGD, upnp_igd_print_level level, const char *fmt, ...) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment