mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-16 19:25:18 +00:00
Added pulregion handling.
Original commit message from CVS: Added pulregion handling. Added GstCapsListFactory in headers
This commit is contained in:
parent
855b6877e9
commit
1af7640685
6 changed files with 40 additions and 4 deletions
|
@ -123,6 +123,7 @@ gst_asyncdisksrc_init (GstAsyncDiskSrc *asyncdisksrc)
|
||||||
g_print("init\n");
|
g_print("init\n");
|
||||||
asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||||
gst_pad_set_pull_function (asyncdisksrc->srcpad,gst_asyncdisksrc_pull);
|
gst_pad_set_pull_function (asyncdisksrc->srcpad,gst_asyncdisksrc_pull);
|
||||||
|
gst_pad_set_pullregion_function (asyncdisksrc->srcpad,gst_asyncdisksrc_pull_region);
|
||||||
// FIXME must set pullregion
|
// FIXME must set pullregion
|
||||||
gst_element_add_pad (GST_ELEMENT (asyncdisksrc), asyncdisksrc->srcpad);
|
gst_element_add_pad (GST_ELEMENT (asyncdisksrc), asyncdisksrc->srcpad);
|
||||||
|
|
||||||
|
|
14
gst/gstbin.c
14
gst/gstbin.c
|
@ -576,9 +576,19 @@ gst_bin_pullsrc_wrapper (int argc,char *argv[])
|
||||||
while (pads) {
|
while (pads) {
|
||||||
pad = GST_PAD (pads->data);
|
pad = GST_PAD (pads->data);
|
||||||
if (pad->direction == GST_PAD_SRC) {
|
if (pad->direction == GST_PAD_SRC) {
|
||||||
if (pad->pullfunc == NULL) fprintf(stderr,"error, no pullfunc in \"%s\"\n", name);
|
region_struct *region = cothread_get_data (element->threadstate, "region");
|
||||||
|
if (region) {
|
||||||
|
//gst_src_push_region (GST_SRC (element), region->offset, region->size);
|
||||||
|
if (pad->pullregionfunc == NULL)
|
||||||
|
fprintf(stderr,"error, no pullregionfunc in \"%s\"\n", name);
|
||||||
|
(pad->pullregionfunc)(pad, region->offset, region->size);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (pad->pullfunc == NULL)
|
||||||
|
fprintf(stderr,"error, no pullfunc in \"%s\"\n", name);
|
||||||
(pad->pullfunc)(pad);
|
(pad->pullfunc)(pad);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pads = g_list_next(pads);
|
pads = g_list_next(pads);
|
||||||
}
|
}
|
||||||
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
|
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
|
||||||
|
@ -732,7 +742,7 @@ gst_bin_create_plan_func (GstBin *bin)
|
||||||
}
|
}
|
||||||
if (!pad->pullfunc)
|
if (!pad->pullfunc)
|
||||||
pad->pullfunc = gst_bin_pullfunc_proxy;
|
pad->pullfunc = gst_bin_pullfunc_proxy;
|
||||||
if (!pad->pullfunc)
|
if (!pad->pullregionfunc)
|
||||||
pad->pullregionfunc = gst_bin_pullregionfunc_proxy;
|
pad->pullregionfunc = gst_bin_pullregionfunc_proxy;
|
||||||
|
|
||||||
/* we only worry about sink pads */
|
/* we only worry about sink pads */
|
||||||
|
|
|
@ -57,6 +57,10 @@ gst_caps_create_entry (GstCapsFactory factory, gint *skipped)
|
||||||
case GST_CAPS_LIST_ID:
|
case GST_CAPS_LIST_ID:
|
||||||
g_print("gstcaps: list not allowed in list\n");
|
g_print("gstcaps: list not allowed in list\n");
|
||||||
break;
|
break;
|
||||||
|
case GST_CAPS_BOOL_ID:
|
||||||
|
entry->capstype = GST_CAPS_BOOL_ID_NUM;
|
||||||
|
entry->data.bool_data = GPOINTER_TO_INT (factory[i++]);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
g_print("gstcaps: unknown caps id found\n");
|
g_print("gstcaps: unknown caps id found\n");
|
||||||
g_free (entry);
|
g_free (entry);
|
||||||
|
@ -181,7 +185,7 @@ gst_caps_dump_entry_func (GstCapsEntry *entry)
|
||||||
entry->data.int_range_data.max);
|
entry->data.int_range_data.max);
|
||||||
break;
|
break;
|
||||||
case GST_CAPS_FOURCC_ID_NUM:
|
case GST_CAPS_FOURCC_ID_NUM:
|
||||||
g_print("gstcaps: fourcc 0x%08x (%4.4s)\n", entry->data.fourcc_data, &entry->data.fourcc_data);
|
g_print("gstcaps: fourcc 0x%08x (%4.4s)\n", entry->data.fourcc_data, (gchar *)&entry->data.fourcc_data);
|
||||||
break;
|
break;
|
||||||
case GST_CAPS_BOOL_ID_NUM:
|
case GST_CAPS_BOOL_ID_NUM:
|
||||||
g_print("gstcaps: boolean %d\n", entry->data.bool_data);
|
g_print("gstcaps: boolean %d\n", entry->data.bool_data);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
typedef struct _GstCaps GstCaps;
|
typedef struct _GstCaps GstCaps;
|
||||||
typedef gpointer GstCapsFactoryEntry;
|
typedef gpointer GstCapsFactoryEntry;
|
||||||
typedef GstCapsFactoryEntry GstCapsFactory[];
|
typedef GstCapsFactoryEntry GstCapsFactory[];
|
||||||
|
typedef GstCapsFactory *GstCapsListFactory[];
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GST_CAPS_END_ID_NUM = 0,
|
GST_CAPS_END_ID_NUM = 0,
|
||||||
|
|
19
gst/gstpad.c
19
gst/gstpad.c
|
@ -245,6 +245,25 @@ gst_pad_set_pull_function (GstPad *pad,
|
||||||
pad->pullfunc = pull;
|
pad->pullfunc = pull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_pad_set_pullregion_function:
|
||||||
|
* @pad: the pad to set the pull function for
|
||||||
|
* @pull: the pull function
|
||||||
|
*
|
||||||
|
* Set the given pull function for the pad
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_pad_set_pullregion_function (GstPad *pad,
|
||||||
|
GstPadPullRegionFunction pull)
|
||||||
|
{
|
||||||
|
g_return_if_fail (pad != NULL);
|
||||||
|
g_return_if_fail (GST_IS_PAD (pad));
|
||||||
|
|
||||||
|
g_print("gstpad: pad setting pullregion function\n");
|
||||||
|
|
||||||
|
pad->pullregionfunc = pull;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_pad_set_chain_function:
|
* gst_pad_set_chain_function:
|
||||||
* @pad: the pad to set the chain function for
|
* @pad: the pad to set the chain function for
|
||||||
|
|
|
@ -123,6 +123,7 @@ gst_asyncdisksrc_init (GstAsyncDiskSrc *asyncdisksrc)
|
||||||
g_print("init\n");
|
g_print("init\n");
|
||||||
asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||||
gst_pad_set_pull_function (asyncdisksrc->srcpad,gst_asyncdisksrc_pull);
|
gst_pad_set_pull_function (asyncdisksrc->srcpad,gst_asyncdisksrc_pull);
|
||||||
|
gst_pad_set_pullregion_function (asyncdisksrc->srcpad,gst_asyncdisksrc_pull_region);
|
||||||
// FIXME must set pullregion
|
// FIXME must set pullregion
|
||||||
gst_element_add_pad (GST_ELEMENT (asyncdisksrc), asyncdisksrc->srcpad);
|
gst_element_add_pad (GST_ELEMENT (asyncdisksrc), asyncdisksrc->srcpad);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue