[Mplayer-cvslog] CVS: main/libvo2 libvo2.c,NONE,1.1 vo2_def.h,NONE,1.1

Arpi of Ize arpi at mplayer.dev.hu
Tue Jul 31 02:30:18 CEST 2001


Update of /cvsroot/mplayer/main/libvo2
In directory mplayer:/var/tmp.root/cvs-serv4806

Added Files:
	libvo2.c vo2_def.h 
Log Message:
libvo2 base

--- NEW FILE ---

#include <stdio.h>
#include <stdlib.h>

#include "libvo2.h"

// libvo2 core interface

vo2_handle_t* vo2_init_sample();

vo2_handle_t* vo2_new(char *drvname){

    // do it better... (later: plugin loader stuff)
    if(!strcmp(drvname,"sample")) return vo2_init_sample();
    if(!strcmp(drvname,"mga")) return vo2_init_mga();
//    if(!strcmp(drvname,"x11")) return vo2_new_mga();
// ...

    fprintf(stderr,"No such driver: %s\n",drvname);
    return NULL;

}

int vo2_start(vo2_handle_t* vo, int w,int h,int format,int buffering,int flags){
    return vo->functions->start(vo->priv,w,h,format,buffering,flags);
}

int vo2_query_format(vo2_handle_t* vo){
    return 1;
}

int vo2_close(vo2_handle_t* vo){
    return vo->functions->stop(vo->priv);
}

--- NEW FILE ---

// include only from vo2_*.c drivers!

static int control(void *p, int cmd, void* param);
static int start(void *p, int w,int h,int format,int buffering,int flags);
static int stop(void *p);
static vo2_surface_t* get_surface(void *p, int num);
static void flip_image(void *p, int num);

static vo2_functions_t functions =
{
    control,
    start,
    stop,
    get_surface,
    flip_image
};

static vo2_handle_t* new_handle(){
    vo2_handle_t* h=malloc(sizeof(vo2_handle_t));
    if(!h) return NULL;
    h->priv=malloc(sizeof(priv_t));
    if(!h->priv){ free(h); return NULL; }
    memset(h->priv,0,sizeof(priv_t));
    h->info=&info;
    h->functions=&functions;
    h->surface=NULL;
    return h;
}




More information about the MPlayer-cvslog mailing list