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
c8cd93a9
Commit
c8cd93a9
authored
Aug 04, 2008
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a netbuffer directly instead of using gst_pad_buffer_alloc
parent
02c9ae59
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
configure.ac
configure.ac
+1
-0
gst/gstnicesrc.c
gst/gstnicesrc.c
+12
-9
gst/gstnicesrc.h
gst/gstnicesrc.h
+1
-2
No files found.
configure.ac
View file @
c8cd93a9
...
@@ -59,6 +59,7 @@ AS_IF([test "$with_gstreamer" != no], [
...
@@ -59,6 +59,7 @@ AS_IF([test "$with_gstreamer" != no], [
PKG_CHECK_MODULES(GST, [
PKG_CHECK_MODULES(GST, [
gstreamer-0.10 >= 0.10.0
gstreamer-0.10 >= 0.10.0
gstreamer-base-0.10 >= 0.10.0
gstreamer-base-0.10 >= 0.10.0
gstreamer-netbuffer-0.10 >= 0.10.0
],
],
[
[
with_gstreamer=yes
with_gstreamer=yes
...
...
gst/gstnicesrc.c
View file @
c8cd93a9
...
@@ -195,15 +195,18 @@ gst_nice_src_read_callback (NiceAgent *agent,
...
@@ -195,15 +195,18 @@ gst_nice_src_read_callback (NiceAgent *agent,
{
{
GstBaseSrc
*
basesrc
=
GST_BASE_SRC
(
data
);
GstBaseSrc
*
basesrc
=
GST_BASE_SRC
(
data
);
GstNiceSrc
*
nicesrc
=
GST_NICE_SRC
(
basesrc
);
GstNiceSrc
*
nicesrc
=
GST_NICE_SRC
(
basesrc
);
GstNetBuffer
*
mybuf
;
GST_LOG_OBJECT
(
agent
,
"Got buffer, getting out of the main loop"
);
GST_LOG_OBJECT
(
agent
,
"Got buffer, getting out of the main loop"
);
nicesrc
->
flow_ret
=
gst_pad_alloc_buffer
(
basesrc
->
srcpad
,
nicesrc
->
offset
,
mybuf
=
gst_netbuffer_new
();
len
,
GST_PAD_CAPS
(
basesrc
->
srcpad
),
&
nicesrc
->
outbuf
);
GST_BUFFER_MALLOCDATA
(
mybuf
)
=
g_memdup
(
buf
,
len
);
if
(
nicesrc
->
flow_ret
==
GST_FLOW_OK
)
{
GST_BUFFER_SIZE
(
mybuf
)
=
len
;
memcpy
(
nicesrc
->
outbuf
->
data
,
buf
,
len
);
GST_BUFFER_DATA
(
mybuf
)
=
GST_BUFFER_MALLOCDATA
(
mybuf
);
nicesrc
->
outbuf
->
size
=
len
;
if
(
GST_PAD_CAPS
(
basesrc
->
srcpad
))
}
GST_BUFFER_CAPS
(
mybuf
)
=
gst_caps_ref
(
GST_PAD_CAPS
(
basesrc
->
srcpad
));
nicesrc
->
outbuf
=
GST_BUFFER_CAST
(
mybuf
);
g_main_loop_quit
(
nicesrc
->
mainloop
);
g_main_loop_quit
(
nicesrc
->
mainloop
);
}
}
...
@@ -267,7 +270,6 @@ gst_nice_src_create (
...
@@ -267,7 +270,6 @@ gst_nice_src_create (
GST_LOG_OBJECT
(
nicesrc
,
"create called"
);
GST_LOG_OBJECT
(
nicesrc
,
"create called"
);
nicesrc
->
outbuf
=
NULL
;
nicesrc
->
outbuf
=
NULL
;
nicesrc
->
offset
=
offset
;
GST_OBJECT_LOCK
(
basesrc
);
GST_OBJECT_LOCK
(
basesrc
);
if
(
nicesrc
->
unlocked
)
{
if
(
nicesrc
->
unlocked
)
{
...
@@ -282,12 +284,13 @@ gst_nice_src_create (
...
@@ -282,12 +284,13 @@ gst_nice_src_create (
GST_LOG_OBJECT
(
nicesrc
,
"Got buffer, pushing"
);
GST_LOG_OBJECT
(
nicesrc
,
"Got buffer, pushing"
);
*
buffer
=
nicesrc
->
outbuf
;
*
buffer
=
nicesrc
->
outbuf
;
return
nicesrc
->
flow_ret
;
GST_BUFFER_OFFSET
(
*
buffer
)
=
offset
;
return
GST_FLOW_OK
;
}
else
{
}
else
{
GST_LOG_OBJECT
(
nicesrc
,
"Got interrupting, returning wrong-state"
);
GST_LOG_OBJECT
(
nicesrc
,
"Got interrupting, returning wrong-state"
);
return
GST_FLOW_WRONG_STATE
;
return
GST_FLOW_WRONG_STATE
;
}
}
}
}
static
void
static
void
...
...
gst/gstnicesrc.h
View file @
c8cd93a9
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
#include <gst/gst.h>
#include <gst/gst.h>
#include <gst/base/gstbasesrc.h>
#include <gst/base/gstbasesrc.h>
#include <gst/netbuffer/gstnetbuffer.h>
#include <nice/nice.h>
#include <nice/nice.h>
...
@@ -66,8 +67,6 @@ struct _GstNiceSrc
...
@@ -66,8 +67,6 @@ struct _GstNiceSrc
guint
stream_id
;
guint
stream_id
;
guint
component_id
;
guint
component_id
;
GMainLoop
*
mainloop
;
GMainLoop
*
mainloop
;
guint64
offset
;
GstFlowReturn
flow_ret
;
GstBuffer
*
outbuf
;
GstBuffer
*
outbuf
;
gboolean
unlocked
;
gboolean
unlocked
;
GSource
*
idle_source
;
GSource
*
idle_source
;
...
...
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