From: <fe...@ke...> - 2007-06-29 18:16:07
|
CVS Root: /cvs/gstreamer Module: gst-openmax Changes by: felipec Date: Fri Jun 29 2007 18:15:56 UTC Log message: Generate proper capabilities for the output buffer in the vorbis decoder. Modified files: omx : gstomx_vorbisdec.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_vorbisdec.c.diff?r1=1.1&r2=1.2 ====Begin Diffs==== Index: gstomx_vorbisdec.c =================================================================== RCS file: /cvs/gstreamer/gst-openmax/omx/gstomx_vorbisdec.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gstomx_vorbisdec.c 15 Jun 2007 11:59:03 -0000 1.1 +++ gstomx_vorbisdec.c 29 Jun 2007 18:15:42 -0000 1.2 @@ -105,6 +105,45 @@ } static void +set_caps (GstOmxBase *omx_base) +{ + guint rate; + guint channels; + + { + OMX_AUDIO_PARAM_PCMMODETYPE *param; + param = calloc (1, sizeof (OMX_AUDIO_PARAM_PCMMODETYPE)); + param->nSize = sizeof (OMX_AUDIO_PARAM_PCMMODETYPE); + param->nVersion.nVersion = 1; + param->nPortIndex = 1; + OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, param); + rate = param->nSamplingRate; + channels = param->nChannels; + free (param); + } + GST_DEBUG_OBJECT (omx_base, "fixing caps"); + GstCaps *new_caps; + new_caps = gst_caps_new_simple ("audio/x-raw-int", + "width", G_TYPE_INT, 16, + "depth", G_TYPE_INT, 16, + "rate", G_TYPE_INT, rate, + "signed", G_TYPE_BOOLEAN, TRUE, + "endianness", G_TYPE_INT, G_BYTE_ORDER ? 1234 : 4321, + "channels", G_TYPE_INT, channels, + NULL); + GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps); + gst_pad_set_caps (omx_base->srcpad, new_caps); +} +static void type_instance_init (GTypeInstance *instance, gpointer g_class) { @@ -117,6 +156,7 @@ GST_DEBUG_OBJECT (omx_base, "start"); omx_base->omx_component = OMX_COMPONENT_ID; + omx_base->set_caps = set_caps; GType |