mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
Make elements nanoseconds aware
Original commit message from CVS: Make elements nanoseconds aware
This commit is contained in:
parent
8b094e02a9
commit
6bb455cdc9
5 changed files with 7 additions and 6 deletions
|
@ -316,7 +316,7 @@ gst_esdmon_get (GstPad *pad)
|
|||
GST_BUFFER_SIZE (buf) = readbytes;
|
||||
GST_BUFFER_OFFSET (buf) = esdmon->curoffset;
|
||||
GST_BUFFER_TIMESTAMP (buf) = esdmon->basetime +
|
||||
esdmon->samples_since_basetime * 1000000LL / esdmon->frequency;
|
||||
esdmon->samples_since_basetime * GST_SECOND / esdmon->frequency;
|
||||
|
||||
esdmon->curoffset += readbytes;
|
||||
readsamples = readbytes / esdmon->channels;
|
||||
|
@ -351,7 +351,7 @@ gst_esdmon_set_property (GObject *object, guint prop_id, const GValue *value, GP
|
|||
break;
|
||||
case ARG_RATE:
|
||||
/* 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;
|
||||
|
||||
/* Set the new frequency */
|
||||
|
|
|
@ -281,7 +281,7 @@ gst_goom_chain (GstPad *pad, GstBuffer *bufin)
|
|||
GST_BUFFER_TIMESTAMP (bufout) = goom->next_time;
|
||||
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);
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ gst_monoscope_chain (GstPad *pad, GstBuffer *bufin)
|
|||
GST_BUFFER_TIMESTAMP (bufout) = monoscope->next_time;
|
||||
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);
|
||||
|
||||
|
|
|
@ -462,6 +462,7 @@ gst_osssink_get_clock (GstElement *element)
|
|||
|
||||
osssink = GST_OSSSINK (element);
|
||||
|
||||
return NULL;
|
||||
return GST_CLOCK (osssink->provided_clock);
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ gst_osssrc_get (GstPad *pad)
|
|||
GST_BUFFER_SIZE (buf) = readbytes;
|
||||
GST_BUFFER_OFFSET (buf) = src->curoffset;
|
||||
GST_BUFFER_TIMESTAMP (buf) = src->basetime +
|
||||
src->samples_since_basetime * 1000000LL / src->frequency;
|
||||
src->samples_since_basetime * GST_SECOND / src->frequency;
|
||||
|
||||
src->curoffset += readbytes;
|
||||
readsamples = readbytes / src->channels;
|
||||
|
@ -265,7 +265,7 @@ gst_osssrc_set_property (GObject *object, guint prop_id, const GValue *value, GP
|
|||
break;
|
||||
case ARG_FREQUENCY:
|
||||
/* 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->frequency = g_value_get_int (value);
|
||||
|
|
Loading…
Reference in a new issue