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
GStreamer
gstreamer
Commits
4760e190
Commit
4760e190
authored
Nov 10, 2011
by
Wim Taymans
Browse files
pushsrc: make alloc method a vmethod
parent
41bb4161
Changes
2
Hide whitespace changes
Inline
Side-by-side
libs/gst/base/gstpushsrc.c
View file @
4760e190
...
...
@@ -72,6 +72,8 @@ G_DEFINE_TYPE_WITH_CODE (GstPushSrc, gst_push_src, GST_TYPE_BASE_SRC, _do_init);
static
gboolean
gst_push_src_query
(
GstBaseSrc
*
src
,
GstQuery
*
query
);
static
GstFlowReturn
gst_push_src_create
(
GstBaseSrc
*
bsrc
,
guint64
offset
,
guint
length
,
GstBuffer
**
ret
);
static
GstFlowReturn
gst_push_src_alloc
(
GstBaseSrc
*
bsrc
,
guint64
offset
,
guint
length
,
GstBuffer
**
ret
);
static
GstFlowReturn
gst_push_src_fill
(
GstBaseSrc
*
bsrc
,
guint64
offset
,
guint
length
,
GstBuffer
*
ret
);
...
...
@@ -81,6 +83,7 @@ gst_push_src_class_init (GstPushSrcClass * klass)
GstBaseSrcClass
*
gstbasesrc_class
=
(
GstBaseSrcClass
*
)
klass
;
gstbasesrc_class
->
create
=
GST_DEBUG_FUNCPTR
(
gst_push_src_create
);
gstbasesrc_class
->
alloc
=
GST_DEBUG_FUNCPTR
(
gst_push_src_alloc
);
gstbasesrc_class
->
fill
=
GST_DEBUG_FUNCPTR
(
gst_push_src_fill
);
gstbasesrc_class
->
query
=
GST_DEBUG_FUNCPTR
(
gst_push_src_query
);
}
...
...
@@ -132,6 +135,24 @@ gst_push_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
return
fret
;
}
static
GstFlowReturn
gst_push_src_alloc
(
GstBaseSrc
*
bsrc
,
guint64
offset
,
guint
length
,
GstBuffer
**
ret
)
{
GstFlowReturn
fret
;
GstPushSrc
*
src
;
GstPushSrcClass
*
pclass
;
src
=
GST_PUSH_SRC
(
bsrc
);
pclass
=
GST_PUSH_SRC_GET_CLASS
(
src
);
if
(
pclass
->
alloc
)
fret
=
pclass
->
alloc
(
src
,
ret
);
else
fret
=
GST_BASE_SRC_CLASS
(
parent_class
)
->
alloc
(
bsrc
,
offset
,
length
,
ret
);
return
fret
;
}
static
GstFlowReturn
gst_push_src_fill
(
GstBaseSrc
*
bsrc
,
guint64
offset
,
guint
length
,
GstBuffer
*
ret
)
...
...
libs/gst/base/gstpushsrc.h
View file @
4760e190
...
...
@@ -54,11 +54,13 @@ struct _GstPushSrc {
struct
_GstPushSrcClass
{
GstBaseSrcClass
parent_class
;
/* ask the subclass to create a buffer */
/* ask the subclass to create a buffer, the default implementation
* uses alloc and fill */
GstFlowReturn
(
*
create
)
(
GstPushSrc
*
src
,
GstBuffer
**
buf
);
/* allocate memory for a buffer */
GstFlowReturn
(
*
alloc
)
(
GstPushSrc
*
src
,
GstBuffer
**
buf
);
/* ask the subclass to fill a buffer */
GstFlowReturn
(
*
fill
)
(
GstPushSrc
*
src
,
GstBuffer
*
buf
);
GstFlowReturn
(
*
fill
)
(
GstPushSrc
*
src
,
GstBuffer
*
buf
);
/*< private >*/
gpointer
_gst_reserved
[
GST_PADDING
];
...
...
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