📄 tskvideocapturevp2b.c
字号:
/*
* Copyright 2004 by SEED Incorporated.
* All rights reserved. Property of SEED Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
#include <std.h>
#include <tsk.h>
#include <vport.h>
#include <vportcap.h>
#include <tvp51xx.h>
#include <csl_edma.h>
#include <fvid.h>
#include <csl_dat.h>
#include <csl_cache.h>
#include <scom.h>
#include "seeddm642.h"
#include "seedvpm642cfg.h"
#include "seedvpm642_vcapparams.h"
#include "seedvpm642_tskvp2b.h"
extern int EXTERNALHEAP;
FVID_Handle capChanCh2b;
/*
* ======== tskVideoCaptureVp2a init ========
* video capture function init.
*/
void VideoCaptureVp2bInit()
{
int status;
SEEDVPM642_vCapParamsChan2b.segId = EXTERNALHEAP ;//EXTERNALHEAP;
SEEDVPM642_vCapParamsTVP5150.hI2C = SEEDVPM642_I2C_hI2C; /*打开驱动程序*/
/******************************************************/
/* initialization of capture driver */
/******************************************************/
/*打开第一通路*/
capChanCh2b = FVID_create( "/VP2BCAPTURE/B/2",
IOM_INPUT,
&status,
(Ptr)&SEEDVPM642_vCapParamsChan2b,
NULL);
/******************************************************/
/* configure video encoder */
/******************************************************/
/*配置第一通路的TVP5150*/
FVID_control( capChanCh2b,
VPORT_CMD_EDC_BASE+EDC_CONFIG,
(Ptr)&SEEDVPM642_vCapParamsTVP5150);
}
/*
* ======== tskVideoCaptureVp2a start ========
* video capture function start.
*/
void VideocaptureVp2bStart()
{
/*启动采集*/
FVID_control(capChanCh2b, VPORT_CMD_START, NULL);
}
/*
* ======== tskVideoCaptureVp2a ========
* video capture function.
*/
void tskVideoCaptureVp2b()
{
FVID_Frame *capFrameBuf;
SCOM_Handle fromInput2btoDIS,fromDIStoInput2b;
/*打开SCOM模块*/
fromInput2btoDIS = SCOM_open("IN2BTODIS");
fromDIStoInput2b = SCOM_open("DISTOIN2B");
/*申请一个空间*/
FVID_alloc(capChanCh2b, &capFrameBuf);
while(1)
{
/*-----------------------------------------------------------*/
/* Send message to process task with pointers to captured frame*/
/*-----------------------------------------------------------*/
SCOM_putMsg(fromInput2btoDIS, (FVID_Frame *)capFrameBuf);
/*-----------------------------------------------------------*/
/* Wait for the message from the process task */
/*-----------------------------------------------------------*/
SCOM_getMsg(fromDIStoInput2b, SYS_FOREVER);
/*-----------------------------------------------------------*/
/* Capture a new frame. */
/*-----------------------------------------------------------*/
FVID_exchange(capChanCh2b, &capFrameBuf);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -