Added pulregion handling.
authorWim Taymans <wim.taymans@gmail.com>
Wed, 6 Dec 2000 23:04:12 +0000 (23:04 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 6 Dec 2000 23:04:12 +0000 (23:04 +0000)
Original commit message from CVS:
Added pulregion handling.
Added GstCapsListFactory in headers

gst/elements/gstasyncdisksrc.c
gst/gstbin.c
gst/gstcaps.c
gst/gstcaps.h
gst/gstpad.c
plugins/elements/gstasyncdisksrc.c

index be1bc64..907c447 100644 (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);
 
index bb36bdf..84d912c 100644 (file)
@@ -576,8 +576,18 @@ 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);
-        (pad->pullfunc)(pad);
+        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);
     }
@@ -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 */
index f4d1704..58a0bc8 100644 (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);
index 62d95ba..20c4b6d 100644 (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,
index 67b9d1e..86be1ba 100644 (file)
@@ -246,6 +246,25 @@ gst_pad_set_pull_function (GstPad *pad,
 }
 
 /**
+ * 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
  * @chain: the chain function
index be1bc64..907c447 100644 (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);