diff options
author | Andy Wingo <wingo@pobox.com> | 2002-03-04 22:15:29 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2002-03-04 22:15:29 +0000 |
commit | f4c0650d6357cd2e4eccc8e90ce1329d6588de2b (patch) | |
tree | f8efc9b729158ea7feb79b4a1f03129aada06fc5 /gst | |
parent | 040132b05382d33d3c167faa70fdc0a9e22eda63 (diff) |
update to the g_object_notify() way of sending the app information this is untested, but should work
Original commit message from CVS:
update to the g_object_notify() way of sending the app information
this is untested, but should work
Diffstat (limited to 'gst')
-rw-r--r-- | gst/avi/gstavidemux.c | 14 | ||||
-rw-r--r-- | gst/avi/gstavidemux.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 62783c4d..7fa99ee3 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -56,6 +56,7 @@ enum { ARG_BITRATE, ARG_MEDIA_TIME, ARG_CURRENT_TIME, + ARG_FRAME_RATE, /* FILL ME */ }; @@ -205,6 +206,9 @@ gst_avi_demux_class_init (GstAviDemuxClass *klass) g_object_class_install_property (G_OBJECT_CLASS(klass), ARG_CURRENT_TIME, g_param_spec_long ("current_time","current_time","current_time", G_MINLONG, G_MAXLONG, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS(klass), ARG_FRAME_RATE, + g_param_spec_long ("frame-rate","frame rate","Current (non-averaged) frame rate", + 0, G_MAXINT, 0, G_PARAM_READABLE)); parent_class = g_type_class_ref (GST_TYPE_ELEMENT); @@ -336,16 +340,13 @@ gst_avi_demux_strh (GstAviDemux *avi_demux) avi_demux->audio_rate = GUINT32_FROM_LE (strh->rate) / scale; } else if (strh->type == GST_RIFF_FCC_vids) { - gfloat frame_rate; guint32 scale; scale = GUINT32_FROM_LE (strh->scale); if (!scale) scale = 1; - frame_rate = (gfloat)GUINT32_FROM_LE (strh->rate) / scale; - - gst_element_send_event (GST_ELEMENT (avi_demux), - gst_event_new_info ("frame_rate", GST_PROPS_FLOAT (frame_rate), NULL)); + avi_demux->frame_rate = (gint) GUINT32_FROM_LE (strh->rate) / scale; + g_object_notify (G_OBJECT (avi_demux), "frame-rate"); } return TRUE; @@ -918,6 +919,9 @@ gst_avi_demux_get_property (GObject *object, guint prop_id, GValue *value, case ARG_CURRENT_TIME: g_value_set_long (value, (src->current_frame * src->time_interval) / 1000000); break; + case ARG_FRAME_RATE: + g_value_set_int (value, (src->frame_rate)); + break; default: break; } diff --git a/gst/avi/gstavidemux.h b/gst/avi/gstavidemux.h index 67a9333d..60a1acca 100644 --- a/gst/avi/gstavidemux.h +++ b/gst/avi/gstavidemux.h @@ -71,6 +71,8 @@ struct _GstAviDemux { GstByteStream *bs; + gint frame_rate; + gst_riff_index_entry *index_entries; gulong index_size; gulong index_offset; |