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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? thread_ftp.c

?? Coriander is a GUI for controlling a Digital Camera (in the sense of the IIDC specs issued by the 1
?? C
字號(hào):
/* * Copyright (C) 2000-2004 Damien Douxchamps  <ddouxchamps@users.sf.net> * * 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. */#include "coriander.h"gintFtpStartThread(camera_t* cam){  chain_t* ftp_service=NULL;  ftpthread_info_t *info=NULL;  gchar *tmp;  ftp_service=GetService(camera,SERVICE_FTP);  if (ftp_service==NULL) { // if no FTP service running...    ftp_service=(chain_t*)malloc(sizeof(chain_t));    ftp_service->current_buffer=NULL;    ftp_service->next_buffer=NULL;    ftp_service->data=(void*)malloc(sizeof(ftpthread_info_t));    info=(ftpthread_info_t*)ftp_service->data;    pthread_mutex_init(&ftp_service->mutex_data, NULL);    pthread_mutex_init(&ftp_service->mutex_struct, NULL);    pthread_mutex_init(&info->mutex_cancel, NULL);        /* if you want a clean-interrupt thread:*/    pthread_mutex_lock(&info->mutex_cancel);    info->cancel_req=0;    pthread_mutex_unlock(&info->mutex_cancel);        /* setup ftp_thread: handles, ...*/    pthread_mutex_lock(&ftp_service->mutex_data);    info->period=cam->prefs.ftp_period;    info->datenum=cam->prefs.ftp_datenum;    info->counter=0;    strcpy(info->address, cam->prefs.ftp_address);    strcpy(info->user, cam->prefs.ftp_user);    strcpy(info->password, cam->prefs.ftp_password);    strcpy(info->path, cam->prefs.ftp_path);    strcpy(info->filename, cam->prefs.ftp_filename);    tmp = strrchr(info->filename, '.');        if (tmp==NULL) {      MainError("You should supply an extension");      pthread_mutex_unlock(&ftp_service->mutex_data);      FreeChain(ftp_service);      return(-1);    }        tmp[0] = '\0';// cut filename before point    strcpy(info->filename_ext, strrchr(cam->prefs.ftp_filename, '.'));        CommonChainSetup(cam,ftp_service,SERVICE_FTP);        info->buffer=NULL;    info->imlib_buffer_size=0;        info->scratch=cam->prefs.ftp_scratch;    #ifdef HAVE_FTPLIB    if (!OpenFtpConnection(info)) {      MainError("Failed to open FTP connection");      pthread_mutex_unlock(&ftp_service->mutex_data);      FreeChain(ftp_service);      return(-1);    }#else    MainError("You don't have FTPLIB");    pthread_mutex_unlock(&ftp_service->mutex_data);    FreeChain(ftp_service);    return(-1);#endif        /* Insert chain and start service*/    pthread_mutex_lock(&ftp_service->mutex_struct);    InsertChain(cam, ftp_service);    if (pthread_create(&ftp_service->thread, NULL, FtpThread,(void*) ftp_service)) {      /* error starting thread. You should cleanup here	 (free, unset global vars,...):*/            /* Mendatory cleanups:*/      RemoveChain(cam, ftp_service);      pthread_mutex_unlock(&ftp_service->mutex_struct);      pthread_mutex_unlock(&ftp_service->mutex_data);      free(info->buffer);      FreeChain(ftp_service);      return(-1);    }    pthread_mutex_unlock(&ftp_service->mutex_struct);    pthread_mutex_unlock(&ftp_service->mutex_data);      }    return (1);}void*FtpCleanupThread(void* arg) {  chain_t* ftp_service;  ftpthread_info_t *info;  ftp_service=(chain_t*)arg;  info=(ftpthread_info_t*)ftp_service->data;  /* Specific cleanups: */  /* Mendatory cleanups: */  pthread_mutex_unlock(&ftp_service->mutex_data);  FtpStopThread(camera); // we do this in case of auto-kill from the thread.  return(NULL);}void*FtpThread(void* arg){  static gchar filename_out[STRING_SIZE];  chain_t* ftp_service=NULL;  ftpthread_info_t *info=NULL;  GdkImlibImage *im=NULL;  long int skip_counter;  float tmp;  ftp_service=(chain_t*)arg;  pthread_mutex_lock(&ftp_service->mutex_data);  info=(ftpthread_info_t*)ftp_service->data;  skip_counter=(info->period-1); /* send immediately, then start skipping */  /* These settings depend on the thread. For 100% safe deferred-cancel   threads, I advise you use a custom thread cancel flag. See display thread.*/  pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL);  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,NULL);  pthread_mutex_unlock(&ftp_service->mutex_data);   // time inits:  ftp_service->prev_time = times(&ftp_service->tms_buf);  ftp_service->fps_frames=0;  ftp_service->processed_frames=0;  while (1) {     /* Clean cancel handlers */    pthread_mutex_lock(&info->mutex_cancel);    if (info->cancel_req>0) {      break;    }    else {      pthread_mutex_unlock(&info->mutex_cancel);      pthread_mutex_lock(&ftp_service->mutex_data);      if(RollBuffers(ftp_service)) { // have buffers been rolled?	FtpThreadCheckParams(ftp_service);	if (ftp_service->current_buffer->width!=-1) {	  if (skip_counter>=(info->period-1)) {	    skip_counter=0;	    convert_to_rgb(ftp_service->current_buffer, info->buffer);	    switch (info->scratch) {	    case FTP_SCRATCH_OVERWRITE:	      sprintf(filename_out, "%s%s", info->filename,info->filename_ext);	      break;	    case FTP_SCRATCH_SEQUENTIAL:	      switch (info->datenum) {	      case FTP_TAG_DATE:		sprintf(filename_out, "%s-%s%s", info->filename, ftp_service->current_buffer->captime_string, info->filename_ext);		break;	      case FTP_TAG_NUMBER:		sprintf(filename_out,"%s-%10.10li%s", info->filename, info->counter++, info->filename_ext);		break;	      }	      break;	    default:	      break;	    }		    	    im=gdk_imlib_create_image_from_data(info->buffer, NULL, ftp_service->current_buffer->width, ftp_service->current_buffer->height);#ifdef HAVE_FTPLIB	    if (!CheckFtpConnection(info)) {	      MainError("Ftp connection lost for good");	      // AUTO CANCEL THREAD	      pthread_mutex_lock(&info->mutex_cancel);	      info->cancel_req=1;	      pthread_mutex_unlock(&info->mutex_cancel);	    }	    else {	      FtpPutFrame(filename_out, im, info);	    }#endif	    ftp_service->fps_frames++;	    ftp_service->processed_frames++;	    if (im != NULL)	      gdk_imlib_kill_image(im);	  }	  else	    skip_counter++;	  	  // FPS display:	  ftp_service->current_time=times(&ftp_service->tms_buf);	  tmp=(float)(ftp_service->current_time-ftp_service->prev_time)/sysconf(_SC_CLK_TCK);	  if (tmp==0)	    ftp_service->fps=fabs(0.0);	  else	    ftp_service->fps=fabs((float)ftp_service->fps_frames/tmp);	}	pthread_mutex_unlock(&ftp_service->mutex_data);      }      else {	pthread_mutex_unlock(&ftp_service->mutex_data);      }    }    usleep(0);  }  pthread_mutex_unlock(&info->mutex_cancel);  return ((void*)1);}gintFtpStopThread(camera_t* cam){  ftpthread_info_t *info;  chain_t *ftp_service;  ftp_service=GetService(cam,SERVICE_FTP);  if (ftp_service!=NULL) { // if FTP service running...    info=(ftpthread_info_t*)ftp_service->data;    /* Clean cancel handler: */    pthread_mutex_lock(&info->mutex_cancel);    info->cancel_req=1;    pthread_mutex_unlock(&info->mutex_cancel);        /* common handlers...*/    pthread_join(ftp_service->thread, NULL);        pthread_mutex_lock(&ftp_service->mutex_data);    pthread_mutex_lock(&ftp_service->mutex_struct);    RemoveChain(cam,ftp_service);        /* Do custom cleanups here...*/    if (info->buffer!=NULL) {      free(info->buffer);      info->buffer=NULL;    }#ifdef HAVE_FTPLIB    CloseFtpConnection(info->ftp_handle);#endif    /* Mendatory cleanups: */    pthread_mutex_unlock(&ftp_service->mutex_struct);    pthread_mutex_unlock(&ftp_service->mutex_data);    FreeChain(ftp_service);      }  return (1);}voidFtpThreadCheckParams(chain_t *ftp_service){  ftpthread_info_t *info;  int buffer_size_change=0;  info=(ftpthread_info_t*)ftp_service->data;  // copy harmless parameters anyway:  ftp_service->local_param_copy.bpp=ftp_service->current_buffer->bpp;  ftp_service->local_param_copy.bayer_pattern=ftp_service->current_buffer->bayer_pattern;  // if some parameters changed, we need to re-allocate the local buffers and restart the ftp  if ((ftp_service->current_buffer->width!=ftp_service->local_param_copy.width)||      (ftp_service->current_buffer->height!=ftp_service->local_param_copy.height)||      (ftp_service->current_buffer->bytes_per_frame!=ftp_service->local_param_copy.bytes_per_frame)||      (ftp_service->current_buffer->mode!=ftp_service->local_param_copy.mode)||      (ftp_service->current_buffer->format!=ftp_service->local_param_copy.format)||      // check F7 color mode change      ((ftp_service->current_buffer->format==FORMAT_SCALABLE_IMAGE_SIZE)&&       (ftp_service->current_buffer->format7_color_mode!=ftp_service->local_param_copy.format7_color_mode)       ) ||      // check bayer and stereo decoding      (ftp_service->current_buffer->stereo_decoding!=ftp_service->local_param_copy.stereo_decoding)||      (ftp_service->current_buffer->bayer!=ftp_service->local_param_copy.bayer)      ) {    if (ftp_service->current_buffer->width*ftp_service->current_buffer->height!=	ftp_service->local_param_copy.width*ftp_service->local_param_copy.height) {      buffer_size_change=1;    }    else {      buffer_size_change=0;    }        // copy all new parameters:    ftp_service->local_param_copy.width=ftp_service->current_buffer->width;    ftp_service->local_param_copy.height=ftp_service->current_buffer->height;    ftp_service->local_param_copy.bytes_per_frame=ftp_service->current_buffer->bytes_per_frame;    ftp_service->local_param_copy.mode=ftp_service->current_buffer->mode;    ftp_service->local_param_copy.format=ftp_service->current_buffer->format;    ftp_service->local_param_copy.format7_color_mode=ftp_service->current_buffer->format7_color_mode;    ftp_service->local_param_copy.stereo_decoding=ftp_service->current_buffer->stereo_decoding;    ftp_service->local_param_copy.bayer=ftp_service->current_buffer->bayer;    ftp_service->local_param_copy.buffer_image_bytes=ftp_service->current_buffer->buffer_image_bytes;        // DO SOMETHING    if (buffer_size_change!=0) {            if (info->buffer!=NULL) {	free(info->buffer);	info->buffer=NULL;      }      info->imlib_buffer_size=ftp_service->current_buffer->width*ftp_service->current_buffer->height*3;      info->buffer=(unsigned char*)malloc(info->imlib_buffer_size*sizeof(unsigned char));    }  }}#ifdef HAVE_FTPLIBgboolean OpenFtpConnection(ftpthread_info_t* info){  char  tmp[STRING_SIZE];  FtpInit();  //MainStatus("Ftp: starting...\n");  if (!FtpConnect(info->address, &info->ftp_handle)) {    MainError("Ftp: connection to server failed");    return FALSE;  }    if (FtpLogin(info->user, info->password, info->ftp_handle) != 1) {    MainError("Ftp: login failed.");    return FALSE;  }    sprintf(tmp, "Ftp: logged in as %s", info->user);  MainStatus(tmp);    if (info->path != NULL && strcmp(info->path,"")) {    if (!FtpChdir(info->path, info->ftp_handle)) {      MainError("Ftp: chdir failed");      return FALSE;    }    sprintf(tmp, "Ftp: chdir %s", info->path);    MainStatus(tmp);  }    MainStatus("Ftp: ready to send");  return TRUE;}voidCloseFtpConnection(netbuf *ftp_handle){  FtpQuit(ftp_handle);}gbooleanCheckFtpConnection(ftpthread_info_t* info){   if (!FtpChdir(".", info->ftp_handle))    // we can't access the current directory! Connection is probably lost. Reconnect:     if (!OpenFtpConnection(info)) {      MainError("Ftp: Can't restore lost connection");      return FALSE;    }  return TRUE;}gbooleanFtpPutFrame(char *filename, GdkImlibImage *im, ftpthread_info_t* info){  //netbuf **file_handle=NULL;  char *tmp;  tmp=(char*)malloc(STRING_SIZE*sizeof(char));  // we have to write to a local tmp file to convert...    sprintf(tmp,"/tmp/coriander_ftp_image%s",info->filename_ext);  gdk_imlib_save_image(im, tmp, NULL);  if (!FtpPut(tmp, filename, FTPLIB_IMAGE, info->ftp_handle)) {    free(tmp);    MainError("Ftp failed to put file.");    return FALSE;  }  free(tmp);  return TRUE;}#endif // HAVE_FTPLIB

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人成精品久久久久久| 亚洲女子a中天字幕| 波多野结衣中文一区| 亚洲成人手机在线| 日本一区二区不卡视频| 日韩一区二区三区电影在线观看 | 国产精品的网站| 91精品国产综合久久精品app| 成人免费福利片| 日韩av成人高清| 悠悠色在线精品| 中文字幕乱码久久午夜不卡| 91精品久久久久久久99蜜桃| 99国产精品国产精品久久| 国产在线播精品第三| 亚洲va韩国va欧美va| 自拍偷自拍亚洲精品播放| 精品av综合导航| 91精品国产综合久久精品app| 91美女在线观看| 国产成人av影院| 激情五月激情综合网| 日韩高清在线电影| 亚洲国产你懂的| 一区二区三区免费观看| 中文字幕亚洲区| 国产精品久久毛片av大全日韩| 亚洲精品一区二区三区四区高清| 欧美另类videos死尸| 欧美日韩亚洲另类| 欧美色图一区二区三区| 日本乱人伦一区| 91亚洲午夜精品久久久久久| 成人成人成人在线视频| 国产成人精品亚洲777人妖 | 精品粉嫩超白一线天av| 337p亚洲精品色噜噜狠狠| 欧美日韩三级在线| 精品视频在线视频| 欧美理论在线播放| 91.成人天堂一区| 欧美一级日韩一级| 日韩亚洲欧美在线| www久久久久| 国产日韩视频一区二区三区| 国产亚洲精品福利| 日本一区二区三区dvd视频在线| 国产亚洲一二三区| 国产精品沙发午睡系列990531| 国产精品久久久久影院色老大 | 91视视频在线直接观看在线看网页在线看| 国产精品一区二区在线看| 国产精品99久久久| 成人免费毛片高清视频| 94-欧美-setu| 欧美日韩日日夜夜| 精品国产一区二区亚洲人成毛片 | 亚洲高清视频中文字幕| 三级影片在线观看欧美日韩一区二区 | 欧美日韩大陆在线| 欧美一级久久久| 久久久久久免费毛片精品| 国产精品青草综合久久久久99| 亚洲私人黄色宅男| 日韩综合一区二区| 国产一区二区伦理| 色婷婷久久99综合精品jk白丝| 欧美手机在线视频| 精品国产乱码久久久久久图片 | 欧美日韩aaaaaa| 日韩写真欧美这视频| 国产色产综合色产在线视频| 亚洲欧美福利一区二区| 色又黄又爽网站www久久| 欧美精选午夜久久久乱码6080| 精品国产91洋老外米糕| 亚洲少妇最新在线视频| 免费人成在线不卡| 成人高清免费在线播放| 欧美日韩一区二区三区视频| 久久综合久久久久88| 亚洲精品欧美综合四区| 青青草97国产精品免费观看 | 99这里只有久久精品视频| 欧美性大战久久久久久久蜜臀| 日韩三级.com| 亚洲免费在线看| 狠狠色狠狠色综合| 欧美在线999| 国产区在线观看成人精品| 亚洲午夜精品17c| 国产老妇另类xxxxx| 91成人在线免费观看| 久久日一线二线三线suv| 亚洲已满18点击进入久久| 国产精选一区二区三区| 欧洲一区在线电影| 日本一二三不卡| 精品无码三级在线观看视频 | 91女神在线视频| 精品国产一区二区精华| 亚洲图片欧美综合| 99精品视频中文字幕| 2020国产精品自拍| 肉肉av福利一精品导航| 色综合天天综合网国产成人综合天 | 日韩精品电影在线| 99re视频精品| 久久一区二区视频| 美腿丝袜在线亚洲一区| 欧美三级电影网站| 亚洲男人的天堂在线aⅴ视频| 国产精品资源在线| 精品入口麻豆88视频| 天天综合天天综合色| 色视频欧美一区二区三区| 中文字幕av一区二区三区免费看 | 久久精品国产免费| 欧美日韩国产精选| 一区二区三区毛片| 色综合中文字幕国产 | 成人精品国产福利| 精品少妇一区二区三区日产乱码 | 51午夜精品国产| 夜色激情一区二区| 91影院在线观看| 亚洲视频资源在线| 99精品视频在线免费观看| 中文成人av在线| 成人小视频免费在线观看| 久久精品视频在线看| 国产乱子伦视频一区二区三区| 精品久久久久久无| 国产又黄又大久久| 国产欧美日韩精品a在线观看| 国产一区欧美一区| 久久久www成人免费无遮挡大片| 狠狠色综合日日| 国产女主播一区| 成人免费va视频| 亚洲三级在线播放| 91福利资源站| 亚州成人在线电影| 3d成人h动漫网站入口| 美脚の诱脚舐め脚责91 | 亚洲专区一二三| 欧美三级视频在线播放| 日韩不卡手机在线v区| 欧美一二三四区在线| 极品少妇一区二区| 国产欧美精品一区二区色综合 | 亚洲电影你懂得| 欧美一区三区四区| 激情综合亚洲精品| 国产欧美一区二区三区沐欲| 久久香蕉国产线看观看99| 国产91精品一区二区麻豆亚洲| 国产精品嫩草久久久久| 91浏览器入口在线观看| 五月天欧美精品| 久久精品人人做人人爽97| 99久久er热在这里只有精品66| 亚洲一区二区三区影院| 91精品国产手机| 国产成人在线视频网址| 亚洲老妇xxxxxx| 日韩欧美久久一区| 国产麻豆精品一区二区| 亚洲色图在线看| 51精品国自产在线| 国产不卡视频一区| 亚洲综合成人在线视频| 精品黑人一区二区三区久久| 成人av在线看| 日韩av一级片| 国产精品乱码人人做人人爱| 欧美日韩亚洲高清一区二区| 激情成人午夜视频| 亚洲激情在线激情| 精品999在线播放| 欧美亚洲精品一区| 国产成人亚洲综合色影视| 亚洲综合色丁香婷婷六月图片| 精品乱码亚洲一区二区不卡| 色综合天天综合给合国产| 麻豆一区二区三区| 一区二区三区精品视频| 久久综合九色综合97婷婷女人 | 99视频精品免费视频| 青青草视频一区| 亚洲色图在线播放| 26uuu国产在线精品一区二区| 色先锋资源久久综合| 久久精工是国产品牌吗| 一区二区三区.www| 欧美国产激情一区二区三区蜜月| 7777女厕盗摄久久久| 日本韩国欧美三级| 国产v综合v亚洲欧| 久久99国产精品免费|