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

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

?? ppm.c.svn-base

?? mediastreamer2是開(kāi)源的網(wǎng)絡(luò)傳輸媒體流的庫(kù)
?? SVN-BASE
字號(hào):
/* * 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 "framehook.h"#include "avformat.h"#include "swscale.h"#include "avstring.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);    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色呦呦网站一区| 国产欧美一区视频| 国产精品麻豆欧美日韩ww| 欧美日韩中文国产| 成人99免费视频| 成人精品国产免费网站| 日本欧美一区二区| 亚洲综合久久久| 成人av在线看| 国产精品乱码人人做人人爱| 污片在线观看一区二区| 久久综合成人精品亚洲另类欧美 | 亚洲h动漫在线| av亚洲产国偷v产偷v自拍| 国产精品2024| 欧美一区二区三区视频免费播放| 午夜欧美在线一二页| av一区二区三区在线| 一区二区在线免费| 欧美午夜精品理论片a级按摩| 亚洲一区在线播放| 一本色道久久综合精品竹菊| 综合久久给合久久狠狠狠97色 | 最新成人av在线| 欧美精品日日鲁夜夜添| 国产精品99久久久久| 久久嫩草精品久久久久| 欧美吻胸吃奶大尺度电影| 国产欧美一区二区三区沐欲| 欧美手机在线视频| 欧美日韩精品免费观看视频| 国产精品视频免费| 激情欧美一区二区三区在线观看| 久久美女艺术照精彩视频福利播放 | 风间由美一区二区三区在线观看 | 欧美激情艳妇裸体舞| 国产精品影视天天线| 日本不卡在线视频| 国产精品456露脸| 日韩在线一二三区| 国产精品视频一二三区| 91精品国产色综合久久不卡电影| 欧美色综合影院| 成人毛片老司机大片| 国内久久婷婷综合| 91丨porny丨户外露出| 中文在线一区二区| 精品福利在线导航| 99久久99精品久久久久久 | 日本一区二区视频在线| 国产精品少妇自拍| 91丝袜美腿高跟国产极品老师 | 国产999精品久久久久久绿帽| 国产精品视频一二三| 日韩免费电影一区| 欧美日韩欧美一区二区| 91一区一区三区| 极品少妇一区二区三区精品视频 | 丝袜美腿亚洲一区| 中文字幕视频一区| 国产日韩成人精品| 久久亚洲欧美国产精品乐播| 日韩一区二区三区四区五区六区| 欧美日韩中文字幕精品| 欧美性色综合网| 99久久国产综合精品女不卡| 国产精品亚洲午夜一区二区三区 | 国产精品久久久久久久午夜片| 蜜桃精品视频在线| 在线成人午夜影院| 一区二区三区在线免费观看| 日韩美女久久久| 一区二区三区中文字幕在线观看| 欧美一区二区三区电影| 一区二区三区不卡在线观看 | 91久久一区二区| 3d成人动漫网站| 美女视频一区在线观看| 国产精品三级av在线播放| 91蜜桃网址入口| 久久综合久色欧美综合狠狠| 久久99精品网久久| 久久综合色播五月| 国产亚洲欧美激情| 欧美优质美女网站| 麻豆精品视频在线观看| 91精品婷婷国产综合久久性色| 欧美色图一区二区三区| 日本欧美在线观看| 在线一区二区视频| 日韩高清在线电影| 一区二区成人在线| 欧美性欧美巨大黑白大战| 日韩免费一区二区| 国产婷婷色一区二区三区| 日本一区二区三区久久久久久久久不| 亚洲成人av一区| 91久久线看在观草草青青| 欧美日韩不卡在线| 国产一区二区三区综合| 欧美日韩免费高清一区色橹橹| 日本亚洲最大的色成网站www| 欧美日韩综合一区| 国产精品白丝av| 99国产欧美另类久久久精品| 色婷婷综合久久久久中文一区二区| 一区二区三区在线播放| 欧美一区二区三区免费视频 | 色欧美88888久久久久久影院| 国产精品传媒在线| 日韩精品一区二区三区中文不卡 | 国产精品中文欧美| 最新高清无码专区| 蜜臀av一区二区在线观看| 日韩欧美一区中文| 日本一区二区免费在线观看视频| 欧美精品九九99久久| 色老汉一区二区三区| 亚洲女人小视频在线观看| 懂色av中文字幕一区二区三区| 亚洲国产一区二区三区| 不卡在线视频中文字幕| 一区精品在线播放| 欧美日韩久久一区| 国产精品电影院| 欧洲av在线精品| 国产精品电影一区二区三区| 欧美日韩不卡一区二区| 中文字幕乱码亚洲精品一区| 国产.欧美.日韩| 国内精品免费**视频| 午夜视频久久久久久| 久久久精品黄色| 国产精品久久久爽爽爽麻豆色哟哟| 久久久久亚洲综合| 欧美日韩精品综合在线| 欧美一级在线免费| 4438x亚洲最大成人网| 国产成人小视频| 精品制服美女丁香| 91视频一区二区| 欧美精品一区二区三区久久久 | 欧美乱妇20p| 中文字幕免费观看一区| 亚洲成人av电影在线| 91无套直看片红桃| 欧美日韩mp4| 亚洲精品水蜜桃| 久草中文综合在线| 精品一区二区三区免费播放| 91香蕉视频污| 久久在线观看免费| 日韩电影免费在线观看网站| 成人在线视频一区二区| 欧美大片在线观看一区二区| 亚洲影视资源网| 色婷婷激情综合| 亚洲欧美日韩一区二区| 国产福利精品导航| 久久久久久久久久美女| 麻豆91小视频| 日韩精品一区二区三区swag| 五月天久久比比资源色| 欧洲国内综合视频| 亚洲超丰满肉感bbw| 欧美三级视频在线观看| 尤物av一区二区| 在线影院国内精品| 亚洲一区二三区| 欧美日韩国产影片| 五月天亚洲精品| 欧美不卡一二三| 激情综合网天天干| 精品福利一二区| 国产不卡视频一区| 中文欧美字幕免费| 91视视频在线观看入口直接观看www| 亚洲视频一二三区| 欧美亚洲免费在线一区| 午夜精品一区二区三区电影天堂| 欧美日韩在线综合| 蜜臀av性久久久久av蜜臀妖精| 在线综合亚洲欧美在线视频| 日韩精品电影在线| 亚洲精品一区二区三区精华液| 国产一区二区中文字幕| 国产精品国产三级国产普通话三级| 成人在线综合网| 亚洲一区二区欧美激情| 91精品国产综合久久久久久漫画 | bt7086福利一区国产| 亚洲婷婷综合色高清在线| 91行情网站电视在线观看高清版| 亚洲大片免费看| 久久亚洲春色中文字幕久久久| 成人精品免费看| 久久婷婷色综合| 国产成人精品免费一区二区| 国产精品你懂的在线欣赏| 99精品热视频|