Make elements nanoseconds aware

Original commit message from CVS:
Make elements nanoseconds aware
This commit is contained in:
Wim Taymans 2002-06-02 13:25:40 +00:00
parent 8b094e02a9
commit 6bb455cdc9
5 changed files with 7 additions and 6 deletions

View file

@ -316,7 +316,7 @@ gst_esdmon_get (GstPad *pad)
GST_BUFFER_SIZE (buf) = readbytes; GST_BUFFER_SIZE (buf) = readbytes;
GST_BUFFER_OFFSET (buf) = esdmon->curoffset; GST_BUFFER_OFFSET (buf) = esdmon->curoffset;
GST_BUFFER_TIMESTAMP (buf) = esdmon->basetime + GST_BUFFER_TIMESTAMP (buf) = esdmon->basetime +
esdmon->samples_since_basetime * 1000000LL / esdmon->frequency; esdmon->samples_since_basetime * GST_SECOND / esdmon->frequency;
esdmon->curoffset += readbytes; esdmon->curoffset += readbytes;
readsamples = readbytes / esdmon->channels; readsamples = readbytes / esdmon->channels;
@ -351,7 +351,7 @@ gst_esdmon_set_property (GObject *object, guint prop_id, const GValue *value, GP
break; break;
case ARG_RATE: case ARG_RATE:
/* Preserve the timestamps */ /* Preserve the timestamps */
esdmon->basetime = esdmon->samples_since_basetime * 1000000LL / esdmon->frequency; esdmon->basetime = esdmon->samples_since_basetime * GST_SECOND / esdmon->frequency;
esdmon->samples_since_basetime = 0; esdmon->samples_since_basetime = 0;
/* Set the new frequency */ /* Set the new frequency */

View file

@ -281,7 +281,7 @@ gst_goom_chain (GstPad *pad, GstBuffer *bufin)
GST_BUFFER_TIMESTAMP (bufout) = goom->next_time; GST_BUFFER_TIMESTAMP (bufout) = goom->next_time;
GST_BUFFER_FLAG_SET (bufout, GST_BUFFER_DONTFREE); GST_BUFFER_FLAG_SET (bufout, GST_BUFFER_DONTFREE);
goom->next_time += 1000000LL / goom->fps; goom->next_time += GST_SECOND / goom->fps;
gst_pad_push (goom->srcpad, bufout); gst_pad_push (goom->srcpad, bufout);

View file

@ -286,7 +286,7 @@ gst_monoscope_chain (GstPad *pad, GstBuffer *bufin)
GST_BUFFER_TIMESTAMP (bufout) = monoscope->next_time; GST_BUFFER_TIMESTAMP (bufout) = monoscope->next_time;
GST_BUFFER_FLAG_SET (bufout, GST_BUFFER_DONTFREE); GST_BUFFER_FLAG_SET (bufout, GST_BUFFER_DONTFREE);
monoscope->next_time += 1000000LL / monoscope->fps; monoscope->next_time += GST_SECOND / monoscope->fps;
gst_pad_push (monoscope->srcpad, bufout); gst_pad_push (monoscope->srcpad, bufout);

View file

@ -462,6 +462,7 @@ gst_osssink_get_clock (GstElement *element)
osssink = GST_OSSSINK (element); osssink = GST_OSSSINK (element);
return NULL;
return GST_CLOCK (osssink->provided_clock); return GST_CLOCK (osssink->provided_clock);
} }

View file

@ -232,7 +232,7 @@ gst_osssrc_get (GstPad *pad)
GST_BUFFER_SIZE (buf) = readbytes; GST_BUFFER_SIZE (buf) = readbytes;
GST_BUFFER_OFFSET (buf) = src->curoffset; GST_BUFFER_OFFSET (buf) = src->curoffset;
GST_BUFFER_TIMESTAMP (buf) = src->basetime + GST_BUFFER_TIMESTAMP (buf) = src->basetime +
src->samples_since_basetime * 1000000LL / src->frequency; src->samples_since_basetime * GST_SECOND / src->frequency;
src->curoffset += readbytes; src->curoffset += readbytes;
readsamples = readbytes / src->channels; readsamples = readbytes / src->channels;
@ -265,7 +265,7 @@ gst_osssrc_set_property (GObject *object, guint prop_id, const GValue *value, GP
break; break;
case ARG_FREQUENCY: case ARG_FREQUENCY:
/* Preserve the timestamps */ /* Preserve the timestamps */
src->basetime = src->samples_since_basetime * 1000000LL / src->frequency; src->basetime = src->samples_since_basetime * GST_SECOND / src->frequency;
src->samples_since_basetime = 0; src->samples_since_basetime = 0;
src->frequency = g_value_get_int (value); src->frequency = g_value_get_int (value);