Mercurial > mplayer.hg
annotate libmpcodecs/vf_vo.c @ 29621:e3d04e77e1f3
Make all mp_*_taglists const.
author | reimar |
---|---|
date | Tue, 08 Sep 2009 21:42:51 +0000 |
parents | 00c0123b6df3 |
children | 3a3370c00ba6 |
rev | line source |
---|---|
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
1 #include <stdio.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
2 #include <stdlib.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
3 #include <string.h> |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
4 |
17012 | 5 #include "config.h" |
6 #include "mp_msg.h" | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
7 |
5607 | 8 #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
|
9 #include "vf.h" |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
10 |
17012 | 11 #include "libvo/video_out.h" |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
12 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
13 #ifdef CONFIG_ASS |
19576 | 14 #include "libass/ass.h" |
15 #include "libass/ass_mp.h" | |
16 extern ass_track_t* ass_track; | |
17 #endif | |
18 | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
19 //===========================================================================// |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
20 |
19576 | 21 extern int sub_visibility; |
20197 | 22 extern float sub_delay; |
19576 | 23 |
20906 | 24 struct vf_priv_s { |
19576 | 25 double pts; |
25219
e82ecde2cbd4
Mark several uses of vo_functions_t as const to stop some of the current
reimar
parents:
23134
diff
changeset
|
26 const vo_functions_t *vo; |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
27 #ifdef CONFIG_ASS |
20477 | 28 ass_renderer_t* ass_priv; |
21506
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
29 int prev_visibility; |
19576 | 30 #endif |
31 }; | |
20906 | 32 #define video_out (vf->priv->vo) |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
33 |
7731 | 34 static int query_format(struct vf_instance_s* vf, unsigned int fmt); /* forward declaration */ |
28611
00c0123b6df3
Add VOCAP_NOSLICES and use it to allow vo_vdpau to not support slices for
reimar
parents:
28546
diff
changeset
|
35 static void draw_slice(struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y); |
7731 | 36 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
37 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
|
38 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
|
39 unsigned int flags, unsigned int outfmt){ |
5559 | 40 |
6197 | 41 if ((width <= 0) || (height <= 0) || (d_width <= 0) || (d_height <= 0)) |
42 { | |
43 mp_msg(MSGT_CPLAYER, MSGL_ERR, "VO: invalid dimensions!\n"); | |
44 return 0; | |
45 } | |
46 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7731
diff
changeset
|
47 if(video_out->info) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7731
diff
changeset
|
48 { const vo_info_t *info = video_out->info; |
5559 | 49 mp_msg(MSGT_CPLAYER,MSGL_INFO,"VO: [%s] %dx%d => %dx%d %s %s%s%s%s\n",info->short_name, |
50 width, height, | |
51 d_width, d_height, | |
52 vo_format_name(outfmt), | |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
10052
diff
changeset
|
53 (flags&VOFLAG_FULLSCREEN)?" [fs]":"", |
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
10052
diff
changeset
|
54 (flags&VOFLAG_MODESWITCHING)?" [vm]":"", |
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
10052
diff
changeset
|
55 (flags&VOFLAG_SWSCALE)?" [zoom]":"", |
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
10052
diff
changeset
|
56 (flags&VOFLAG_FLIPPING)?" [flip]":""); |
5559 | 57 mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Description: %s\n",info->name); |
58 mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Author: %s\n", info->author); | |
59 if(info->comment && strlen(info->comment) > 0) | |
60 mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Comment: %s\n", info->comment); | |
61 } | |
62 | |
7687 | 63 // save vo's stride capability for the wanted colorspace: |
23134
1de2a46a0987
Add -ass-hinting option for setting font hinting method.
eugeni
parents:
22232
diff
changeset
|
64 vf->default_caps=query_format(vf,outfmt); |
28611
00c0123b6df3
Add VOCAP_NOSLICES and use it to allow vo_vdpau to not support slices for
reimar
parents:
28546
diff
changeset
|
65 vf->draw_slice = (vf->default_caps & VOCAP_NOSLICES) ? NULL : draw_slice; |
7687 | 66 |
22232 | 67 if(config_video_out(video_out,width,height,d_width,d_height,flags,"MPlayer",outfmt)) |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
68 return 0; |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7731
diff
changeset
|
69 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
70 #ifdef CONFIG_ASS |
20446
e8adc3778348
Split ass_configure() into several smaller functions.
eugeni
parents:
20197
diff
changeset
|
71 if (vf->priv->ass_priv) |
23134
1de2a46a0987
Add -ass-hinting option for setting font hinting method.
eugeni
parents:
22232
diff
changeset
|
72 ass_configure(vf->priv->ass_priv, width, height, !!(vf->default_caps & VFCAP_EOSD_UNSCALED)); |
19576 | 73 #endif |
74 | |
5511 | 75 ++vo_config_count; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
76 return 1; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
77 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
78 |
6832
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6786
diff
changeset
|
79 static int control(struct vf_instance_s* vf, int request, void* data) |
6780 | 80 { |
5643 | 81 switch(request){ |
20973
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
82 case VFCTRL_GET_DEINTERLACE: |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
83 { |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
84 if(!video_out) return CONTROL_FALSE; // vo not configured? |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
85 return(video_out->control(VOCTRL_GET_DEINTERLACE, data) |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
86 == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE; |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
87 } |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
88 case VFCTRL_SET_DEINTERLACE: |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
89 { |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
90 if(!video_out) return CONTROL_FALSE; // vo not configured? |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
91 return(video_out->control(VOCTRL_SET_DEINTERLACE, data) |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
92 == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE; |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
93 } |
5643 | 94 case VFCTRL_DRAW_OSD: |
6157 | 95 if(!vo_config_count) return CONTROL_FALSE; // vo not configured? |
5643 | 96 video_out->draw_osd(); |
97 return CONTROL_TRUE; | |
10052
b358b7509e1a
sort of a hack, but at least this lets the framerate-increasing
rfelker
parents:
9593
diff
changeset
|
98 case VFCTRL_FLIP_PAGE: |
b358b7509e1a
sort of a hack, but at least this lets the framerate-increasing
rfelker
parents:
9593
diff
changeset
|
99 { |
b358b7509e1a
sort of a hack, but at least this lets the framerate-increasing
rfelker
parents:
9593
diff
changeset
|
100 if(!vo_config_count) return CONTROL_FALSE; // vo not configured? |
b358b7509e1a
sort of a hack, but at least this lets the framerate-increasing
rfelker
parents:
9593
diff
changeset
|
101 video_out->flip_page(); |
b358b7509e1a
sort of a hack, but at least this lets the framerate-increasing
rfelker
parents:
9593
diff
changeset
|
102 return CONTROL_TRUE; |
b358b7509e1a
sort of a hack, but at least this lets the framerate-increasing
rfelker
parents:
9593
diff
changeset
|
103 } |
6780 | 104 case VFCTRL_SET_EQUALIZER: |
105 { | |
6832
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6786
diff
changeset
|
106 vf_equalizer_t *eq=data; |
6780 | 107 if(!vo_config_count) return CONTROL_FALSE; // vo not configured? |
26754
63630c09e237
cosmetics: Remove pointless parentheses from return calls.
diego
parents:
25813
diff
changeset
|
108 return (video_out->control(VOCTRL_SET_EQUALIZER, eq->item, eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE; |
6780 | 109 } |
110 case VFCTRL_GET_EQUALIZER: | |
111 { | |
6832
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6786
diff
changeset
|
112 vf_equalizer_t *eq=data; |
6780 | 113 if(!vo_config_count) return CONTROL_FALSE; // vo not configured? |
26754
63630c09e237
cosmetics: Remove pointless parentheses from return calls.
diego
parents:
25813
diff
changeset
|
114 return (video_out->control(VOCTRL_GET_EQUALIZER, eq->item, &eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE; |
6780 | 115 } |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
116 #ifdef CONFIG_ASS |
19576 | 117 case VFCTRL_INIT_EOSD: |
118 { | |
20477 | 119 vf->priv->ass_priv = ass_renderer_init((ass_library_t*)data); |
20446
e8adc3778348
Split ass_configure() into several smaller functions.
eugeni
parents:
20197
diff
changeset
|
120 if (!vf->priv->ass_priv) return CONTROL_FALSE; |
20706
6ae01628975f
Initialize fontconfig in VFCTRL_INIT_EOSD handler.
eugeni
parents:
20477
diff
changeset
|
121 ass_configure_fonts(vf->priv->ass_priv); |
21506
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
122 vf->priv->prev_visibility = 0; |
20446
e8adc3778348
Split ass_configure() into several smaller functions.
eugeni
parents:
20197
diff
changeset
|
123 return CONTROL_TRUE; |
19576 | 124 } |
125 case VFCTRL_DRAW_EOSD: | |
126 { | |
21506
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
127 mp_eosd_images_t images = {NULL, 2}; |
20906 | 128 double pts = vf->priv->pts; |
19576 | 129 if (!vo_config_count || !vf->priv->ass_priv) return CONTROL_FALSE; |
130 if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE)) { | |
131 mp_eosd_res_t res; | |
132 memset(&res, 0, sizeof(res)); | |
133 if (video_out->control(VOCTRL_GET_EOSD_RES, &res) == VO_TRUE) { | |
20446
e8adc3778348
Split ass_configure() into several smaller functions.
eugeni
parents:
20197
diff
changeset
|
134 ass_set_frame_size(vf->priv->ass_priv, res.w, res.h); |
e8adc3778348
Split ass_configure() into several smaller functions.
eugeni
parents:
20197
diff
changeset
|
135 ass_set_margins(vf->priv->ass_priv, res.mt, res.mb, res.ml, res.mr); |
21427 | 136 ass_set_aspect_ratio(vf->priv->ass_priv, (double)res.w / res.h); |
19576 | 137 } |
138 | |
25813 | 139 images.imgs = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, &images.changed); |
21506
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
140 if (!vf->priv->prev_visibility) |
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
141 images.changed = 2; |
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
142 vf->priv->prev_visibility = 1; |
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
143 } else |
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
144 vf->priv->prev_visibility = 0; |
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
145 vf->priv->prev_visibility = sub_visibility; |
8174acbf0633
Speed up ASS subtitles display by detecting changes between two consecutive
eugeni
parents:
21427
diff
changeset
|
146 return (video_out->control(VOCTRL_DRAW_EOSD, &images) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE; |
19576 | 147 } |
148 #endif | |
20906 | 149 case VFCTRL_GET_PTS: |
150 { | |
151 *(double *)data = vf->priv->pts; | |
152 return CONTROL_TRUE; | |
153 } | |
5643 | 154 } |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
155 // return video_out->control(request,data); |
5519 | 156 return CONTROL_UNKNOWN; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
157 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
158 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
159 static int query_format(struct vf_instance_s* vf, unsigned int fmt){ |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5559
diff
changeset
|
160 int flags=video_out->control(VOCTRL_QUERY_FORMAT,&fmt); |
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5559
diff
changeset
|
161 // draw_slice() accepts stride, draw_frame() doesn't: |
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5559
diff
changeset
|
162 if(flags) |
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5559
diff
changeset
|
163 if(fmt==IMGFMT_YV12 || fmt==IMGFMT_I420 || fmt==IMGFMT_IYUV) |
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5559
diff
changeset
|
164 flags|=VFCAP_ACCEPT_STRIDE; |
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5559
diff
changeset
|
165 return flags; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
166 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
167 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
168 static void get_image(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
|
169 mp_image_t *mpi){ |
28546
e887c2dd6c62
Move direct-rendering hack from vo_xvmc to vf_vo, so it does not need to
reimar
parents:
27341
diff
changeset
|
170 if(!vo_config_count) return; |
e887c2dd6c62
Move direct-rendering hack from vo_xvmc to vf_vo, so it does not need to
reimar
parents:
27341
diff
changeset
|
171 // GET_IMAGE is required for hardware-accelerated formats |
e887c2dd6c62
Move direct-rendering hack from vo_xvmc to vf_vo, so it does not need to
reimar
parents:
27341
diff
changeset
|
172 if(vo_directrendering || |
e887c2dd6c62
Move direct-rendering hack from vo_xvmc to vf_vo, so it does not need to
reimar
parents:
27341
diff
changeset
|
173 IMGFMT_IS_XVMC(mpi->imgfmt) || IMGFMT_IS_VDPAU(mpi->imgfmt)) |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
174 video_out->control(VOCTRL_GET_IMAGE,mpi); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
175 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
176 |
7368 | 177 static int put_image(struct vf_instance_s* vf, |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
178 mp_image_t *mpi, double pts){ |
7368 | 179 if(!vo_config_count) return 0; // vo not configured? |
18917
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
17906
diff
changeset
|
180 // record pts (potentially modified by filters) for main loop |
20906 | 181 vf->priv->pts = pts; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
182 // first check, maybe the vo/vf plugin implements draw_image using mpi: |
7368 | 183 if(video_out->control(VOCTRL_DRAW_IMAGE,mpi)==VO_TRUE) return 1; // done. |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
184 // nope, fallback to old draw_frame/draw_slice: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
185 if(!(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK))){ |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
186 // blit frame: |
7687 | 187 // if(mpi->flags&MP_IMGFLAG_PLANAR) |
188 if(vf->default_caps&VFCAP_ACCEPT_STRIDE) | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
189 video_out->draw_slice(mpi->planes,mpi->stride,mpi->w,mpi->h,mpi->x,mpi->y); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
190 else |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
191 video_out->draw_frame(mpi->planes); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
192 } |
7368 | 193 return 1; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
194 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
195 |
9560
ae2ce6ebc1fa
Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents:
8148
diff
changeset
|
196 static void start_slice(struct vf_instance_s* vf, |
ae2ce6ebc1fa
Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents:
8148
diff
changeset
|
197 mp_image_t *mpi) { |
ae2ce6ebc1fa
Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents:
8148
diff
changeset
|
198 if(!vo_config_count) return; // vo not configured? |
ae2ce6ebc1fa
Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents:
8148
diff
changeset
|
199 video_out->control(VOCTRL_START_SLICE,mpi); |
ae2ce6ebc1fa
Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents:
8148
diff
changeset
|
200 } |
ae2ce6ebc1fa
Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents:
8148
diff
changeset
|
201 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
202 static void draw_slice(struct vf_instance_s* vf, |
7220
e3ecccc7e505
warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents:
7125
diff
changeset
|
203 unsigned char** src, int* stride, int w,int h, int x, int y){ |
5511 | 204 if(!vo_config_count) return; // vo not configured? |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
205 video_out->draw_slice(src,stride,w,h,x,y); |
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 |
19576 | 208 static void uninit(struct vf_instance_s* vf) |
209 { | |
210 if (vf->priv) { | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
211 #ifdef CONFIG_ASS |
19576 | 212 if (vf->priv->ass_priv) |
20477 | 213 ass_renderer_done(vf->priv->ass_priv); |
19582 | 214 #endif |
19576 | 215 free(vf->priv); |
216 } | |
217 } | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
218 //===========================================================================// |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
219 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
220 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
|
221 vf->config=config; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
222 vf->control=control; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
223 vf->query_format=query_format; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
224 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
|
225 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
|
226 vf->draw_slice=draw_slice; |
9560
ae2ce6ebc1fa
Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents:
8148
diff
changeset
|
227 vf->start_slice=start_slice; |
19576 | 228 vf->uninit=uninit; |
229 vf->priv=calloc(1, sizeof(struct vf_priv_s)); | |
25219
e82ecde2cbd4
Mark several uses of vo_functions_t as const to stop some of the current
reimar
parents:
23134
diff
changeset
|
230 vf->priv->vo = (const vo_functions_t *)args; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
231 if(!video_out) return 0; // no vo ? |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
232 // if(video_out->preinit(args)) return 0; // preinit failed |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
233 return 1; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
234 } |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
235 |
25221 | 236 const vf_info_t vf_info_vo = { |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
237 "libvo wrapper", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
238 "vo", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
239 "A'rpi", |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
240 "for internal use", |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
9560
diff
changeset
|
241 open, |
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
9560
diff
changeset
|
242 NULL |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
243 }; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
244 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
245 //===========================================================================// |