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

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

?? video_out_x11.c

?? mpeg2dec-0.4.1.tar.gz mpeg2 decoder source code.Have been compiled successfully.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * video_out_x11.c * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org> * Copyright (C) 2003      Regis Duchesne <hpreg@zoy.org> * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. * See http://libmpeg2.sourceforge.net/ for updates. * * mpeg2dec 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. * * mpeg2dec 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 "config.h"#ifdef LIBVO_X11#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#include <sys/ipc.h>#include <sys/shm.h>#include <X11/extensions/XShm.h>#include <inttypes.h>/* since it doesn't seem to be defined on some platforms */int XShmGetEventBase (Display *);#ifdef LIBVO_XV#include <string.h>	/* strcmp */#include <X11/extensions/Xvlib.h>#define FOURCC_YV12 0x32315659#define FOURCC_UYVY 0x59565955#endif#include "mpeg2.h"#include "video_out.h"#include "mpeg2convert.h"typedef struct {    void * data;    int wait_completion;    XImage * ximage;#ifdef LIBVO_XV    XvImage * xvimage;#endif} x11_frame_t;typedef struct x11_instance_s {    vo_instance_t vo;    x11_frame_t frame[3];    int index;    int width;    int height;    Display * display;    Window window;    GC gc;    XVisualInfo vinfo;    XShmSegmentInfo shminfo;    int completion_type;#ifdef LIBVO_XV    unsigned int adaptors;    XvAdaptorInfo * adaptorInfo;    XvPortID port;    int xv;#endif    void (* teardown) (struct x11_instance_s * instance);} x11_instance_t;static int open_display (x11_instance_t * instance, int width, int height){    int major;    int minor;    Bool pixmaps;    XVisualInfo visualTemplate;    XVisualInfo * XvisualInfoTable;    XVisualInfo * XvisualInfo;    int number;    int i;    XSetWindowAttributes attr;    XGCValues gcValues;    instance->display = XOpenDisplay (NULL);    if (! (instance->display)) {	fprintf (stderr, "Can not open display\n");	return 1;    }    if ((XShmQueryVersion (instance->display, &major, &minor,			   &pixmaps) == 0) ||	(major < 1) || ((major == 1) && (minor < 1))) {	fprintf (stderr, "No xshm extension\n");	return 1;    }    instance->completion_type =	XShmGetEventBase (instance->display) + ShmCompletion;    /* list truecolor visuals for the default screen */#ifdef __cplusplus    visualTemplate.c_class = TrueColor;#else    visualTemplate.class = TrueColor;#endif    visualTemplate.screen = DefaultScreen (instance->display);    XvisualInfoTable = XGetVisualInfo (instance->display,				       VisualScreenMask | VisualClassMask,				       &visualTemplate, &number);    if (XvisualInfoTable == NULL) {	fprintf (stderr, "No truecolor visual\n");	return 1;    }    /* find the visual with the highest depth */    XvisualInfo = XvisualInfoTable;    for (i = 1; i < number; i++)	if (XvisualInfoTable[i].depth > XvisualInfo->depth)	    XvisualInfo = XvisualInfoTable + i;    instance->vinfo = *XvisualInfo;    XFree (XvisualInfoTable);    attr.background_pixmap = None;    attr.backing_store = NotUseful;    attr.border_pixel = 0;    attr.event_mask = 0;    /* fucking sun blows me - you have to create a colormap there... */    attr.colormap = XCreateColormap (instance->display,				     RootWindow (instance->display,						 instance->vinfo.screen),				     instance->vinfo.visual, AllocNone);    instance->window =	XCreateWindow (instance->display,		       DefaultRootWindow (instance->display),		       0 /* x */, 0 /* y */, width, height,		       0 /* border_width */, instance->vinfo.depth,		       InputOutput, instance->vinfo.visual,		       (CWBackPixmap | CWBackingStore | CWBorderPixel |			CWEventMask | CWColormap), &attr);    instance->gc = XCreateGC (instance->display, instance->window, 0,			      &gcValues);#ifdef LIBVO_XV    instance->adaptors = 0;    instance->adaptorInfo = NULL;#endif    return 0;}static int shmerror = 0;static int handle_error (Display * display, XErrorEvent * error){    shmerror = 1;    return 0;}static void * create_shm (x11_instance_t * instance, int size){    instance->shminfo.shmid = shmget (IPC_PRIVATE, size, IPC_CREAT | 0777);    if (instance->shminfo.shmid == -1)	goto error;    instance->shminfo.shmaddr = (char *) shmat (instance->shminfo.shmid, 0, 0);    if (instance->shminfo.shmaddr == (char *)-1)	goto error;    /* on linux the IPC_RMID only kicks off once everyone detaches the shm */    /* doing this early avoids shm leaks when we are interrupted. */    /* this would break the solaris port though :-/ */    /* shmctl (instance->shminfo.shmid, IPC_RMID, 0); */    /* XShmAttach fails on remote displays, so we have to catch this event */    XSync (instance->display, False);    XSetErrorHandler (handle_error);    instance->shminfo.readOnly = True;    if (! (XShmAttach (instance->display, &(instance->shminfo))))	shmerror = 1;    XSync (instance->display, False);    XSetErrorHandler (NULL);    if (shmerror) {    error:	fprintf (stderr, "cannot create shared memory\n");	if (instance->shminfo.shmid != -1) {	    shmdt (instance->shminfo.shmaddr);	    shmctl (instance->shminfo.shmid, IPC_RMID, 0);	}	return NULL;    }    return instance->shminfo.shmaddr;}static void destroy_shm (x11_instance_t * instance){    XShmDetach (instance->display, &(instance->shminfo));    shmdt (instance->shminfo.shmaddr);    shmctl (instance->shminfo.shmid, IPC_RMID, 0);}static void x11_event (x11_instance_t * instance)	/* XXXXXXXXXXX */{    XEvent event;    char * addr;    int i;    XNextEvent (instance->display, &event);    if (event.type == instance->completion_type) {	addr = (instance->shminfo.shmaddr +		((XShmCompletionEvent *)&event)->offset);	for (i = 0; i < 3; i++)	    if (addr == instance->frame[i].data)		instance->frame[i].wait_completion = 0;    }}static void x11_start_fbuf (vo_instance_t * _instance,			    uint8_t * const * buf, void * id){    x11_instance_t * instance = (x11_instance_t *) _instance;    x11_frame_t * frame = (x11_frame_t *) id;    while (frame->wait_completion)	x11_event (instance);}static void x11_setup_fbuf (vo_instance_t * _instance,			    uint8_t ** buf, void ** id){    x11_instance_t * instance = (x11_instance_t *) _instance;    buf[0] = (uint8_t *) instance->frame[instance->index].data;    buf[1] = buf[2] = NULL;    *id = instance->frame + instance->index++;}static void x11_draw_frame (vo_instance_t * _instance,			    uint8_t * const * buf, void * id){    x11_frame_t * frame;    x11_instance_t * instance;    frame = (x11_frame_t *) id;    instance = (x11_instance_t *) _instance;    XShmPutImage (instance->display, instance->window, instance->gc,		  frame->ximage, 0, 0, 0, 0, instance->width, instance->height,		  True);    XFlush (instance->display);    frame->wait_completion = 1;}static int x11_alloc_frames (x11_instance_t * instance){    int size;    char * alloc;    int i;    size = 0;    alloc = NULL;    for (i = 0; i < 3; i++) {	instance->frame[i].wait_completion = 0;	instance->frame[i].ximage =	    XShmCreateImage (instance->display, instance->vinfo.visual,			     instance->vinfo.depth, ZPixmap, NULL /* data */,			     &(instance->shminfo),			     instance->width, instance->height);	if (instance->frame[i].ximage == NULL) {	    fprintf (stderr, "Cannot create ximage\n");	    return 1;	} else if (i == 0) {	    size = (instance->frame[0].ximage->bytes_per_line *		    instance->frame[0].ximage->height);	    alloc = (char *) create_shm (instance, 3 * size);	    if (alloc == NULL) {		XDestroyImage (instance->frame[i].ximage);		return 1;	    }	} else if (size != (instance->frame[i].ximage->bytes_per_line *			    instance->frame[i].ximage->height)) {	    fprintf (stderr, "unexpected ximage data size\n");	    return 1;	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品视频一区| 欧美日韩一二区| 欧美日韩免费高清一区色橹橹 | 成人免费在线播放视频| 日韩高清国产一区在线| 99久久99久久精品免费看蜜桃| 91精品在线免费观看| 亚洲女同女同女同女同女同69| 久久国产精品无码网站| 欧美性感一区二区三区| 国产精品视频免费| 久久精品国产99久久6| 不卡的av在线| 国产亚洲欧洲997久久综合| 五月天国产精品| 色综合天天天天做夜夜夜夜做| 亚洲色图欧美在线| 狠狠色综合播放一区二区| 制服.丝袜.亚洲.另类.中文| 亚洲综合区在线| 日韩一区二区三区在线观看| 中文字幕中文乱码欧美一区二区 | 国产盗摄视频一区二区三区| 777久久久精品| 一区二区三区四区在线| 99久久婷婷国产| 国产日韩欧美a| 国产伦精品一区二区三区视频青涩 | 成人av在线播放网址| 久久午夜国产精品| 九色综合狠狠综合久久| 欧美成人精品福利| 日韩中文字幕亚洲一区二区va在线 | 26uuuu精品一区二区| 丝袜美腿亚洲一区二区图片| 日本精品免费观看高清观看| 亚洲狼人国产精品| 日本韩国欧美在线| 一区二区三区鲁丝不卡| 欧美专区在线观看一区| 无码av中文一区二区三区桃花岛| 91福利视频久久久久| 亚洲一线二线三线久久久| 欧美日韩国产影片| 婷婷一区二区三区| 精品国产免费人成电影在线观看四季 | 精品一区中文字幕| 国产日本亚洲高清| 91丝袜呻吟高潮美腿白嫩在线观看| 国产精品久久久久久久久久免费看| 国产乱淫av一区二区三区| 国产精品欧美久久久久一区二区| 91性感美女视频| 亚洲va欧美va天堂v国产综合| 欧美日韩亚洲综合| 久久疯狂做爰流白浆xx| 国产拍揄自揄精品视频麻豆| 色噜噜夜夜夜综合网| 亚洲电影一区二区三区| 欧美精品一区二区久久久| 国产69精品一区二区亚洲孕妇 | 成人激情小说网站| 亚洲一区二区在线免费观看视频| 91精品国产高清一区二区三区| 国产一区欧美二区| 一区二区三区欧美在线观看| 欧美一级视频精品观看| 成人丝袜18视频在线观看| 亚洲影院免费观看| 国产欧美日韩中文久久| 欧美日韩免费观看一区三区| 国产精品系列在线播放| 亚洲成人黄色影院| 国产视频一区在线播放| 欧美日精品一区视频| 成人午夜视频网站| 日本不卡一二三| 亚洲私人影院在线观看| 国产美女久久久久| 91麻豆精品国产91久久久资源速度| 久久激情五月婷婷| 亚洲精品国产一区二区精华液| 337p亚洲精品色噜噜噜| 99精品视频在线观看免费| 蜜臀av性久久久久蜜臀av麻豆| 中文字幕精品在线不卡| 91精品国产综合久久精品性色| 99视频有精品| 国产高清不卡一区二区| 丝袜美腿亚洲一区二区图片| 亚洲日本一区二区| 国产欧美日本一区二区三区| 欧美一级片在线观看| 日本电影欧美片| youjizz国产精品| 国内久久精品视频| 日本va欧美va瓶| 亚洲h精品动漫在线观看| 国产精品久久久久久久久免费樱桃 | 日韩欧美精品在线视频| 欧美性色黄大片| 97久久精品人人做人人爽| 国模冰冰炮一区二区| 亚洲欧美一区二区三区极速播放| 久久午夜色播影院免费高清| 91亚洲精品乱码久久久久久蜜桃| 高清av一区二区| 国产一区二区三区不卡在线观看| 日韩中文字幕91| 亚洲国产日韩精品| 一区二区三区欧美在线观看| 中文字幕一区二区三| 国产精品欧美精品| 国产精品电影一区二区| 国产精品麻豆久久久| 欧美激情一区二区三区| 国产午夜精品福利| 国产精品色呦呦| 亚洲欧洲成人自拍| 亚洲欧美精品午睡沙发| 亚洲三级在线免费观看| 亚洲视频一区二区免费在线观看| 欧美国产精品v| 国产精品成人免费| 亚洲精品伦理在线| 亚洲国产精品欧美一二99| 亚洲国产中文字幕在线视频综合| 午夜欧美一区二区三区在线播放| 日韩精品欧美精品| 裸体一区二区三区| 国产成人综合精品三级| 成人app软件下载大全免费| 色婷婷精品大在线视频| 欧美日韩高清影院| 9191久久久久久久久久久| 3751色影院一区二区三区| 26uuu亚洲| 国产精品免费视频一区| 一区二区三国产精华液| 日本不卡免费在线视频| 国产精品自在在线| 成人a免费在线看| 欧美三级一区二区| 精品国产成人在线影院| 欧美性猛交xxxx乱大交退制版| 欧美老人xxxx18| 欧美xxxxxxxxx| 国产精品久久久久久一区二区三区| 亚洲乱码国产乱码精品精小说 | 黄色资源网久久资源365| 岛国精品一区二区| 欧美撒尿777hd撒尿| 精品1区2区在线观看| 国产精品免费免费| 日韩福利电影在线观看| yourporn久久国产精品| 日韩一区和二区| 国产精品传媒在线| 免费不卡在线观看| 色综合久久久久久久| 精品欧美一区二区三区精品久久| 国产精品久久久久久久久免费丝袜| 亚洲不卡在线观看| 成人免费电影视频| 91精品国产一区二区三区蜜臀| 欧美一区二区私人影院日本| 日韩不卡在线观看日韩不卡视频| 另类小说图片综合网| aaa欧美日韩| 久久综合久色欧美综合狠狠| 亚洲精品久久久久久国产精华液 | 国产精品久线观看视频| 亚洲国产视频一区二区| 99re66热这里只有精品3直播 | 麻豆一区二区在线| 色婷婷狠狠综合| 国产情人综合久久777777| 日韩不卡一区二区| 在线精品亚洲一区二区不卡| 国产精品国产三级国产aⅴ入口 | 欧美一区二区三区四区高清| 中文字幕中文在线不卡住| 国产一区二区电影| 精品理论电影在线| 久久99精品国产.久久久久| 国产精品一区二区在线看| 欧美一区二区三区男人的天堂| 亚洲美女在线一区| 不卡的av中国片| 中文字幕欧美区| 国产一区在线观看麻豆| 精品国产99国产精品| 欧美96一区二区免费视频| 欧美日本韩国一区| 亚洲综合网站在线观看| 91捆绑美女网站| 亚洲精选在线视频| 色综合久久久网| 亚洲精品视频自拍| 欧美三级视频在线|