Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
libnice
libnice
Commits
242b113f
Commit
242b113f
authored
Jan 27, 2012
by
Olivier Crête
👻
Browse files
Use GstPushSrc as a base class
parent
e2383f9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
gst/gstnicesrc.c
View file @
242b113f
...
...
@@ -50,9 +50,7 @@ GST_DEBUG_CATEGORY_STATIC (nicesrc_debug);
static
GstFlowReturn
gst_nice_src_create
(
GstBaseSrc
*
basesrc
,
guint64
offset
,
guint
length
,
GstPushSrc
*
basesrc
,
GstBuffer
**
buffer
);
static
gboolean
...
...
@@ -93,7 +91,7 @@ GST_STATIC_PAD_TEMPLATE (
GST_PAD_ALWAYS
,
GST_STATIC_CAPS_ANY
);
G_DEFINE_TYPE
(
GstNiceSrc
,
gst_nice_src
,
GST_TYPE_
BASE
_SRC
);
G_DEFINE_TYPE
(
GstNiceSrc
,
gst_nice_src
,
GST_TYPE_
PUSH
_SRC
);
enum
{
...
...
@@ -106,6 +104,7 @@ enum
static
void
gst_nice_src_class_init
(
GstNiceSrcClass
*
klass
)
{
GstPushSrcClass
*
gstpushsrc_class
;
GstBaseSrcClass
*
gstbasesrc_class
;
GstElementClass
*
gstelement_class
;
GObjectClass
*
gobject_class
;
...
...
@@ -113,8 +112,10 @@ gst_nice_src_class_init (GstNiceSrcClass *klass)
GST_DEBUG_CATEGORY_INIT
(
nicesrc_debug
,
"nicesrc"
,
0
,
"libnice source"
);
gstpushsrc_class
=
(
GstPushSrcClass
*
)
klass
;
gstpushsrc_class
->
create
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_create
);
gstbasesrc_class
=
(
GstBaseSrcClass
*
)
klass
;
gstbasesrc_class
->
create
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_create
);
gstbasesrc_class
->
unlock
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_unlock
);
gstbasesrc_class
->
unlock_stop
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_unlock_stop
);
...
...
@@ -262,17 +263,13 @@ gst_nice_src_unlock_stop (GstBaseSrc *src)
static
GstFlowReturn
gst_nice_src_create
(
GstBaseSrc
*
basesrc
,
guint64
offset
,
guint
length
,
GstPushSrc
*
basesrc
,
GstBuffer
**
buffer
)
{
GstNiceSrc
*
nicesrc
=
GST_NICE_SRC
(
basesrc
);
GST_LOG_OBJECT
(
nicesrc
,
"create called"
);
nicesrc
->
offset
=
offset
;
GST_OBJECT_LOCK
(
basesrc
);
if
(
nicesrc
->
unlocked
)
{
GST_OBJECT_UNLOCK
(
basesrc
);
...
...
gst/gstnicesrc.h
View file @
242b113f
...
...
@@ -39,7 +39,7 @@
#define _GSTNICESRC_H
#include <gst/gst.h>
#include <gst/base/gst
base
src.h>
#include <gst/base/gst
push
src.h>
#include <nice/nice.h>
...
...
@@ -60,15 +60,13 @@ typedef struct _GstNiceSrc GstNiceSrc;
struct
_GstNiceSrc
{
Gst
Base
Src
parent
;
Gst
Push
Src
parent
;
GstPad
*
srcpad
;
NiceAgent
*
agent
;
guint
stream_id
;
guint
component_id
;
GMainContext
*
mainctx
;
GMainLoop
*
mainloop
;
guint64
offset
;
GstFlowReturn
flow_ret
;
GQueue
*
outbufs
;
gboolean
unlocked
;
GSource
*
idle_source
;
...
...
@@ -78,7 +76,7 @@ typedef struct _GstNiceSrcClass GstNiceSrcClass;
struct
_GstNiceSrcClass
{
Gst
Base
SrcClass
parent_class
;
Gst
Push
SrcClass
parent_class
;
};
GType
gst_nice_src_get_type
(
void
);
...
...
Write
Preview
Supports
Markdown
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