Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mediastreamer2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
mediastreamer2
Commits
b21f3042
Commit
b21f3042
authored
Jan 24, 2013
by
Yann Diorcet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create macro for use old and new version of libupnp
parent
2deac9e3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
upnp_igd.c
src/upnp/upnp_igd.c
+7
-6
upnp_igd_cmd.c
src/upnp/upnp_igd_cmd.c
+3
-2
upnp_igd_private.h
src/upnp/upnp_igd_private.h
+6
-0
upnp_igd_utils.c
src/upnp/upnp_igd_utils.c
+1
-0
No files found.
src/upnp/upnp_igd.c
View file @
b21f3042
...
...
@@ -2,6 +2,7 @@
#include "upnp_igd_utils.h"
#include "upnp_igd_private.h"
#include <string.h>
#include <stdlib.h>
#include <upnp.h>
#include <upnptools.h>
...
...
@@ -872,7 +873,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
,
a_event
->
CtrlUrl
,
a_event
->
ActionRequest
,
a_event
->
ActionResult
);
upnp_igd_handle_send_action
(
igd_ctxt
,
UPNP_STRING
(
a_event
->
CtrlUrl
)
,
a_event
->
ActionRequest
,
a_event
->
ActionResult
);
}
}
break
;
...
...
@@ -882,7 +883,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
,
sv_event
->
CtrlUrl
,
sv_event
->
StateVarName
,
sv_event
->
CurrentVal
);
upnp_igd_handle_get_var
(
igd_ctxt
,
UPNP_STRING
(
sv_event
->
CtrlUrl
)
,
sv_event
->
StateVarName
,
sv_event
->
CurrentVal
);
}
}
break
;
...
...
@@ -901,7 +902,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
,
es_event
->
PublisherUrl
,
es_event
->
Sid
,
es_event
->
TimeOut
);
upnp_igd_handle_subscribe_update
(
igd_ctxt
,
UPNP_STRING
(
es_event
->
PublisherUrl
)
,
es_event
->
Sid
,
es_event
->
TimeOut
);
}
}
break
;
...
...
@@ -912,10 +913,10 @@ int upnp_igd_callback(Upnp_EventType event_type, void* event, void *cookie) {
Upnp_SID
newSID
;
int
ret
;
ret
=
UpnpSubscribe
(
igd_ctxt
->
upnp_handle
,
es_event
->
PublisherUrl
,
&
TimeOut
,
newSID
);
ret
=
UpnpSubscribe
(
igd_ctxt
->
upnp_handle
,
UPNP_STRING
(
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
,
es_event
->
PublisherUrl
,
newSID
,
TimeOut
);
upnp_igd_handle_subscribe_update
(
igd_ctxt
,
UPNP_STRING
(
es_event
->
PublisherUrl
)
,
newSID
,
TimeOut
);
}
else
{
upnp_igd_print
(
igd_ctxt
,
UPNP_IGD_ERROR
,
"Error Subscribing to EventURL -- %d"
,
ret
);
}
...
...
@@ -951,7 +952,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
=
NULL
;
igd_ctxt
->
timer_thread
=
(
ithread_t
)
NULL
;
/* Initialize print mutex */
{
...
...
src/upnp/upnp_igd_cmd.c
View file @
b21f3042
#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
;
...
...
@@ -72,7 +73,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
,
a_event
->
CtrlUrl
,
a_event
->
ActionRequest
,
a_event
->
ActionResult
);
upnp_igd_port_mapping_handle_action
(
igd_port_mapping_ctxt
,
a_event
->
ErrCode
,
UPNP_STRING
(
a_event
->
CtrlUrl
)
,
a_event
->
ActionRequest
,
a_event
->
ActionResult
);
}
break
;
...
...
src/upnp/upnp_igd_private.h
View file @
b21f3042
...
...
@@ -62,6 +62,12 @@ 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
[];
...
...
src/upnp/upnp_igd_utils.c
View file @
b21f3042
...
...
@@ -32,6 +32,7 @@
#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
,
...)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment