AudioCodec.h
上传用户:lusi_8715
上传日期:2007-01-08
资源大小:199k
文件大小:2k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /**************************************************************************************
  2.  *                                                                                    *
  3.  * This application contains code from OpenDivX and is released as a "Larger Work"    *
  4.  * under that license. Consistant with that license, this application is released     *
  5.  * under the GNU General Public License.                                              *
  6.  *                                                                                    *
  7.  * The OpenDivX license can be found at: http://www.projectmayo.com/opendivx/docs.php *
  8.  * The GPL can be found at: http://www.gnu.org/copyleft/gpl.html                      *
  9.  *                                                                                    *
  10.  * Copyright (c) 2001 - Project Mayo                                                  *
  11.  *                                                                                    *
  12.  * Authors: Damien Chavarria <adrc at projectmayo.com>                                *
  13.  *                                                                                    *
  14.  **************************************************************************************/
  15. #ifndef AUDIO_CODEC_H
  16. #define AUDIO_CODEC_H
  17. #include "AviDecaps.h"
  18. #include <windows.h>
  19. #include <windowsx.h>
  20. #include <mmsystem.h>
  21. #include <memory.h>
  22. #include <stdlib.h>
  23. #include <stdio.h>
  24. #include <mmreg.h>
  25. #include <msacm.h>
  26. #include "mpglib.h"
  27. #include "ring.h"
  28. #include <mmreg.h>
  29. #include <msacm.h>
  30. #define INPUT_BUFFER_SIZE 16384
  31. /*
  32.  * The codec class
  33.  */
  34. class AudioCodec {
  35. private:
  36. /*
  37.  * ACM Codec
  38.  *
  39.  */
  40. HACMSTREAM      hacm;
  41. ACMSTREAMHEADER acmHeader;
  42. DWORD           acm;
  43. DWORD           acmLeft;
  44. DWORD           acmInLeft;
  45. /*
  46.  * MPEG only codec
  47.  *
  48.  */
  49. struct mpstr    mp;
  50. int             last_result;
  51. int             mpeg;
  52. int             real_size;
  53. WAVEFORMATEX   *oFormat;
  54. AviDecaps      *decaps;
  55. char           *in_buffer;
  56. char           *out_buffer;
  57. int             DecompressMp3(char *outmemory, int outmemsize, int *done);
  58. public:
  59. AudioCodec(AviDecaps *decaps, WAVEFORMATEX *lpWave);
  60. ~AudioCodec();
  61. BOOL          IsOK();
  62. WAVEFORMATEX *GetFormat();
  63. int           EmptyBuffers();
  64. char         *GetCodecName();
  65. int           Decompress(void *buffer, int size);
  66. int           Close();
  67. };
  68. #endif