From: Jeremy S. <je...@us...> - 2002-06-22 16:20:39
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: jesimon Date: Sat Jun 22 2002 09:20:37 PDT Log message: Add timestamp, mikmod work now Put mikmod to secondary rank ( modplug first ) Modified files: ext/mikmod : drv_gst.c gstmikmod.c gstmikmod.h Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/mikmod/drv_gst.c.diff?r1=1.3&r2=1.4 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/mikmod/gstmikmod.c.diff?r1=1.14&r2=1.15 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/mikmod/gstmikmod.h.diff?r1=1.3&r2=1.4 ====Begin Diffs==== Index: drv_gst.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/mikmod/drv_gst.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- drv_gst.c 2 Feb 2002 14:03:45 -0000 1.3 +++ drv_gst.c 22 Jun 2002 16:20:25 -0000 1.4 @@ -40,9 +40,11 @@ length = VC_WriteBytes((SBYTE *) audiobuffer, buffer_size); outdata = gst_buffer_new(); - + GST_BUFFER_DATA( outdata ) = g_memdup( audiobuffer, length ); GST_BUFFER_SIZE( outdata ) = length; + + GST_BUFFER_TIMESTAMP( outdata ) = timestamp; if ( need_sync == 1 ) { Index: gstmikmod.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/mikmod/gstmikmod.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gstmikmod.c 8 Jun 2002 09:12:58 -0000 1.14 +++ gstmikmod.c 22 Jun 2002 16:20:25 -0000 1.15 @@ -332,13 +332,15 @@ if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) break; } - - if ( mikmod->Buffer ) { - mikmod->Buffer = gst_buffer_append( mikmod->Buffer, buffer_in ); - gst_buffer_unref( buffer_in ); + else + { + if ( mikmod->Buffer ) { + mikmod->Buffer = gst_buffer_append( mikmod->Buffer, buffer_in ); + gst_buffer_unref( buffer_in ); + } + else + mikmod->Buffer = buffer_in; } - else - mikmod->Buffer = buffer_in; } if ( mikmod->_16bit ) @@ -346,6 +348,8 @@ else mode16bits = 8; + gst_mikmod_setup( mikmod ); + MikMod_RegisterDriver(&drv_gst); MikMod_RegisterAllLoaders(); @@ -373,8 +377,9 @@ do { if ( Player_Active() ) { - drv_gst.Update(); + timestamp = ( module->sngtime / 1024.0 ) * GST_SECOND; + drv_gst.Update(); gst_element_yield (element); } else { @@ -438,7 +443,6 @@ GST_DEBUG (0,"state pending %d", GST_STATE_PENDING (element)); - /* if going down into NULL state, close the file if it's open */ if (GST_STATE_PENDING (element) == GST_STATE_READY) { gst_mikmod_setup(mikmod); @@ -469,7 +473,6 @@ MikMod_Exit(); - /* if we haven't failed already, give the parent class a chance to ;-) */ if (GST_ELEMENT_CLASS (parent_class)->change_state) return GST_ELEMENT_CLASS (parent_class)->change_state (element); @@ -611,7 +614,7 @@ factory = gst_element_factory_new("mikmod",GST_TYPE_MIKMOD, &mikmod_details); g_return_val_if_fail(factory != NULL, FALSE); - gst_element_factory_set_rank (factory, GST_ELEMENT_RANK_PRIMARY); + gst_element_factory_set_rank (factory, GST_ELEMENT_RANK_SECONDARY); gst_element_factory_add_pad_template (factory, mikmod_src_factory ()); gst_element_factory_add_pad_template (factory, mikmod_sink_factory ()); Index: gstmikmod.h =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/mikmod/gstmikmod.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gstmikmod.h 20 Mar 2002 21:44:43 -0000 1.3 +++ gstmikmod.h 22 Jun 2002 16:20:25 -0000 1.4 @@ -76,6 +76,7 @@ MODULE *module; MREADER *reader; GstPad *srcpad; +gint64 timestamp; int need_sync; GType gst_mikmod_get_type(void); |