Mercurial > mplayer.hg
annotate libmpcodecs/vf_yuy2.c @ 31063:55cd4161425a
Fix compilation with gcc 2.95.3 (with --disable-ass).
author | cehoyos |
---|---|
date | Wed, 28 Apr 2010 11:57:09 +0000 |
parents | a972c1a4a012 |
children |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
18 |
5539 | 19 #include <stdio.h> |
20 #include <stdlib.h> | |
21 #include <string.h> | |
22 #include <inttypes.h> | |
23 | |
17012 | 24 #include "config.h" |
25 #include "mp_msg.h" | |
18004
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
17906
diff
changeset
|
26 #include "help_mp.h" |
5539 | 27 |
5607 | 28 #include "img_format.h" |
29 #include "mp_image.h" | |
5539 | 30 #include "vf.h" |
31 | |
18861 | 32 #include "libswscale/rgb2rgb.h" |
10993 | 33 #include "vf_scale.h" |
5539 | 34 |
35 //===========================================================================// | |
36 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
37 static int config(struct vf_instance *vf, |
5539 | 38 int width, int height, int d_width, int d_height, |
39 unsigned int flags, unsigned int outfmt){ | |
10993 | 40 |
41 sws_rgb2rgb_init(get_sws_cpuflags()); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
42 |
5539 | 43 if(vf_next_query_format(vf,IMGFMT_YUY2)<=0){ |
18004
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
17906
diff
changeset
|
44 mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YUY2"); |
5539 | 45 return 0; |
46 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
47 |
5539 | 48 return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YUY2); |
49 } | |
50 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
51 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ |
5539 | 52 mp_image_t *dmpi; |
53 | |
54 // hope we'll get DR buffer: | |
55 dmpi=vf_get_image(vf->next,IMGFMT_YUY2, | |
56 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, | |
57 mpi->w, mpi->h); | |
58 | |
7342 | 59 if(mpi->imgfmt==IMGFMT_422P) |
60 yuv422ptoyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], | |
61 mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); | |
62 else | |
5539 | 63 yv12toyuy2(mpi->planes[0],mpi->planes[1],mpi->planes[2], dmpi->planes[0], |
64 mpi->w,mpi->h, mpi->stride[0],mpi->stride[1],dmpi->stride[0]); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
65 |
9934 | 66 vf_clone_mpi_attributes(dmpi, mpi); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
67 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
68 return vf_next_put_image(vf,dmpi, pts); |
5539 | 69 } |
70 | |
71 //===========================================================================// | |
72 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
73 static int query_format(struct vf_instance *vf, unsigned int fmt){ |
5539 | 74 switch(fmt){ |
75 case IMGFMT_YV12: | |
76 case IMGFMT_I420: | |
77 case IMGFMT_IYUV: | |
7342 | 78 case IMGFMT_422P: |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5539
diff
changeset
|
79 return vf_next_query_format(vf,IMGFMT_YUY2) & (~VFCAP_CSP_SUPPORTED_BY_HW); |
5539 | 80 } |
81 return 0; | |
82 } | |
83 | |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30421
diff
changeset
|
84 static int vf_open(vf_instance_t *vf, char *args){ |
5539 | 85 vf->config=config; |
86 vf->put_image=put_image; | |
87 vf->query_format=query_format; | |
88 return 1; | |
89 } | |
90 | |
25221 | 91 const vf_info_t vf_info_yuy2 = { |
7342 | 92 "fast YV12/Y422p -> YUY2 conversion", |
5539 | 93 "yuy2", |
94 "A'rpi", | |
95 "", | |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30421
diff
changeset
|
96 vf_open, |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
7368
diff
changeset
|
97 NULL |
5539 | 98 }; |
99 | |
100 //===========================================================================// |