mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +00:00
DMO support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8296 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
c989ead81b
commit
f482d214a7
5
Makefile
5
Makefile
@ -62,7 +62,7 @@ ifeq ($(GUI),yes)
|
||||
PARTS += Gui
|
||||
endif
|
||||
ifneq ($(W32_LIB),)
|
||||
PARTS += loader loader/dshow
|
||||
PARTS += loader loader/dshow loader/dmo
|
||||
endif
|
||||
ifeq ($(LIBMENU),yes)
|
||||
PARTS += libmenu
|
||||
@ -136,6 +136,9 @@ libmpcodecs/libmpcodecs.a:
|
||||
loader/dshow/libDS_Filter.a:
|
||||
$(MAKE) -C loader/dshow
|
||||
|
||||
loader/dmo/libDMO_Filter.a:
|
||||
$(MAKE) -C loader/dmo
|
||||
|
||||
libavcodec/libavcodec.a:
|
||||
$(MAKE) -C libavcodec
|
||||
|
||||
|
8
configure
vendored
8
configure
vendored
@ -3685,12 +3685,12 @@ echores "$_dshow"
|
||||
|
||||
if test "$_dshow" = yes ; then
|
||||
_def_dshow='#define USE_DIRECTSHOW 1'
|
||||
_ld_dshow='loader/dshow/libDS_Filter.a'
|
||||
_dep_dshow='loader/dshow/libDS_Filter.a'
|
||||
_codecmodules="directshow $_codecmodules"
|
||||
_ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
|
||||
_dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
|
||||
_codecmodules="dshow/dmo $_codecmodules"
|
||||
else
|
||||
_def_dshow='#undef USE_DIRECTSHOW'
|
||||
_nocodecmodules="directshow $_nocodecmodules"
|
||||
_nocodecmodules="dshow/dmo $_nocodecmodules"
|
||||
fi
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@ AUDIO_SRCS=dec_audio.c ad.c $(AUDIO_SRCS_LIB) $(AUDIO_SRCS_NAT) $(AUDIO_SRCS_OPT
|
||||
|
||||
VIDEO_SRCS_LIB=vd_libmpeg2.c vd_nuv.c vd_lzo.c
|
||||
VIDEO_SRCS_NAT=vd_null.c vd_cinepak.c vd_qtrpza.c vd_raw.c vd_msvidc.c vd_fli.c vd_qtrle.c vd_qtsmc.c vd_roqvideo.c vd_cyuv.c vd_msrle.c vd_huffyuv.c vd_mpegpes.c vd_svq1.c vd_lcl.c vd_mtga.c
|
||||
VIDEO_SRCS_OPT=vd_realvid.c vd_ffmpeg.c vd_dshow.c vd_vfw.c vd_vfwex.c vd_odivx.c vd_divx4.c vd_xanim.c vd_xvid.c vd_libdv.c vd_qtvideo.c
|
||||
VIDEO_SRCS_OPT=vd_realvid.c vd_ffmpeg.c vd_dshow.c vd_dmo.c vd_vfw.c vd_vfwex.c vd_odivx.c vd_divx4.c vd_xanim.c vd_xvid.c vd_libdv.c vd_qtvideo.c
|
||||
VIDEO_SRCS=dec_video.c vd.c $(VIDEO_SRCS_NAT) $(VIDEO_SRCS_LIB) $(VIDEO_SRCS_OPT)
|
||||
|
||||
VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_pp.c vf_scale.c vf_format.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c
|
||||
|
@ -30,6 +30,7 @@ extern vd_functions_t mpcodecs_vd_cinepak;
|
||||
extern vd_functions_t mpcodecs_vd_qtrpza;
|
||||
extern vd_functions_t mpcodecs_vd_ffmpeg;
|
||||
extern vd_functions_t mpcodecs_vd_dshow;
|
||||
extern vd_functions_t mpcodecs_vd_dmo;
|
||||
extern vd_functions_t mpcodecs_vd_vfw;
|
||||
extern vd_functions_t mpcodecs_vd_vfwex;
|
||||
extern vd_functions_t mpcodecs_vd_odivx;
|
||||
@ -68,6 +69,7 @@ vd_functions_t* mpcodecs_vd_drivers[] = {
|
||||
#ifdef USE_WIN32DLL
|
||||
#ifdef USE_DIRECTSHOW
|
||||
&mpcodecs_vd_dshow,
|
||||
&mpcodecs_vd_dmo,
|
||||
#endif
|
||||
&mpcodecs_vd_vfw,
|
||||
&mpcodecs_vd_vfwex,
|
||||
|
90
libmpcodecs/vd_dmo.c
Normal file
90
libmpcodecs/vd_dmo.c
Normal file
@ -0,0 +1,90 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "config.h"
|
||||
#ifdef USE_DIRECTSHOW
|
||||
|
||||
#include "mp_msg.h"
|
||||
#include "help_mp.h"
|
||||
|
||||
#include "vd_internal.h"
|
||||
|
||||
#include "loader/dmo/DMO_VideoDecoder.h"
|
||||
|
||||
static vd_info_t info = {
|
||||
"DMO video codecs",
|
||||
"dmo",
|
||||
"A'rpi",
|
||||
"based on http://avifile.sf.net",
|
||||
"win32 codecs"
|
||||
};
|
||||
|
||||
LIBVD_EXTERN(dmo)
|
||||
|
||||
// to set/get/query special features/parameters
|
||||
static int control(sh_video_t *sh,int cmd,void* arg,...){
|
||||
return CONTROL_UNKNOWN;
|
||||
}
|
||||
|
||||
// init driver
|
||||
static int init(sh_video_t *sh){
|
||||
unsigned int out_fmt;
|
||||
if(!(sh->context=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){
|
||||
mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll);
|
||||
mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n");
|
||||
mp_msg(MSGT_DECVIDEO,MSGL_HINT,"package from: ftp://mplayerhq.hu/MPlayer/releases/w32codec.zip !\n");
|
||||
return 0;
|
||||
}
|
||||
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0;
|
||||
out_fmt=sh->codec->outfmt[sh->outfmtidx];
|
||||
switch(out_fmt){
|
||||
case IMGFMT_YUY2:
|
||||
case IMGFMT_UYVY:
|
||||
DMO_VideoDecoder_SetDestFmt(sh->context,16,out_fmt);break; // packed YUV
|
||||
case IMGFMT_YV12:
|
||||
case IMGFMT_I420:
|
||||
case IMGFMT_IYUV:
|
||||
DMO_VideoDecoder_SetDestFmt(sh->context,12,out_fmt);break; // planar YUV
|
||||
case IMGFMT_YVU9:
|
||||
DMO_VideoDecoder_SetDestFmt(sh->context,9,out_fmt);break;
|
||||
default:
|
||||
DMO_VideoDecoder_SetDestFmt(sh->context,out_fmt&255,0); // RGB/BGR
|
||||
}
|
||||
DMO_VideoDecoder_StartInternal(sh->context);
|
||||
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32/DMOhow video codec init OK!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// uninit driver
|
||||
static void uninit(sh_video_t *sh){
|
||||
DMO_VideoDecoder_Destroy(sh->context);
|
||||
}
|
||||
|
||||
//mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
|
||||
|
||||
// decode a frame
|
||||
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
||||
mp_image_t* mpi;
|
||||
if(len<=0) return NULL; // skipped frame
|
||||
|
||||
if(flags&3){
|
||||
// framedrop:
|
||||
DMO_VideoDecoder_DecodeInternal(sh->context, data, len, 0, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0 /*MP_IMGFLAG_ACCEPT_STRIDE*/,
|
||||
sh->disp_w, sh->disp_h);
|
||||
|
||||
if(!mpi){ // temporary!
|
||||
printf("couldn't allocate image for cinepak codec\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DMO_VideoDecoder_DecodeInternal(sh->context, data, len, 1, mpi->planes[0]);
|
||||
|
||||
return mpi;
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user