Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
tskVideoInput.c
Package: DSP-C6000-DM642DEMO.rar [view]
Upload User: dahaojd
Upload Date: 2008-01-29
Package Size: 14357k
Code Size: 2k
Category:
DSP program
Development Platform:
C/C++
- #include <std.h>
- #include <csl.h>
- #include <csl_dat.h>
- #include <csl_cache.h>
- #include <chan.h>
- #include <scom.h>
- #include <utl.h>
- #include <fvid.h>
- #include <tsk.h>
- #include "edc.h"
- #include "vport.h"
- #include "vportcap.h"
- #include "evmdm642.h"
- #include "saa7115.h"
- #include "appMain.h"
- #include "appBiosObjects.h"
- #include "appThreads.h"
- #include "evmdm642_vcapparams.h"
- #include "cap_dis_size.h"
- static unsigned char YArray[LINE_SZ*NUM_LINES*2];
- static unsigned char CbArray[(LINE_SZ*NUM_LINES*2)>>1];
- static unsigned char CrArray[(LINE_SZ*NUM_LINES*2)>>1];
- /* heap IDs defined in the BIOS configuration file */
- extern int extHeap;
- FVID_Handle capChan;
- FVID_Frame *capFrameBuf;
- void tskVideoInputInit()
- {
- int status;
- EVMDM642_vCapParamsChan.segId = extHeap;
- EVMDM642_vCapParamsSAA7115.hI2C = EVMDM642_I2C_hI2C;
- capChan = FVID_create("/VP0CAPTURE/A/0",
- IOM_INPUT, &status, (Ptr)&EVMDM642_vCapParamsChan, NULL);
- FVID_control(capChan, VPORT_CMD_EDC_BASE+EDC_CONFIG, (Ptr)&EVMDM642_vCapParamsSAA7115);
- }
- void tskVideoInputStart()
- {
- FVID_control(capChan, VPORT_CMD_START, NULL);
- }
- /* handle video capture, scaling and re-format */
- void tskVideoInput()
- {
- int frame=0;
- SCOM_Handle fromInputtoProc,fromProctoInput;
- char *outBuf[3];
- char *inBuf[3];
- ScomMessage scomMsg;
- ScomMessage *pMsgBuf;
- fromInputtoProc = SCOM_open("INTOPROC");
- fromProctoInput = SCOM_open("PROCTOIN");
- FVID_alloc(capChan, &capFrameBuf);
- pMsgBuf = &scomMsg;
- while(1)
- {
- frame++;
- UTL_stsStart( stsCapTime );
- inBuf[0] = capFrameBuf->frame.iFrm.y1;
- inBuf[1] = capFrameBuf->frame.iFrm.cb1;
- inBuf[2] = capFrameBuf->frame.iFrm.cr1;
- outBuf[0] = (char *)YArray;
- outBuf[1] = (char *)CbArray;
- outBuf[2] = (char *)CrArray;
- yuv422to420(inBuf,outBuf, 720, 480);
- UTL_stsStop( stsCapTime );
- pMsgBuf->bufY = YArray;
- pMsgBuf->bufU = CbArray;
- pMsgBuf->bufV = CrArray;
- SCOM_putMsg(fromInputtoProc, pMsgBuf);
- // Calculate how long it takes to capture one frame
- UTL_stsPeriod( stsCycleTime );
- FVID_exchange(capChan, &capFrameBuf);
- pMsgBuf = SCOM_getMsg(fromProctoInput, SYS_FOREVER);
- }
- }