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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? video_basic.c

?? 一個很棒的視頻服務器
?? C
字號:
/*  camserv - An internet streaming picture application * *  Copyright (C) 1999-2002  Jon Travis (jtravis@p00p.org) * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* * This module is to provide an example of how to create a new video * module for the camserv program.  */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "grafxmisc.h"#include "camconfig.h"#include "modinfo.h"#include "video.h"/* * In the videodata structure, one should place all of the state information * they will need in subsequent callbacks.  This could include a number * of things: * *          o  File descriptors to open video devices. *          o  Allocated memory for image storage & manipulation *          o  Configuration information about the current state of the device. * * * Keep in mind that ultimately configuration information MUST be read from * the camconfig structure so that re-initialization can occur if required. * Therefore if something is read from the camcfg structure and then modified, * it should be re-written back to the camcfg struct. */typedef struct video_data_st {  char section_name[ MAX_SECTION_NAME + 1];  unsigned char components[ 3 ]; /* Rval, gval, and bval                */  int comp_mod;                  /* Current component being modified    */  int direction;                 /* Direction of colour changing        */  int width, height;  int initialized;               /* 1 if device is initialized, else 0. */} VideoData;VideoData *video_open( CamConfig *ccfg, char *section_name );void video_close( VideoData *vdata );int video_init( VideoData *vdata, CamConfig *ccfg );int video_deinit( VideoData *vdata );int video_snap( VideoData *vdata, char *place_buffer, Video_Info *vinfo,		CamConfig *ccfg );int video_get_geom( VideoData *vid_dev, Video_Geometry *geom );#define DEVICE_MAX_WIDTH  1024#define DEVICE_MAX_HEIGHT 768#define DEVICE_MIN_WIDTH  40#define DEVICE_MIN_HEIGHT 30/* * video_open:  This routine should perform any operations it will need to *              do to 'open' and allocate space for device storage.  This *              may be things such as opening the device file, allocating *              memory for state storage, and initializing states. * * Arguments:   ccfg = Camera configuration. * * Return values:  Returns NULL on failure, else a valid pointer to a new *                 state structure */VideoData *video_open( CamConfig *ccfg, char *sec_name ){  VideoData *vdata;  if( (vdata = malloc( sizeof( *vdata ))) == NULL )    return NULL;    strncpy( vdata->section_name, sec_name, sizeof( vdata->section_name ));  vdata->section_name[ sizeof( vdata->section_name ) - 1 ] = '\0';  vdata->components[ 0 ] = 0;  vdata->components[ 1 ] = 0;  vdata->components[ 2 ] = 0;  vdata->comp_mod = 0;         /* The red component */  vdata->width = vdata->height = 0;  vdata->initialized = 0;  return vdata;}/* * video_close:  Close a video device, and deallocate all memory associated *               with the state information.  At this point, the video module *               should consider this to be the final access it has to any *               outside thang. * * Arguments:    vdata = VideoData as returned from the initial video_open. */void video_close( VideoData *vdata ){  free( vdata );}/* * video_init:  Initialize the video device.  This is slightly different from *              the open routine, in that it may be called often between *              an open and close call.  The purpose of this routine is *              to use configuration information to configure and 'init' *              the device.  This may be called periodically to reconfigure *              the video device.  For each init call, there should be 1 *              de-init call, so the video device need not worry about *              init being called twice in a row. * * Arguments:   ccfg = Camera configuration to use in initialization *  * Return value:  Returns -1 on failure 0 on success. */int video_init( VideoData *vdata, CamConfig *ccfg ){  /* Use information from the camconfig structure to init the device */  /* All of the VIDCONFIG_* settings should be checked and modified as    * necessary.  For instance when the device is initialized, if it is   * black and white, it should be stored in the camconfig structure, as   * should the actual used width,height, etc. */  vdata->width  = camconfig_query_def_int( ccfg, SEC_VIDEO,					   VIDCONFIG_WIDTH, 320 );  vdata->height = camconfig_query_def_int( ccfg, SEC_VIDEO,					   VIDCONFIG_HEIGHT, 240 );    vdata->width = clip_to(vdata->width, DEVICE_MIN_WIDTH, DEVICE_MAX_WIDTH);  vdata->height = clip_to( vdata->height, DEVICE_MIN_HEIGHT,DEVICE_MAX_HEIGHT);  camconfig_set_int( ccfg, SEC_VIDEO,		     VIDCONFIG_WIDTH,      vdata->width );  camconfig_set_int( ccfg, SEC_VIDEO,		     VIDCONFIG_HEIGHT,     vdata->height );  camconfig_set_int( ccfg, SEC_VIDEO,		     VIDCONFIG_MAXWIDTH,   DEVICE_MAX_WIDTH );  camconfig_set_int( ccfg, SEC_VIDEO,		     VIDCONFIG_MAXHEIGHT,  DEVICE_MAX_HEIGHT );  camconfig_set_int( ccfg, SEC_VIDEO, 		     VIDCONFIG_MINWIDTH,   DEVICE_MIN_WIDTH );  camconfig_set_int( ccfg, SEC_VIDEO,		     VIDCONFIG_MINHEIGHT,  DEVICE_MIN_HEIGHT );  camconfig_set_int( ccfg, SEC_VIDEO,		     VIDCONFIG_ISB_N_W,    0 );    vdata->initialized = 1;  return 0;}/* * video_deinit:  De-initialize the video device.  This is to perform *                temporary cleanup before a device is either re-initialized *                or closed.  This can be used to do things such as freeing *                captured video frames, or other cleanup procedures. * * Arguments:     vdata = Video data as returned from video_open *  * Return values: Returns -1 on failure, 0 on success. */int video_deinit( VideoData *vdata ){  return 0;}/* * video_snap:  Take a 'snapshot' from the video device.  This can range *              anywhere from reading device's, generating random noise, *              or anything one wants.  The picture taken can be in any *              format desired, however when it is placed into the place *              buffer it must either be in RGB (1 byte per component) *              format, or in the case of B&W a single byte containing the *              intensity of the pixel.  The place buffer is provided by *              the caller, and will contain enough space to store the *              maximum sized output from the snapshot.  In addition, the *              vinfo structure should contain information about the size *              of the taken picture, and various other attributes, such as *              B&W, height, width, etc. * * Arguments:   vdata        = Video data as returned by video_open. *              place_buffer = Location to place output data of the snapshot *              vinfo        = Location to place information about the snapshot *              ccfg         = Camera configuration to use if necessary. * * Return values:  Returns 0 on snapshot success, else -1 */int video_snap( VideoData *vdata, char *place_buffer, Video_Info *vinfo,		CamConfig *ccfg ){  char *cp, *endcp;  vinfo->width = vdata->width;  vinfo->height = vdata->height;  vinfo->is_black_white = 0;  vinfo->nbytes = vinfo->width * vinfo->height * 3;  endcp = place_buffer + vinfo->width * vinfo->height * 3;  for( cp = place_buffer; cp < endcp; cp += 3 ){    *(cp + 0) = vdata->components[ 0 ] ;    *(cp + 1) = vdata->components[ 1 ] ;    *(cp + 2) = vdata->components[ 2 ] ;  }  /* Very simple color changing */  vdata->components[ vdata->comp_mod ] += vdata->direction *  5;  if( vdata->components[ vdata->comp_mod ] == 0 ||      vdata->components[ vdata->comp_mod ] == 255 )  {  /* Change component */    vdata->comp_mod = (vdata->comp_mod + 1) % 3;    if( vdata->components[ vdata->comp_mod ] == 0 )      vdata->direction = 1;    else      vdata->direction = -1;  }  return 0;}/* * video_get_geom:  Get geometry information about the video device.  *                  The video device must be opened before the geometry *                  can be gotten, so it will be passed in.  All of the *                  video device information which CAN be gotten, should. * * Arguments:       vid_device = Video device as returned from video_open *                  geom       = Location to place geometry information * * Return values:   Returns an ORed combination of VIDEO_GEOM_*, representing *                  which information in the returned structure is valid. *                  0 is returned on function failure. */int video_get_geom( VideoData *vdata, Video_Geometry *geom ){  geom->max_width  = DEVICE_MAX_WIDTH;  geom->max_height = DEVICE_MAX_HEIGHT;  geom->min_width  = DEVICE_MIN_WIDTH;  geom->min_height = DEVICE_MIN_HEIGHT;  if( vdata->initialized == 1 ){      geom->cur_width  = vdata->width;      geom->cur_height = vdata->height;      return VIDEO_GEOM_MAX | VIDEO_GEOM_MIN | VIDEO_GEOM_CUR;  }        return VIDEO_GEOM_MAX | VIDEO_GEOM_MIN;}/* * modinfo_query:  Routine to return information about the variables *                 accessed by this particular module. * * Return values:  Returns a malloced ModInfo structure, for which *                 the caller must free, or NULL on failure. */ModInfo *modinfo_query(){  ModInfo *res;  char varname[ 1024 ];  if( (res = modinfo_create( 2 )) == NULL )    return NULL;  sprintf( varname, "[%s]:%s", SEC_VIDEO, VIDCONFIG_WIDTH );  modinfo_varname_set( res, 0, varname );  modinfo_desc_set( res, 0, "Standard video width" );  res->vars[ 0 ].type = MODINFO_TYPE_INT;    sprintf( varname, "[%s]:%s", SEC_VIDEO, VIDCONFIG_HEIGHT );  modinfo_varname_set( res, 1, varname );  modinfo_desc_set( res, 1, "Standard video height" );  res->vars[ 1 ].type = MODINFO_TYPE_INT;    return res;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品剧情在线观看| 亚洲欧美二区三区| 色呦呦国产精品| 蜜桃一区二区三区在线观看| 国产精品久线在线观看| 日韩免费一区二区| 欧美三级日韩三级国产三级| 成人免费视频网站在线观看| 免费在线看一区| 亚洲综合激情网| 国产精品久久久久久户外露出| 日韩欧美一二区| 欧美日韩国产在线观看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 亚洲图片欧美色图| 国产精品国产三级国产有无不卡| 欧美大片拔萝卜| 欧美高清激情brazzers| 在线看日本不卡| 91丨九色porny丨蝌蚪| 风间由美一区二区av101| 久久精品国产澳门| 乱一区二区av| 美国欧美日韩国产在线播放| 亚洲国产你懂的| 亚洲一区欧美一区| 亚洲精品中文在线影院| 亚洲欧洲日产国产综合网| 国产无人区一区二区三区| 久久久蜜臀国产一区二区| 精品剧情在线观看| 精品国产不卡一区二区三区| 欧美大片拔萝卜| 26uuu国产一区二区三区| 日韩欧美在线网站| 欧美tk丨vk视频| 26uuu另类欧美亚洲曰本| 精品国精品自拍自在线| 精品久久99ma| 精品处破学生在线二十三| 精品福利在线导航| 久久久99精品免费观看不卡| 久久久久久亚洲综合| 国产亚洲自拍一区| 国产精品污www在线观看| 国产精品麻豆视频| 亚洲欧美日韩中文字幕一区二区三区| 亚洲私人黄色宅男| 亚洲免费观看高清完整版在线观看熊| 亚洲黄色免费网站| 水蜜桃久久夜色精品一区的特点| 日韩有码一区二区三区| 美腿丝袜亚洲三区| 国产成人小视频| 91网站视频在线观看| 欧美日韩在线播| 91精选在线观看| 精品国一区二区三区| 欧美国产精品v| 一区二区三区在线观看网站| 亚洲va国产天堂va久久en| 青青草原综合久久大伊人精品优势| 美美哒免费高清在线观看视频一区二区| 免费精品视频最新在线| 国产精品一区二区男女羞羞无遮挡| 成人app网站| 在线观看一区二区视频| 欧美一区二区三区成人| 久久精品一区二区三区不卡| 亚洲男人天堂av网| 免费在线看成人av| 不卡电影免费在线播放一区| 欧美亚洲高清一区| 日韩欧美中文字幕制服| 国产精品久久久久四虎| 亚洲第一激情av| 国产在线观看一区二区| 99久久伊人久久99| 欧美精品粉嫩高潮一区二区| 久久综合九色欧美综合狠狠| 一区二区三区日韩欧美精品| 美女网站色91| 色综合久久久久久久久久久| 日韩你懂的在线观看| 亚洲女性喷水在线观看一区| 日本美女视频一区二区| 成人免费高清在线| 日韩免费高清视频| 一区二区三区蜜桃网| 国产在线日韩欧美| 欧美性猛交xxxxxxxx| 国产精品天天摸av网| 日日夜夜免费精品视频| 9久草视频在线视频精品| 欧美一区二区成人| 亚洲黄色小视频| 国产激情一区二区三区四区| 欧美精品色一区二区三区| 国产精品久久久久久户外露出 | 国产成人亚洲综合a∨婷婷| 欧美性色综合网| 亚洲国产精品成人综合色在线婷婷 | 国产精品免费久久久久| 蜜臀av性久久久久蜜臀aⅴ| 91国产免费看| 中文在线一区二区| 久久99久久久久久久久久久| 色老汉一区二区三区| 亚洲国产精品99久久久久久久久| 麻豆精品国产传媒mv男同| 91传媒视频在线播放| 国产精品拍天天在线| 国产麻豆精品一区二区| 欧美一区二区视频在线观看| 亚洲午夜三级在线| 色综合久久综合| 国产欧美一二三区| 国产一区在线精品| 欧美精品一区二区三区蜜桃| 日韩av电影天堂| 欧美日本一区二区| 亚洲综合在线第一页| 色综合天天天天做夜夜夜夜做| 欧美国产综合一区二区| 国产一区二区主播在线| 欧美成人欧美edvon| 久久国产欧美日韩精品| 欧美大片顶级少妇| 蜜桃一区二区三区在线观看| 欧美一区二区三区日韩| 免费成人av资源网| 日韩欧美黄色影院| 六月丁香婷婷色狠狠久久| 69av一区二区三区| 日韩成人av影视| 制服.丝袜.亚洲.中文.综合| 婷婷中文字幕综合| 51午夜精品国产| 久久国产精品无码网站| 欧美不卡在线视频| 国产高清成人在线| 日本一区二区电影| 91一区二区在线| 亚洲精品国产精华液| 欧美性大战久久久久久久蜜臀 | 精品少妇一区二区三区日产乱码| 日韩精品电影在线观看| 日韩一级精品视频在线观看| 久久国产生活片100| 精品国产91久久久久久久妲己| 国产在线一区观看| 国产精品久久久久久久久快鸭| 色综合久久六月婷婷中文字幕| 亚洲一区二区三区国产| 91精品国产丝袜白色高跟鞋| 久久精品国产久精国产爱| 国产日韩欧美精品电影三级在线| 成人av在线一区二区| 亚洲资源中文字幕| 7777精品伊人久久久大香线蕉完整版| 久久99久久久久久久久久久| 中文字幕免费不卡| 欧美视频你懂的| 精品伊人久久久久7777人| 日本一区二区三区dvd视频在线| 色综合天天综合网国产成人综合天 | 亚洲一区二区三区精品在线| 欧美一区二区三区免费大片| 国产成人精品在线看| 亚洲精品中文字幕乱码三区| 欧美一区二区视频网站| 成人美女视频在线观看| 亚洲一区在线看| 欧美精品一区二区三区一线天视频| 成人涩涩免费视频| 亚洲国产精品尤物yw在线观看| 久久欧美一区二区| 欧美在线综合视频| 国产精品1区2区| 亚洲午夜久久久久中文字幕久| 久久色.com| 欧美在线不卡一区| 国产精品18久久久久久久久久久久 | 欧美一区二区精美| 99久久综合精品| 久久精品国产77777蜜臀| 亚洲人妖av一区二区| 日韩欧美国产一区二区三区| 99精品视频一区| 久久精品国产久精国产| 亚洲综合成人在线| 国产亚洲一区字幕| 精品视频在线看| 风间由美一区二区av101| 日本免费在线视频不卡一不卡二| 国产精品久线观看视频| 精品国产乱码久久久久久免费| 欧美系列日韩一区| av在线不卡网| 国产一区二区成人久久免费影院 |