📄 test2.h
字号:
#ifndef TEST2_H
#define TEST2_H
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/file.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>
#include <signal.h>
#include <endian.h>
#include <linux/soundcard.h>
#include <sys/resource.h>
#include <linux/config.h>
#ifdef CONFIG_KEY
#include <linux/key.h>
#endif
//#include "defs.h"
#include "mpegdec.h"
#include "fastmem.h"
int prebuflimit;
static unsigned char ready = 0;
/*
* Global settings per decode stream. Used to control the final
* PCM to raw driver data conversion.
*/
static int stereo;
static int bits;
static int quality;
/****************************************************************************/
/*
* Master MP3 decoder settings.
*/
static MPEGDEC_STREAM *mps = NULL;
static MPEGDEC_CTRL mpa_ctrl;
static MPEGDEC_CTRL mpa_defctrl = {
NULL, // Bitstream access is default file I/O
// Layers I & II settings (#3)
{ FALSE, { 1, 2, 48000 }, { 1, 2, 48000 } },
// Layer III settings (#3)
{ FALSE, { 1, 2, 48000 }, { 1, 2, 48000 } },
0, // #2: Don't check mpeg validity at start
// (needed for mux stream)
2048 // #2: Stream Buffer size
};
static char *modes[] = { "stereo", "j-stereo", "dual", "mono" };
/****************************************************************************/
/*
* MP3 data stream support (could be file or http stream).
*/
#define MP3_BUF_SIZE (1024)
static char *mp3_filename;
static int mp3_fd;
static INT8 *mp3_buffer;
static UINT32 mp3_buffer_size;
static UINT32 mp3_buffer_offset;
static UINT32 mp3_buffer_next_block;
static UINT32 mp3_stream_size;
static char *rawbuf;
static char *prebuffer;
int prebufsize;
int prebufcnt;
int prebufnow;
INT16 *pcm[MPEGDEC_MAX_CHANNELS];
int dspfd;
int pcmcount, rawcount;
static int getstreamsize(void);
static UINT32 getnextbuffer();
INT32 bs_open(char *stream_name, INT32 buffer_size, INT32 *stream_size);
void bs_close(INT32 handle);
INT32 bs_read(INT32 handle, void *buffer, INT32 num_bytes);
int bs_seek(INT32 handle, INT32 abs_byte_seek_pos);
void setdsp(int fd, int playstereo, int playbits);
int writepcm(int fd, INT16 *pcm[2], int count);
void flushpcm(int fd);
void close_all();
int ready_play( const char *fn );
void play_frame( unsigned char *ply );
void play_forward( int f );
void play_backward( int b );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -