ex
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/duer-os-light/external/mp3dec/pub/mpadecobjfixpt.h@47:9e361da97763, 2017-07-18 (annotated)
- Committer:
- TMBOY
- Date:
- Tue Jul 18 16:54:45 2017 +0800
- Revision:
- 47:9e361da97763
?
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| TMBOY | 47:9e361da97763 | 1 | /* ***** BEGIN LICENSE BLOCK ***** |
| TMBOY | 47:9e361da97763 | 2 | * Version: RCSL 1.0/RPSL 1.0 |
| TMBOY | 47:9e361da97763 | 3 | * |
| TMBOY | 47:9e361da97763 | 4 | * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. |
| TMBOY | 47:9e361da97763 | 5 | * |
| TMBOY | 47:9e361da97763 | 6 | * The contents of this file, and the files included with this file, are |
| TMBOY | 47:9e361da97763 | 7 | * subject to the current version of the RealNetworks Public Source License |
| TMBOY | 47:9e361da97763 | 8 | * Version 1.0 (the "RPSL") available at |
| TMBOY | 47:9e361da97763 | 9 | * http://www.helixcommunity.org/content/rpsl unless you have licensed |
| TMBOY | 47:9e361da97763 | 10 | * the file under the RealNetworks Community Source License Version 1.0 |
| TMBOY | 47:9e361da97763 | 11 | * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, |
| TMBOY | 47:9e361da97763 | 12 | * in which case the RCSL will apply. You may also obtain the license terms |
| TMBOY | 47:9e361da97763 | 13 | * directly from RealNetworks. You may not use this file except in |
| TMBOY | 47:9e361da97763 | 14 | * compliance with the RPSL or, if you have a valid RCSL with RealNetworks |
| TMBOY | 47:9e361da97763 | 15 | * applicable to this file, the RCSL. Please see the applicable RPSL or |
| TMBOY | 47:9e361da97763 | 16 | * RCSL for the rights, obligations and limitations governing use of the |
| TMBOY | 47:9e361da97763 | 17 | * contents of the file. |
| TMBOY | 47:9e361da97763 | 18 | * |
| TMBOY | 47:9e361da97763 | 19 | * This file is part of the Helix DNA Technology. RealNetworks is the |
| TMBOY | 47:9e361da97763 | 20 | * developer of the Original Code and owns the copyrights in the portions |
| TMBOY | 47:9e361da97763 | 21 | * it created. |
| TMBOY | 47:9e361da97763 | 22 | * |
| TMBOY | 47:9e361da97763 | 23 | * This file, and the files included with this file, is distributed and made |
| TMBOY | 47:9e361da97763 | 24 | * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
| TMBOY | 47:9e361da97763 | 25 | * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
| TMBOY | 47:9e361da97763 | 26 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS |
| TMBOY | 47:9e361da97763 | 27 | * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
| TMBOY | 47:9e361da97763 | 28 | * |
| TMBOY | 47:9e361da97763 | 29 | * Technology Compatibility Kit Test Suite(s) Location: |
| TMBOY | 47:9e361da97763 | 30 | * http://www.helixcommunity.org/content/tck |
| TMBOY | 47:9e361da97763 | 31 | * |
| TMBOY | 47:9e361da97763 | 32 | * Contributor(s): |
| TMBOY | 47:9e361da97763 | 33 | * |
| TMBOY | 47:9e361da97763 | 34 | * ***** END LICENSE BLOCK ***** */ |
| TMBOY | 47:9e361da97763 | 35 | |
| TMBOY | 47:9e361da97763 | 36 | #ifndef _MPADECOBJFIXPT_H_ |
| TMBOY | 47:9e361da97763 | 37 | #define _MPADECOBJFIXPT_H_ |
| TMBOY | 47:9e361da97763 | 38 | |
| TMBOY | 47:9e361da97763 | 39 | #include "mp3dec.h" /* public C API for new MP3 decoder */ |
| TMBOY | 47:9e361da97763 | 40 | |
| TMBOY | 47:9e361da97763 | 41 | class CMpaDecObj |
| TMBOY | 47:9e361da97763 | 42 | { |
| TMBOY | 47:9e361da97763 | 43 | public: |
| TMBOY | 47:9e361da97763 | 44 | CMpaDecObj(); |
| TMBOY | 47:9e361da97763 | 45 | ~CMpaDecObj(); |
| TMBOY | 47:9e361da97763 | 46 | |
| TMBOY | 47:9e361da97763 | 47 | /////////////////////////////////////////////////////////////////////////// |
| TMBOY | 47:9e361da97763 | 48 | // Function: Init_n |
| TMBOY | 47:9e361da97763 | 49 | // Purpose: Initialize the mp3 decoder. |
| TMBOY | 47:9e361da97763 | 50 | // Parameters: pSync a pointer to a syncword |
| TMBOY | 47:9e361da97763 | 51 | // ulSize the size of the buffer pSync points to |
| TMBOY | 47:9e361da97763 | 52 | // bUseSize this tells the decoder to use the input frame |
| TMBOY | 47:9e361da97763 | 53 | // size on the decode instead of calculating |
| TMBOY | 47:9e361da97763 | 54 | // the frame size. This is necessary when |
| TMBOY | 47:9e361da97763 | 55 | // our formatted mp3 data (main_data_begin always |
| TMBOY | 47:9e361da97763 | 56 | // equal to 0). |
| TMBOY | 47:9e361da97763 | 57 | // |
| TMBOY | 47:9e361da97763 | 58 | // Returns: returns 1 on success, 0 on failure |
| TMBOY | 47:9e361da97763 | 59 | /////////////////////////////////////////////////////////////////////////// |
| TMBOY | 47:9e361da97763 | 60 | int Init_n(unsigned char *pSync, |
| TMBOY | 47:9e361da97763 | 61 | unsigned long ulSize, |
| TMBOY | 47:9e361da97763 | 62 | unsigned char bUseSize=0); |
| TMBOY | 47:9e361da97763 | 63 | |
| TMBOY | 47:9e361da97763 | 64 | /////////////////////////////////////////////////////////////////////////// |
| TMBOY | 47:9e361da97763 | 65 | // Function: DecodeFrame_v |
| TMBOY | 47:9e361da97763 | 66 | // Purpose: Decodes one mp3 frame |
| TMBOY | 47:9e361da97763 | 67 | // Parameters: pSource pointer to an mp3 frame (at a syncword) |
| TMBOY | 47:9e361da97763 | 68 | // pulSize size of the buffer pSource points to. It will |
| TMBOY | 47:9e361da97763 | 69 | // contain the number of mp3 bytes decoded upon |
| TMBOY | 47:9e361da97763 | 70 | // return. |
| TMBOY | 47:9e361da97763 | 71 | // pPCM pointer to a buffer to decode into |
| TMBOY | 47:9e361da97763 | 72 | // pulPCMSize size of the PCM buffer. It will contain the |
| TMBOY | 47:9e361da97763 | 73 | // number of PCM bytes prodced upon return. |
| TMBOY | 47:9e361da97763 | 74 | /////////////////////////////////////////////////////////////////////////// |
| TMBOY | 47:9e361da97763 | 75 | void DecodeFrame_v(unsigned char *pSource, |
| TMBOY | 47:9e361da97763 | 76 | unsigned long *pulSize, |
| TMBOY | 47:9e361da97763 | 77 | unsigned char *pPCM, |
| TMBOY | 47:9e361da97763 | 78 | unsigned long *pulPCMSize); |
| TMBOY | 47:9e361da97763 | 79 | |
| TMBOY | 47:9e361da97763 | 80 | // overloaded new version that returns error code in errCode |
| TMBOY | 47:9e361da97763 | 81 | void DecodeFrame_v(unsigned char *pSource, |
| TMBOY | 47:9e361da97763 | 82 | unsigned long *pulSize, |
| TMBOY | 47:9e361da97763 | 83 | unsigned char *pPCM, |
| TMBOY | 47:9e361da97763 | 84 | unsigned long *pulPCMSize, |
| TMBOY | 47:9e361da97763 | 85 | int *errCode); |
| TMBOY | 47:9e361da97763 | 86 | |
| TMBOY | 47:9e361da97763 | 87 | void GetPCMInfo_v(unsigned long &ulSampRate, |
| TMBOY | 47:9e361da97763 | 88 | int &nChannels, |
| TMBOY | 47:9e361da97763 | 89 | int &nBitsPerSample); |
| TMBOY | 47:9e361da97763 | 90 | |
| TMBOY | 47:9e361da97763 | 91 | // return number of samples per frame, PER CHANNEL (renderer multiplies this result by nChannels) |
| TMBOY | 47:9e361da97763 | 92 | int GetSamplesPerFrame_n(); |
| TMBOY | 47:9e361da97763 | 93 | |
| TMBOY | 47:9e361da97763 | 94 | void SetTrustPackets(unsigned char bTrust) { m_bTrustPackets = bTrust; } |
| TMBOY | 47:9e361da97763 | 95 | |
| TMBOY | 47:9e361da97763 | 96 | private: |
| TMBOY | 47:9e361da97763 | 97 | void * m_pDec; // generic void ptr |
| TMBOY | 47:9e361da97763 | 98 | |
| TMBOY | 47:9e361da97763 | 99 | void * m_pDecL1; // not implemented (could use old Xing mpadecl1.cpp) |
| TMBOY | 47:9e361da97763 | 100 | void * m_pDecL2; // not implemented (could use old Xing mpadecl2.cpp) |
| TMBOY | 47:9e361da97763 | 101 | HMP3Decoder m_pDecL3; |
| TMBOY | 47:9e361da97763 | 102 | |
| TMBOY | 47:9e361da97763 | 103 | MP3FrameInfo m_lastMP3FrameInfo; |
| TMBOY | 47:9e361da97763 | 104 | unsigned char m_bUseFrameSize; |
| TMBOY | 47:9e361da97763 | 105 | unsigned char m_bTrustPackets; |
| TMBOY | 47:9e361da97763 | 106 | }; |
| TMBOY | 47:9e361da97763 | 107 | |
| TMBOY | 47:9e361da97763 | 108 | #endif /* _MPADECOBJFIXPT_H_ */ |
