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

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

?? ppm.c.svn-base

?? ffmpeg最新源碼
?? SVN-BASE
字號:
/* * PPM Video Hook * Copyright (c) 2003 Charles Yates * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */#include <stdio.h>#include <unistd.h>#include <fcntl.h>#include <sys/types.h>#include <sys/wait.h>#include <ctype.h>#include "libavutil/avstring.h"#include "libavformat/framehook.h"#include "libavformat/avformat.h"#include "libswscale/swscale.h"static int sws_flags = SWS_BICUBIC;/** Bi-directional pipe structure.*/typedef struct rwpipe{    int pid;    FILE *reader;    FILE *writer;}rwpipe;/** Create a bidirectional pipe for the given command.*/static rwpipe *rwpipe_open( int argc, char *argv[] ){    rwpipe *this = av_mallocz( sizeof( rwpipe ) );    if ( this != NULL )    {        int input[ 2 ];        int output[ 2 ];        pipe( input );        pipe( output );        this->pid = fork();        if ( this->pid == 0 )        {#define COMMAND_SIZE 10240            char *command = av_mallocz( COMMAND_SIZE );            int i;            strcpy( command, "" );            for ( i = 0; i < argc; i ++ )            {                av_strlcat( command, argv[ i ], COMMAND_SIZE );                av_strlcat( command, " ", COMMAND_SIZE );            }            dup2( output[ 0 ], STDIN_FILENO );            dup2( input[ 1 ], STDOUT_FILENO );            close( input[ 0 ] );            close( input[ 1 ] );            close( output[ 0 ] );            close( output[ 1 ] );            execl("/bin/sh", "sh", "-c", command, (char*)NULL );            _exit( 255 );        }        else        {            close( input[ 1 ] );            close( output[ 0 ] );            this->reader = fdopen( input[ 0 ], "r" );            this->writer = fdopen( output[ 1 ], "w" );        }    }    return this;}/** Read data from the pipe.*/static FILE *rwpipe_reader( rwpipe *this ){    if ( this != NULL )        return this->reader;    else        return NULL;}/** Write data to the pipe.*/static FILE *rwpipe_writer( rwpipe *this ){    if ( this != NULL )        return this->writer;    else        return NULL;}/* Read a number from the pipe - assumes PNM style headers.*/static int rwpipe_read_number( rwpipe *rw ){    int value = 0;    int c = 0;    FILE *in = rwpipe_reader( rw );    do    {        c = fgetc( in );        while( c != EOF && !isdigit( c ) && c != '#' )            c = fgetc( in );        if ( c == '#' )            while( c != EOF && c != '\n' )                c = fgetc( in );    }    while ( c != EOF && !isdigit( c ) );    while( c != EOF && isdigit( c ) )    {        value = value * 10 + ( c - '0' );        c = fgetc( in );    }    return value;}/** Read a PPM P6 header.*/static int rwpipe_read_ppm_header( rwpipe *rw, int *width, int *height ){    char line[ 3 ];    FILE *in = rwpipe_reader( rw );    int max;    fgets( line, 3, in );    if ( !strncmp( line, "P6", 2 ) )    {        *width = rwpipe_read_number( rw );        *height = rwpipe_read_number( rw );        max = rwpipe_read_number( rw );        return max != 255 || *width <= 0 || *height <= 0;    }    return 1;}/** Close the pipe and process.*/static void rwpipe_close( rwpipe *this ){    if ( this != NULL )    {        fclose( this->reader );        fclose( this->writer );        waitpid( this->pid, NULL, 0 );        av_free( this );    }}/** Context info for this vhook - stores the pipe and image buffers.*/typedef struct{    rwpipe *rw;    int size1;    char *buf1;    int size2;    char *buf2;    // This vhook first converts frame to RGB ...    struct SwsContext *toRGB_convert_ctx;    // ... then processes it via a PPM command pipe ...    // ... and finally converts back frame from RGB to initial format    struct SwsContext *fromRGB_convert_ctx;}ContextInfo;/** Initialise the context info for this vhook.*/int Configure(void **ctxp, int argc, char *argv[]){    if ( argc > 1 )    {        *ctxp = av_mallocz(sizeof(ContextInfo));        if ( ctxp != NULL && argc > 1 )        {            ContextInfo *info = (ContextInfo *)*ctxp;            info->rw = rwpipe_open( argc - 1, &argv[ 1 ] );            return 0;        }    }    return 1;}/** Process a frame.*/void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, int64_t pts){    int err = 0;    ContextInfo *ci = (ContextInfo *) ctx;    AVPicture picture1;    AVPicture picture2;    AVPicture *pict = picture;    int out_width;    int out_height;    int i;    uint8_t *ptr = NULL;    FILE *in = rwpipe_reader( ci->rw );    FILE *out = rwpipe_writer( ci->rw );    /* Check that we have a pipe to talk to. */    if ( in == NULL || out == NULL )        err = 1;    /* Convert to RGB24 if necessary */    if ( !err && pix_fmt != PIX_FMT_RGB24 )    {        int size = avpicture_get_size(PIX_FMT_RGB24, width, height);        if ( size != ci->size1 )        {            av_free( ci->buf1 );            ci->buf1 = av_malloc(size);            ci->size1 = size;            err = ci->buf1 == NULL;        }        if ( !err )        {            avpicture_fill(&picture1, ci->buf1, PIX_FMT_RGB24, width, height);            // if we already got a SWS context, let's realloc if is not re-useable            ci->toRGB_convert_ctx = sws_getCachedContext(ci->toRGB_convert_ctx,                                        width, height, pix_fmt,                                        width, height, PIX_FMT_RGB24,                                        sws_flags, NULL, NULL, NULL);            if (ci->toRGB_convert_ctx == NULL) {                av_log(NULL, AV_LOG_ERROR,                       "Cannot initialize the toRGB conversion context\n");                return;            }// img_convert parameters are          2 first destination, then 4 source// sws_scale   parameters are context, 4 first source,      then 2 destination            sws_scale(ci->toRGB_convert_ctx,                     picture->data, picture->linesize, 0, height,                     picture1.data, picture1.linesize);            pict = &picture1;        }    }    /* Write out the PPM */    if ( !err )    {        ptr = pict->data[ 0 ];        fprintf( out, "P6\n%d %d\n255\n", width, height );        for ( i = 0; !err && i < height; i ++ )        {            err = !fwrite( ptr, width * 3, 1, out );            ptr += pict->linesize[ 0 ];        }        if ( !err )            err = fflush( out );    }    /* Read the PPM returned. */    if ( !err && !rwpipe_read_ppm_header( ci->rw, &out_width, &out_height ) )    {        int size = avpicture_get_size(PIX_FMT_RGB24, out_width, out_height);        if ( size != ci->size2 )        {            av_free( ci->buf2 );            ci->buf2 = av_malloc(size);            ci->size2 = size;            err = ci->buf2 == NULL;        }        if ( !err )        {            avpicture_fill(&picture2, ci->buf2, PIX_FMT_RGB24, out_width, out_height);            ptr = picture2.data[ 0 ];            for ( i = 0; !err && i < out_height; i ++ )            {                err = !fread( ptr, out_width * 3, 1, in );                ptr += picture2.linesize[ 0 ];            }        }    }    /* Convert the returned PPM back to the input format */    if ( !err )    {        /* The out_width/out_height returned from the PPM         * filter won't necessarily be the same as width and height         * but it will be scaled anyway to width/height.         */        av_log(NULL, AV_LOG_DEBUG,                  "PPM vhook: Input dimensions: %d x %d Output dimensions: %d x %d\n",                  width, height, out_width, out_height);        ci->fromRGB_convert_ctx = sws_getCachedContext(ci->fromRGB_convert_ctx,                                        out_width, out_height, PIX_FMT_RGB24,                                        width,     height,     pix_fmt,                                        sws_flags, NULL, NULL, NULL);        if (ci->fromRGB_convert_ctx == NULL) {            av_log(NULL, AV_LOG_ERROR,                   "Cannot initialize the fromRGB conversion context\n");            return;        }// img_convert parameters are          2 first destination, then 4 source// sws_scale   parameters are context, 4 first source,      then 2 destination        sws_scale(ci->fromRGB_convert_ctx,                 picture2.data, picture2.linesize, 0, out_height,                 picture->data, picture->linesize);    }}/** Clean up the effect.*/void Release(void *ctx){    ContextInfo *ci;    ci = (ContextInfo *) ctx;    if (ctx)    {        rwpipe_close( ci->rw );        av_free( ci->buf1 );        av_free( ci->buf2 );        sws_freeContext(ci->toRGB_convert_ctx);        sws_freeContext(ci->fromRGB_convert_ctx);        av_free(ctx);    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
波波电影院一区二区三区| 日本成人在线网站| 91视频.com| 中文成人av在线| 91麻豆成人久久精品二区三区| 日韩毛片高清在线播放| 91丨porny丨在线| 亚洲综合图片区| 欧美区在线观看| 狂野欧美性猛交blacked| 精品sm在线观看| 99久久婷婷国产综合精品电影| 亚洲老司机在线| 欧美一级夜夜爽| 国产·精品毛片| 亚洲人成在线观看一区二区| 欧美日本不卡视频| 精品一二线国产| 专区另类欧美日韩| 91精品国产福利| 床上的激情91.| 亚洲国产日韩一区二区| 日韩一区二区在线观看| 国产成人啪免费观看软件| 亚洲免费视频成人| 精品欧美黑人一区二区三区| 91亚洲永久精品| 丝袜国产日韩另类美女| 久久久国产精华| 欧美日韩亚洲综合一区二区三区| 黄色精品一二区| 自拍av一区二区三区| 欧美mv日韩mv国产网站app| 成人性生交大片| 青青草视频一区| 日韩一区中文字幕| 欧美变态tickle挠乳网站| 91久久国产最好的精华液| 国产一区二区三区四区在线观看| 亚洲免费电影在线| 日本一区二区三区免费乱视频| 欧美三级韩国三级日本三斤| 成人免费视频caoporn| 午夜激情久久久| 亚洲伦在线观看| 国产午夜精品福利| 欧美一区二区三区视频在线| 色婷婷av一区二区三区之一色屋| 国产精品一区一区| 日韩不卡一区二区| 亚洲国产另类av| 亚洲欧美综合色| 国产欧美中文在线| 欧美精品一区二| 91精品国产品国语在线不卡| 97久久久精品综合88久久| 国产一区欧美日韩| 日韩av在线免费观看不卡| 亚洲制服欧美中文字幕中文字幕| 国产精品国产成人国产三级| 欧美激情自拍偷拍| 久久久.com| 久久色视频免费观看| 日韩欧美中文字幕制服| 制服丝袜av成人在线看| 欧美日韩一区二区在线观看| 色综合天天综合网天天狠天天| 成人精品视频一区| 成人免费va视频| 国产精品18久久久| 国产精品99久久久| 国产精品88av| 成人性生交大片免费看视频在线| 国产91丝袜在线播放九色| 久久99精品久久久久婷婷| 久久97超碰国产精品超碰| 日本vs亚洲vs韩国一区三区二区| 天天影视涩香欲综合网 | 欧美久久久久久久久中文字幕| 91无套直看片红桃| 色婷婷综合中文久久一本| 99综合影院在线| 91麻豆高清视频| 欧美日韩一区不卡| 91精品免费观看| 日韩精品一区二区三区视频播放| 欧美大白屁股肥臀xxxxxx| 久久婷婷色综合| 欧美国产精品一区| 亚洲精品高清在线观看| 亚洲国产成人av网| 青青青爽久久午夜综合久久午夜| 麻豆精品视频在线观看| 国产在线观看免费一区| 成人av午夜影院| 在线看国产日韩| 欧美日韩一区二区三区不卡| 欧美一区二区成人| 久久久久久毛片| 亚洲品质自拍视频网站| 亚洲国产aⅴ成人精品无吗| 日本不卡1234视频| 大桥未久av一区二区三区中文| 99麻豆久久久国产精品免费| 欧美中文字幕一区| 亚洲精品在线网站| 国产精品乱子久久久久| 亚洲国产三级在线| 国产乱人伦偷精品视频不卡| 9i在线看片成人免费| 欧美精品久久一区| 亚洲国产成人午夜在线一区| 欧美aⅴ一区二区三区视频| 国产高清在线精品| 欧美午夜影院一区| 久久婷婷综合激情| 亚洲成人1区2区| 国产一区二区三区四区在线观看| 99精品视频一区二区| 91精品国产麻豆| 国产精品第四页| 免费三级欧美电影| 99精品久久免费看蜜臀剧情介绍| 欧美夫妻性生活| 亚洲欧洲在线观看av| 美国毛片一区二区| 色成年激情久久综合| 久久精品一区二区三区不卡| 亚洲国产视频在线| 成人av免费网站| 精品美女被调教视频大全网站| 亚洲色图视频免费播放| 国产一区二三区好的| 欧美日韩在线一区二区| 国产精品国产三级国产aⅴ中文 | 蜜臀久久久久久久| 99国产精品国产精品毛片| 精品国产免费一区二区三区香蕉| 一级精品视频在线观看宜春院| 国产一区不卡视频| 欧美日精品一区视频| 最好看的中文字幕久久| 国产另类ts人妖一区二区| 91麻豆精品国产自产在线观看一区| 国产精品午夜在线| 精彩视频一区二区三区| 欧美电影在线免费观看| 亚洲欧美二区三区| 成人精品国产免费网站| 国产亚洲成aⅴ人片在线观看| 男男gaygay亚洲| 精品视频色一区| 亚洲国产综合在线| 色综合天天狠狠| 亚洲日韩欧美一区二区在线| 国产成人午夜99999| 久久影音资源网| 黄页视频在线91| 久久久久综合网| 国产精品1区二区.| 久久久久久久电影| 国产成人精品影视| 国产欧美日韩精品在线| 国产成人av影院| 国产日韩欧美精品一区| 国产大陆亚洲精品国产| 国产清纯在线一区二区www| 国产一区二区精品久久91| wwwwxxxxx欧美| 国产麻豆一精品一av一免费 | 1024精品合集| 9久草视频在线视频精品| 国产精品美女久久久久aⅴ国产馆| 国产精品亚洲人在线观看| 欧美激情一二三区| 97精品视频在线观看自产线路二| 亚洲婷婷综合久久一本伊一区| 99国内精品久久| 综合在线观看色| 91成人在线精品| 亚洲国产精品久久不卡毛片| 欧美午夜电影一区| 日韩精品电影一区亚洲| 日韩欧美在线一区二区三区| 激情综合网激情| 国产欧美一区二区精品性| 99久久精品国产一区二区三区 | 色激情天天射综合网| 一区二区三区精品在线观看| 欧美日韩国产综合久久| 日本视频一区二区三区| 欧美va亚洲va| 99热这里都是精品| 午夜婷婷国产麻豆精品| 欧美大片顶级少妇| 91社区在线播放| 日本女优在线视频一区二区| 欧美精品一区二| 91捆绑美女网站| 免费成人结看片|