Mercurial > mplayer.hg
annotate libmpcodecs/vf.h @ 21473:6e03eb6af0b7
Move the generation of osdep/mplayer-rc.o back to the top-level Makefile,
having it as a part of osdep/libosdep.a is not enough.
based on a patch by Zuxy Meng, zuxy.meng gmail com
author | diego |
---|---|
date | Mon, 04 Dec 2006 11:59:23 +0000 |
parents | 597505748535 |
children | f60d9ef45902 |
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 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
2 struct vf_instance_s; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
3 struct vf_priv_s; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
4 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
5 typedef struct vf_info_s { |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
6 const char *info; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
7 const char *name; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
8 const char *author; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
9 const char *comment; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
10 int (*open)(struct vf_instance_s* vf,char* args); |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
9490
diff
changeset
|
11 // Ptr to a struct dscribing the options |
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
9490
diff
changeset
|
12 void* opts; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
13 } vf_info_t; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
14 |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
15 typedef struct vf_image_context_s { |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
16 mp_image_t* static_images[2]; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
17 mp_image_t* temp_images[1]; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
18 mp_image_t* export_images[1]; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
19 int static_idx; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
20 } vf_image_context_t; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
21 |
14878 | 22 typedef struct vf_format_context_t { |
23 int have_configured; | |
24 int orig_width, orig_height, orig_fmt; | |
25 } vf_format_context_t; | |
26 | |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
27 typedef struct vf_instance_s { |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
28 vf_info_t* info; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
29 // funcs: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
30 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
|
31 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
|
32 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
|
33 int (*control)(struct vf_instance_s* vf, |
6832
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6780
diff
changeset
|
34 int request, void* data); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
35 int (*query_format)(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
|
36 unsigned int fmt); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
37 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
|
38 mp_image_t *mpi); |
7368 | 39 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:
17566
diff
changeset
|
40 mp_image_t *mpi, double pts); |
9490
48ac3ce565ab
start_slice() added - similar to get_image(), but is called when using slices
arpi
parents:
8367
diff
changeset
|
41 void (*start_slice)(struct vf_instance_s* vf, |
48ac3ce565ab
start_slice() added - similar to get_image(), but is called when using slices
arpi
parents:
8367
diff
changeset
|
42 mp_image_t *mpi); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
43 void (*draw_slice)(struct vf_instance_s* vf, |
7220
e3ecccc7e505
warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents:
6886
diff
changeset
|
44 unsigned char** src, int* stride, int w,int h, int x, int y); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
45 void (*uninit)(struct vf_instance_s* vf); |
18917
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
17906
diff
changeset
|
46 |
21163 | 47 int (*continue_buffered_image)(struct vf_instance_s* vf); |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5562
diff
changeset
|
48 // caps: |
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5562
diff
changeset
|
49 unsigned int default_caps; // used by default query_format() |
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5562
diff
changeset
|
50 unsigned int default_reqs; // used by default config() |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
51 // data: |
14073 | 52 int w, h; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
53 vf_image_context_t imgctx; |
14878 | 54 vf_format_context_t fmt; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
55 struct vf_instance_s* next; |
10140
30cad6ad9dbc
fix segfaults with slices. support slice rendering into a filter even
rfelker
parents:
10052
diff
changeset
|
56 mp_image_t *dmpi; |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
57 struct vf_priv_s* priv; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
58 } vf_instance_t; |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
59 |
5519 | 60 // control codes: |
61 #include "mpc_info.h" | |
62 | |
6832
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6780
diff
changeset
|
63 typedef struct vf_seteq_s |
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6780
diff
changeset
|
64 { |
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6780
diff
changeset
|
65 char *item; |
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6780
diff
changeset
|
66 int value; |
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6780
diff
changeset
|
67 } vf_equalizer_t; |
54578e5a8050
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
arpi
parents:
6780
diff
changeset
|
68 |
5519 | 69 #define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */ |
70 #define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */ | |
71 #define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */ | |
6780 | 72 #define VFCTRL_GET_EQUALIZER 8 /* gset color options (brightness,contrast etc) */ |
5643 | 73 #define VFCTRL_DRAW_OSD 7 |
6886 | 74 #define VFCTRL_CHANGE_RECTANGLE 9 /* Change the rectangle boundaries */ |
10052
b358b7509e1a
sort of a hack, but at least this lets the framerate-increasing
rfelker
parents:
9934
diff
changeset
|
75 #define VFCTRL_FLIP_PAGE 10 /* Tell the vo to flip pages */ |
12335 | 76 #define VFCTRL_DUPLICATE_FRAME 11 /* For encoding - encode zero-change frame */ |
12337
6f1b4c989914
soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
12335
diff
changeset
|
77 #define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */ |
13593
e2dca00374f2
add new control message, that is send after end of stream, to flush all remaining frames in the video system
iive
parents:
12337
diff
changeset
|
78 #define VFCTRL_FLUSH_FRAMES 13 /* For encoding - flush delayed frames */ |
16446 | 79 #define VFCTRL_SCREENSHOT 14 /* Make a screenshot */ |
19521 | 80 #define VFCTRL_INIT_EOSD 15 /* Select EOSD renderer */ |
81 #define VFCTRL_DRAW_EOSD 16 /* Render EOSD */ | |
20906 | 82 #define VFCTRL_GET_PTS 17 /* Return last pts value that reached vf_vo*/ |
20973
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
83 #define VFCTRL_SET_DEINTERLACE 18 /* Set deinterlacing status */ |
c0bcec5150a3
Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents:
20906
diff
changeset
|
84 #define VFCTRL_GET_DEINTERLACE 19 /* Get deinterlacing status */ |
5643 | 85 |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5562
diff
changeset
|
86 #include "vfcap.h" |
5562 | 87 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17566
diff
changeset
|
88 //FIXME this should be in a common header, but i dunno which |
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17566
diff
changeset
|
89 #define MP_NOPTS_VALUE (-1LL<<63) //both int64_t and double should be able to represent this exactly |
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17566
diff
changeset
|
90 |
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17566
diff
changeset
|
91 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
92 // functions: |
5661 | 93 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
94 mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h); |
5550 | 95 |
18980
ed69754aa58d
Marks several string parameters as const when they are not modified in the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents:
18937
diff
changeset
|
96 vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, const char *name, char **args); |
ed69754aa58d
Marks several string parameters as const when they are not modified in the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents:
18937
diff
changeset
|
97 vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char **args); |
14183
c9ff4fe2caaf
add the flip filter at the end of the filter chain.
reimar
parents:
14073
diff
changeset
|
98 vf_instance_t* vf_add_before_vo(vf_instance_t **vf, char *name, char **args); |
18980
ed69754aa58d
Marks several string parameters as const when they are not modified in the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents:
18937
diff
changeset
|
99 vf_instance_t* vf_open_encoder(vf_instance_t* next, const char *name, char *args); |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
100 |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5562
diff
changeset
|
101 unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int preferred); |
9934 | 102 void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src); |
18917
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
17906
diff
changeset
|
103 void vf_queue_frame(vf_instance_t *vf, int (*)(vf_instance_t *)); |
d9a75b26da6c
Add a new video pts tracking mode, enabled by option -correct-pts.
uau
parents:
17906
diff
changeset
|
104 int vf_output_queued_frame(vf_instance_t *vf); |
5565
0b301fec999a
capabilities support -> automatic insertion of scale, expand, pp
arpi
parents:
5562
diff
changeset
|
105 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
106 // default wrappers: |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
107 int vf_next_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
|
108 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
|
109 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
|
110 int vf_next_control(struct vf_instance_s* vf, int request, void* data); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
111 int vf_next_query_format(struct vf_instance_s* vf, unsigned int fmt); |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17566
diff
changeset
|
112 int vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi, double pts); |
8367 | 113 void vf_next_draw_slice (struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y); |
5550 | 114 |
5507
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
115 vf_instance_t* append_filters(vf_instance_t* last); |
d0d029fda134
video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff
changeset
|
116 |
5737 | 117 void vf_uninit_filter(vf_instance_t* vf); |
118 void vf_uninit_filter_chain(vf_instance_t* vf); | |
119 | |
14878 | 120 int vf_config_wrapper(struct vf_instance_s* vf, |
121 int width, int height, int d_width, int d_height, | |
122 unsigned int flags, unsigned int outfmt); |