Mercurial > mplayer.hg
annotate libmpcodecs/vf_yuy2.c @ 10560:11826d9f90c7
this patch fixes
1) some bugs introduced in the tuner autodetection and in the channel-parsing functions,
3) retries reading when the mplayer/mencoder don't read fast enough (sooner it exited)
but especially
4) makes the stream compliant with the new, modular stream api (the one
currently in CVS is not and is totally unreachable).
[and maybe more, next time please include cvslog in patch! -- A'rpi]
patch by Nico <nsabbi@libero.it>
author | arpi |
---|---|
date | Mon, 11 Aug 2003 00:02:46 +0000 |
parents | 89da8ec89558 |
children | 7f95a79ba916 |
rev | line source |
---|---|
5539 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
4 #include <inttypes.h> | |
5 | |
6 #include "../config.h" | |
7 #include "../mp_msg.h" | |
8 | |
5607 | 9 #include "img_format.h" |
10 #include "mp_image.h" | |
5539 | 11 #include "vf.h" |
12 | |
13 #include "../libvo/fastmemcpy.h" | |
14 #include "../postproc/rgb2rgb.h" | |
15 | |
16 //===========================================================================// | |
17 | |
18 static int config(struct vf_instance_s* vf, | |
19 int width, int height, int d_width, int d_height, | |
20 unsigned int flags, unsigned int outfmt){ | |
21 | |
22 if(vf_next_query_format(vf,IMGFMT_YUY2)<=0){ | |
23 printf("yuy2 not supported by next filter/vo :(\n"); | |
24 return 0; | |
25 } | |
26 | |
27 return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YUY2); | |
28 } | |
29 | |
7368 | 30 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
5539 | 31 mp_image_t *dmpi; |
32 | |
33 // hope we'll get DR buffer: | |
34 dmpi=vf_get_image(vf->next,IMGFMT_YUY2, | |
35 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, | |
36 mpi->w, mpi->h); | |
37 | |
7342 | 38 if(mpi->imgfmt==IMGFMT_422P) |
39 yuv422ptoyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], | |
40 mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); | |
41 else | |
5539 | 42 yv12toyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], |
43 mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); | |
44 | |
9934 | 45 vf_clone_mpi_attributes(dmpi, mpi); |
5539 | 46 |
7368 | 47 return vf_next_put_image(vf,dmpi); |
5539 | 48 } |
49 | |
50 //===========================================================================// | |
51 | |
52 static int query_format(struct vf_instance_s* vf, unsigned int fmt){ | |
53 switch(fmt){ | |
54 case IMGFMT_YV12: | |
55 case IMGFMT_I420: | |
56 case IMGFMT_IYUV: | |
7342 | 57 case IMGFMT_422P: |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5539
diff
changeset
|
58 return vf_next_query_format(vf,IMGFMT_YUY2) & (~VFCAP_CSP_SUPPORTED_BY_HW); |
5539 | 59 } |
60 return 0; | |
61 } | |
62 | |
63 static int open(vf_instance_t *vf, char* args){ | |
64 vf->config=config; | |
65 vf->put_image=put_image; | |
66 vf->query_format=query_format; | |
67 return 1; | |
68 } | |
69 | |
70 vf_info_t vf_info_yuy2 = { | |
7342 | 71 "fast YV12/Y422p -> YUY2 conversion", |
5539 | 72 "yuy2", |
73 "A'rpi", | |
74 "", | |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
7368
diff
changeset
|
75 open, |
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
7368
diff
changeset
|
76 NULL |
5539 | 77 }; |
78 | |
79 //===========================================================================// |