Add an fd param to set the file descriptor as an int

Original commit message from CVS:
Add an fd param to set the file descriptor as an int
This commit is contained in:
Wim Taymans 2002-10-17 22:32:55 +00:00
parent 0f02673d3e
commit 99315ab3a6
3 changed files with 23 additions and 1 deletions

2
common

@ -1 +1 @@
Subproject commit 2f0e1ecbfe7d27cf1b2215204958c95516db173d Subproject commit cd050468e0d9e0d1b9134eb3081e2ab3228f0c01

View file

@ -52,6 +52,7 @@ enum {
ARG_LOCATION, ARG_LOCATION,
ARG_BYTESPERREAD, ARG_BYTESPERREAD,
ARG_OFFSET, ARG_OFFSET,
ARG_FD,
}; };
@ -106,6 +107,10 @@ gst_fdsrc_class_init (GstFdSrcClass *klass)
"offset", ARG_OFFSET, G_PARAM_READABLE, "offset", ARG_OFFSET, G_PARAM_READABLE,
NULL); NULL);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "fd", "An open file descriptor to read from",
0, G_MAXINT, 0, G_PARAM_READWRITE));
gobject_class->set_property = gst_fdsrc_set_property; gobject_class->set_property = gst_fdsrc_set_property;
gobject_class->get_property = gst_fdsrc_get_property; gobject_class->get_property = gst_fdsrc_get_property;
} }
@ -148,6 +153,9 @@ gst_fdsrc_set_property (GObject *object, guint prop_id, const GValue *value, GPa
src->fd = fd; src->fd = fd;
} }
break; break;
case ARG_FD:
src->fd = g_value_get_int (value);
break;
case ARG_BYTESPERREAD: case ARG_BYTESPERREAD:
src->bytes_per_read = g_value_get_int (value); src->bytes_per_read = g_value_get_int (value);
break; break;
@ -173,6 +181,9 @@ gst_fdsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
case ARG_OFFSET: case ARG_OFFSET:
g_value_set_int64 (value, src->curoffset); g_value_set_int64 (value, src->curoffset);
break; break;
case ARG_FD:
g_value_set_int (value, src->fd);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;

View file

@ -52,6 +52,7 @@ enum {
ARG_LOCATION, ARG_LOCATION,
ARG_BYTESPERREAD, ARG_BYTESPERREAD,
ARG_OFFSET, ARG_OFFSET,
ARG_FD,
}; };
@ -106,6 +107,10 @@ gst_fdsrc_class_init (GstFdSrcClass *klass)
"offset", ARG_OFFSET, G_PARAM_READABLE, "offset", ARG_OFFSET, G_PARAM_READABLE,
NULL); NULL);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "fd", "An open file descriptor to read from",
0, G_MAXINT, 0, G_PARAM_READWRITE));
gobject_class->set_property = gst_fdsrc_set_property; gobject_class->set_property = gst_fdsrc_set_property;
gobject_class->get_property = gst_fdsrc_get_property; gobject_class->get_property = gst_fdsrc_get_property;
} }
@ -148,6 +153,9 @@ gst_fdsrc_set_property (GObject *object, guint prop_id, const GValue *value, GPa
src->fd = fd; src->fd = fd;
} }
break; break;
case ARG_FD:
src->fd = g_value_get_int (value);
break;
case ARG_BYTESPERREAD: case ARG_BYTESPERREAD:
src->bytes_per_read = g_value_get_int (value); src->bytes_per_read = g_value_get_int (value);
break; break;
@ -173,6 +181,9 @@ gst_fdsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
case ARG_OFFSET: case ARG_OFFSET:
g_value_set_int64 (value, src->curoffset); g_value_set_int64 (value, src->curoffset);
break; break;
case ARG_FD:
g_value_set_int (value, src->fd);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;