mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
add track object virtual methods for property change notifications
This commit is contained in:
parent
b13bf26795
commit
fee9f7fb67
2 changed files with 41 additions and 0 deletions
|
@ -316,6 +316,10 @@ gnlobject_start_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
||||||
GESTrackObject * obj)
|
GESTrackObject * obj)
|
||||||
{
|
{
|
||||||
guint64 start;
|
guint64 start;
|
||||||
|
GESTrackObjectClass *klass;
|
||||||
|
|
||||||
|
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||||
|
|
||||||
g_object_get (gnlobject, "start", &start, NULL);
|
g_object_get (gnlobject, "start", &start, NULL);
|
||||||
|
|
||||||
GST_DEBUG ("gnlobject start : %" GST_TIME_FORMAT " current : %"
|
GST_DEBUG ("gnlobject start : %" GST_TIME_FORMAT " current : %"
|
||||||
|
@ -323,6 +327,8 @@ gnlobject_start_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
||||||
|
|
||||||
if (start != obj->start) {
|
if (start != obj->start) {
|
||||||
obj->start = start;
|
obj->start = start;
|
||||||
|
if (klass->start_changed)
|
||||||
|
klass->start_changed (obj, start);
|
||||||
/* FIXME : emit changed */
|
/* FIXME : emit changed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,6 +339,10 @@ gnlobject_media_start_cb (GstElement * gnlobject,
|
||||||
GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj)
|
GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj)
|
||||||
{
|
{
|
||||||
guint64 start;
|
guint64 start;
|
||||||
|
GESTrackObjectClass *klass;
|
||||||
|
|
||||||
|
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||||
|
|
||||||
g_object_get (gnlobject, "media-start", &start, NULL);
|
g_object_get (gnlobject, "media-start", &start, NULL);
|
||||||
|
|
||||||
GST_DEBUG ("gnlobject in-point : %" GST_TIME_FORMAT " current : %"
|
GST_DEBUG ("gnlobject in-point : %" GST_TIME_FORMAT " current : %"
|
||||||
|
@ -340,6 +350,8 @@ gnlobject_media_start_cb (GstElement * gnlobject,
|
||||||
|
|
||||||
if (start != obj->inpoint) {
|
if (start != obj->inpoint) {
|
||||||
obj->inpoint = start;
|
obj->inpoint = start;
|
||||||
|
if (klass->media_start_changed)
|
||||||
|
klass->media_start_changed (obj, start);
|
||||||
/* FIXME : emit changed */
|
/* FIXME : emit changed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,12 +361,18 @@ gnlobject_priority_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
||||||
GESTrackObject * obj)
|
GESTrackObject * obj)
|
||||||
{
|
{
|
||||||
guint32 priority;
|
guint32 priority;
|
||||||
|
GESTrackObjectClass *klass;
|
||||||
|
|
||||||
|
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||||
|
|
||||||
g_object_get (gnlobject, "priority", &priority, NULL);
|
g_object_get (gnlobject, "priority", &priority, NULL);
|
||||||
|
|
||||||
GST_DEBUG ("gnlobject priority : %d current : %d", priority, obj->priority);
|
GST_DEBUG ("gnlobject priority : %d current : %d", priority, obj->priority);
|
||||||
|
|
||||||
if (priority != obj->priority) {
|
if (priority != obj->priority) {
|
||||||
obj->priority = priority;
|
obj->priority = priority;
|
||||||
|
if (klass->priority_changed)
|
||||||
|
klass->priority_changed (obj, priority);
|
||||||
/* FIXME : emit changed */
|
/* FIXME : emit changed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,6 +382,10 @@ gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
||||||
GESTrackObject * obj)
|
GESTrackObject * obj)
|
||||||
{
|
{
|
||||||
guint64 duration;
|
guint64 duration;
|
||||||
|
GESTrackObjectClass *klass;
|
||||||
|
|
||||||
|
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||||
|
|
||||||
g_object_get (gnlobject, "duration", &duration, NULL);
|
g_object_get (gnlobject, "duration", &duration, NULL);
|
||||||
|
|
||||||
GST_DEBUG ("gnlobject duration : %" GST_TIME_FORMAT " current : %"
|
GST_DEBUG ("gnlobject duration : %" GST_TIME_FORMAT " current : %"
|
||||||
|
@ -371,6 +393,8 @@ gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
||||||
|
|
||||||
if (duration != obj->duration) {
|
if (duration != obj->duration) {
|
||||||
obj->duration = duration;
|
obj->duration = duration;
|
||||||
|
if (klass->duration_changed)
|
||||||
|
klass->duration_changed (obj, duration);
|
||||||
/* FIXME : emit changed */
|
/* FIXME : emit changed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,12 +404,18 @@ gnlobject_active_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
|
||||||
GESTrackObject * obj)
|
GESTrackObject * obj)
|
||||||
{
|
{
|
||||||
gboolean active;
|
gboolean active;
|
||||||
|
GESTrackObjectClass *klass;
|
||||||
|
|
||||||
|
klass = GES_TRACK_OBJECT_GET_CLASS (obj);
|
||||||
|
|
||||||
g_object_get (gnlobject, "active", &active, NULL);
|
g_object_get (gnlobject, "active", &active, NULL);
|
||||||
|
|
||||||
GST_DEBUG ("gnlobject active : %d current : %d", active, obj->active);
|
GST_DEBUG ("gnlobject active : %d current : %d", active, obj->active);
|
||||||
|
|
||||||
if (active != obj->active) {
|
if (active != obj->active) {
|
||||||
obj->active = active;
|
obj->active = active;
|
||||||
|
if (klass->active_changed)
|
||||||
|
klass->active_changed (obj, active);
|
||||||
/* FIXME : emit changed */
|
/* FIXME : emit changed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,11 @@ struct _GESTrackObject {
|
||||||
* GESTrackObjectClass:
|
* GESTrackObjectClass:
|
||||||
* @parent_class: parent class
|
* @parent_class: parent class
|
||||||
* @create_gnl_object: method to create the GNonLin container object.
|
* @create_gnl_object: method to create the GNonLin container object.
|
||||||
|
* @start_changed: start property of gnlobject has changed
|
||||||
|
* @media_start_changed: media-start property of gnlobject has changed
|
||||||
|
* @duration_changed: duration property glnobject has changed
|
||||||
|
* @priority_changed: duration property glnobject has changed
|
||||||
|
* @active_changed: active property of gnlobject has changed
|
||||||
*
|
*
|
||||||
* Subclasses can override the @create_gnl_object method to override what type
|
* Subclasses can override the @create_gnl_object method to override what type
|
||||||
* of GNonLin object will be created.
|
* of GNonLin object will be created.
|
||||||
|
@ -136,6 +141,12 @@ struct _GESTrackObjectClass {
|
||||||
/*< public >*/
|
/*< public >*/
|
||||||
/* virtual methods for subclasses */
|
/* virtual methods for subclasses */
|
||||||
gboolean (*create_gnl_object) (GESTrackObject * object);
|
gboolean (*create_gnl_object) (GESTrackObject * object);
|
||||||
|
|
||||||
|
void (*start_changed) (GESTrackObject *object, guint64 start);
|
||||||
|
void (*media_start_changed) (GESTrackObject *object, guint64 media_start);
|
||||||
|
void (*priority_changed) (GESTrackObject *object, guint priority);
|
||||||
|
void (*duration_changed) (GESTrackObject *object, guint64 duration);
|
||||||
|
void (*active_changed) (GESTrackObject *object, gboolean active);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType ges_track_object_get_type (void);
|
GType ges_track_object_get_type (void);
|
||||||
|
|
Loading…
Reference in a new issue