mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-09 07:52:36 +00:00
PCM data in AVI is always little endian
Original commit message from CVS: PCM data in AVI is always little endian
This commit is contained in:
parent
82f3d59000
commit
5a77a54a5a
2 changed files with 19 additions and 5 deletions
|
@ -127,7 +127,7 @@ GST_PAD_TEMPLATE_FACTORY (src_audio_templ,
|
||||||
"audio/raw",
|
"audio/raw",
|
||||||
"format", GST_PROPS_STRING ("int"),
|
"format", GST_PROPS_STRING ("int"),
|
||||||
"law", GST_PROPS_INT (0),
|
"law", GST_PROPS_INT (0),
|
||||||
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
|
"endianness", GST_PROPS_INT (G_LITTLE_ENDIAN),
|
||||||
"signed", GST_PROPS_LIST (
|
"signed", GST_PROPS_LIST (
|
||||||
GST_PROPS_BOOLEAN (TRUE),
|
GST_PROPS_BOOLEAN (TRUE),
|
||||||
GST_PROPS_BOOLEAN (FALSE)
|
GST_PROPS_BOOLEAN (FALSE)
|
||||||
|
@ -786,7 +786,7 @@ gst_avi_demux_strf_auds (GstAviDemux *avi_demux)
|
||||||
gst_props_new (
|
gst_props_new (
|
||||||
"format", GST_PROPS_STRING ("int"),
|
"format", GST_PROPS_STRING ("int"),
|
||||||
"law", GST_PROPS_INT (0),
|
"law", GST_PROPS_INT (0),
|
||||||
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
|
"endianness", GST_PROPS_INT (G_LITTLE_ENDIAN),
|
||||||
"signed", GST_PROPS_BOOLEAN ((GUINT16_FROM_LE (strf->size) != 8)),
|
"signed", GST_PROPS_BOOLEAN ((GUINT16_FROM_LE (strf->size) != 8)),
|
||||||
"width", GST_PROPS_INT ((GUINT16_FROM_LE (strf->blockalign)*8) /
|
"width", GST_PROPS_INT ((GUINT16_FROM_LE (strf->blockalign)*8) /
|
||||||
GUINT16_FROM_LE (strf->channels)),
|
GUINT16_FROM_LE (strf->channels)),
|
||||||
|
|
|
@ -419,19 +419,27 @@ gst_avimux_sinkconnect (GstPad *pad, GstCaps *vscaps)
|
||||||
}
|
}
|
||||||
else if (!strcmp (mimetype, "audio/x-mp3"))
|
else if (!strcmp (mimetype, "audio/x-mp3"))
|
||||||
{
|
{
|
||||||
gint layer;
|
gint layer = 3;
|
||||||
|
|
||||||
gst_caps_get_int(caps, "layer", &layer);
|
if (gst_caps_has_property(caps, "layer"))
|
||||||
|
gst_caps_get_int(caps, "layer", &layer);
|
||||||
|
else
|
||||||
|
GST_DEBUG(GST_CAT_PLUGIN_INFO,
|
||||||
|
"No layer specified, assuming layer 3");
|
||||||
|
|
||||||
/* we don't need to do anything here, compressed mp3 contains it all */
|
/* we don't need to do anything here, compressed mp3 contains it all */
|
||||||
avimux->auds.format = (layer == 3?
|
avimux->auds.format = (layer == 3?
|
||||||
GST_RIFF_WAVE_FORMAT_MPEGL3 :
|
GST_RIFF_WAVE_FORMAT_MPEGL3 :
|
||||||
GST_RIFF_WAVE_FORMAT_MPEGL12);
|
GST_RIFF_WAVE_FORMAT_MPEGL12);
|
||||||
|
avimux->auds_hdr.scale = avimux->auds_hdr.samplesize = 1;
|
||||||
|
avimux->auds_hdr.rate = avimux->auds.av_bps = 0;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (!strcmp (mimetype, "application/x-ogg"))
|
else if (!strcmp (mimetype, "application/x-ogg"))
|
||||||
{
|
{
|
||||||
avimux->auds.format = GST_RIFF_WAVE_FORMAT_VORBIS1;
|
avimux->auds.format = GST_RIFF_WAVE_FORMAT_VORBIS1;
|
||||||
|
avimux->auds_hdr.scale = avimux->auds_hdr.samplesize = 1;
|
||||||
|
avimux->auds_hdr.rate = avimux->auds.av_bps = 0;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -969,8 +977,14 @@ gst_avimux_stop_file (GstAviMux *avimux)
|
||||||
/* set rate and everything having to do with that */
|
/* set rate and everything having to do with that */
|
||||||
avimux->avi_hdr.us_frame = avimux->vids_hdr.scale = 1000000/avimux->framerate;
|
avimux->avi_hdr.us_frame = avimux->vids_hdr.scale = 1000000/avimux->framerate;
|
||||||
avimux->avi_hdr.max_bps = 0;
|
avimux->avi_hdr.max_bps = 0;
|
||||||
if (avimux->audio_pad_connected)
|
if (avimux->audio_pad_connected) {
|
||||||
|
/* calculate bps if needed */
|
||||||
|
if (!avimux->auds.av_bps) {
|
||||||
|
g_warning("Bps calculation needed!");
|
||||||
|
avimux->auds_hdr.rate = avimux->auds.av_bps * avimux->auds_hdr.scale;
|
||||||
|
}
|
||||||
avimux->avi_hdr.max_bps += avimux->auds.av_bps;
|
avimux->avi_hdr.max_bps += avimux->auds.av_bps;
|
||||||
|
}
|
||||||
if (avimux->video_pad_connected)
|
if (avimux->video_pad_connected)
|
||||||
avimux->avi_hdr.max_bps += ((avimux->vids.bit_cnt+7)/8) *
|
avimux->avi_hdr.max_bps += ((avimux->vids.bit_cnt+7)/8) *
|
||||||
avimux->framerate *
|
avimux->framerate *
|
||||||
|
|
Loading…
Reference in a new issue