[MPlayer-dev-eng] mplayer + codec(*.so)

houdiney houdiney at 126.com
Fri Dec 26 14:26:59 CET 2008


Hi, all:
First,
         Wish you have a happy Christmas!
Second,
    I have been puzzled in a question: I wanna integrate a midi lib(libmidi.so) into mplayer,
so in the directory .../mplayer/libmpcodecs/, I created file ad_midi.c like some other codec's(ex. ad_libmad.c), as follows:
 
//-----------------------------------
 ...
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include "mp_msg.h"
#include "vd_internal.h"
#include "m_option.h"
static int init(sh_video_t *sh){
return 0;
}
static void uninit(sh_video_t *sh){
return;
}
static int control(sh_video_t *sh,int cmd,void* arg,...){
return 0;
}
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
return NULL;
}
static vd_info_t info = 
{
"midi",
"libmidi",
"houdiney <houdiney at 126.com>",
"houdiney <houdiney at 126.com>",
"No Comment"
};
LIBVD_EXTERN(libmidi)
...
//-----------------------------------

then, in the file ad.c, I added :
extern ad_functions_t mpcodecs_ad_libmidi; 
in struct mpcodecs_ad_drivers:
&mpcodecs_ad_libmidi 
in file .../libmpcodecs/Makefile, add:
  SRCS_COMMON-$(LIBMIDI)  += ad_libmidi.c 

then type "make" in a shell in directory mplayer, bu error follows:
...
libmpcodecs/libmpcodecs.a(ad.o):(.data+0x58): undefined reference to `mpcodecs_ad_libmidi' 

Could someone give me an advise on what I should  do next ?

2008-12-26 



houdiney 



More information about the MPlayer-dev-eng mailing list