summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2003-05-24 10:41:58 +0000
committerWim Taymans <wim.taymans@gmail.com>2003-05-24 10:41:58 +0000
commited75cd44e465ca78689652fa8a9c6e9855612e8a (patch)
treecd7cd1b9dea4aa0f2dc0c5d88d9f53a483f987dd
parentfe40d42ec36a64aac6212f4ef2954572800c12f2 (diff)
downloadgst-plugins-bad-ed75cd44e465ca78689652fa8a9c6e9855612e8a.tar.gz
gst-plugins-bad-ed75cd44e465ca78689652fa8a9c6e9855612e8a.tar.bz2
gst-plugins-bad-ed75cd44e465ca78689652fa8a9c6e9855612e8a.zip
UNITS -> DEFAULT
Original commit message from CVS: UNITS -> DEFAULT
-rw-r--r--ext/ivorbis/vorbisfile.c32
-rw-r--r--ext/swfdec/gstswfdec.c22
-rw-r--r--gst-libs/gst/video/video.c2
-rw-r--r--gst/modplug/gstmodplug.cc6
4 files changed, 15 insertions, 47 deletions
diff --git a/ext/ivorbis/vorbisfile.c b/ext/ivorbis/vorbisfile.c
index 5ae6fe2f..8403d065 100644
--- a/ext/ivorbis/vorbisfile.c
+++ b/ext/ivorbis/vorbisfile.c
@@ -523,7 +523,7 @@ gst_ivorbisfile_loop (GstElement *element)
}
break;
}
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (ivorbisfile->seek_accurate) {
if (ov_pcm_seek (&ivorbisfile->vf, ivorbisfile->seek_value) == 0) {
ivorbisfile->need_discont = TRUE;
@@ -606,7 +606,7 @@ gst_ivorbisfile_loop (GstElement *element)
samples = (gint64) (ov_pcm_tell (&ivorbisfile->vf));
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, time,
- GST_FORMAT_UNITS, samples, NULL);
+ GST_FORMAT_DEFAULT, samples, NULL);
gst_pad_push (ivorbisfile->srcpad, GST_BUFFER (discont));
}
@@ -634,7 +634,7 @@ gst_ivorbisfile_get_formats (GstPad *pad)
static GstFormat src_formats[] = {
GST_FORMAT_TIME,
GST_FORMAT_BYTES,
- GST_FORMAT_UNITS,
+ GST_FORMAT_DEFAULT,
0,
0
};
@@ -664,16 +664,13 @@ gst_ivorbisfile_src_convert (GstPad *pad,
ivorbisfile = GST_IVORBISFILE (gst_pad_get_parent (pad));
- if (*dest_format == GST_FORMAT_DEFAULT)
- *dest_format = GST_FORMAT_TIME;
-
vi = ov_info (&ivorbisfile->vf, -1);
bytes_per_sample = vi->channels * 2;
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value / (vi->channels * 2);
break;
case GST_FORMAT_TIME:
@@ -688,7 +685,7 @@ gst_ivorbisfile_src_convert (GstPad *pad,
default:
res = FALSE;
}
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
switch (*dest_format) {
case GST_FORMAT_BYTES:
*dest_value = src_value * bytes_per_sample;
@@ -706,7 +703,7 @@ gst_ivorbisfile_src_convert (GstPad *pad,
switch (*dest_format) {
case GST_FORMAT_BYTES:
scale = bytes_per_sample;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value * scale * vi->rate / GST_SECOND;
break;
default:
@@ -724,7 +721,7 @@ gst_ivorbisfile_src_convert (GstPad *pad,
case GST_FORMAT_BYTES:
res = FALSE;
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (src_value > ivorbisfile->vf.links) {
src_value = ivorbisfile->vf.links;
}
@@ -772,9 +769,6 @@ gst_ivorbisfile_sink_convert (GstPad *pad,
ivorbisfile = GST_IVORBISFILE (gst_pad_get_parent (pad));
- if (*dest_format == GST_FORMAT_DEFAULT)
- *dest_format = GST_FORMAT_TIME;
-
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
@@ -843,7 +837,7 @@ gst_ivorbisfile_src_query (GstPad *pad, GstQueryType type,
case GST_QUERY_TOTAL:
{
switch (*format) {
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (ivorbisfile->vf.seekable)
*value = ov_pcm_total (&ivorbisfile->vf, -1);
else
@@ -855,9 +849,6 @@ gst_ivorbisfile_src_query (GstPad *pad, GstQueryType type,
else
return FALSE;
break;
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fall through */
case GST_FORMAT_TIME:
if (ivorbisfile->vf.seekable)
*value = (gint64) (ov_time_total (&ivorbisfile->vf, -1) * GST_SECOND);
@@ -879,9 +870,6 @@ gst_ivorbisfile_src_query (GstPad *pad, GstQueryType type,
}
case GST_QUERY_POSITION:
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fall through */
case GST_FORMAT_TIME:
if (ivorbisfile->vf.seekable)
*value = (gint64) (ov_time_tell (&ivorbisfile->vf) * GST_SECOND);
@@ -895,7 +883,7 @@ gst_ivorbisfile_src_query (GstPad *pad, GstQueryType type,
else
*value = ivorbisfile->total_bytes;
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
if (ivorbisfile->vf.seekable)
*value = ov_pcm_tell (&ivorbisfile->vf);
else
@@ -975,7 +963,7 @@ gst_ivorbisfile_src_event (GstPad *pad, GstEvent *event)
}
offset /= vi->channels * 2;
/* fallthrough */
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
ivorbisfile->seek_pending = TRUE;
ivorbisfile->seek_value = offset;
ivorbisfile->seek_format = format;
diff --git a/ext/swfdec/gstswfdec.c b/ext/swfdec/gstswfdec.c
index 666ca0ab..f5f597bb 100644
--- a/ext/swfdec/gstswfdec.c
+++ b/ext/swfdec/gstswfdec.c
@@ -345,8 +345,6 @@ gst_swfdec_convert_sink (GstPad *pad, GstFormat src_format, gint64 src_value,
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME:
default:
res = FALSE;
@@ -354,8 +352,6 @@ gst_swfdec_convert_sink (GstPad *pad, GstFormat src_format, gint64 src_value,
break;
case GST_FORMAT_TIME:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_BYTES;
case GST_FORMAT_BYTES:
default:
res = FALSE;
@@ -381,8 +377,6 @@ gst_swfdec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME:
default:
res = FALSE;
@@ -390,23 +384,19 @@ gst_swfdec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
break;
case GST_FORMAT_TIME:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_BYTES;
case GST_FORMAT_BYTES:
*dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2) *
video_rates[swfdec->decoder->frame_rate_code] / GST_SECOND;
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value * video_rates[swfdec->decoder->frame_rate_code] / GST_SECOND;
break;
default:
res = FALSE;
}
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
switch (*dest_format) {
- case GST_FORMAT_DEFAULT:
- *dest_format = GST_FORMAT_TIME;
case GST_FORMAT_TIME:
if (video_rates[swfdec->decoder->frame_rate_code] != 0.0) {
*dest_value = src_value * GST_SECOND /
@@ -418,7 +408,7 @@ gst_swfdec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
case GST_FORMAT_BYTES:
*dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2);
break;
- case GST_FORMAT_UNITS:
+ case GST_FORMAT_DEFAULT:
*dest_value = src_value;
break;
default:
@@ -445,9 +435,6 @@ gst_swfdec_src_query (GstPad *pad, GstQueryType type,
case GST_QUERY_TOTAL:
{
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fallthrough */
case GST_FORMAT_TIME:
{
int n_frames;
@@ -470,9 +457,6 @@ gst_swfdec_src_query (GstPad *pad, GstQueryType type,
case GST_QUERY_POSITION:
{
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
- /* fallthrough */
default:
res = FALSE;
break;
diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c
index 7c8b4852..a265c5e6 100644
--- a/gst-libs/gst/video/video.c
+++ b/gst-libs/gst/video/video.c
@@ -27,7 +27,7 @@
gdouble
gst_video_frame_rate (GstPad *pad)
{
- GstFormat dest_format = GST_FORMAT_UNITS;
+ GstFormat dest_format = GST_FORMAT_DEFAULT;
gint64 dest_value = 0;
gdouble fps;
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc
index 948de81b..8085eb22 100644
--- a/gst/modplug/gstmodplug.cc
+++ b/gst/modplug/gstmodplug.cc
@@ -402,7 +402,7 @@ gst_modplug_get_formats (GstPad *pad)
{
static const GstFormat src_formats[] = {
/* GST_FORMAT_BYTES,
- GST_FORMAT_UNITS,*/
+ GST_FORMAT_DEFAULT,*/
GST_FORMAT_TIME,
(GstFormat)0
};
@@ -441,8 +441,6 @@ gst_modplug_src_query (GstPad *pad, GstQueryType type,
switch (type) {
case GST_QUERY_TOTAL:
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
case GST_FORMAT_TIME:
*value=(gint64)modplug->mSoundFile->GetSongTime() * GST_SECOND;
break;
@@ -453,8 +451,6 @@ gst_modplug_src_query (GstPad *pad, GstQueryType type,
break;
case GST_QUERY_POSITION:
switch (*format) {
- case GST_FORMAT_DEFAULT:
- *format = GST_FORMAT_TIME;
default:
tmp = ((float)( modplug->mSoundFile->GetSongTime() * modplug->mSoundFile->GetCurrentPos() ) / (float)modplug->mSoundFile->GetMaxPosition() );
*value=(gint64)(tmp * GST_SECOND);