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

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

?? video_osd.c

?? TI workshop 培訓資料。 是關于如何創建DAVINCI平臺下codec engine
?? C
字號:
/* * video_output.c *//* Standard Linux headers */#include <stdio.h>		// always include stdio.h#include <stdlib.h>		// always include stdlib.h#include <string.h>             // defines memset and memcpy methods#include <fcntl.h>		// defines open, read, write methods#include <unistd.h>		// defines close and sleep methods#include <sys/mman.h>		// defines mmap method#include <sys/ioctl.h>		// defines ioctl method#include <linux/fb.h>		// defines framebuffer driver methods/* Application header files */#include "video_osd.h"		// video driver definitions#include "debug.h"		// DBG and ERR macros/* Bits per pixel for video window */#define SCREEN_BPP          16/* Global variables to hold attribute and osd window attributes */struct fb_var_screeninfo attrInfo;struct fb_var_screeninfo osdInfo;/****************************************************************************** *  video_osd_setup ******************************************************************************//*  input parameters:                                                         *//*	int *osdFdByRef     -- used to return the file desc of OSD device     *//*      int *attrFdByRef    -- used to return the file desc of attribute dev  *//*      char *osdDevice     -- string containing name of OSD device           *//*      char *attrDevice    -- string containing name of attribute device     *//*      unsigned char trans -- 8-bit binary pattern to use as a fill for the  *//*                             attribute window. 0x00 = transparent OSD       *//*                             0x11, 0x22, 0x33, 0x44, 0x55, 0x66 are         *//*                             alpha blends. 0x77 shows OSD only (no video)   *//*                             0x99-0xFF are same, but OSD blinks.            *//*      unsigned short **osdDisplayByRef -- used to return a pointer to the   *//*                             mmap'ed osd buffer                             *//*      unsigned short **attrDisplayByRef -- used to return a pointer to the  *//*                             mmap'ed attribute buffer                       *//*                                                                            *//******************************************************************************/int video_osd_setup(int *osdFdByRef, int *attrFdByRef, char *osdDevice, 			char *attrDevice, unsigned char trans, 			unsigned short **osdDisplayByRef, 			unsigned short **attrDisplayByRef){    int                      size;    *osdFdByRef = open(osdDevice, O_RDWR);    if (*osdFdByRef == -1) {        ERR("Failed to open OSD device %s\n", osdDevice);        return VOSD_FAILURE;    }    *attrFdByRef = open(attrDevice, O_RDWR);    if (*attrFdByRef == -1) {        ERR("Failed to open attribute window device %s\n", attrDevice);	close(*osdFdByRef);        return VOSD_FAILURE;    }    DBG("OSD device %s opened with file descriptor %d\n", osdDevice, 								*osdFdByRef);    DBG("Attribute device %s opened with file descriptor %d\n", attrDevice,								*attrFdByRef);    if (ioctl(*osdFdByRef, FBIOGET_VSCREENINFO, &osdInfo) == -1) {        ERR("Error reading variable info for file descriptor %d\n", 							*osdFdByRef);	close(*attrFdByRef);	close(*osdFdByRef);        return VOSD_FAILURE;    }    /* Sixteen bits per pixel */    size = osdInfo.xres_virtual * osdInfo.yres * 2;     *osdDisplayByRef = (unsigned short *) mmap(NULL, size,                                          PROT_READ | PROT_WRITE,                                          MAP_SHARED, *osdFdByRef, 0);    if (*osdDisplayByRef == MAP_FAILED) {        ERR("Failed mmap on file descripor %d\n", *osdFdByRef);	close(*attrFdByRef);	close(*osdFdByRef);        return VOSD_FAILURE;    }    DBG("Mapped osd window to location %p, size %d (%#x)\n", *osdDisplayByRef,							size, size);    /* Fill the window with the new attribute value */    memset(*osdDisplayByRef, 0, size);    DBG("\tFilled OSD window with pattern: 0x0\n");    if (ioctl(*attrFdByRef, FBIOGET_VSCREENINFO, &attrInfo) == -1) {        ERR("Error reading variable info for file descriptor %d\n", 							*attrFdByRef);	close(*attrFdByRef);	close(*osdFdByRef);        return VOSD_FAILURE;    }    /* One nibble per pixel */    size = attrInfo.xres_virtual * attrInfo.yres / 2;     *attrDisplayByRef = (unsigned short *) mmap(NULL, size,                                          PROT_READ | PROT_WRITE,                                          MAP_SHARED, *attrFdByRef, 0);    if (*attrDisplayByRef == MAP_FAILED) {        ERR("Failed mmap on file descripor %d\n", *attrFdByRef);	close(*attrFdByRef);	close(*osdFdByRef);        return VOSD_FAILURE;    }    DBG("Mapped attribute window to location %p, size %d (%#x)\n", 					*attrDisplayByRef, size, size);    /* Fill the window with the new attribute value */    memset(*attrDisplayByRef, trans, size);    DBG("\tFilled attribute window with pattern: %#x\n", trans);    return VOSD_SUCCESS;}/****************************************************************************** *  video_osd_place ******************************************************************************//*  input parameters:                                                         *//*      unsigned short *osdDisplay   -- mmap'ed location of osd window        *//*      unsigned short *attrDisplay  -- mmap'ed location of attribute window  *//*      unsigned short *picture      -- bitmapped picture array               *//*      int x_offset                 -- x offset to place picture in osd      *//*      int y_offset                 -- y offset to place picture in osd      *//*      int x_picsize                -- x dimension of picture                *//*      int y_picsize                -- y dimension of picture                *//*                                                                            *//*  NOTE: this function does not check offsets and picture size against       *//*      dimensions of osd and attr window. If your math is wrong, you will    *//*      get a segmentation fault (or worse)                                   *//*                                                                            *//******************************************************************************/int video_osd_place(unsigned short *osdDisplay, unsigned short *attrDisplay, 		unsigned short *picture, unsigned char trans,		int x_offset, int y_offset, int x_picsize, int y_picsize){    int i;    unsigned short *displayOrigin;    unsigned short *attrOrigin;    displayOrigin = osdDisplay + (y_offset * osdInfo.xres_virtual) + x_offset;    attrOrigin = attrDisplay + (y_offset * (attrInfo.xres_virtual >> 2)) 						+ (x_offset >> 2);    for(i=0; i<y_picsize; i++){	memcpy(displayOrigin + (i*osdInfo.xres_virtual), 				picture + (i*x_picsize), (x_picsize << 1));	memset(attrOrigin + (i*(attrInfo.xres_virtual >> 2)), trans, 							(x_picsize >> 1) );    }    return VOSD_SUCCESS;}/****************************************************************************** *  video_osd_scroll ******************************************************************************//*  input parameters:                                                         *//*      unsigned short *osdDisplay   -- mmap'ed location of osd window        *//*      unsigned short *attrDisplay  -- mmap'ed location of attribute window  *//*      unsigned short *picture      -- bitmapped picture array               *//*      int x_offset                 -- x offset to place picture in osd      *//*      int y_offset                 -- y offset to place picture in osd      *//*      int x_picsize                -- x dimension of picture                *//*      int y_picsize                -- y dimension of picture                *//*      int x_scroll                 -- x scrolling offset                    *//*      int y_scroll                 -- y scrolling offset                    *//*                                                                            *//*  NOTE: this function does not check offsets and picture size against       *//*      dimensions of osd and attr window. If your math is wrong, you will    *//*      get a segmentation fault (or worse)                                   *//*                                                                            *//*  NOTE #2: This function does not set the attribute window's transparency   *//*      use video_osd_place once as an initialization before using scroll     *//*                                                                            *//******************************************************************************/int video_osd_scroll(unsigned short *osdDisplay, unsigned short *attrDisplay, 		unsigned short *picture,		int x_offset, int y_offset, int x_picsize, int y_picsize,		int x_scroll, int y_scroll){    int i;    unsigned short *displayOrigin;    unsigned short *attrOrigin;    displayOrigin = osdDisplay + (y_offset * osdInfo.xres_virtual) + x_offset;    attrOrigin = attrDisplay + (y_offset * (attrInfo.xres_virtual >> 2)) 						+ (x_offset >> 2);    for(i=0; i<(y_picsize - y_scroll); i++){	memcpy(displayOrigin + (i*osdInfo.xres_virtual), 			picture + ((i+y_scroll)*x_picsize) + x_scroll,			((x_picsize-x_scroll) << 1));	memcpy(displayOrigin + (i*osdInfo.xres_virtual) + (x_picsize-x_scroll), 			picture + ((i+y_scroll)*x_picsize),			((x_scroll) << 1));    }    for(i=(y_picsize - y_scroll); i<y_picsize; i++){	memcpy(displayOrigin + (i*osdInfo.xres_virtual), 			picture+ ((i-y_picsize+y_scroll)*x_picsize) + x_scroll, 			((x_picsize-x_scroll) << 1));	memcpy(displayOrigin +(i*osdInfo.xres_virtual) + (x_picsize -x_scroll), 			picture + ((i-y_picsize+y_scroll)*x_picsize), 			(x_scroll << 1));    }    return VOSD_SUCCESS;}/****************************************************************************** *  video_osd_circframe ******************************************************************************//*  input parameters:                                                         *//*      unsigned short *osdDisplay   -- mmap'ed location of osd window        *//*      unsigned short *attrDisplay  -- mmap'ed location of attribute window  *//*      unsigned short fillval       -- color fill for the frame in 5-6-5 RGB *//*      unsigned char trans          -- transparency value for the frame      *//*                             0x00 = transparent frame (so you won't see it) *//*                             0x11, 0x22, 0x33, 0x44, 0x55, 0x66 are         *//*                             alpha blends. 0x77 shows solid frame           *//*                             0x99-0xFF are same, but OSD blinks.            *//*                                                                            *//******************************************************************************/int video_osd_circframe(unsigned short *osdDisplay, 		unsigned short *attrDisplay, unsigned short fillval, 		unsigned char trans){    int i, j;    float x, y, x_scale, y_scale;    char *attrChar = (char *) attrDisplay;    x_scale = (float) (osdInfo.xres_virtual >> 1);    y_scale = (float) (osdInfo.yres >> 1);    for(j=0;j<osdInfo.yres;j++){	for(i=0;i<osdInfo.xres_virtual;i+=2){	    x = (float) i - x_scale;	    y = (float) j - y_scale;	    if(((x*x / (x_scale*x_scale)) + (y*y/(y_scale*y_scale))) > 0.9){		attrChar[(j*attrInfo.xres_virtual + i) >> 1] = trans;		osdDisplay[j*osdInfo.xres_virtual + i] = fillval;		osdDisplay[j*osdInfo.xres_virtual + i + 1] = fillval;	    }        }    }    return VOSD_SUCCESS;}/****************************************************************************** *  video_osd_cleanup ******************************************************************************//*  input parameters:                                                         *//*      int osdFd                   -- file descriptor of open attr window    *//*      int attrFd                  -- file descriptor of open osd window     *//*      unsigned short *osdDisplay  -- mmap'ed location of osd window         *//*      unsigned short *attrDisplay -- mmap'ed location of attribute window   *//*                                                                            *//******************************************************************************/int video_osd_cleanup(int osdFd, int attrFd, unsigned short *osdDisplay, 			unsigned short *attrDisplay){    struct fb_var_screeninfo vInfo;    int                      size;    DBG("Entering osd window cleanup\n");    if (ioctl(osdFd, FBIOGET_VSCREENINFO, &vInfo) == -1) {        ERR("Error reading variable information for file descriptor %d\n", 							osdFd);	close(attrFd);	close(osdFd);        return VOSD_FAILURE;    }    /* Sixteen bits per pixel */    size = vInfo.xres_virtual * vInfo.yres * 2;     munmap(osdDisplay, size);    close(osdFd);    DBG("\tClosed osd window (file descriptor: %d)\n", osdFd);    DBG("\tUnmapped osd window memory (%p)\n", osdDisplay);    DBG("Entering attribute window cleanup\n");    if (ioctl(attrFd, FBIOGET_VSCREENINFO, &vInfo) == -1) {        ERR("Error reading variable information for file descriptor %d\n", 							attrFd);	close(attrFd);	close(osdFd);        return VOSD_FAILURE;    }    /* One nibble per pixel */    size = vInfo.xres_virtual * vInfo.yres / 2;     memset(attrDisplay, 0, size);    munmap(attrDisplay, size);    close(attrFd);    DBG("\tClosed attribute window (file descriptor: %d)\n", attrFd);    DBG("\tUnmapped attribute window memory (%p)\n", attrDisplay);    return VOSD_SUCCESS;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人妖av一区二区| 日韩美一区二区三区| 中文字幕一区三区| 91在线码无精品| 亚洲综合精品自拍| 欧美一二三区在线| 免费久久99精品国产| 2023国产精华国产精品| 欧美一区二区视频网站| 毛片av中文字幕一区二区| 久久久国际精品| 色综合久久久久综合体桃花网| 亚洲日本中文字幕区| 欧美日韩一区视频| 激情综合网激情| 国产精品久久久久精k8 | 国产成人一区二区精品非洲| 欧美激情一区二区| 欧美日韩日日骚| 国产揄拍国内精品对白| 亚洲免费伊人电影| 日韩视频免费观看高清在线视频| 精品亚洲porn| 伊人性伊人情综合网| 日韩你懂的在线观看| 成人av免费在线观看| 免费成人在线影院| 中文字幕在线不卡视频| 91麻豆精品国产无毒不卡在线观看| 国产综合色精品一区二区三区| 中文字幕视频一区| 日韩欧美亚洲国产精品字幕久久久| jiyouzz国产精品久久| 日韩二区三区四区| 亚洲精品欧美激情| 久久久亚洲综合| 在线欧美日韩精品| 国产999精品久久久久久| 亚洲国产精品一区二区尤物区| 久久亚洲综合色一区二区三区| 91久久一区二区| 国产精品亚洲午夜一区二区三区 | 免费观看在线色综合| 国产精品乱人伦| 精品免费国产二区三区| 在线视频观看一区| 99热这里都是精品| 国产精品一区二区在线看| 丝袜亚洲另类丝袜在线| 亚洲精品国久久99热| 国产亚洲婷婷免费| 欧美成人国产一区二区| 欧美视频一区二区三区| av中文字幕一区| 欧美mv和日韩mv的网站| 欧美日韩综合一区| 91色九色蝌蚪| 99久久精品免费精品国产| 国产乱子轮精品视频| 美国十次了思思久久精品导航| 亚洲一二三四久久| 亚洲日本在线视频观看| 国产精品麻豆视频| 中文字幕免费不卡| 精品成人免费观看| 欧美精品一区二区三区蜜桃视频| 欧美久久一区二区| 欧美精品一级二级三级| 欧美三级视频在线播放| 欧美综合视频在线观看| 一本到高清视频免费精品| 99这里只有精品| 91浏览器入口在线观看| 99re热这里只有精品免费视频| 国产91丝袜在线播放| 粉嫩av一区二区三区| 成人免费看黄yyy456| 成人福利视频在线看| 91在线精品一区二区| 不卡影院免费观看| 91亚洲男人天堂| 91美女在线视频| 色婷婷综合五月| 欧美日韩在线播放一区| 欧美日韩国产免费一区二区| 91.成人天堂一区| 日韩精品一区在线| 久久看人人爽人人| 欧美激情在线一区二区| 国产精品成人免费在线| 亚洲黄色性网站| 日日夜夜精品视频免费| 美女在线观看视频一区二区| 国产在线播放一区三区四| 国产成人免费在线观看| 91色在线porny| 制服丝袜av成人在线看| 欧美α欧美αv大片| 欧美国产亚洲另类动漫| 亚洲精品乱码久久久久| 秋霞电影网一区二区| 国产老妇另类xxxxx| 97se亚洲国产综合自在线观| 欧美视频自拍偷拍| 日韩欧美国产一区二区在线播放| 欧美成人福利视频| 亚洲日本在线天堂| 老司机精品视频在线| 成人av免费在线| 欧美日本高清视频在线观看| 精品国产凹凸成av人导航| 国产精品久久久久影院老司 | 色婷婷久久99综合精品jk白丝| 色综合 综合色| 日韩美女一区二区三区四区| 亚洲国产经典视频| 丝袜美腿亚洲综合| 懂色av一区二区夜夜嗨| 69久久99精品久久久久婷婷| 国产情人综合久久777777| 偷拍与自拍一区| 成人免费看黄yyy456| 日韩一区和二区| 亚洲精品欧美激情| 国产凹凸在线观看一区二区| 欧洲亚洲国产日韩| 国产三级一区二区三区| 日本v片在线高清不卡在线观看| 成人高清免费观看| 精品电影一区二区| 亚洲成人精品一区二区| gogogo免费视频观看亚洲一| 亚洲国产你懂的| 国产suv一区二区三区88区| 欧美一区二区三区日韩视频| 亚洲免费在线观看视频| 东方欧美亚洲色图在线| 日韩精品自拍偷拍| 一区二区三区日韩精品视频| 国产成人自拍高清视频在线免费播放| 欧美三级资源在线| 亚洲精品免费在线| 成人高清在线视频| 久久久久久久久久久99999| 日韩av中文字幕一区二区三区| 97se亚洲国产综合自在线观| 久久九九久精品国产免费直播| 日韩av一级片| 欧美日韩亚洲综合在线| 亚洲视频在线一区观看| hitomi一区二区三区精品| 久久久99精品免费观看| 精彩视频一区二区三区| 69久久99精品久久久久婷婷| 亚洲成av人片| 欧美性色欧美a在线播放| 亚洲图片欧美激情| 99riav久久精品riav| 最新久久zyz资源站| aaa欧美日韩| 国产精品久久久久影院| 成人性生交大片| 国产精品色婷婷| 懂色av一区二区夜夜嗨| 欧美激情在线观看视频免费| 顶级嫩模精品视频在线看| 久久九九影视网| 粉嫩嫩av羞羞动漫久久久| 国产精品乱码妇女bbbb| 99久久精品免费观看| 亚洲免费在线观看| 在线观看日韩一区| 日韩国产精品久久| 亚洲国产aⅴ成人精品无吗| 欧美中文字幕一区二区三区亚洲| 一区二区三区小说| 欧美三级中文字| 免费成人在线影院| 久久久精品黄色| 91在线观看免费视频| 亚洲美女视频一区| 欧美精品一二三区| 国产一区二区三区免费观看| 国产欧美日韩精品一区| 91在线你懂得| 日本成人在线视频网站| 欧美一区二视频| 国产精品1区2区3区在线观看| 久久精品亚洲精品国产欧美kt∨| 福利一区二区在线观看| 亚洲同性gay激情无套| 欧美日韩中文国产| 蜜芽一区二区三区| 欧美激情在线看| 欧美在线视频日韩| 久久99国产精品久久99果冻传媒| 国产欧美日本一区视频| 91精彩视频在线观看| 久久99精品久久久久| 亚洲人成精品久久久久久|