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

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

?? mexddgrab.cpp

?? 本源碼為利用光流法提取視頻關(guān)鍵幀的matlab程序?qū)崿F(xiàn)
?? CPP
字號:
/***************************************************
This is the matlab interface code to the grabber code.
It just wraps the grabber functions and does some error
conversion.

Written by Micah Richert.
07/14/2005
**************************************************/

#include "mex.h"
#include "DDGrab.h"

TCHAR str[200]; // 

TCHAR* message(HRESULT hr)
{
	if (hr == S_OK)
	{
		return "";
	} else {
		if (AMGetErrorText(hr,str,200) != 0) return str;
		return "Unknown error";
	}
}

DDGrabber DDG;

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
	if (nrhs < 1 || !mxIsChar(prhs[0])) mexErrMsgTxt("First parameter must be the command (a string)");

	char cmd[100];
	mxGetString(prhs[0],cmd,100);

	if (!_stricmp("buildGraph",cmd))
	{
		if (nrhs < 2 || !mxIsChar(prhs[1])) mexErrMsgTxt("buildGraph: second parameter must be the filename (as a string)");
		if (nlhs > 0) mexErrMsgTxt("buildGraph: there are no outputs");
		int filenamelen = mxGetN(prhs[1])+1;
		char* filename = new char[filenamelen];
		if (!filename) mexErrMsgTxt("buildGraph: out of memory");
		mxGetString(prhs[1],filename,filenamelen);

		char* errmsg =  message(DDG.buildGraph(filename));
		free(filename);

		if (strcmp("",errmsg)) mexErrMsgTxt(errmsg);
		plhs[0] = NULL;
	} else if (!_stricmp("doCapture",cmd)) {
		if (nlhs > 0) mexErrMsgTxt("doCapture: there are no outputs");
		char* errmsg =  message(DDG.doCapture());
		if (strcmp("",errmsg)) mexErrMsgTxt(errmsg);
		plhs[0] = NULL;
	} else if (!_stricmp("getVideoInfo",cmd)) {
		if (nrhs < 2 || !mxIsNumeric(prhs[1])) mexErrMsgTxt("getVideoInfo: second parameter must be the video stream id (as a number)");
		if (nlhs > 4) mexErrMsgTxt("getVideoInfo: there are only 4 output values: widht, height, nrFramesCaptured, nrFramesTotal");

		unsigned int id = mxGetScalar(prhs[1]);
		int width,height,nrFramesCaptured,nrFramesTotal;
		char* errmsg =  message(DDG.getVideoInfo(id, &width, &height, &nrFramesCaptured, &nrFramesTotal));

		if (strcmp("",errmsg)) mexErrMsgTxt(errmsg);

		if (nlhs >= 1) {plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[0])[0] = width; }
		if (nlhs >= 2) {plhs[1] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[1])[0] = height; }
		if (nlhs >= 3) {plhs[2] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[2])[0] = nrFramesCaptured; }
		if (nlhs >= 4) {plhs[3] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[3])[0] = nrFramesTotal; }
	} else if (!_stricmp("getAudioInfo",cmd)) {
		if (nrhs < 2 || !mxIsNumeric(prhs[1])) mexErrMsgTxt("getAudioInfo: second parameter must be the audio stream id (as a number)");
		if (nlhs > 5) mexErrMsgTxt("getAudioInfo: there are only 5 output values: nrChannels, rate, bits, nrFramesCaptured, nrFramesTotal");

		unsigned int id = mxGetScalar(prhs[1]);
		int nrChannels,rate,bits,nrFramesCaptured,nrFramesTotal;
		char* errmsg =  message(DDG.getAudioInfo(id, &nrChannels, &rate, &bits, &nrFramesCaptured, &nrFramesTotal));

		if (strcmp("",errmsg)) mexErrMsgTxt(errmsg);

		if (nlhs >= 1) {plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[0])[0] = nrChannels; }
		if (nlhs >= 2) {plhs[1] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[1])[0] = rate; }
		if (nlhs >= 3) {plhs[2] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[2])[0] = bits; }
		if (nlhs >= 4) {plhs[3] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[3])[0] = nrFramesCaptured; }
		if (nlhs >= 5) {plhs[4] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[4])[0] = nrFramesTotal; }
	} else if (!_stricmp("getCaptureInfo",cmd)) {
		if (nlhs > 2) mexErrMsgTxt("getCaptureInfo: there are only 2 output values: nrVideo, nrAudio");

		int nrVideo, nrAudio;
		DDG.getCaptureInfo(&nrVideo, &nrAudio);

		if (nlhs >= 1) {plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[0])[0] = nrVideo; }
		if (nlhs >= 2) {plhs[1] = mxCreateDoubleMatrix(1,1,mxREAL); mxGetPr(plhs[1])[0] = nrAudio; }
	} else if (!_stricmp("getVideoFrame",cmd)) {
		if (nrhs < 3 || !mxIsNumeric(prhs[1]) || !mxIsNumeric(prhs[2])) mexErrMsgTxt("getVideoFrame: second parameter must be the audio stream id (as a number) and third parameter must be the frame number");
		if (nlhs > 1) mexErrMsgTxt("getVideoFrame: there are only 1 output value: data");

		unsigned int id = mxGetScalar(prhs[1]);
		int frameNr = mxGetScalar(prhs[2]);
		char* data;
		int nrBytes;
		int dims[] = {1,1};
		char* errmsg =  message(DDG.getVideoFrame(id, frameNr, &data, &nrBytes));

		if (strcmp("",errmsg)) mexErrMsgTxt(errmsg);

		dims[0] = nrBytes;
		plhs[0] = mxCreateNumericArray(2, dims, mxUINT8_CLASS, mxREAL); // empty 2d matrix
		memcpy(mxGetPr(plhs[0]),data,nrBytes);
		free(data);
	} else if (!_stricmp("getAudioFrame",cmd)) {
		if (nrhs < 3 || !mxIsNumeric(prhs[1]) || !mxIsNumeric(prhs[2])) mexErrMsgTxt("getAudioFrame: second parameter must be the audio stream id (as a number) and third parameter must be the frame number");
		if (nlhs > 1) mexErrMsgTxt("getAudioFrame: there are only 1 output value: data");

		unsigned int id = mxGetScalar(prhs[1]);
		int frameNr = mxGetScalar(prhs[2]);
		char* data;
		int nrBytes;
		int dims[] = {1,1};
		char* errmsg =  message(DDG.getAudioFrame(id, frameNr, &data, &nrBytes));

		if (strcmp("",errmsg)) mexErrMsgTxt(errmsg);

		dims[0] = nrBytes;
		plhs[0] = mxCreateNumericArray(2, dims, mxUINT8_CLASS, mxREAL); // empty 2d matrix
		memcpy(mxGetPr(plhs[0]),data,nrBytes);
		free(data);
	} else if (!_stricmp("setFrames",cmd)) {
		if (nrhs < 2 || !mxIsDouble(prhs[1])) mexErrMsgTxt("setFrames: second parameter must be the frame numbers (as doubles)");
		if (nlhs > 0) mexErrMsgTxt("setFrames: there are no outputs");
		int nrFrames = mxGetN(prhs[1]) * mxGetM(prhs[1]);
		int* frameNrs = new int[nrFrames];
		if (!frameNrs) mexErrMsgTxt("setFrames: out of memory");
		double* data = mxGetPr(prhs[1]);
		for (int i=0; i<nrFrames; i++) frameNrs[i] = data[i];

		DDG.setFrames(frameNrs, nrFrames);
		plhs[0] = NULL;
	} else if (!_stricmp("disableVideo",cmd)) {
		if (nlhs > 0) mexErrMsgTxt("disableVideo: there are no outputs");
		DDG.disableVideo();
		plhs[0] = NULL;
	} else if (!_stricmp("disableAudio",cmd)) {
		if (nlhs > 0) mexErrMsgTxt("disableAudio: there are no outputs");
		DDG.disableAudio();
		plhs[0] = NULL;
	} else if (!_stricmp("cleanUp",cmd)) {
		if (nlhs > 0) mexErrMsgTxt("cleanUp: there are no outputs");
		DDG.cleanUp();
		plhs[0] = NULL;
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费毛片嘿嘿连载视频| 日韩精品专区在线影院观看 | 制服.丝袜.亚洲.另类.中文| 久久精品一区二区| 日韩高清在线不卡| 91视频www| 国产精品久久夜| 久久99国产精品麻豆| 欧美精品久久一区| 亚洲天堂福利av| 成人h动漫精品一区二区| 精品少妇一区二区三区日产乱码| 亚洲综合偷拍欧美一区色| 国产激情视频一区二区在线观看 | 欧美在线高清视频| 国产精品理伦片| 国产91精品免费| 久久蜜桃av一区精品变态类天堂| 日本成人中文字幕| 欧美日韩日日摸| 亚洲综合免费观看高清在线观看| 成人理论电影网| 1000精品久久久久久久久| 国产精品影视在线观看| 精品国产一二三| 国产伦精品一区二区三区在线观看| 777午夜精品免费视频| 香蕉av福利精品导航| 欧洲一区在线电影| 亚洲午夜精品在线| 欧美日韩的一区二区| 五月天激情综合| 制服.丝袜.亚洲.另类.中文| 日本亚洲三级在线| 日韩欧美中文字幕一区| 久久精品国产99国产| 精品国产一区二区三区av性色| 蜜臀va亚洲va欧美va天堂| 日韩欧美亚洲一区二区| 国产在线精品一区二区三区不卡| 久久老女人爱爱| 成人黄色av网站在线| 亚洲欧洲国产日本综合| 欧美综合天天夜夜久久| 日韩高清中文字幕一区| 久久影视一区二区| 波多野结衣视频一区| 亚洲一区二区三区四区五区黄 | 精品综合免费视频观看| 精品国产三级电影在线观看| 国产91丝袜在线18| 一级做a爱片久久| 51精品秘密在线观看| 精品中文av资源站在线观看| 国产日韩精品视频一区| 在线视频你懂得一区二区三区| 午夜成人在线视频| 国产亚洲欧美一级| 91成人国产精品| 久久99国产精品久久99| 综合久久久久综合| 3d成人h动漫网站入口| 国产精品一区二区在线播放| 一区二区三区在线影院| 日韩美女视频在线| 99视频在线观看一区三区| 五月天久久比比资源色| 久久精品免视看| 欧美亚洲日本国产| 国产成人免费视频| 图片区小说区国产精品视频| 国产午夜精品一区二区| 欧美日韩国产美女| 成人免费视频app| 老司机一区二区| 樱桃国产成人精品视频| 26uuu亚洲综合色欧美| 欧美日韩免费在线视频| 国产99精品视频| 奇米色一区二区| 一区二区在线看| 久久精品夜夜夜夜久久| 在线综合亚洲欧美在线视频| 99re热这里只有精品视频| 狠狠色丁香婷婷综合| 亚洲午夜久久久久久久久电影网| 欧美激情一区二区三区| 欧美电影免费观看高清完整版在线| a级高清视频欧美日韩| 国产精品自在欧美一区| 日韩电影网1区2区| 亚洲国产精品久久艾草纯爱 | 国产喷白浆一区二区三区| 91精品国产91综合久久蜜臀| 色94色欧美sute亚洲线路一ni| 国产精品一品视频| 国产综合久久久久久鬼色| 日韩精品电影在线| 亚洲成人免费看| 亚洲激情在线激情| 国产精品成人免费在线| 欧美国产精品一区二区三区| 久久亚洲一区二区三区四区| 制服视频三区第一页精品| 欧美日韩日日夜夜| 欧美老年两性高潮| 欧美日韩在线一区二区| 欧美日韩一区在线观看| 91成人免费网站| 欧美三级电影精品| 欧美日韩一二区| 91麻豆精品国产91久久久久| 欧美日韩亚州综合| 91精品国产综合久久福利软件| 欧美特级限制片免费在线观看| 91国偷自产一区二区三区观看 | 国产精品国产自产拍在线| 国产亚洲1区2区3区| 久久精品亚洲国产奇米99| 久久亚洲二区三区| 中文字幕成人在线观看| 亚洲欧洲av色图| 亚洲欧美另类图片小说| 一区二区三区精品视频在线| 亚洲国产精品久久人人爱| 天天色图综合网| 国产一区二区三区免费| 国产成人啪免费观看软件| 9色porny自拍视频一区二区| 色婷婷综合久久久中文字幕| 欧美日韩国产首页| 久久综合九色综合97_久久久| 久久久综合视频| 亚洲精品视频一区二区| 日韩和欧美的一区| 国产精一品亚洲二区在线视频| 成人精品鲁一区一区二区| 91福利区一区二区三区| 日韩欧美第一区| 中文字幕一区二区三区不卡| 亚洲一区二区三区四区五区黄| 青青草97国产精品免费观看无弹窗版| 极品少妇一区二区三区精品视频| 国产不卡视频在线观看| 欧美在线小视频| 日韩一区二区在线观看| 国产精品沙发午睡系列990531| 亚洲已满18点击进入久久| 免费成人性网站| 99久久久免费精品国产一区二区 | 麻豆一区二区99久久久久| 粉嫩av一区二区三区| 欧美日韩国产片| 国产精品全国免费观看高清| 日韩av电影一区| 91在线免费看| 欧美电影免费观看高清完整版 | 日韩一区二区三区免费观看| 欧美国产一区视频在线观看| 午夜久久电影网| 大桥未久av一区二区三区中文| 在线观看免费视频综合| 国产喷白浆一区二区三区| 日韩—二三区免费观看av| 成人黄色a**站在线观看| 日韩免费高清视频| 亚洲动漫第一页| gogo大胆日本视频一区| 精品国产一区二区三区不卡| 亚洲午夜一区二区| 91啪九色porn原创视频在线观看| 精品福利一区二区三区免费视频| 亚洲va欧美va人人爽| 99久久综合色| 国产日韩欧美综合一区| 老司机一区二区| 欧美一区二区三区的| 亚洲第一福利一区| 欧美综合亚洲图片综合区| 国产精品国产三级国产普通话99| 激情六月婷婷综合| 欧美一区二区三区白人| 亚洲超丰满肉感bbw| 在线国产亚洲欧美| 亚洲欧美日韩人成在线播放| 成人综合激情网| 国产日韩欧美高清| 国产一区视频导航| 精品sm在线观看| 激情另类小说区图片区视频区| 日韩一区二区免费在线电影| 午夜欧美大尺度福利影院在线看| 色8久久精品久久久久久蜜| 自拍偷拍亚洲综合| 成年人国产精品| 国产精品美女久久久久久| 大白屁股一区二区视频| 中文字幕免费不卡| 成人一级黄色片| 中文字幕一区二区在线播放|