Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
0e9dcfae
Commit
0e9dcfae
authored
Sep 13, 2012
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile the plugin for both GStreamer 0.10 and 1.0
Revert this patch to drop GStreamer 0.10 support
parent
322e89ad
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
19 deletions
+96
-19
Makefile.am
Makefile.am
+2
-7
configure.ac
configure.ac
+31
-4
gst/Makefile.am
gst/Makefile.am
+26
-6
gst/gstnice.c
gst/gstnice.c
+7
-1
gst/gstnicesink.c
gst/gstnicesink.c
+13
-1
gst/gstnicesrc.c
gst/gstnicesrc.c
+17
-0
No files found.
Makefile.am
View file @
0e9dcfae
...
@@ -8,21 +8,16 @@
...
@@ -8,21 +8,16 @@
include
common.mk
include
common.mk
ALWAYS_
SUBDIRS
=
\
SUBDIRS
=
\
stun
\
stun
\
socket
\
socket
\
random
\
random
\
agent
\
agent
\
nice
\
nice
\
gst
\
docs
\
docs
\
tests
tests
SUBDIRS
=
$(ALWAYS_SUBDIRS)
if
WITH_GSTREAMER
SUBDIRS
+=
gst
endif
DIST_SUBDIRS
=
$(ALWAYS_SUBDIRS)
gst
DISTCHECK_CONFIGURE_FLAGS
=
--disable-assert
-enable-gtk-doc
DISTCHECK_CONFIGURE_FLAGS
=
--disable-assert
-enable-gtk-doc
EXTRA_DIST
=
\
EXTRA_DIST
=
\
...
...
configure.ac
View file @
0e9dcfae
...
@@ -111,15 +111,20 @@ PKG_CHECK_MODULES(GLIB, [dnl
...
@@ -111,15 +111,20 @@ PKG_CHECK_MODULES(GLIB, [dnl
])
])
AC_ARG_WITH(gstreamer,
AC_ARG_WITH(gstreamer,
AC_HELP_STRING([--with-gstreamer], [
use GStreamer
]),
AC_HELP_STRING([--with-gstreamer], [
build GStreamer plugin
]),
[with_gstreamer=${withval}],
[with_gstreamer=${withval}],
[with_gstreamer=auto])
[with_gstreamer=auto])
AC_ARG_WITH(gstreamer-0.10,
AC_HELP_STRING([--with-gstreamer-0.10], [build GStreamer 0.10 plugin]),
[with_gstreamer010=${withval}],
[with_gstreamer010=auto])
AS_IF([test "$with_gstreamer" != no], [
AS_IF([test "$with_gstreamer" != no], [
PKG_CHECK_MODULES(GST, [
PKG_CHECK_MODULES(GST, [
gstreamer-1.0 >= 0.11.1
gstreamer-1.0 >= 0.11.
9
1
gstreamer-base-1.0 >= 0.11.1
gstreamer-base-1.0 >= 0.11.
9
1
],
],
[
[
with_gstreamer=yes
with_gstreamer=yes
...
@@ -128,16 +133,38 @@ AS_IF([test "$with_gstreamer" != no], [
...
@@ -128,16 +133,38 @@ AS_IF([test "$with_gstreamer" != no], [
],
],
[
[
AS_IF([test "$with_gstreamer" = yes], [
AS_IF([test "$with_gstreamer" = yes], [
AC_MSG_ERROR([GStreamer
support was requested but GStreamer
libraries are not available])
AC_MSG_ERROR([GStreamer
1.0 support was requested but GStreamer 1.0
libraries are not available])
])
])
with_gstreamer=no
with_gstreamer=no
])
])
])
])
AS_IF([test "$with_gstreamer010" != no], [
PKG_CHECK_MODULES(GST010, [
gstreamer-0.10 >= 0.10.10
gstreamer-base-0.10 >= 0.10.10
],
[
with_gstreamer010=yes
GST_MAJORMINOR=0.10
gstplugin010dir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
],
[
AS_IF([test "$with_gstreamer010" = yes], [
AC_MSG_ERROR([GStreamer 0.10 support was requested but GStreamer 0.10 libraries are not available])
])
with_gstreamer010=no
])
])
AC_SUBST(gstplugindir)
AC_SUBST(gstplugindir)
AC_SUBST(gstplugin010dir)
AM_CONDITIONAL(WITH_GSTREAMER, test "$with_gstreamer" = yes)
AM_CONDITIONAL(WITH_GSTREAMER, test "$with_gstreamer" = yes)
AM_CONDITIONAL(WITH_GSTREAMER010, test "$with_gstreamer010" = yes)
GUPNP_IGD_REQUIRED=0.1.2
GUPNP_IGD_REQUIRED=0.1.2
...
...
gst/Makefile.am
View file @
0e9dcfae
...
@@ -7,22 +7,22 @@
...
@@ -7,22 +7,22 @@
# Licensed under MPL 1.1/LGPL 2.1. See file COPYING.
# Licensed under MPL 1.1/LGPL 2.1. See file COPYING.
AM_CFLAGS
=
$(LIBNICE_CFLAGS)
\
AM_CFLAGS
=
$(LIBNICE_CFLAGS)
\
$(GST_CFLAGS)
\
-I
$(top_srcdir)
\
-I
$(top_srcdir)
\
-I
$(top_srcdir)
/socket
\
-I
$(top_srcdir)
/socket
\
-I
$(top_srcdir)
/agent
\
-I
$(top_srcdir)
/agent
\
-I
$(top_srcdir)
/random
\
-I
$(top_srcdir)
/random
\
-I
$(top_srcdir)
/stun
\
-I
$(top_srcdir)
/stun
-DGST_USE_UNSTABLE_API
COMMON_LDADD
=
\
COMMON_LIBADD
=
\
$(GST_LIBS)
\
$(top_builddir)
/nice/libnice.la
$(top_builddir)
/nice/libnice.la
# libgstnice
# libgstnice
if
WITH_GSTREAMER
gstplugin_LTLIBRARIES
=
libgstnice.la
gstplugin_LTLIBRARIES
=
libgstnice.la
libgstnice_la_CFLAGS
=
$(AM_CFLAGS)
$(GST_CFLAGS)
-DGST_USE_UNSTABLE_API
libgstnice_la_SOURCES
=
\
libgstnice_la_SOURCES
=
\
gstnicesrc.h
\
gstnicesrc.h
\
gstnicesrc.c
\
gstnicesrc.c
\
...
@@ -31,6 +31,26 @@ libgstnice_la_SOURCES = \
...
@@ -31,6 +31,26 @@ libgstnice_la_SOURCES = \
gstnice.h
\
gstnice.h
\
gstnice.c
gstnice.c
libgstnice_la_LIBADD
=
$(COMMON_LDADD
)
libgstnice_la_LIBADD
=
$(COMMON_LIBADD)
$(GST_LIBS
)
libgstnice_la_LDFLAGS
=
-module
-avoid-version
libgstnice_la_LDFLAGS
=
-module
-avoid-version
endif
if
WITH_GSTREAMER010
gstplugin010_LTLIBRARIES
=
libgstnice010.la
libgstnice010_la_CFLAGS
=
$(AM_CFLAGS)
$(GST010_CFLAGS)
libgstnice010_la_SOURCES
=
\
gstnicesrc.h
\
gstnicesrc.c
\
gstnicesink.h
\
gstnicesink.c
\
gstnice.h
\
gstnice.c
libgstnice010_la_LIBADD
=
$(COMMON_LIBADD)
$(GST010_LIBS)
libgstnice010_la_LDFLAGS
=
-module
-avoid-version
endif
gst/gstnice.c
View file @
0e9dcfae
...
@@ -55,10 +55,16 @@ plugin_init (GstPlugin *plugin)
...
@@ -55,10 +55,16 @@ plugin_init (GstPlugin *plugin)
return
TRUE
;
return
TRUE
;
}
}
#if GST_CHECK_VERSION (1,0,0)
#define PLUGIN_NAME nice
#else
#define PLUGIN_NAME "nice"
#endif
GST_PLUGIN_DEFINE
(
GST_PLUGIN_DEFINE
(
GST_VERSION_MAJOR
,
GST_VERSION_MAJOR
,
GST_VERSION_MINOR
,
GST_VERSION_MINOR
,
nice
,
PLUGIN_NAME
,
"Interactive UDP connectivity establishment"
,
"Interactive UDP connectivity establishment"
,
plugin_init
,
VERSION
,
"LGPL"
,
PACKAGE_NAME
,
plugin_init
,
VERSION
,
"LGPL"
,
PACKAGE_NAME
,
"http://telepathy.freedesktop.org/wiki/"
);
"http://telepathy.freedesktop.org/wiki/"
);
...
...
gst/gstnicesink.c
View file @
0e9dcfae
...
@@ -110,7 +110,12 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
...
@@ -110,7 +110,12 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
gst_element_class_add_pad_template
(
gstelement_class
,
gst_element_class_add_pad_template
(
gstelement_class
,
gst_static_pad_template_get
(
&
gst_nice_sink_sink_template
));
gst_static_pad_template_get
(
&
gst_nice_sink_sink_template
));
gst_element_class_set_metadata
(
gstelement_class
,
"ICE sink"
,
#if GST_CHECK_VERSION (1,0,0)
gst_element_class_set_metadata
(
gstelement_class
,
#else
gst_element_class_set_details_simple
(
gstelement_class
,
#endif
"ICE sink"
,
"Sink"
,
"Sink"
,
"Interactive UDP connectivity establishment"
,
"Interactive UDP connectivity establishment"
,
"Dafydd Harries <dafydd.harries@collabora.co.uk>"
);
"Dafydd Harries <dafydd.harries@collabora.co.uk>"
);
...
@@ -154,6 +159,8 @@ static GstFlowReturn
...
@@ -154,6 +159,8 @@ static GstFlowReturn
gst_nice_sink_render
(
GstBaseSink
*
basesink
,
GstBuffer
*
buffer
)
gst_nice_sink_render
(
GstBaseSink
*
basesink
,
GstBuffer
*
buffer
)
{
{
GstNiceSink
*
nicesink
=
GST_NICE_SINK
(
basesink
);
GstNiceSink
*
nicesink
=
GST_NICE_SINK
(
basesink
);
#if GST_CHECK_VERSION (1,0,0)
GstMapInfo
info
;
GstMapInfo
info
;
gst_buffer_map
(
buffer
,
&
info
,
GST_MAP_READ
);
gst_buffer_map
(
buffer
,
&
info
,
GST_MAP_READ
);
...
@@ -162,6 +169,11 @@ gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer)
...
@@ -162,6 +169,11 @@ gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer)
nicesink
->
component_id
,
info
.
size
,
(
gchar
*
)
info
.
data
);
nicesink
->
component_id
,
info
.
size
,
(
gchar
*
)
info
.
data
);
gst_buffer_unmap
(
buffer
,
&
info
);
gst_buffer_unmap
(
buffer
,
&
info
);
#else
nice_agent_send
(
nicesink
->
agent
,
nicesink
->
stream_id
,
nicesink
->
component_id
,
GST_BUFFER_SIZE
(
buffer
),
(
gchar
*
)
GST_BUFFER_DATA
(
buffer
));
#endif
return
GST_FLOW_OK
;
return
GST_FLOW_OK
;
}
}
...
...
gst/gstnicesrc.c
View file @
0e9dcfae
...
@@ -129,7 +129,11 @@ gst_nice_src_class_init (GstNiceSrcClass *klass)
...
@@ -129,7 +129,11 @@ gst_nice_src_class_init (GstNiceSrcClass *klass)
gst_element_class_add_pad_template
(
gstelement_class
,
gst_element_class_add_pad_template
(
gstelement_class
,
gst_static_pad_template_get
(
&
gst_nice_src_src_template
));
gst_static_pad_template_get
(
&
gst_nice_src_src_template
));
#if GST_CHECK_VERSION (1,0,0)
gst_element_class_set_metadata
(
gstelement_class
,
gst_element_class_set_metadata
(
gstelement_class
,
#else
gst_element_class_set_details_simple
(
gstelement_class
,
#endif
"ICE source"
,
"ICE source"
,
"Source"
,
"Source"
,
"Interactive UDP connectivity establishment"
,
"Interactive UDP connectivity establishment"
,
...
@@ -194,8 +198,13 @@ gst_nice_src_read_callback (NiceAgent *agent,
...
@@ -194,8 +198,13 @@ gst_nice_src_read_callback (NiceAgent *agent,
GST_LOG_OBJECT
(
agent
,
"Got buffer, getting out of the main loop"
);
GST_LOG_OBJECT
(
agent
,
"Got buffer, getting out of the main loop"
);
#if GST_CHECK_VERSION (1,0,0)
buffer
=
gst_buffer_new_allocate
(
NULL
,
len
,
NULL
);
buffer
=
gst_buffer_new_allocate
(
NULL
,
len
,
NULL
);
gst_buffer_fill
(
buffer
,
0
,
buf
,
len
);
gst_buffer_fill
(
buffer
,
0
,
buf
,
len
);
#else
buffer
=
gst_buffer_new_and_alloc
(
len
);
memcpy
(
GST_BUFFER_DATA
(
buffer
),
buf
,
len
);
#endif
g_queue_push_tail
(
nicesrc
->
outbufs
,
buffer
);
g_queue_push_tail
(
nicesrc
->
outbufs
,
buffer
);
g_main_loop_quit
(
nicesrc
->
mainloop
);
g_main_loop_quit
(
nicesrc
->
mainloop
);
...
@@ -270,7 +279,11 @@ gst_nice_src_create (
...
@@ -270,7 +279,11 @@ gst_nice_src_create (
GST_OBJECT_LOCK
(
basesrc
);
GST_OBJECT_LOCK
(
basesrc
);
if
(
nicesrc
->
unlocked
)
{
if
(
nicesrc
->
unlocked
)
{
GST_OBJECT_UNLOCK
(
basesrc
);
GST_OBJECT_UNLOCK
(
basesrc
);
#if GST_CHECK_VERSION (1,0,0)
return
GST_FLOW_FLUSHING
;
return
GST_FLOW_FLUSHING
;
#else
return
GST_FLOW_WRONG_STATE
;
#endif
}
}
GST_OBJECT_UNLOCK
(
basesrc
);
GST_OBJECT_UNLOCK
(
basesrc
);
...
@@ -283,7 +296,11 @@ gst_nice_src_create (
...
@@ -283,7 +296,11 @@ gst_nice_src_create (
return
GST_FLOW_OK
;
return
GST_FLOW_OK
;
}
else
{
}
else
{
GST_LOG_OBJECT
(
nicesrc
,
"Got interrupting, returning wrong-state"
);
GST_LOG_OBJECT
(
nicesrc
,
"Got interrupting, returning wrong-state"
);
#if GST_CHECK_VERSION (1,0,0)
return
GST_FLOW_FLUSHING
;
return
GST_FLOW_FLUSHING
;
#else
return
GST_FLOW_WRONG_STATE
;
#endif
}
}
}
}
...
...
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