DECODER_main.c File Reference


Detailed Description

This module provides decoder interface handle.

REVISION

Definition in file DECODER_main.c.

#include "../SYSTEM/sys_hardware.h"
#include "../coder/coder.h"
#include "decoder.h"

Include dependency graph for DECODER_main.c:

Include dependency graph

Go to the source code of this file.

Functions

int * DECODER_main (void)
 Function fetches decoder output upon PCM request.


Function Documentation

int* DECODER_main void   ) 
 

Function fetches decoder output upon PCM request.

All decoders share this same pipe interface although they might use different sized pipes.

Returns:
Readable pipe frame if data is available, otherwise NULL.

Definition at line 45 of file DECODER_main.c.

References AI_STOP, Decoder, st_CODER::flag, st_DECODER::flag, st_DECODER::pipe, PIPE_readNext(), SAUDIOCTL, SEM_coder, and SENDOFMUSIC.

Referenced by AUDIO_start().

00046 {
00047     PIPE_Obj *  pipe = &Decoder.pipe;
00048     
00049     if(Decoder.flag & DEC_PIPE_READNEXT_PENDING)
00050     {
00051         PIPE_readNext(pipe);
00052         Decoder.flag &= ~DEC_PIPE_READNEXT_PENDING;
00053         
00054         if(SEM_count(SEM_coder) == 0) SEM_post(SEM_coder);
00055     }
00056     
00057     if( PIPE_readFrameNum(pipe) )
00058     {
00059         Decoder.flag |= DEC_PIPE_READNEXT_PENDING;
00060         return pipe->RdFrame.Frame;
00061     }
00062     else if(Coder.flag & F_CODER_DEC_EOF)
00063     {
00064         if(!(Coder.flag&F_CODER_DEC_EOF_POSTED))
00065         {
00066             Coder.flag |= F_CODER_DEC_EOF_POSTED;
00067             mMSG_send(sysMsgQ, SYS_MSG_ID, SAUDIOCTL, AI_STOP, SYS_FOREVER);
00068             mMSG_send(uiChildMsgQ, SYS_MSG_ID, SENDOFMUSIC, DONTCARE, SYS_FOREVER);
00069         }
00070         return NULL;
00071     }
00072     
00073     if(SEM_count(SEM_coder) == 0) SEM_post(SEM_coder);
00074     return NULL;    
00075 }

Here is the call graph for this function:


Generated on Wed Jan 19 01:12:55 2005 for neuros-firmware by  doxygen 1.3.9.1