Added pulregion handling.

Original commit message from CVS:
Added pulregion handling.
Added GstCapsListFactory in headers
This commit is contained in:
Wim Taymans 2000-12-06 23:04:12 +00:00
parent 855b6877e9
commit 1af7640685
6 changed files with 40 additions and 4 deletions

View file

@ -123,6 +123,7 @@ gst_asyncdisksrc_init (GstAsyncDiskSrc *asyncdisksrc)
g_print("init\n");
asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
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
gst_element_add_pad (GST_ELEMENT (asyncdisksrc), asyncdisksrc->srcpad);

View file

@ -576,9 +576,19 @@ gst_bin_pullsrc_wrapper (int argc,char *argv[])
while (pads) {
pad = GST_PAD (pads->data);
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);
}
}
pads = g_list_next(pads);
}
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
@ -732,7 +742,7 @@ gst_bin_create_plan_func (GstBin *bin)
}
if (!pad->pullfunc)
pad->pullfunc = gst_bin_pullfunc_proxy;
if (!pad->pullfunc)
if (!pad->pullregionfunc)
pad->pullregionfunc = gst_bin_pullregionfunc_proxy;
/* we only worry about sink pads */

View file

@ -57,6 +57,10 @@ gst_caps_create_entry (GstCapsFactory factory, gint *skipped)
case GST_CAPS_LIST_ID:
g_print("gstcaps: list not allowed in list\n");
break;
case GST_CAPS_BOOL_ID:
entry->capstype = GST_CAPS_BOOL_ID_NUM;
entry->data.bool_data = GPOINTER_TO_INT (factory[i++]);
break;
default:
g_print("gstcaps: unknown caps id found\n");
g_free (entry);
@ -181,7 +185,7 @@ gst_caps_dump_entry_func (GstCapsEntry *entry)
entry->data.int_range_data.max);
break;
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;
case GST_CAPS_BOOL_ID_NUM:
g_print("gstcaps: boolean %d\n", entry->data.bool_data);

View file

@ -26,6 +26,7 @@
typedef struct _GstCaps GstCaps;
typedef gpointer GstCapsFactoryEntry;
typedef GstCapsFactoryEntry GstCapsFactory[];
typedef GstCapsFactory *GstCapsListFactory[];
typedef enum {
GST_CAPS_END_ID_NUM = 0,

View file

@ -245,6 +245,25 @@ gst_pad_set_pull_function (GstPad *pad,
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:
* @pad: the pad to set the chain function for

View file

@ -123,6 +123,7 @@ gst_asyncdisksrc_init (GstAsyncDiskSrc *asyncdisksrc)
g_print("init\n");
asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
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
gst_element_add_pad (GST_ELEMENT (asyncdisksrc), asyncdisksrc->srcpad);