Mercurial > mplayer.hg
annotate libmpcodecs/vf_expand.c @ 30918:be200e917ae1
Remove unused OPTFLAGS variable from config.mak.
author | diego |
---|---|
date | Thu, 25 Mar 2010 19:53:05 +0000 |
parents | 0aa7c9d45f92 |
children | 92f88bb315c5 |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
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:
29916
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:
29916
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:
29916
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
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:
29916
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:
29916
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:
29916
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
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:
29916
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:
29916
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:
29916
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29916
diff
changeset
|
18 |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
19 #define OSD_SUPPORT |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
20 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
21 #include <stdio.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
22 #include <stdlib.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
23 #include <string.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
24 |
17012 | 25 #include "config.h" |
26 #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
|
27 #include "help_mp.h" |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
28 |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
29 #include "img_format.h" |
5607 | 30 #include "mp_image.h" |
30653
3d23e24c5c60
Declare externally used variables from vd.c as extern in vd.h.
diego
parents:
30642
diff
changeset
|
31 #include "vd.h" |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
32 #include "vf.h" |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
33 |
17012 | 34 #include "libvo/fastmemcpy.h" |
29437 | 35 #include "libavutil/avutil.h" |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
36 |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
37 #ifdef OSD_SUPPORT |
17012 | 38 #include "libvo/sub.h" |
39 #include "libvo/osd.h" | |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
40 #endif |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
41 |
9594 | 42 #include "m_option.h" |
43 #include "m_struct.h" | |
44 | |
45 static struct vf_priv_s { | |
29624
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
46 // These four values are a backup of the values parsed from the command line. |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
47 // This is necessary so that we do not get a mess upon filter reinit due to |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
48 // e.g. aspect changes and with only aspect specified on the command line, |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
49 // where we would otherwise use the values calculated for a different aspect |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
50 // instead of recalculating them again. |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
51 int cfg_exp_w, cfg_exp_h; |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
52 int cfg_exp_x, cfg_exp_y; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
53 int exp_w,exp_h; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
54 int exp_x,exp_y; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
55 int osd; |
15939 | 56 double aspect; |
57 int round; | |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
58 unsigned char* fb_ptr; |
21803
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
59 int passthrough; |
15252 | 60 int first_slice; |
22027 | 61 } const vf_priv_dflt = { |
9594 | 62 -1,-1, |
63 -1,-1, | |
29916
dd9272344d74
Fix initialization values for vf_expand priv struct.
reimar
parents:
29638
diff
changeset
|
64 -1,-1, |
dd9272344d74
Fix initialization values for vf_expand priv struct.
reimar
parents:
29638
diff
changeset
|
65 -1,-1, |
9594 | 66 0, |
15939 | 67 0., |
68 1, | |
15252 | 69 NULL, |
21803
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
70 0, |
15252 | 71 0 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
72 }; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
73 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
74 //===========================================================================// |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
75 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
76 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
77 static struct vf_instance *vf=NULL; // fixme (needs sub.c changes) |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
78 static int orig_w,orig_h; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
79 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
80 static void remove_func_2(int x0,int y0, int w,int h){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
81 // TODO: let's cleanup the place |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
82 //printf("OSD clear: %d;%d %dx%d \n",x0,y0,w,h); |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
83 vf_mpi_clear(vf->dmpi,x0,y0,w,h); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
84 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
85 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
86 static void remove_func(int x0,int y0, int w,int h){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
87 if(!vo_osd_changed_flag) return; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
88 // split it to 4 parts: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
89 if(y0<vf->priv->exp_y){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
90 // it has parts above the image: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
91 int y=y0+h; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
92 if(y>vf->priv->exp_y) y=vf->priv->exp_y; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
93 remove_func_2(x0,y0,w,y-y0); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
94 if(y0+h<=vf->priv->exp_y) return; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
95 h-=y-y0;y0=y; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
96 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
97 if(y0+h>vf->priv->exp_y+orig_h){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
98 // it has parts under the image: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
99 int y=y0; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
100 if(y<vf->priv->exp_y+orig_h) y=vf->priv->exp_y+orig_h; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
101 remove_func_2(x0,y,w,y0+h-y); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
102 if(y0>=vf->priv->exp_y+orig_h) return; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
103 h=y-y0; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
104 } |
24243
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
105 if(x0<vf->priv->exp_x){ |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
106 // it has parts on the left side of the image: |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
107 int x=x0+w; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
108 if(x>vf->priv->exp_x) x=vf->priv->exp_x; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
109 remove_func_2(x0,y0,x-x0,h); |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
110 if(x0+w<=vf->priv->exp_x) return; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
111 w-=x-x0;x0=x; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
112 } |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
113 if(x0+w>vf->priv->exp_x+orig_w){ |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
114 // it has parts on the right side of the image: |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
115 int x=x0; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
116 if(x<vf->priv->exp_x+orig_w) x=vf->priv->exp_x+orig_w; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
117 remove_func_2(x,y0,x0+w-x,h); |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
118 if(x0>=vf->priv->exp_x+orig_w) return; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
119 w=x-x0; |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
120 } |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
121 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
122 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
123 static void draw_func(int x0,int y0, int w,int h,unsigned char* src, unsigned char *srca, int stride){ |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
124 unsigned char* dst; |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
125 if(!vo_osd_changed_flag && vf->dmpi->planes[0]==vf->priv->fb_ptr){ |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
126 // ok, enough to update the area inside the video, leave the black bands |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
127 // untouched! |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
128 if(x0<vf->priv->exp_x){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
129 int tmp=vf->priv->exp_x-x0; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
130 w-=tmp; src+=tmp; srca+=tmp; x0+=tmp; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
131 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
132 if(y0<vf->priv->exp_y){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
133 int tmp=vf->priv->exp_y-y0; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
134 h-=tmp; src+=tmp*stride; srca+=tmp*stride; y0+=tmp; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
135 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
136 if(x0+w>vf->priv->exp_x+orig_w){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
137 w=vf->priv->exp_x+orig_w-x0; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
138 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
139 if(y0+h>vf->priv->exp_y+orig_h){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
140 h=vf->priv->exp_y+orig_h-y0; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
141 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
142 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
143 if(w<=0 || h<=0) return; // nothing to do... |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
144 // printf("OSD redraw: %d;%d %dx%d \n",x0,y0,w,h); |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
145 dst=vf->dmpi->planes[0]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
146 vf->dmpi->stride[0]*y0+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
147 (vf->dmpi->bpp>>3)*x0; |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
148 switch(vf->dmpi->imgfmt){ |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
149 case IMGFMT_BGR15: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
150 case IMGFMT_RGB15: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
151 vo_draw_alpha_rgb15(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
152 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
153 case IMGFMT_BGR16: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
154 case IMGFMT_RGB16: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
155 vo_draw_alpha_rgb16(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
156 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
157 case IMGFMT_BGR24: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
158 case IMGFMT_RGB24: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
159 vo_draw_alpha_rgb24(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
160 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
161 case IMGFMT_BGR32: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
162 case IMGFMT_RGB32: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
163 vo_draw_alpha_rgb32(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
164 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
165 case IMGFMT_YV12: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
166 case IMGFMT_I420: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
167 case IMGFMT_IYUV: |
6537
ae203145245e
yv12 osd drawer is working for y8/y800/yvu9/if09 becouse it uses only Y-plane and Y-plane is the same for all these formats
alex
parents:
6525
diff
changeset
|
168 case IMGFMT_YVU9: |
ae203145245e
yv12 osd drawer is working for y8/y800/yvu9/if09 becouse it uses only Y-plane and Y-plane is the same for all these formats
alex
parents:
6525
diff
changeset
|
169 case IMGFMT_IF09: |
ae203145245e
yv12 osd drawer is working for y8/y800/yvu9/if09 becouse it uses only Y-plane and Y-plane is the same for all these formats
alex
parents:
6525
diff
changeset
|
170 case IMGFMT_Y800: |
ae203145245e
yv12 osd drawer is working for y8/y800/yvu9/if09 becouse it uses only Y-plane and Y-plane is the same for all these formats
alex
parents:
6525
diff
changeset
|
171 case IMGFMT_Y8: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
172 vo_draw_alpha_yv12(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
173 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
174 case IMGFMT_YUY2: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
175 vo_draw_alpha_yuy2(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
176 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
177 case IMGFMT_UYVY: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
178 vo_draw_alpha_yuy2(w,h,src,srca,stride,dst+1,vf->dmpi->stride[0]); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
179 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
180 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
181 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
182 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
183 static void draw_osd(struct vf_instance *vf_,int w,int h){ |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
184 vf=vf_;orig_w=w;orig_h=h; |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
185 // printf("======================================\n"); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
186 if(vf->priv->exp_w!=w || vf->priv->exp_h!=h || |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
187 vf->priv->exp_x || vf->priv->exp_y){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
188 // yep, we're expanding image, not just copy. |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
189 if(vf->dmpi->planes[0]!=vf->priv->fb_ptr){ |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
190 // double buffering, so we need full clear :( |
15099 | 191 if (vf->priv->exp_y > 0) |
192 remove_func_2(0,0,vf->priv->exp_w,vf->priv->exp_y); | |
193 if (vf->priv->exp_y+h < vf->priv->exp_h) | |
194 remove_func_2(0,vf->priv->exp_y+h,vf->priv->exp_w,vf->priv->exp_h-h-vf->priv->exp_y); | |
24243
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
195 if (vf->priv->exp_x > 0) |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
196 remove_func_2(0,vf->priv->exp_y,vf->priv->exp_x,h); |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
197 if (vf->priv->exp_x+w < vf->priv->exp_w) |
aeffa880c7d6
Add code to clear left and right borders not only top and bottom.
reimar
parents:
22027
diff
changeset
|
198 remove_func_2(vf->priv->exp_x+w,vf->priv->exp_y,vf->priv->exp_w-w-vf->priv->exp_x,h); |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
199 } else { |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
200 // partial clear: |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
201 vo_remove_text(vf->priv->exp_w,vf->priv->exp_h,remove_func); |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
202 } |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
203 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
204 vo_draw_text(vf->priv->exp_w,vf->priv->exp_h,draw_func); |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
205 // save buffer pointer for double buffering detection - yes, i know it's |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
206 // ugly method, but note that codecs with DR support does the same... |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
207 if(vf->dmpi) |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
208 vf->priv->fb_ptr=vf->dmpi->planes[0]; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
209 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
210 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
211 #endif |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
212 //===========================================================================// |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
213 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
214 static int config(struct vf_instance *vf, |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
215 int width, int height, int d_width, int d_height, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
216 unsigned int flags, unsigned int outfmt){ |
21803
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
217 if(outfmt == IMGFMT_MPEGPES) { |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
218 vf->priv->passthrough = 1; |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
219 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
220 } |
6525 | 221 if (outfmt == IMGFMT_IF09) return 0; |
29624
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
222 vf->priv->exp_x = vf->priv->cfg_exp_x; |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
223 vf->priv->exp_y = vf->priv->cfg_exp_y; |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
224 vf->priv->exp_w = vf->priv->cfg_exp_w; |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
225 vf->priv->exp_h = vf->priv->cfg_exp_h; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
226 // calculate the missing parameters: |
5921 | 227 #if 0 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
228 if(vf->priv->exp_w<width) vf->priv->exp_w=width; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
229 if(vf->priv->exp_h<height) vf->priv->exp_h=height; |
5921 | 230 #else |
231 if ( vf->priv->exp_w == -1 ) vf->priv->exp_w=width; | |
232 else if (vf->priv->exp_w < -1 ) vf->priv->exp_w=width - vf->priv->exp_w; | |
233 else if ( vf->priv->exp_w<width ) vf->priv->exp_w=width; | |
234 if ( vf->priv->exp_h == -1 ) vf->priv->exp_h=height; | |
235 else if ( vf->priv->exp_h < -1 ) vf->priv->exp_h=height - vf->priv->exp_h; | |
236 else if( vf->priv->exp_h<height ) vf->priv->exp_h=height; | |
237 #endif | |
15939 | 238 if (vf->priv->aspect) { |
20561
b7ed249cbc6e
Do not modify parsed command-line values on config,
reimar
parents:
18321
diff
changeset
|
239 float adjusted_aspect = vf->priv->aspect; |
b7ed249cbc6e
Do not modify parsed command-line values on config,
reimar
parents:
18321
diff
changeset
|
240 adjusted_aspect *= ((double)width/height) / ((double)d_width/d_height); |
b7ed249cbc6e
Do not modify parsed command-line values on config,
reimar
parents:
18321
diff
changeset
|
241 if (vf->priv->exp_h < vf->priv->exp_w / adjusted_aspect) { |
b7ed249cbc6e
Do not modify parsed command-line values on config,
reimar
parents:
18321
diff
changeset
|
242 vf->priv->exp_h = vf->priv->exp_w / adjusted_aspect + 0.5; |
15939 | 243 } else { |
20561
b7ed249cbc6e
Do not modify parsed command-line values on config,
reimar
parents:
18321
diff
changeset
|
244 vf->priv->exp_w = vf->priv->exp_h * adjusted_aspect + 0.5; |
15939 | 245 } |
246 } | |
15941 | 247 if (vf->priv->round > 1) { // round up. |
248 vf->priv->exp_w = (1 + (vf->priv->exp_w - 1) / vf->priv->round) * vf->priv->round; | |
15939 | 249 vf->priv->exp_h = (1 + (vf->priv->exp_h - 1) / vf->priv->round) * vf->priv->round; |
250 } | |
251 | |
5687 | 252 if(vf->priv->exp_x<0 || vf->priv->exp_x+width>vf->priv->exp_w) vf->priv->exp_x=(vf->priv->exp_w-width)/2; |
253 if(vf->priv->exp_y<0 || vf->priv->exp_y+height>vf->priv->exp_h) vf->priv->exp_y=(vf->priv->exp_h-height)/2; | |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
254 vf->priv->fb_ptr=NULL; |
6060 | 255 |
256 if(!opt_screen_size_x && !opt_screen_size_y){ | |
257 d_width=d_width*vf->priv->exp_w/width; | |
258 d_height=d_height*vf->priv->exp_h/height; | |
259 } | |
260 return vf_next_config(vf,vf->priv->exp_w,vf->priv->exp_h,d_width,d_height,flags,outfmt); | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
261 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
262 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
263 // there are 4 cases: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
264 // codec --DR--> expand --DR--> vo |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
265 // codec --DR--> expand -copy-> vo |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
266 // codec -copy-> expand --DR--> vo |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
267 // codec -copy-> expand -copy-> vo (worst case) |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
268 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
269 static void get_image(struct vf_instance *vf, mp_image_t *mpi){ |
6761
cb1180ccac76
DR1+IPB support (works only with ffmpeg12, as libmpeg2 doesn't accept stride)
arpi
parents:
6539
diff
changeset
|
270 // if(mpi->type==MP_IMGTYPE_IPB) return; // not yet working |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
271 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
272 if(vf->priv->osd && (mpi->flags&MP_IMGFLAG_PRESERVE)){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
273 // check if we have to render osd! |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
274 vo_update_osd(vf->priv->exp_w, vf->priv->exp_h); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
275 if(vo_osd_check_range_update(vf->priv->exp_x,vf->priv->exp_y, |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
276 vf->priv->exp_x+mpi->w,vf->priv->exp_y+mpi->h)) return; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
277 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
278 #endif |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
279 if(vf->priv->exp_w==mpi->width || |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
280 (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH)) ){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
281 // try full DR ! |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
282 mpi->priv=vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26754
diff
changeset
|
283 mpi->type, mpi->flags, |
29437 | 284 FFMAX(vf->priv->exp_w, mpi->width +vf->priv->exp_x), |
285 FFMAX(vf->priv->exp_h, mpi->height+vf->priv->exp_y)); | |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
286 if((vf->dmpi->flags & MP_IMGFLAG_DRAW_CALLBACK) && |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
287 !(vf->dmpi->flags & MP_IMGFLAG_DIRECT)){ |
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
|
288 mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_FullDRNotPossible); |
9495 | 289 return; |
290 } | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
291 // set up mpi as a cropped-down image of dmpi: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
292 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
293 mpi->planes[0]=vf->dmpi->planes[0]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
294 vf->priv->exp_y*vf->dmpi->stride[0]+vf->priv->exp_x; |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
295 mpi->planes[1]=vf->dmpi->planes[1]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
296 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->dmpi->stride[1]+(vf->priv->exp_x>>mpi->chroma_x_shift); |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
297 mpi->planes[2]=vf->dmpi->planes[2]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
298 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->dmpi->stride[2]+(vf->priv->exp_x>>mpi->chroma_x_shift); |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
299 mpi->stride[1]=vf->dmpi->stride[1]; |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
300 mpi->stride[2]=vf->dmpi->stride[2]; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
301 } else { |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
302 mpi->planes[0]=vf->dmpi->planes[0]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
303 vf->priv->exp_y*vf->dmpi->stride[0]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
304 vf->priv->exp_x*(vf->dmpi->bpp/8); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
305 } |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
306 mpi->stride[0]=vf->dmpi->stride[0]; |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
307 mpi->width=vf->dmpi->width; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
308 mpi->flags|=MP_IMGFLAG_DIRECT; |
9495 | 309 mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK; |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
310 // vf->dmpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
311 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
312 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
313 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
314 static void start_slice(struct vf_instance *vf, mp_image_t *mpi){ |
9495 | 315 // printf("start_slice called! flag=%d\n",mpi->flags&MP_IMGFLAG_DRAW_CALLBACK); |
316 if(!vf->next->draw_slice){ | |
317 mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK; | |
318 return; | |
319 } | |
320 // they want slices!!! allocate the buffer. | |
321 if(!mpi->priv) | |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
322 mpi->priv=vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
9495 | 323 // MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26754
diff
changeset
|
324 MP_IMGTYPE_TEMP, mpi->flags, |
29437 | 325 FFMAX(vf->priv->exp_w, mpi->width +vf->priv->exp_x), |
326 FFMAX(vf->priv->exp_h, mpi->height+vf->priv->exp_y)); | |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
327 if(!(vf->dmpi->flags&MP_IMGFLAG_DRAW_CALLBACK)) |
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
|
328 mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupportSlices); // shouldn't happen. |
15252 | 329 vf->priv->first_slice = 1; |
9495 | 330 } |
331 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
332 static void draw_top_blackbar_slice(struct vf_instance *vf, |
15252 | 333 unsigned char** src, int* stride, int w,int h, int x, int y){ |
334 if(vf->priv->exp_y>0 && y == 0) { | |
14074
dc5eaa0795d7
call draw_slice in top-down order (fixes crash with -vf expand=...,scale)
henry
parents:
10311
diff
changeset
|
335 vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, |
dc5eaa0795d7
call draw_slice in top-down order (fixes crash with -vf expand=...,scale)
henry
parents:
10311
diff
changeset
|
336 vf->dmpi->w,vf->priv->exp_y,0,0); |
15252 | 337 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26754
diff
changeset
|
338 |
15252 | 339 } |
340 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
341 static void draw_bottom_blackbar_slice(struct vf_instance *vf, |
15252 | 342 unsigned char** src, int* stride, int w,int h, int x, int y){ |
15099 | 343 if(vf->priv->exp_y+vf->h<vf->dmpi->h && y+h == vf->h) { |
344 unsigned char *src2[MP_MAX_PLANES]; | |
345 src2[0] = vf->dmpi->planes[0] | |
346 + (vf->priv->exp_y+vf->h)*vf->dmpi->stride[0]; | |
347 if(vf->dmpi->flags&MP_IMGFLAG_PLANAR){ | |
348 src2[1] = vf->dmpi->planes[1] | |
349 + ((vf->priv->exp_y+vf->h)>>vf->dmpi->chroma_y_shift)*vf->dmpi->stride[1]; | |
350 src2[2] = vf->dmpi->planes[2] | |
351 + ((vf->priv->exp_y+vf->h)>>vf->dmpi->chroma_y_shift)*vf->dmpi->stride[2]; | |
352 } else { | |
353 src2[1] = vf->dmpi->planes[1]; // passthrough rgb8 palette | |
354 } | |
355 vf_next_draw_slice(vf, src2, vf->dmpi->stride, | |
14074
dc5eaa0795d7
call draw_slice in top-down order (fixes crash with -vf expand=...,scale)
henry
parents:
10311
diff
changeset
|
356 vf->dmpi->w,vf->dmpi->h-(vf->priv->exp_y+vf->h), |
dc5eaa0795d7
call draw_slice in top-down order (fixes crash with -vf expand=...,scale)
henry
parents:
10311
diff
changeset
|
357 0,vf->priv->exp_y+vf->h); |
15099 | 358 } |
9495 | 359 } |
360 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
361 static void draw_slice(struct vf_instance *vf, |
15252 | 362 unsigned char** src, int* stride, int w,int h, int x, int y){ |
363 // printf("draw_slice() called %d at %d\n",h,y); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26754
diff
changeset
|
364 |
15252 | 365 if (y == 0 && y+h == vf->h) { |
366 // special case - only one slice | |
367 draw_top_blackbar_slice(vf, src, stride, w, h, x, y); | |
368 vf_next_draw_slice(vf,src,stride,w,h,x+vf->priv->exp_x,y+vf->priv->exp_y); | |
369 draw_bottom_blackbar_slice(vf, src, stride, w, h, x, y); | |
370 return; | |
371 } | |
372 if (vf->priv->first_slice) { | |
373 draw_top_blackbar_slice(vf, src, stride, w, h, x, y); | |
374 draw_bottom_blackbar_slice(vf, src, stride, w, h, x, y); | |
375 } | |
376 vf_next_draw_slice(vf,src,stride,w,h,x+vf->priv->exp_x,y+vf->priv->exp_y); | |
377 if (!vf->priv->first_slice) { | |
378 draw_top_blackbar_slice(vf, src, stride, w, h, x, y); | |
379 draw_bottom_blackbar_slice(vf, src, stride, w, h, x, y); | |
380 } | |
381 vf->priv->first_slice = 0; | |
382 } | |
383 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
384 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ |
21803
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
385 if (vf->priv->passthrough) { |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
386 mp_image_t *dmpi = vf_get_image(vf->next, IMGFMT_MPEGPES, |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
387 MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h); |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
388 dmpi->planes[0]=mpi->planes[0]; |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
389 return vf_next_put_image(vf,dmpi, pts); |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
390 } |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
391 |
9495 | 392 if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){ |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
393 vf->dmpi=mpi->priv; |
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
|
394 if(!vf->dmpi) { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL); return 0; } |
9495 | 395 mpi->priv=NULL; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
396 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
397 if(vf->priv->osd) draw_osd(vf,mpi->w,mpi->h); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
398 #endif |
7368 | 399 // we've used DR, so we're ready... |
9279 | 400 if(!(mpi->flags&MP_IMGFLAG_PLANAR)) |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
401 vf->dmpi->planes[1] = mpi->planes[1]; // passthrough rgb8 palette |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17102
diff
changeset
|
402 return vf_next_put_image(vf,vf->dmpi, pts); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
403 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
404 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
405 // hope we'll get DR buffer: |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
406 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
407 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
408 vf->priv->exp_w, vf->priv->exp_h); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26754
diff
changeset
|
409 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
410 // copy mpi->dmpi... |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
411 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
412 memcpy_pic(vf->dmpi->planes[0]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
413 vf->priv->exp_y*vf->dmpi->stride[0]+vf->priv->exp_x, |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
414 mpi->planes[0], mpi->w, mpi->h, |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
415 vf->dmpi->stride[0],mpi->stride[0]); |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
416 memcpy_pic(vf->dmpi->planes[1]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
417 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->dmpi->stride[1]+(vf->priv->exp_x>>mpi->chroma_x_shift), |
18321
22be226a5cf5
fixes a bug when copying the image into a destination buffer smaller than the source.
gpoirier
parents:
18004
diff
changeset
|
418 mpi->planes[1], (mpi->w>>mpi->chroma_x_shift), (mpi->h>>mpi->chroma_y_shift), |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
419 vf->dmpi->stride[1],mpi->stride[1]); |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
420 memcpy_pic(vf->dmpi->planes[2]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
421 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->dmpi->stride[2]+(vf->priv->exp_x>>mpi->chroma_x_shift), |
18321
22be226a5cf5
fixes a bug when copying the image into a destination buffer smaller than the source.
gpoirier
parents:
18004
diff
changeset
|
422 mpi->planes[2], (mpi->w>>mpi->chroma_x_shift), (mpi->h>>mpi->chroma_y_shift), |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
423 vf->dmpi->stride[2],mpi->stride[2]); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
424 } else { |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
425 memcpy_pic(vf->dmpi->planes[0]+ |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
426 vf->priv->exp_y*vf->dmpi->stride[0]+vf->priv->exp_x*(vf->dmpi->bpp/8), |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
427 mpi->planes[0], mpi->w*(vf->dmpi->bpp/8), mpi->h, |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
428 vf->dmpi->stride[0],mpi->stride[0]); |
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
9603
diff
changeset
|
429 vf->dmpi->planes[1] = mpi->planes[1]; // passthrough rgb8 palette |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
430 } |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
431 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
432 if(vf->priv->osd) draw_osd(vf,mpi->w,mpi->h); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
433 #endif |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17102
diff
changeset
|
434 return vf_next_put_image(vf,vf->dmpi, pts); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
435 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
436 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
437 //===========================================================================// |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
438 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
439 static int control(struct vf_instance *vf, int request, void* data){ |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
440 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
441 switch(request){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
442 case VFCTRL_DRAW_OSD: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
443 if(vf->priv->osd) return CONTROL_TRUE; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
444 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
445 #endif |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
446 return vf_next_control(vf,request,data); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
447 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
448 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
449 static int query_format(struct vf_instance *vf, unsigned int fmt){ |
26754
63630c09e237
cosmetics: Remove pointless parentheses from return calls.
diego
parents:
25221
diff
changeset
|
450 return vf_next_query_format(vf,fmt); |
21803
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
451 } |
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
452 |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30566
diff
changeset
|
453 static int vf_open(vf_instance_t *vf, char *args){ |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
454 vf->config=config; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
455 vf->control=control; |
21803
3acc4b00bcc6
allows OSD menu to be displayed when using MPEG PES video out
ben
parents:
20561
diff
changeset
|
456 vf->query_format=query_format; |
9495 | 457 vf->start_slice=start_slice; |
458 vf->draw_slice=draw_slice; | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
459 vf->get_image=get_image; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
460 vf->put_image=put_image; |
29638
209b805a26a9
%lf is not a valid printf format specifier, use just %f instead.
reimar
parents:
29624
diff
changeset
|
461 mp_msg(MSGT_VFILTER, MSGL_INFO, "Expand: %d x %d, %d ; %d, osd: %d, aspect: %f, round: %d\n", |
29624
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
462 vf->priv->cfg_exp_w, |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
463 vf->priv->cfg_exp_h, |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
464 vf->priv->cfg_exp_x, |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
465 vf->priv->cfg_exp_y, |
15939 | 466 vf->priv->osd, |
467 vf->priv->aspect, | |
468 vf->priv->round); | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
469 return 1; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
470 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
471 |
9594 | 472 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f) |
30662 | 473 static const m_option_t vf_opts_fields[] = { |
29624
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
474 {"w", ST_OFF(cfg_exp_w), CONF_TYPE_INT, 0, 0 ,0, NULL}, |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
475 {"h", ST_OFF(cfg_exp_h), CONF_TYPE_INT, 0, 0 ,0, NULL}, |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
476 {"x", ST_OFF(cfg_exp_x), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL}, |
b73705bd899f
Always keep a backup of the expand values from the command-line, so values
reimar
parents:
29437
diff
changeset
|
477 {"y", ST_OFF(cfg_exp_y), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL}, |
9594 | 478 {"osd", ST_OFF(osd), CONF_TYPE_FLAG, 0 , 0, 1, NULL}, |
15939 | 479 {"aspect", ST_OFF(aspect), CONF_TYPE_DOUBLE, M_OPT_MIN, 0, 0, NULL}, |
480 {"round", ST_OFF(round), CONF_TYPE_INT, M_OPT_MIN, 1, 0, NULL}, | |
9594 | 481 { NULL, NULL, 0, 0, 0, 0, NULL } |
482 }; | |
483 | |
30662 | 484 static const m_struct_t vf_opts = { |
9594 | 485 "expand", |
486 sizeof(struct vf_priv_s), | |
487 &vf_priv_dflt, | |
488 vf_opts_fields | |
489 }; | |
490 | |
491 | |
492 | |
25221 | 493 const vf_info_t vf_info_expand = { |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
494 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
495 "expanding & osd", |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
496 #else |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
497 "expanding", |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
498 #endif |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
499 "expand", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
500 "A'rpi", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
501 "", |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30566
diff
changeset
|
502 vf_open, |
9594 | 503 &vf_opts |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
504 }; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
505 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
506 //===========================================================================// |