Mercurial > mplayer.hg
annotate libmpcodecs/vf_expand.c @ 5834:ece3a19677b9
Fix keypad volume control.
author | atmos4 |
---|---|
date | Thu, 25 Apr 2002 20:59:12 +0000 |
parents | f19dff1456ed |
children | 4c3956729446 |
rev | line source |
---|---|
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
1 #define OSD_SUPPORT |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
2 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
3 #include <stdio.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
4 #include <stdlib.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
5 #include <string.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
6 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
7 #include "../config.h" |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
8 #include "../mp_msg.h" |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
9 |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
10 #include "img_format.h" |
5607 | 11 #include "mp_image.h" |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
12 #include "vf.h" |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
13 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
14 #include "../libvo/fastmemcpy.h" |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
15 |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
16 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
17 #include "../libvo/sub.h" |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
18 #include "../libvo/osd.h" |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
19 #endif |
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 struct vf_priv_s { |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
22 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
|
23 int exp_x,exp_y; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
24 mp_image_t *dmpi; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
25 int osd; |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
26 unsigned char* fb_ptr; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
27 }; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
28 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
29 //===========================================================================// |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
30 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
31 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
32 static struct vf_instance_s* vf=NULL; // fixme (needs sub.c changes) |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
33 static int orig_w,orig_h; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
34 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
35 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
|
36 // 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
|
37 //printf("OSD clear: %d;%d %dx%d \n",x0,y0,w,h); |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
38 vf_mpi_clear(vf->priv->dmpi,x0,y0,w,h); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
39 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
40 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
41 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
|
42 if(!vo_osd_changed_flag) return; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
43 // split it to 4 parts: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
44 if(y0<vf->priv->exp_y){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
45 // it has parts above the image: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
46 int y=y0+h; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
47 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
|
48 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
|
49 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
|
50 h-=y-y0;y0=y; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
51 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
52 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
|
53 // it has parts under the image: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
54 int y=y0; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
55 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
|
56 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
|
57 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
|
58 h=y-y0; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
59 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
60 if(x0>=vf->priv->exp_x || x0+w<=vf->priv->exp_x+orig_w) return; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
61 // TODO clear left and right side of the image if needed |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
62 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
63 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
64 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
|
65 unsigned char* dst; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
66 if(!vo_osd_changed_flag && vf->priv->dmpi->planes[0]==vf->priv->fb_ptr){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
67 // 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
|
68 // untouched! |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
69 if(x0<vf->priv->exp_x){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
70 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
|
71 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
|
72 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
73 if(y0<vf->priv->exp_y){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
74 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
|
75 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
|
76 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
77 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
|
78 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
|
79 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
80 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
|
81 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
|
82 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
83 } |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
84 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
|
85 // printf("OSD redraw: %d;%d %dx%d \n",x0,y0,w,h); |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
86 dst=vf->priv->dmpi->planes[0]+ |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
87 vf->priv->dmpi->stride[0]*y0+ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
88 (vf->priv->dmpi->bpp>>3)*x0; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
89 switch(vf->priv->dmpi->imgfmt){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
90 case IMGFMT_BGR15: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
91 case IMGFMT_RGB15: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
92 vo_draw_alpha_rgb15(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
93 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
94 case IMGFMT_BGR16: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
95 case IMGFMT_RGB16: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
96 vo_draw_alpha_rgb16(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
97 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
98 case IMGFMT_BGR24: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
99 case IMGFMT_RGB24: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
100 vo_draw_alpha_rgb24(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
101 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
102 case IMGFMT_BGR32: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
103 case IMGFMT_RGB32: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
104 vo_draw_alpha_rgb32(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
105 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
106 case IMGFMT_YV12: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
107 case IMGFMT_I420: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
108 case IMGFMT_IYUV: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
109 vo_draw_alpha_yv12(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
110 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
111 case IMGFMT_YUY2: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
112 vo_draw_alpha_yuy2(w,h,src,srca,stride,dst,vf->priv->dmpi->stride[0]); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
113 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
114 case IMGFMT_UYVY: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
115 vo_draw_alpha_yuy2(w,h,src,srca,stride,dst+1,vf->priv->dmpi->stride[0]); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
116 break; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
117 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
118 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
119 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
120 static void draw_osd(struct vf_instance_s* vf_,int w,int h){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
121 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
|
122 // printf("======================================\n"); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
123 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
|
124 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
|
125 // yep, we're expanding image, not just copy. |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
126 if(vf->priv->dmpi->planes[0]!=vf->priv->fb_ptr){ |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
127 // double buffering, so we need full clear :( |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
128 remove_func(0,0,vf->priv->exp_w,vf->priv->exp_h); |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
129 } else { |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
130 // partial clear: |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
131 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
|
132 } |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
133 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
134 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
|
135 // 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
|
136 // ugly method, but note that codecs with DR support does the same... |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5644
diff
changeset
|
137 vf->priv->fb_ptr=vf->priv->dmpi->planes[0]; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
138 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
139 |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
140 #endif |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
141 //===========================================================================// |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
142 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
143 static int config(struct vf_instance_s* vf, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
144 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
|
145 unsigned int flags, unsigned int outfmt){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
146 int ret; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
147 // calculate the missing parameters: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
148 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
|
149 if(vf->priv->exp_h<height) vf->priv->exp_h=height; |
5687 | 150 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; |
151 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
|
152 vf->priv->fb_ptr=NULL; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
153 ret=vf_next_config(vf,vf->priv->exp_w,vf->priv->exp_h,d_width,d_height,flags,outfmt); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
154 return ret; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
155 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
156 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
157 // there are 4 cases: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
158 // 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
|
159 // 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
|
160 // 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
|
161 // 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
|
162 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
163 static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
5671 | 164 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
|
165 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
166 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
|
167 // check if we have to render osd! |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
168 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
|
169 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
|
170 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
|
171 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
172 #endif |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
173 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
|
174 (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
|
175 // try full DR ! |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
176 vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
177 mpi->type, mpi->flags, vf->priv->exp_w, vf->priv->exp_h); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
178 // 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
|
179 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
180 mpi->planes[0]=vf->priv->dmpi->planes[0]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
181 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
182 mpi->planes[1]=vf->priv->dmpi->planes[1]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
183 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>1); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
184 mpi->planes[2]=vf->priv->dmpi->planes[2]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
185 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>1); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
186 mpi->stride[1]=vf->priv->dmpi->stride[1]; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
187 mpi->stride[2]=vf->priv->dmpi->stride[2]; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
188 } else { |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
189 mpi->planes[0]=vf->priv->dmpi->planes[0]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
190 vf->priv->exp_y*vf->priv->dmpi->stride[0]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
191 vf->priv->exp_x*(vf->priv->dmpi->bpp/8); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
192 } |
5530 | 193 mpi->stride[0]=vf->priv->dmpi->stride[0]; |
194 mpi->width=vf->priv->dmpi->width; | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
195 mpi->flags|=MP_IMGFLAG_DIRECT; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
196 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
197 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
198 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
199 static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
200 if(mpi->flags&MP_IMGFLAG_DIRECT){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
201 vf_next_put_image(vf,vf->priv->dmpi); |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
202 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
203 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
|
204 #endif |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
205 return; // we've used DR, so we're ready... |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
206 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
207 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
208 // hope we'll get DR buffer: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
209 vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
210 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
|
211 vf->priv->exp_w, vf->priv->exp_h); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
212 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
213 // copy mpi->dmpi... |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
214 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
215 memcpy_pic(vf->priv->dmpi->planes[0]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
216 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
217 mpi->planes[0], mpi->w, mpi->h, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
218 vf->priv->dmpi->stride[0],mpi->stride[0]); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
219 memcpy_pic(vf->priv->dmpi->planes[1]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
220 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>1), |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
221 mpi->planes[1], mpi->w>>1, mpi->h>>1, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
222 vf->priv->dmpi->stride[1],mpi->stride[1]); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
223 memcpy_pic(vf->priv->dmpi->planes[2]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
224 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>1), |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
225 mpi->planes[2], mpi->w>>1, mpi->h>>1, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
226 vf->priv->dmpi->stride[2],mpi->stride[2]); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
227 } else { |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
228 memcpy_pic(vf->priv->dmpi->planes[0]+ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
229 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x*(vf->priv->dmpi->bpp/8), |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
230 mpi->planes[0], mpi->w*(vf->priv->dmpi->bpp/8), mpi->h, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
231 vf->priv->dmpi->stride[0],mpi->stride[0]); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
232 } |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
233 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
234 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
|
235 #endif |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
236 vf_next_put_image(vf,vf->priv->dmpi); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
237 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
238 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
239 //===========================================================================// |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
240 |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
241 static int control(struct vf_instance_s* vf, int request, void* data){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
242 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
243 switch(request){ |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
244 case VFCTRL_DRAW_OSD: |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
245 if(vf->priv->osd) return CONTROL_TRUE; |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
246 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
247 #endif |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
248 return vf_next_control(vf,request,data); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
249 } |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
250 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
251 static int open(vf_instance_t *vf, char* args){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
252 vf->config=config; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
253 vf->control=control; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
254 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
|
255 vf->put_image=put_image; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
256 vf->priv=malloc(sizeof(struct vf_priv_s)); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
257 // TODO: parse args -> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
258 vf->priv->exp_x= |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
259 vf->priv->exp_y= |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
260 vf->priv->exp_w= |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
261 vf->priv->exp_h=-1; |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
262 if(args) sscanf(args, "%d:%d:%d:%d:%d", |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
263 &vf->priv->exp_w, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
264 &vf->priv->exp_h, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
265 &vf->priv->exp_x, |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
266 &vf->priv->exp_y, |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
267 &vf->priv->osd); |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
268 printf("Expand: %d x %d, %d ; %d (-1=autodetect) osd: %d\n", |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
269 vf->priv->exp_w, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
270 vf->priv->exp_h, |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
271 vf->priv->exp_x, |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
272 vf->priv->exp_y, |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
273 vf->priv->osd); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
274 return 1; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
275 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
276 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
277 vf_info_t vf_info_expand = { |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
278 #ifdef OSD_SUPPORT |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
279 "expanding & osd", |
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
280 #else |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
281 "expanding", |
5644
f1465a280612
(buggy) osd support, disabled for now, mencoder needs fixes to compile
arpi
parents:
5607
diff
changeset
|
282 #endif |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
283 "expand", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
284 "A'rpi", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
285 "", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
286 open |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
287 }; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
288 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
289 //===========================================================================// |