⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vidcapaud.c

📁 Equator 公司BSP-15 DSP开发平台所有驱动程序源码
💻 C
字号:
/***** Copyright (c) 2002 Equator Technologies, Inc.**//******************************************************************************  FILENAME: vidcapaud.c******  DESCRIPTION:***    Test application for video capture and display with Audio.******    This application captures and displays PAL or NTSC video and Audio.******    Note: The Shark board only has one video input path.******    Sample command lines:***      NTSC:        vidcap 0 1 0 0  (one input port)***                   vidcap 0 1 1 0  (alternate between two input ports)***      PAL:         vidcap 1 1 0 0  (one input port)***************************************************************************/#include <eti/drv.h>// Macro for checking a driver return code#define CHECK_RC(rc, fnname) \    if (ETIDRV_CHECK_ERROR(rc)) { \        printf(fnname ## " failed, error = 0x%08x\n", rc); \        exit(1); \    }// Main processing functionSCODE ProcessVidcap_Audio(    BOOL bUsePal,        // Set to 0 to capture/display NTSC    BOOL bUsePort0,      // Capture from video port 0    BOOL bUsePort1,      // Capture from video port 1    int iFramesToCapture // Number of frames to capture (0=capture forever)){    SCODE err = ETIDRV_OK;    int iFrameCount;    err = InitVidcap(bUsePal, bUsePort0, bUsePort1);    CHECK_RC(err, "InitDRGB");    if (bUsePal)      err = InitAudio(25);  // to match PAL frame rate    else      err = InitAudio(30);  // to match NTSC frame rate    CHECK_RC(err, "InitAudio");    //    // Loop the desired number of frames (0 = forever)    //    iFrameCount   = 0;    while (iFramesToCapture == 0 ||           iFrameCount < iFramesToCapture) {      err = ProcessVidcapSingle(iFrameCount);      CHECK_RC(err, "ProcessVidcapSingle");      err = ProcessAudioSingle();      CHECK_RC(err, "ProcessAudioSingle");      ++iFrameCount;    }    err = CloseVidcap();    CHECK_RC(err, "CloseVidcap");    err = CloseAudio();    CHECK_RC(err, "CloseAudio");    return err;}static void usage (void){   printf("usage: vidcapaud bUsePal bUsePort0 bUsePort1 NumFrames\n");   printf("  Zero NumFrames will run forever\n");   printf("  Set bUsePort to 1 for S-Video, 2 for composite\n");}SCODE vidcapaud(    BOOL bUsePal,        // Set to 0 to capture/display NTSC    BOOL bUsePort0,      // Capture from video port 0    BOOL bUsePort1,      // Capture from video port 1    int iFramesToCapture // Number of frames to capture (0=capture forever)){    if ((bUsePal != 0    &&  bUsePal != 1)   ||   // valid UsePal values        (bUsePort0 != 0  &&  bUsePort0 != 1) ||   // valid port0 values        (bUsePort1 != 0  &&  bUsePort1 != 1) ||   // valid port1 values        (bUsePort0 == 0  &&  bUsePort1 == 0) ||   // no input ports?        iFramesToCapture < 0) {        usage();        exit(1);    }    printf("Vidcap and Audio test application\n");    return ProcessVidcap_Audio (bUsePal, bUsePort0, bUsePort1, iFramesToCapture);}#ifndef RTOS int main(int argc, char *argv[]){    SCODE err;    BOOL bUsePal;    BOOL bUsePort0;    BOOL bUsePort1;    int iFramesToCapture;        //    // Get command line arguments    //     if (argc != 5) {        usage();        exit(1);    }    bUsePal = atoi(argv[1]);    bUsePort0 = atoi(argv[2]);    bUsePort1 = atoi(argv[3]);    iFramesToCapture = atoi(argv[4]);    err = vidcapaud(bUsePal, bUsePort0, bUsePort1, iFramesToCapture);    exit(err == ETIDRV_OK ? 0 : 1);}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -