|
Packit |
47f805 |
/**
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
* Lame ACM wrapper, encode/decode MP3 based RIFF/AVI files in MS Windows
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
* Copyright (c) 2002 Steve Lhomme <steve.lhomme at free.fr>
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
47f805 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
47f805 |
* License as published by the Free Software Foundation; either
|
|
Packit |
47f805 |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
47f805 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
47f805 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
47f805 |
* Lesser General Public License for more details.
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
47f805 |
* License along with this library; if not, write to the Free Software
|
|
Packit |
47f805 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
*/
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/*!
|
|
Packit |
47f805 |
\author Steve Lhomme
|
|
Packit |
47f805 |
\version \$Id: DecodeStream.h,v 1.2 2006/12/25 21:37:34 robert Exp $
|
|
Packit |
47f805 |
*/
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
#if !defined(_DECODESTREAM_H__INCLUDED_)
|
|
Packit |
47f805 |
#define _DECODESTREAM_H__INCLUDED_
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
#if _MSC_VER >= 1000
|
|
Packit |
47f805 |
#pragma once
|
|
Packit |
47f805 |
#endif // _MSC_VER >= 1000
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
#include <mmreg.h>
|
|
Packit |
47f805 |
#include <msacm.h>
|
|
Packit |
47f805 |
#include <msacmdrv.h>
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
#include "ADbg/ADbg.h"
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
struct lame_global_flags;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
class DecodeStream
|
|
Packit |
47f805 |
{
|
|
Packit |
47f805 |
public:
|
|
Packit |
47f805 |
DecodeStream( );
|
|
Packit |
47f805 |
virtual ~DecodeStream( );
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
static DecodeStream * Create();
|
|
Packit |
47f805 |
static const bool Erase(const DecodeStream * a_ACMStream);
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
bool init(const int nSamplesPerSec, const int nChannels, const int nAvgBytesPerSec, const int nSourceBitrate);
|
|
Packit |
47f805 |
bool open();
|
|
Packit |
47f805 |
bool close(LPBYTE pOutputBuffer, DWORD *pOutputSize);
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
DWORD GetOutputSizeForInput(const DWORD the_SrcLength) const;
|
|
Packit |
47f805 |
bool ConvertBuffer(LPACMDRVSTREAMHEADER a_StreamHeader);
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
static unsigned int GetOutputSampleRate(int samples_per_sec, int bitrate, int channels);
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
protected:
|
|
Packit |
47f805 |
lame_global_flags * gfp;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
ADbg * my_debug;
|
|
Packit |
47f805 |
int my_SamplesPerSec;
|
|
Packit |
47f805 |
int my_Channels;
|
|
Packit |
47f805 |
int my_AvgBytesPerSec;
|
|
Packit |
47f805 |
DWORD my_SamplesPerBlock;
|
|
Packit |
47f805 |
int my_SourceBitrate;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
MPSTR my_DecodeData;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
unsigned int m_WorkingBufferUseSize;
|
|
Packit |
47f805 |
char m_WorkingBuffer[2304*2]; // should be at least twice my_SamplesPerBlock
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
inline int GetBytesPerBlock(DWORD bytes_per_sec, DWORD samples_per_sec, int BlockAlign) const;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
};
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
#endif // !defined(_DECODESTREAM_H__INCLUDED_)
|
|
Packit |
47f805 |
|