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

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


Sorry, for simplay, I really wrote last letter by hand, so some error has been made:
1. ad_libmidi.c, not ad_midi.c;
2. LIBAD_EXTERN(libmidi), not LIBVD_EXTERN(libmidi)


2008-12-26 



houdiney 



发件人: houdiney 
发送时间: 2008-12-26  21:26:52 
收件人: mplayer-dev-eng at mplayerhq.hu 
抄送: houdiney 
主题: mplayer + codec(*.so) 
 
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