Mercurial > mplayer.hg
view libmpcodecs/vd_libdv.c @ 22771:ce6b4af46882
r22547: fix up some longer than 80 char lines , and use suggestion from Diego.
r22570: dont start newline with a space and readd subdirectory
r22718: add new audio and video codecs to libavcodec list
r22748: add png and gif encoders, how to use them with mencoder is another question
r22749: split sonic into sonic/sonicls and wma into wmav1/wmav2
r22750: add rest of lavc encoders to list (vcr1, cljr, jpegls, ffvhuff, msmpeg4v1)
r22751: gsm requires libgsm so remove it
r22752: aiff isnt there as well, TEST FIRST, THEN DOCUMENT COMPN!
r22753: ok so cljr , vcr1 and msmpegv1 dont actually work... removed
r22679: Some more details for the mga_vid section taken from drivers/README.
r22686: tdfx_vid compilation has been simplified.
r22695: Add a link to Attila's mga_vid port to Linux 2.6.x.
r22704: 'make install' now takes care of most manual installation steps for *_vid.o.
author | voroshil |
---|---|
date | Sat, 24 Mar 2007 03:08:19 +0000 |
parents | ed8f90096c65 |
children | 71b3e04d0555 |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include <math.h> #include "config.h" #include "img_format.h" #include <libdv/dv.h> #include <libdv/dv_types.h> #include "stream/stream.h" #include "libmpdemux/demuxer.h" #include "libmpdemux/stheader.h" #include "vd_internal.h" static vd_info_t info = { "Raw DV Video Decoder", "libdv", "Alexander Neundorf <neundorf@kde.org>", "http://libdv.sf.net", "native codec" }; LIBVD_EXTERN(libdv) // to set/get/query special features/parameters static int control(sh_video_t *sh,int cmd,void* arg,...){ return CONTROL_UNKNOWN; } static dv_decoder_t* global_rawdv_decoder=NULL; dv_decoder_t* init_global_rawdv_decoder() { if(!global_rawdv_decoder){ global_rawdv_decoder=dv_decoder_new(TRUE,TRUE,FALSE); global_rawdv_decoder->quality=DV_QUALITY_BEST; global_rawdv_decoder->prev_frame_decoded = 0; } return global_rawdv_decoder; } // init driver static int init(sh_video_t *sh) { sh->context = (void *)init_global_rawdv_decoder(); return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2); } // uninit driver static void uninit(sh_video_t *sh){ } // decode a frame static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags) { mp_image_t* mpi; dv_decoder_t *decoder=sh->context; if(len<=0 || (flags&3)){ // fprintf(stderr,"decode() (rawdv) SKIPPED\n"); return NULL; // skipped frame } dv_parse_header(decoder, data); mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, sh->disp_w, sh->disp_h); if(!mpi){ // temporary! fprintf(stderr,"couldn't allocate image for stderr codec\n"); return NULL; } dv_decode_full_frame(decoder, data, e_dv_color_yuv, mpi->planes, mpi->stride); return mpi; }