Mercurial > mplayer.hg
annotate libmpcodecs/vd_cyuv.c @ 7492:5465cbd5c5ef
Modern versions of OpenSSH listen on localhost to forward the X11 connection
(X11UseLocalhost defaults to yes). The following patch permits to consider
as non local any DISPLAY environment which port is greater or equal to 10
else mplayer tries a local optimization on a distant X server which doesn't
work.
patch by Denis.Ducamp@groar.org
author | arpi |
---|---|
date | Mon, 23 Sep 2002 21:17:30 +0000 |
parents | 28677d779205 |
children | 84f406c22df1 |
rev | line source |
---|---|
4989 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 | |
4 #include "config.h" | |
5 #include "mp_msg.h" | |
6 | |
7 #include "vd_internal.h" | |
8 | |
9 static vd_info_t info = { | |
10 "Creative YUV decoder", | |
11 "cyuv", | |
12 "A'rpi", | |
13 "Dr. Tim Ferguson", | |
14 "native codec" | |
15 }; | |
16 | |
17 LIBVD_EXTERN(cyuv) | |
18 | |
19 // to set/get/query special features/parameters | |
20 static int control(sh_video_t *sh,int cmd,void* arg,...){ | |
21 return CONTROL_UNKNOWN; | |
22 } | |
23 | |
24 // init driver | |
25 static int init(sh_video_t *sh){ | |
5124 | 26 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_UYVY); |
4989 | 27 } |
28 | |
29 // uninit driver | |
30 static void uninit(sh_video_t *sh){ | |
31 } | |
32 | |
33 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); | |
34 | |
35 void decode_cyuv( | |
36 unsigned char *buf, | |
37 int size, | |
38 unsigned char *frame, | |
39 int width, | |
40 int height, | |
5351
eea0213d64c8
added YUY2 output to the widely used (heh) CYUV decoder because it seemed
melanson
parents:
5124
diff
changeset
|
41 int format); |
4989 | 42 |
43 // decode a frame | |
44 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | |
45 mp_image_t* mpi; | |
46 if(len<=0) return NULL; // skipped frame | |
47 | |
48 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0, | |
49 sh->disp_w, sh->disp_h); | |
50 if(!mpi) return NULL; | |
51 | |
5351
eea0213d64c8
added YUY2 output to the widely used (heh) CYUV decoder because it seemed
melanson
parents:
5124
diff
changeset
|
52 decode_cyuv(data, len, mpi->planes[0], sh->disp_w, sh->disp_h, |
eea0213d64c8
added YUY2 output to the widely used (heh) CYUV decoder because it seemed
melanson
parents:
5124
diff
changeset
|
53 sh->codec->outfmt[sh->outfmtidx]); |
4989 | 54 |
55 return mpi; | |
56 } |