?? tskvideooutput.c
字號(hào):
/*
* Copyright 2003 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
#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 <vportdis.h>
#include <saa7105.h>
#include <evmdm642.h>
#include <evmdm642_disParamsSDTVDefault.h>
#include "appMain.h"
#include "appThreads.h"
#include "tskVideoOutput.h"
VPORT_PortParams EVMDM642_vDisParamsPort
= EVMDM642_DIS_PARAMS_PORT_DEFAULT;
#if defined _NTSC
static VPORTDIS_Params EVMDM642_vDisParamsChan
= EVMDM642_DIS_PARAMS_CHAN_BT656_DEFAULT(NTSC);
static SAA7105_ConfParams EVMDM642_vDisParamsSAA7105
= EVMDM642_DIS_PARAMS_SAA7105_SDTV_DEFAULT(NTSC720, SVIDEO);
#elif defined _PAL
static VPORTDIS_Params EVMDM642_vDisParamsChan
= EVMDM642_DIS_PARAMS_CHAN_BT656_DEFAULT(PAL);
static SAA7105_ConfParams EVMDM642_vDisParamsSAA7105
= EVMDM642_DIS_PARAMS_SAA7105_SDTV_DEFAULT(PAL720, SVIDEO);
#endif
ThrOutput thrOutput;
FVID_Handle disChan;
FVID_Frame *disFrameBuf;
/*-------------------------------------------------------*/
/* Initialize the display channel */
/*-------------------------------------------------------*/
void tskVideoOutputInit()
{
int status;
EVMDM642_vDisParamsChan.segId = extHeap; //EXTERNALHEAP;
EVMDM642_vDisParamsSAA7105.hI2C = EVMDM642_I2C_hI2C;
/******************************************************/
/* initialization of display driver */
/******************************************************/
disChan = FVID_create("/VP2DISPLAY", IOM_OUTPUT,
&status, (Ptr)&EVMDM642_vDisParamsChan, NULL);
/******************************************************/
/* configure video encoder & decoder */
/******************************************************/
FVID_control(disChan, VPORT_CMD_EDC_BASE + EDC_CONFIG,
(Ptr)&EVMDM642_vDisParamsSAA7105);
}
/*-------------------------------------------------------*/
/* Start the display channel */
/*-------------------------------------------------------*/
void tskVideoOutputStart()
{
FVID_control(disChan, VPORT_CMD_START, NULL);
}
/*-------------------------------------------------------*/
/* handle video display, scaling and re-format */
/*-------------------------------------------------------*/
void tskVideoOutput()
{
int status;
unsigned int *bufs;
char *inBuf[3], *outBuf[3];
SCOM_Handle fromProctoOut,fromOuttoIn;
ScomBufChannels *pMsgBuf;
fromProctoOut = SCOM_open("PROCTOOUT");
fromOuttoIn = SCOM_open("OUTTOIN");
FVID_alloc(disChan, &disFrameBuf);
while(1)
{
/*-----------------------------------------------------------*/
/* Wait for the message from the process task to recieve new */
/* frame to be displayed. */
/*-----------------------------------------------------------*/
pMsgBuf = SCOM_getMsg(fromProctoOut, SYS_FOREVER);
status = pMsgBuf->status;
if(status)
{
bufs = pMsgBuf->bufChannel;
inBuf[0] = (char *)bufs[0];
inBuf[1] = (char *)bufs[1];
inBuf[2] = (char *)bufs[2];
outBuf[0] = disFrameBuf->frame.iFrm.y1;
outBuf[1] = disFrameBuf->frame.iFrm.cb1;
outBuf[2] = disFrameBuf->frame.iFrm.cr1;
/*-----------------------------------------------------------*/
/* Call YUV420to422 to do chroma resampling */
/*-----------------------------------------------------------*/
yuv420to422(inBuf,outBuf,LINE_SZ, NUM_LINES);
/*-----------------------------------------------------------*/
/* Display the decoded frame. */
/*-----------------------------------------------------------*/
FVID_exchange(disChan, &disFrameBuf);
}
/*-----------------------------------------------------------*/
/* Send message to input task to continue */
/*-----------------------------------------------------------*/
SCOM_putMsg(fromOuttoIn, pMsgBuf);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -