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
242b113f
Commit
242b113f
authored
Jan 27, 2012
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GstPushSrc as a base class
parent
e2383f9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
gst/gstnicesrc.c
gst/gstnicesrc.c
+7
-10
gst/gstnicesrc.h
gst/gstnicesrc.h
+3
-5
No files found.
gst/gstnicesrc.c
View file @
242b113f
...
@@ -50,9 +50,7 @@ GST_DEBUG_CATEGORY_STATIC (nicesrc_debug);
...
@@ -50,9 +50,7 @@ GST_DEBUG_CATEGORY_STATIC (nicesrc_debug);
static
GstFlowReturn
static
GstFlowReturn
gst_nice_src_create
(
gst_nice_src_create
(
GstBaseSrc
*
basesrc
,
GstPushSrc
*
basesrc
,
guint64
offset
,
guint
length
,
GstBuffer
**
buffer
);
GstBuffer
**
buffer
);
static
gboolean
static
gboolean
...
@@ -93,7 +91,7 @@ GST_STATIC_PAD_TEMPLATE (
...
@@ -93,7 +91,7 @@ GST_STATIC_PAD_TEMPLATE (
GST_PAD_ALWAYS
,
GST_PAD_ALWAYS
,
GST_STATIC_CAPS_ANY
);
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
enum
{
{
...
@@ -106,6 +104,7 @@ enum
...
@@ -106,6 +104,7 @@ enum
static
void
static
void
gst_nice_src_class_init
(
GstNiceSrcClass
*
klass
)
gst_nice_src_class_init
(
GstNiceSrcClass
*
klass
)
{
{
GstPushSrcClass
*
gstpushsrc_class
;
GstBaseSrcClass
*
gstbasesrc_class
;
GstBaseSrcClass
*
gstbasesrc_class
;
GstElementClass
*
gstelement_class
;
GstElementClass
*
gstelement_class
;
GObjectClass
*
gobject_class
;
GObjectClass
*
gobject_class
;
...
@@ -113,8 +112,10 @@ gst_nice_src_class_init (GstNiceSrcClass *klass)
...
@@ -113,8 +112,10 @@ gst_nice_src_class_init (GstNiceSrcClass *klass)
GST_DEBUG_CATEGORY_INIT
(
nicesrc_debug
,
"nicesrc"
,
GST_DEBUG_CATEGORY_INIT
(
nicesrc_debug
,
"nicesrc"
,
0
,
"libnice source"
);
0
,
"libnice source"
);
gstpushsrc_class
=
(
GstPushSrcClass
*
)
klass
;
gstpushsrc_class
->
create
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_create
);
gstbasesrc_class
=
(
GstBaseSrcClass
*
)
klass
;
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
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_unlock
);
gstbasesrc_class
->
unlock_stop
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_unlock_stop
);
gstbasesrc_class
->
unlock_stop
=
GST_DEBUG_FUNCPTR
(
gst_nice_src_unlock_stop
);
...
@@ -262,17 +263,13 @@ gst_nice_src_unlock_stop (GstBaseSrc *src)
...
@@ -262,17 +263,13 @@ gst_nice_src_unlock_stop (GstBaseSrc *src)
static
GstFlowReturn
static
GstFlowReturn
gst_nice_src_create
(
gst_nice_src_create
(
GstBaseSrc
*
basesrc
,
GstPushSrc
*
basesrc
,
guint64
offset
,
guint
length
,
GstBuffer
**
buffer
)
GstBuffer
**
buffer
)
{
{
GstNiceSrc
*
nicesrc
=
GST_NICE_SRC
(
basesrc
);
GstNiceSrc
*
nicesrc
=
GST_NICE_SRC
(
basesrc
);
GST_LOG_OBJECT
(
nicesrc
,
"create called"
);
GST_LOG_OBJECT
(
nicesrc
,
"create called"
);
nicesrc
->
offset
=
offset
;
GST_OBJECT_LOCK
(
basesrc
);
GST_OBJECT_LOCK
(
basesrc
);
if
(
nicesrc
->
unlocked
)
{
if
(
nicesrc
->
unlocked
)
{
GST_OBJECT_UNLOCK
(
basesrc
);
GST_OBJECT_UNLOCK
(
basesrc
);
...
...
gst/gstnicesrc.h
View file @
242b113f
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
#define _GSTNICESRC_H
#define _GSTNICESRC_H
#include <gst/gst.h>
#include <gst/gst.h>
#include <gst/base/gst
base
src.h>
#include <gst/base/gst
push
src.h>
#include <nice/nice.h>
#include <nice/nice.h>
...
@@ -60,15 +60,13 @@ typedef struct _GstNiceSrc GstNiceSrc;
...
@@ -60,15 +60,13 @@ typedef struct _GstNiceSrc GstNiceSrc;
struct
_GstNiceSrc
struct
_GstNiceSrc
{
{
Gst
Base
Src
parent
;
Gst
Push
Src
parent
;
GstPad
*
srcpad
;
GstPad
*
srcpad
;
NiceAgent
*
agent
;
NiceAgent
*
agent
;
guint
stream_id
;
guint
stream_id
;
guint
component_id
;
guint
component_id
;
GMainContext
*
mainctx
;
GMainContext
*
mainctx
;
GMainLoop
*
mainloop
;
GMainLoop
*
mainloop
;
guint64
offset
;
GstFlowReturn
flow_ret
;
GQueue
*
outbufs
;
GQueue
*
outbufs
;
gboolean
unlocked
;
gboolean
unlocked
;
GSource
*
idle_source
;
GSource
*
idle_source
;
...
@@ -78,7 +76,7 @@ typedef struct _GstNiceSrcClass GstNiceSrcClass;
...
@@ -78,7 +76,7 @@ typedef struct _GstNiceSrcClass GstNiceSrcClass;
struct
_GstNiceSrcClass
struct
_GstNiceSrcClass
{
{
Gst
Base
SrcClass
parent_class
;
Gst
Push
SrcClass
parent_class
;
};
};
GType
gst_nice_src_get_type
(
void
);
GType
gst_nice_src_get_type
(
void
);
...
...
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