Commit 99315ab3 authored by Wim Taymans's avatar Wim Taymans
Browse files

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
parent 0f02673d
common @ cd050468
Subproject commit 2f0e1ecbfe7d27cf1b2215204958c95516db173d
Subproject commit cd050468e0d9e0d1b9134eb3081e2ab3228f0c01
......@@ -52,6 +52,7 @@ enum {
ARG_LOCATION,
ARG_BYTESPERREAD,
ARG_OFFSET,
ARG_FD,
};
......@@ -106,6 +107,10 @@ gst_fdsrc_class_init (GstFdSrcClass *klass)
"offset", ARG_OFFSET, G_PARAM_READABLE,
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->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;
}
break;
case ARG_FD:
src->fd = g_value_get_int (value);
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = g_value_get_int (value);
break;
......@@ -173,6 +181,9 @@ gst_fdsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
case ARG_OFFSET:
g_value_set_int64 (value, src->curoffset);
break;
case ARG_FD:
g_value_set_int (value, src->fd);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
......@@ -52,6 +52,7 @@ enum {
ARG_LOCATION,
ARG_BYTESPERREAD,
ARG_OFFSET,
ARG_FD,
};
......@@ -106,6 +107,10 @@ gst_fdsrc_class_init (GstFdSrcClass *klass)
"offset", ARG_OFFSET, G_PARAM_READABLE,
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->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;
}
break;
case ARG_FD:
src->fd = g_value_get_int (value);
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = g_value_get_int (value);
break;
......@@ -173,6 +181,9 @@ gst_fdsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
case ARG_OFFSET:
g_value_set_int64 (value, src->curoffset);
break;
case ARG_FD:
g_value_set_int (value, src->fd);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment