No. The config information (which is 2 bytes) is sent before any other
frames are sent.

On Jul 13, 11:57 pm, sesha giri <sesha_giri_n...@yahoo.co.in> wrote:
> Do you mean to say that aac parser adds the header to the frame..
>
> ________________________________
> From: RaviY <yend...@pv.com>
> To: android-framework <android-framework@googlegroups.com>
> Sent: Monday, 13 July, 2009 11:49:45 PM
> Subject: Re: how does omx component comes to know about the number of 
> channels  and sampling rate of the audio clip
>
> You can look at how this "config" information is passed from the aac
> parser to the aac decoder. NOTE: The parameter values are not directly
> sent to the decoder. Instead, they are sent in a buffer (called the
> config buffer) which the decoder is supposed to understand and decode.
>
> -Ravi
>
> On Jul 13, 12:58 pm, sesha giri <sesha_giri_n...@yahoo.co.in> wrote:
>
> > Hi Ravi,
>
> > I am trying to use my own g711 decoder instead of the existing g711 decoder.
> > But in case of g711 decoder the frames given to decoder does not decode the 
> > sampling frequecy info.
> > So thats the reason by some means I wanted to pass this info from wav 
> > parser to decode component.
>
> > --Giri
>
> > ________________________________
> > From: RaviY <yend...@pv.com>
> > To: android-framework <android-framework@googlegroups.com>
> > Sent: Monday, 13 July, 2009 7:11:20 PM
> > Subject: Re: how does omx component comes to know about the number of 
> > channels  and sampling rate of the audio clip
>
> > - We don't pass that information from the parser node to the decoder
> > node. The main reason being that we don't trust that information.
> > - There isn't and shouldn't be any information about the bitstream
> > that the decoder cannot decipher.
> > - Once again, why do you have a decoder for a WAV content? Are you
> > adding support for formats other than PCM, ulaw, and alaw?
>
> > -Ravi
>
> > On Jul 13, 1:28 am, sesha giri <sesha_giri_n...@yahoo.co.in> wrote:
>
> > > Hi Ravi,
>
> > > I had seen this case in pvmf_omx_audiodec_node.cpp
>
> > > This is what the case(The code is from the cupcake version of Android):
> > >        case OMX_EventPortSettingsChanged:
> > >         {
> > >             LOGD("EventHandlerProcessing::OMX_EventPortSettingsChanged");
> > >             PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, 
> > > PVLOGMSG_STACK_TRACE,
> > >                             (0, 
> > > "PVMFOMXAudioDecNode::EventHandlerProcessing: 
> > > OMX_EventPortSettingsChanged returned from OMX component"));
>
> > >             // first check if dynamic reconfiguration is already in 
> > > progress,
> > >             // if so, wait until this is completed, and then initiate the 
> > > 2nd reconfiguration
> > >             if (iDynamicReconfigInProgress)
> > >             {
> > >                 
> > > LOGD("EventHandlerProcessing::OMX_EventPortSettingsChanged::iDynamicReconfigInProgress");
> > >                 PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, 
> > > PVLOGMSG_STACK_TRACE,
> > >                                 (0, 
> > > "PVMFOMXAudioDecNode::EventHandlerProcessing: 
> > > OMX_EventPortSettingsChanged returned for port %d, dynamic reconfig 
> > > already in progress", aData1));
>
> > >                 iSecondPortToReconfig = aData1;
> > >                 iSecondPortReportedChange = true;
>
> > >                 // check the audio sampling rate and fs right away in 
> > > case of output port
> > >                 // is this output port?
> > >                 if (iSecondPortToReconfig == iOutputPortIndex)
> > >                 {
>
> > >                     OMX_ERRORTYPE Err;
> > >                     // GET the output buffer params and sizes
> > >                     OMX_AUDIO_PARAM_PCMMODETYPE Audio_Pcm_Param;
> > >                     Audio_Pcm_Param.nPortIndex = iOutputPortIndex; // 
> > > we're looking for output port params
> > >                     Audio_Pcm_Param.nSize = 
> > > sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
> > >                     Audio_Pcm_Param.nVersion.s.nVersionMajor = 
> > > SPECVERSIONMAJOR;
> > >                     Audio_Pcm_Param.nVersion.s.nVersionMinor = 
> > > SPECVERSIONMINOR;
> > >                     Audio_Pcm_Param.nVersion.s.nRevision = SPECREVISION;
> > >                     Audio_Pcm_Param.nVersion.s.nStep = SPECSTEP;
>
> > >                     Err = OMX_GetParameter(iOMXAudioDecoder, 
> > > OMX_IndexParamAudioPcm, &Audio_Pcm_Param);
> > >                     if (Err != OMX_ErrorNone)
> > >                     {
> > >                         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, 
> > > PVLOGMSG_ERR,
> > >                                         (0, 
> > > "PVMFOMXAudioDecNode::EventHandlerProcessing() PortSettingsChanged -> 
> > > Cannot get component output parameters"));
>
> > >                         SetState(EPVMFNodeError);
> > >                         ReportErrorEvent(PVMFErrResource);
> > >                     }
>
> > >                     iPCMSamplingRate = Audio_Pcm_Param.nSamplingRate; // 
> > > can be set to 0 (if unknown)
>
> > >                     if (iPCMSamplingRate == 0) // use default sampling 
> > > rate (i.e. 48000)
> > >                         iPCMSamplingRate = 
> > > PVOMXAUDIODEC_DEFAULT_SAMPLINGRATE;
>
> > >                     iNumberOfAudioChannels = Audio_Pcm_Param.nChannels;   
> > >      // should be 1 or 2
> > >                     if (iNumberOfAudioChannels != 1 && 
> > > iNumberOfAudioChannels != 2)
> > >                     {
> > >                         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, 
> > > PVLOGMSG_ERR,
> > >                                         (0, 
> > > "PVMFOMXAudioDecNode::EventHandlerProcessing() PortSettingsChanged -> 
> > > Output parameters num channels = %d", iNumberOfAudioChannels));
>
> > >                         SetState(EPVMFNodeError);
> > >                         ReportErrorEvent(PVMFErrResource);
> > >                     }
> > >                 }
> > >             }
> > >             else
> > >             {
> > >                 PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, 
> > > PVLOGMSG_STACK_TRACE,
> > >                                 (0, 
> > > "PVMFOMXAudioDecNode::EventHandlerProcessing: 
> > > OMX_EventPortSettingsChanged returned for port %d", aData1));
>
> > >                 iProcessingState = 
> > > EPVMFOMXAudioDecNodeProcessingState_PortReconfig;
> > >                 iPortIndexForDynamicReconfig = aData1;
> > >                 // start "discarding" data right away, don't wait
> > >                 // check the audio sampling rate and fs right away in 
> > > case of output port
> > >                 // is this output port?
> > >                 if (iPortIndexForDynamicReconfig == iOutputPortIndex)
> > >                 {
>
> > >                     OMX_ERRORTYPE Err;
> > >                     // GET the output buffer params and sizes
> > >                     OMX_AUDIO_PARAM_PCMMODETYPE Audio_Pcm_Param;
> > >                     Audio_Pcm_Param.nPortIndex = iOutputPortIndex; // 
> > > we're looking for output port params
> > >                     Audio_Pcm_Param.nSize = 
> > > sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
> > >                     Audio_Pcm_Param.nVersion.s.nVersionMajor = 
> > > SPECVERSIONMAJOR;
> > >                     Audio_Pcm_Param.nVersion.s.nVersionMinor = 
> > > SPECVERSIONMINOR;
> > >                     Audio_Pcm_Param.nVersion.s.nRevision = SPECREVISION;
> > >                     Audio_Pcm_Param.nVersion.s.nStep = SPECSTEP;
>
> > >                     Err = OMX_GetParameter(iOMXAudioDecoder, 
> > > OMX_IndexParamAudioPcm, &Audio_Pcm_Param);
> > >                     if (Err != OMX_ErrorNone)
> > >                     {
> > >                         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, 
> > > PVLOGMSG_ERR,
> > >                                         (0, 
> > > "PVMFOMXAudioDecNode::EventHandlerProcessing() PortSettingsChanged -> 
> > > Cannot get component output parameters"));
>
> > >                         SetState(EPVMFNodeError);
> > >                         ReportErrorEvent(PVMFErrResource);
>
> > >                     }
>
> > >                     iPCMSamplingRate = Audio_Pcm_Param.nSamplingRate; // 
> > > can be set to 0 (if unknown)
>
> > >                     if (iPCMSamplingRate == 0) // use default sampling 
> > > rate (i.e. 48000)
> > >                         iPCMSamplingRate = 
> > > PVOMXAUDIODEC_DEFAULT_SAMPLINGRATE;
>
> > >                     iNumberOfAudioChannels = Audio_Pcm_Param.nChannels;   
> > >      // should be 1 or 2
> > >                     if (iNumberOfAudioChannels != 1 && 
> > > iNumberOfAudioChannels != 2)
> > >                     {
> > >                         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, 
> > > PVLOGMSG_ERR,
> > >                                         (0, 
> > > "PVMFOMXAudioDecNode::EventHandlerProcessing() PortSettingsChanged -> 
> > > Output parameters num channels = %d", iNumberOfAudioChannels));
>
> > >                         SetState(EPVMFNodeError);
> > >                         ReportErrorEvent(PVMFErrResource);
>
> > >                     }
>
> > >                 }
> > >                 iDynamicReconfigInProgress = true;
> > >             }
>
> > >             RunIfNotReady();
> > >             break;
> > >         }//end of case OMX_PortSettingsChanged
>
> > > Here if you see it gets the parameter from audio decode node which in 
> > > turn calls the decoder component layer
> > > After geting the values it sets its own value.
>
> > > But what I need is that I want to get the values from WAV Parser and set 
> > > the same to decoder component layer
> > > Because In my case the WAV Parser is the one which has the proper info 
> > > which I want to Pass it on to decoder layer.
>
> > > How can I do that.
>
> > > --Giri
>
> > > ________________________________
> > > From: RaviY <yend...@pv.com>
> > > To: android-framework <android-framework@googlegroups.com>
> > > Sent: Saturday, 11 July, 2009 7:39:29 PM
> > > Subject: Re: how does omx component comes to know about the number of 
> > > channels  and sampling rate of the audio clip
>
> > > Search for OMX_EventPortSettingsChanged.
>
> > > On Jul 11, 1:12 am, sesha giri <sesha_giri_n...@yahoo.co.in> wrote:
>
> > > > Hi
>
> > > > I was asking how does that port reconfiguration happens.
> > > > I didnt find that any where
> > > > Even it happens it does not configure the sampling rate and number of 
> > > > chanels.
>
> > > > Regarding the WAV component I am writing my own WAV component for G711.
>
> > > > -Giri
>
> > > > ________________________________
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to