亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? sbcdec.c

?? BlueZ源碼
?? C
字號(hào):
/* * *  Bluetooth low-complexity, subband codec (SBC) decoder * *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org> * * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA * */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include <stdio.h>#include <errno.h>#include <fcntl.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <getopt.h>#include <sys/stat.h>#include <sys/ioctl.h>#include <sys/soundcard.h>#include "sbc.h"#include "formats.h"#define BUF_SIZE 8192static int verbose = 0;static void decode(char *filename, char *output, int tofile){	unsigned char buf[BUF_SIZE], *stream;	struct stat st;	off_t filesize;	sbc_t sbc;	int fd, ad, pos, streamlen, framelen, count, written, len;	int format = AFMT_S16_BE, frequency, channels;	if (stat(filename, &st) < 0) {		fprintf(stderr, "Can't get size of file %s: %s\n",						filename, strerror(errno));		return;	}	filesize = st.st_size;	stream = malloc(st.st_size);	if (!stream) {		fprintf(stderr, "Can't allocate memory for %s: %s\n",						filename, strerror(errno));		return;	}	fd = open(filename, O_RDONLY);	if (fd < 0) {		fprintf(stderr, "Can't open file %s: %s\n",						filename, strerror(errno));		goto free;	}	if (read(fd, stream, st.st_size) != st.st_size) {		fprintf(stderr, "Can't read content of %s: %s\n",						filename, strerror(errno));		close(fd);		goto free;	}	close(fd);	pos = 0;	streamlen = st.st_size;	if (tofile)		ad = open(output, O_WRONLY | O_CREAT | O_TRUNC, 0644);	else		ad = open(output, O_WRONLY, 0);	if (ad < 0) {		fprintf(stderr, "Can't open output %s: %s\n",						output, strerror(errno));		goto free;	}	sbc_init(&sbc, 0L);	sbc.endian = SBC_BE;	framelen = sbc_decode(&sbc, stream, streamlen, buf, sizeof(buf), &len);	channels = sbc.mode == SBC_MODE_MONO ? 1 : 2;	switch (sbc.frequency) {	case SBC_FREQ_16000:		frequency = 16000;		break;	case SBC_FREQ_32000:		frequency = 32000;		break;	case SBC_FREQ_44100:		frequency = 44100;		break;	case SBC_FREQ_48000:		frequency = 48000;		break;	default:		frequency = 0;	}	if (verbose) {		fprintf(stderr,"decoding %s with rate %d, %d subbands, "			"%d bits, allocation method %s and mode %s\n",			filename, frequency, sbc.subbands * 4 + 4, sbc.bitpool,			sbc.allocation == SBC_AM_SNR ? "SNR" : "LOUDNESS",			sbc.mode == SBC_MODE_MONO ? "MONO" :					sbc.mode == SBC_MODE_STEREO ?						"STEREO" : "JOINTSTEREO");	}	if (tofile) {		struct au_header au_hdr;		au_hdr.magic       = AU_MAGIC;		au_hdr.hdr_size    = BE_INT(24);		au_hdr.data_size   = BE_INT(0);		au_hdr.encoding    = BE_INT(AU_FMT_LIN16);		au_hdr.sample_rate = BE_INT(frequency);		au_hdr.channels    = BE_INT(channels);		written = write(ad, &au_hdr, sizeof(au_hdr));		if (written < sizeof(au_hdr)) {			fprintf(stderr, "Failed to write header\n");			goto close;		}	} else {		if (ioctl(ad, SNDCTL_DSP_SETFMT, &format) < 0) {			fprintf(stderr, "Can't set audio format on %s: %s\n",						output, strerror(errno));			goto close;		}		if (ioctl(ad, SNDCTL_DSP_CHANNELS, &channels) < 0) {			fprintf(stderr, "Can't set number of channels on %s: %s\n",						output, strerror(errno));			goto close;		}		if (ioctl(ad, SNDCTL_DSP_SPEED, &frequency) < 0) {			fprintf(stderr, "Can't set audio rate on %s: %s\n",						output, strerror(errno));			goto close;		}	}	count = len;	while (framelen > 0) {		/* we have completed an sbc_decode at this point sbc.len is the		 * length of the frame we just decoded count is the number of		 * decoded bytes yet to be written */		if (count + len >= BUF_SIZE) {			/* buffer is too full to stuff decoded audio in so it			 * must be written to the device */			written = write(ad, buf, count);			if (written > 0)				count -= written;		}		/* sanity check */		if (count + len >= BUF_SIZE) {			fprintf(stderr,				"buffer size of %d is too small for decoded"				" data (%d)\n", BUF_SIZE, len + count);			exit(1);		}		/* push the pointer in the file forward to the next bit to be		 * decoded tell the decoder to decode up to the remaining		 * length of the file (!) */		pos += framelen;		framelen = sbc_decode(&sbc, stream + pos, streamlen - pos,					buf + count, sizeof(buf) - count, &len);		/* increase the count */		count += len;	}	if (count > 0) {		written = write(ad, buf, count);		if (written > 0)			count -= written;	}close:	sbc_finish(&sbc);	close(ad);free:	free(stream);}static void usage(void){	printf("SBC decoder utility ver %s\n", VERSION);	printf("Copyright (c) 2004-2008  Marcel Holtmann\n\n");	printf("Usage:\n"		"\tsbcdec [options] file(s)\n"		"\n");	printf("Options:\n"		"\t-h, --help           Display help\n"		"\t-v, --verbose        Verbose mode\n"		"\t-d, --device <dsp>   Sound device\n"		"\t-f, --file <file>    Decode to a file\n"		"\n");}static struct option main_options[] = {	{ "help",	0, 0, 'h' },	{ "device",	1, 0, 'd' },	{ "verbose",	0, 0, 'v' },	{ "file",	1, 0, 'f' },	{ 0, 0, 0, 0 }};int main(int argc, char *argv[]){	char *output = NULL;	int i, opt, tofile = 0;	while ((opt = getopt_long(argc, argv, "+hvd:f:",						main_options, NULL)) != -1) {		switch(opt) {		case 'h':			usage();			exit(0);		case 'v':			verbose = 1;			break;		case 'd':			if (output)				free(output);			output = strdup(optarg);			tofile = 0;			break;		case 'f' :			if (output)				free(output);			output = strdup(optarg);			tofile = 1;			break;		default:			exit(1);		}	}	argc -= optind;	argv += optind;	optind = 0;	if (argc < 1) {		usage();		exit(1);	}	for (i = 0; i < argc; i++)		decode(argv[i], output ? output : "/dev/dsp", tofile);	if (output)		free(output);	return 0;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
香蕉av福利精品导航| 亚洲综合色区另类av| 国产精品女人毛片| 亚洲色图.com| 丝袜美腿高跟呻吟高潮一区| 日本一区中文字幕| 国产精品69毛片高清亚洲| jizzjizzjizz欧美| 欧美军同video69gay| 久久亚洲精华国产精华液| 国产精品欧美一区喷水| 亚洲444eee在线观看| 国产精品538一区二区在线| 色综合久久综合中文综合网| 7777精品伊人久久久大香线蕉最新版 | 色菇凉天天综合网| 日韩欧美三级在线| 亚洲欧美激情插| 免费日韩伦理电影| 一区二区三区精品久久久| 精品亚洲国产成人av制服丝袜| 91在线视频官网| 日韩欧美精品在线视频| 亚洲免费观看高清完整版在线| 蜜乳av一区二区| 一本一道久久a久久精品| 日韩亚洲欧美在线观看| 亚洲日本va午夜在线电影| 精品一区二区三区免费毛片爱| 国产精品系列在线| 亚洲欧美乱综合| 日韩一级二级三级精品视频| 老司机免费视频一区二区| 蜜臀久久99精品久久久画质超高清| 狠狠网亚洲精品| 欧美日韩一区二区在线观看 | 99久久99久久精品国产片果冻 | 欧美日韩在线精品一区二区三区激情 | 亚洲高清久久久| 久久国产免费看| 欧美艳星brazzers| 中文字幕精品三区| 老司机精品视频在线| 欧美伦理影视网| 亚洲色图视频网站| 不卡视频在线看| 久久久不卡网国产精品一区| 天使萌一区二区三区免费观看| 91免费国产在线观看| 中文字幕av资源一区| 久久国产精品72免费观看| 欧美顶级少妇做爰| 亚洲一区在线看| 91性感美女视频| 国产精品私人自拍| 国产精品一区二区免费不卡 | 久久国产尿小便嘘嘘尿| 欧美日韩国产精品成人| 亚洲最新视频在线播放| 99re热这里只有精品视频| 国产午夜精品一区二区三区视频| 久久精品国产精品亚洲红杏| 欧美日韩国产一区| 亚洲成人在线观看视频| 在线视频综合导航| 悠悠色在线精品| 色播五月激情综合网| 一区二区三区中文在线观看| 91免费视频网址| 亚洲人成人一区二区在线观看| 成人国产精品免费| 国产精品高潮久久久久无| 成人午夜激情影院| 国产精品久久久久久久第一福利| 日本韩国欧美一区二区三区| 成人美女在线观看| 中日韩av电影| 99re8在线精品视频免费播放| 欧美国产一区二区| www.av亚洲| 亚洲精品视频免费看| 在线视频国内自拍亚洲视频| 一区二区国产盗摄色噜噜| 欧美影视一区在线| 天天av天天翘天天综合网 | 亚洲电影你懂得| 欧美精品 日韩| 麻豆精品视频在线观看视频| 国产激情91久久精品导航| 久久精品亚洲麻豆av一区二区| 国产大陆亚洲精品国产| 国产精品久久国产精麻豆99网站 | 一区二区三区四区在线| 欧美亚洲动漫另类| 午夜欧美视频在线观看| 日韩一区二区免费视频| 国内精品不卡在线| 国产精品欧美久久久久无广告 | 欧美一级理论性理论a| 成人午夜激情影院| 久久久久国产精品麻豆ai换脸| 91久久国产最好的精华液| 美女精品自拍一二三四| 亚洲国产精品综合小说图片区| 久久日韩精品一区二区五区| 91精品婷婷国产综合久久| 欧美亚州韩日在线看免费版国语版| 狠狠狠色丁香婷婷综合久久五月| 国产精品系列在线观看| www.激情成人| 国产成人高清在线| 自拍偷自拍亚洲精品播放| 91九色02白丝porn| 日韩成人一级片| 2017欧美狠狠色| eeuss鲁片一区二区三区| 亚洲国产视频一区二区| 日韩女优制服丝袜电影| 国产成人aaaa| 亚洲愉拍自拍另类高清精品| 51精品视频一区二区三区| 精品亚洲国产成人av制服丝袜| 亚洲欧洲av另类| 欧美美女黄视频| 懂色中文一区二区在线播放| 亚洲欧美电影一区二区| 日韩午夜在线观看视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 国产麻豆精品在线观看| 亚洲欧洲国产日韩| 欧美日韩高清不卡| 国产美女精品人人做人人爽| 亚洲女人小视频在线观看| 日韩欧美一区在线| 91香蕉视频在线| 亚洲一区二区三区国产| 久久综合九色综合97婷婷女人| 91网站黄www| 久久国产欧美日韩精品| 亚洲综合成人在线视频| 精品国产乱码久久久久久久久 | 久久久99精品久久| 欧美在线啊v一区| 国产精品亚洲综合一区在线观看| 一区二区在线观看免费| 久久综合色天天久久综合图片| 91高清视频免费看| 国产精品一区在线观看乱码 | 成人一区二区在线观看| 亚洲国产精品久久久久秋霞影院| 国产亚洲精品bt天堂精选| 欧美日韩国产美女| 91丨porny丨户外露出| 黑人精品欧美一区二区蜜桃| 夜夜亚洲天天久久| 中文字幕av一区二区三区高| 91精品国产黑色紧身裤美女| 91麻豆国产在线观看| 国产一区二区h| 亚洲成a人片综合在线| 免费在线观看成人| 欧美精品日韩一本| 一本大道久久a久久综合| 国产一区二区三区在线观看免费视频| 亚洲国产一区二区在线播放| 国产精品短视频| 久久精品人人做人人爽人人| 3d成人动漫网站| 欧美在线啊v一区| 色悠悠久久综合| 成人激情av网| 国产精品亚洲一区二区三区在线| 日本成人超碰在线观看| 亚洲一区二区三区小说| 亚洲人成伊人成综合网小说| 国产免费成人在线视频| 精品久久久久久久久久久久久久久| 欧美日韩一本到| 欧美中文字幕一区二区三区亚洲| 99免费精品视频| 不卡av在线免费观看| 丁香天五香天堂综合| 国产在线一区观看| 日本大胆欧美人术艺术动态| 天堂成人免费av电影一区| 亚洲高清一区二区三区| 一区二区高清视频在线观看| 亚洲男人的天堂一区二区| 中文字幕在线不卡一区二区三区| 国产欧美综合在线| 国产日韩欧美一区二区三区综合| 精品国一区二区三区| 精品成人在线观看| 欧美tickling网站挠脚心| 精品国产一区久久| 精品国产乱码久久久久久久| 久久天堂av综合合色蜜桃网| 久久免费的精品国产v∧| 成人免费精品视频| av在线不卡网|