ARG_LOCATION,
ARG_BYTESPERREAD,
ARG_OFFSET,
- ARG_SIZE,
+ ARG_FILESIZE,
};
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OFFSET,
g_param_spec_long("offset","offset","offset",
G_MINLONG,G_MAXLONG,0,G_PARAM_READWRITE)); // CHECKME
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SIZE,
- g_param_spec_long("size","size","size",
+ g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FILESIZE,
+ g_param_spec_long("filesize","filesize","filesize",
G_MINLONG,G_MAXLONG,0,G_PARAM_READABLE)); // CHECKME
gobject_class->set_property = gst_disksrc_set_property;
case ARG_OFFSET:
g_value_set_long (value, src->curoffset);
break;
- case ARG_SIZE:
+ case ARG_FILESIZE:
g_value_set_long (value, src->size);
break;
default:
/* deal with EOF state */
if (src->curoffset >= src->size) {
GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
- gst_pad_event(pad,(void *)GST_EVENT_EOS);
+ gst_pad_event(pad, GST_EVENT_EOS, 0LL, 0);
buf = gst_buffer_new();
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
return buf;
} else
GST_BUFFER_SIZE (buf) = src->bytes_per_read;
- GST_DEBUG (0,"map %p, offset %ld, size %d\n", src->map, src->curoffset, GST_BUFFER_SIZE (buf));
+ GST_DEBUG (0,"map %p, offset %ld (%p), size %d\n", src->map, src->curoffset,
+ src->map + src->curoffset, GST_BUFFER_SIZE (buf));
//gst_util_dump_mem (GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
/* deal with EOF state */
if (offset >= src->size) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
GST_DEBUG (0,"map offset %lld >= size %ld --> eos\n", offset, src->size);
//FIXME
buf = gst_buffer_new();
src->new_seek = TRUE;
}
return TRUE;
+ GST_DEBUG(0, "opened file %s\n",src->filename);
}
/* unmap and close the file */
GValue *value, GParamSpec *pspec);
static void gst_fakesink_chain (GstPad *pad, GstBuffer *buf);
-static gboolean gst_fakesink_event (GstPad *pad, void *event);
+static gboolean gst_fakesink_event (GstPad *pad, GstEventType event, guint64 timestamp, guint32 data);
static GstElementClass *parent_class = NULL;
static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
fakesink = GST_FAKESINK (gst_pad_get_parent (pad));
if (!fakesink->silent)
- g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %llu) \n",
+ g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %lld) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
static gboolean
-gst_fakesink_event (GstPad *pad, void *event)
+gst_fakesink_event (GstPad *pad, GstEventType event, guint64 timestamp, guint32 data)
{
- GST_DEBUG (GST_CAT_EVENT, "fakesink has event %d on pad %s:%s\n",(gint)event,GST_DEBUG_PAD_NAME(pad));
- if ((gint)event == GST_EVENT_EOS) {
+ GST_DEBUG (GST_CAT_EVENT, "fakesink has event %d on pad %s:%s\n",event,GST_DEBUG_PAD_NAME(pad));
+ if (event == GST_EVENT_EOS) {
GST_DEBUG(GST_CAT_EVENT, "have EOS\n");
}
}
g_return_val_if_fail (GST_IS_FAKESRC (src), NULL);
if (src->num_buffers == 0) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return NULL;
}
else {
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return NULL;
}
GstBuffer *buf;
if (src->num_buffers == 0) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return;
}
else {
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return;
}
gst_multidisksrc_close_file(src);
if (!src->listptr) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return FALSE;
}
gst_multidisksrc_close_file(src);
if (!src->listptr) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return FALSE;
}
}
/* if we didn't get as many bytes as we asked for, we're at EOF */
if (readbytes == 0) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return NULL;
}
#include <gst/gstxml.h>
#include <gst/cothreads.h>
#include <gst/gstscheduler.h>
+#include <gst/gsttimecache.h>
#include <gst/gstparse.h>
#include <gst/gstextratypes.h>
}
+
+/* pad is the receiving pad */
+static void
+gst_pad_event_default(GstPad *pad, GstEventType event, guint64 timestamp, guint32 data)
+{
+ GST_DEBUG(GST_CAT_EVENT, "default event handler for pad %s:%s\n",GST_DEBUG_PAD_NAME(pad));
+ switch (event) {
+ case GST_EVENT_EOS:
+ if (GST_PAD_PARENT(pad)->numsinkpads == 1)
+ gst_element_signal_eos(GST_PAD_PARENT(pad));
+ else
+ GST_DEBUG(GST_CAT_EVENT, "WARNING: no default behavior for EOS with multiple sinkpads\n");
+ break;
+ }
+}
+
gboolean
-gst_pad_event (GstPad *pad, void *event)
+gst_pad_event (GstPad *pad, GstEventType event, gint64 timestamp, guint32 data)
{
GstRealPad *peer;
gboolean handled = FALSE;
peer = GST_RPAD_PEER(pad);
if (GST_RPAD_EVENTFUNC(peer))
- handled = GST_RPAD_EVENTFUNC(peer) (peer, event);
-
+ handled = GST_RPAD_EVENTFUNC(peer) (peer, event, timestamp, data);
else {
GST_DEBUG(GST_CAT_EVENT, "there's no event function for peer %s:%s\n",GST_DEBUG_PAD_NAME(peer));
}
if (!handled) {
GST_DEBUG(GST_CAT_EVENT, "would proceed with default behavior here\n");
- gst_pad_event_default(peer,event);
- }
-}
-
-/* pad is the receiving pad */
-static void
-gst_pad_event_default(GstPad *pad, void *event)
-{
- switch((gint)event) {
- case GST_EVENT_EOS:
- if (GST_PAD_PARENT(pad)->numsrcpads == 1)
- gst_element_signal_eos(GST_PAD_PARENT(pad));
- else
- GST_DEBUG(GST_CAT_EVENT, "WARNING: no default behavior for EOS with multiple srcpads\n");
- break;
+ gst_pad_event_default(peer,event, timestamp, data);
}
}
#define GST_TYPE_PAD (gst_pad_get_type ())
-#define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD,GstPad))
-#define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD,GstPadClass))
+#define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD, GstPad))
+#define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD, GstPadClass))
#define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
#define GST_IS_PAD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
#define GST_TYPE_REAL_PAD (gst_real_pad_get_type ())
-#define GST_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD,GstRealPad))
-#define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD,GstRealPadClass))
+#define GST_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD, GstRealPad))
+#define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD, GstRealPadClass))
#define GST_IS_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REAL_PAD))
#define GST_IS_REAL_PAD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REAL_PAD))
#define GST_TYPE_GHOST_PAD (gst_ghost_pad_get_type ())
-#define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD,GstGhostPad))
-#define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD,GstGhostPadClass))
+#define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad))
+#define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass))
#define GST_IS_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GHOST_PAD))
#define GST_IS_GHOST_PAD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD))
* buf is the buffer being passed */
typedef void (*GstPadChainFunction) (GstPad *pad,GstBuffer *buf);
typedef GstBuffer* (*GstPadGetFunction) (GstPad *pad);
-typedef gboolean (*GstPadEventFunction) (GstPad *pad, void *event);
+typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEventType event, gint64 timestamp, guint32 data);
typedef GstBuffer* (*GstPadGetRegionFunction) (GstPad *pad, GstRegionType type, guint64 offset, guint64 len);
typedef GstBuffer* (*GstPadPullRegionFunction) (GstPad *pad, GstRegionType type, guint64 offset, guint64 len);
#endif
#if 1
-gboolean gst_pad_event (GstPad *pad, void *event);
+gboolean gst_pad_event (GstPad *pad, GstEventType event, gint64 timestamp, guint32 data);
#else
-#define gst_pad_event(pad,event) G_STMT_START{ \
+#define gst_pad_event(pad,event,timestamp,data) G_STMT_START{ \
( (((GstRealPad *)(pad))->peer->eventhandler) ? \
- (((GstRealPad *)(pad))->peer->eventhandler)((GstPad *)(((GstRealPad *)(pad))->peer),(event)) : \
+ (((GstRealPad *)(pad))->peer->eventhandler)((GstPad *)(((GstRealPad *)(pad))->peer),(event),(timestamp),(data)) : \
FALSE )
}G_STMT_END
#endif
};
struct _GstTraceEntry {
- guint64 timestamp;
+ gint64 timestamp;
guint32 sequence;
guint32 data;
gchar message[112];
ARG_LOCATION,
ARG_BYTESPERREAD,
ARG_OFFSET,
- ARG_SIZE,
+ ARG_FILESIZE,
};
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OFFSET,
g_param_spec_long("offset","offset","offset",
G_MINLONG,G_MAXLONG,0,G_PARAM_READWRITE)); // CHECKME
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SIZE,
- g_param_spec_long("size","size","size",
+ g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FILESIZE,
+ g_param_spec_long("filesize","filesize","filesize",
G_MINLONG,G_MAXLONG,0,G_PARAM_READABLE)); // CHECKME
gobject_class->set_property = gst_disksrc_set_property;
case ARG_OFFSET:
g_value_set_long (value, src->curoffset);
break;
- case ARG_SIZE:
+ case ARG_FILESIZE:
g_value_set_long (value, src->size);
break;
default:
/* deal with EOF state */
if (src->curoffset >= src->size) {
GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
- gst_pad_event(pad,(void *)GST_EVENT_EOS);
+ gst_pad_event(pad, GST_EVENT_EOS, 0LL, 0);
buf = gst_buffer_new();
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
return buf;
} else
GST_BUFFER_SIZE (buf) = src->bytes_per_read;
- GST_DEBUG (0,"map %p, offset %ld, size %d\n", src->map, src->curoffset, GST_BUFFER_SIZE (buf));
+ GST_DEBUG (0,"map %p, offset %ld (%p), size %d\n", src->map, src->curoffset,
+ src->map + src->curoffset, GST_BUFFER_SIZE (buf));
//gst_util_dump_mem (GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
/* deal with EOF state */
if (offset >= src->size) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
GST_DEBUG (0,"map offset %lld >= size %ld --> eos\n", offset, src->size);
//FIXME
buf = gst_buffer_new();
src->new_seek = TRUE;
}
return TRUE;
+ GST_DEBUG(0, "opened file %s\n",src->filename);
}
/* unmap and close the file */
GValue *value, GParamSpec *pspec);
static void gst_fakesink_chain (GstPad *pad, GstBuffer *buf);
-static gboolean gst_fakesink_event (GstPad *pad, void *event);
+static gboolean gst_fakesink_event (GstPad *pad, GstEventType event, guint64 timestamp, guint32 data);
static GstElementClass *parent_class = NULL;
static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
fakesink = GST_FAKESINK (gst_pad_get_parent (pad));
if (!fakesink->silent)
- g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %llu) \n",
+ g_print("fakesink: chain ******* (%s:%s)< (%d bytes, %lld) \n",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_signal_emit (G_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
static gboolean
-gst_fakesink_event (GstPad *pad, void *event)
+gst_fakesink_event (GstPad *pad, GstEventType event, guint64 timestamp, guint32 data)
{
- GST_DEBUG (GST_CAT_EVENT, "fakesink has event %d on pad %s:%s\n",(gint)event,GST_DEBUG_PAD_NAME(pad));
- if ((gint)event == GST_EVENT_EOS) {
+ GST_DEBUG (GST_CAT_EVENT, "fakesink has event %d on pad %s:%s\n",event,GST_DEBUG_PAD_NAME(pad));
+ if (event == GST_EVENT_EOS) {
GST_DEBUG(GST_CAT_EVENT, "have EOS\n");
}
}
g_return_val_if_fail (GST_IS_FAKESRC (src), NULL);
if (src->num_buffers == 0) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return NULL;
}
else {
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return NULL;
}
GstBuffer *buf;
if (src->num_buffers == 0) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return;
}
else {
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return;
}
gst_multidisksrc_close_file(src);
if (!src->listptr) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return FALSE;
}
gst_multidisksrc_close_file(src);
if (!src->listptr) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return FALSE;
}
}
/* if we didn't get as many bytes as we asked for, we're at EOF */
if (readbytes == 0) {
- gst_pad_event (pad, (void*)GST_EVENT_EOS);
+ gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
return NULL;
}