annotate libmpcodecs/vf.h @ 29075:b188e15262b2

Add missing $(EXESUF) to example/test program dependency declaration.
author diego
date Tue, 31 Mar 2009 16:52:24 +0000
parents 134689b7b548
children 0f1b5b68af32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25553
diff changeset
1 #ifndef MPLAYER_VF_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25553
diff changeset
2 #define MPLAYER_VF_H
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
3
26147
41652035483c Add necessary header #includes to fix 'make checkheaders'.
diego
parents: 26029
diff changeset
4 #include "mp_image.h"
41652035483c Add necessary header #includes to fix 'make checkheaders'.
diego
parents: 26029
diff changeset
5
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
6 struct vf_instance_s;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
7 struct vf_priv_s;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
8
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
9 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
10 const char *info;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
11 const char *name;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
12 const char *author;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
13 const char *comment;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
14 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
15 // Ptr to a struct dscribing the options
24968
f60d9ef45902 stage 1 of applying const to vf structs
rfelker
parents: 21430
diff changeset
16 const void* opts;
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
17 } vf_info_t;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
18
28515
134689b7b548 Add MP_IMGTYPE_NUMBERED which gives access to the kind of mp_image_t that
reimar
parents: 28174
diff changeset
19 #define NUM_NUMBERED_MPI 50
134689b7b548 Add MP_IMGTYPE_NUMBERED which gives access to the kind of mp_image_t that
reimar
parents: 28174
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 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
22 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
23 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
24 mp_image_t* export_images[1];
28515
134689b7b548 Add MP_IMGTYPE_NUMBERED which gives access to the kind of mp_image_t that
reimar
parents: 28174
diff changeset
25 mp_image_t* numbered_images[NUM_NUMBERED_MPI];
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
26 int static_idx;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
27 } vf_image_context_t;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
28
14878
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
29 typedef struct vf_format_context_t {
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
30 int have_configured;
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
31 int orig_width, orig_height, orig_fmt;
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
32 } vf_format_context_t;
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
33
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
34 typedef struct vf_instance_s {
24968
f60d9ef45902 stage 1 of applying const to vf structs
rfelker
parents: 21430
diff changeset
35 const vf_info_t* info;
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
36 // funcs:
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
37 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);
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
40 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
41 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
42 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
43 unsigned int fmt);
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
44 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
45 mp_image_t *mpi);
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7220
diff changeset
46 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
47 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
48 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
49 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
50 void (*draw_slice)(struct vf_instance_s* vf,
7220
e3ecccc7e505 warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 6886
diff changeset
51 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
52 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
53
21163
13d6af2767b6 Fix incorrect function pointer definition.
uau
parents: 20973
diff changeset
54 int (*continue_buffered_image)(struct vf_instance_s* vf);
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5562
diff changeset
55 // caps:
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5562
diff changeset
56 unsigned int default_caps; // used by default query_format()
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5562
diff changeset
57 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
58 // data:
14073
9e81af56f554 fix image dimensions at filter config time
henry
parents: 13593
diff changeset
59 int w, h;
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
60 vf_image_context_t imgctx;
14878
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
61 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
62 struct vf_instance_s* next;
10140
30cad6ad9dbc fix segfaults with slices. support slice rendering into a filter even
rfelker
parents: 10052
diff changeset
63 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
64 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
65 } vf_instance_t;
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
66
5519
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5508
diff changeset
67 // control codes:
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5508
diff changeset
68 #include "mpc_info.h"
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5508
diff changeset
69
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
70 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
71 {
25223
578feac808bd vf_equalizer_t string is constant
reimar
parents: 24968
diff changeset
72 const char *item;
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
73 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
74 } 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
75
5519
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5508
diff changeset
76 #define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5508
diff changeset
77 #define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5508
diff changeset
78 #define VFCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */
6780
5bf3ed8a17c4 equalizer reworked
alex
parents: 6081
diff changeset
79 #define VFCTRL_GET_EQUALIZER 8 /* gset color options (brightness,contrast etc) */
5643
3d9de27d9bd0 OSD handled by vf control()
arpi
parents: 5565
diff changeset
80 #define VFCTRL_DRAW_OSD 7
6886
0cc9640c2e90 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6832
diff changeset
81 #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
82 #define VFCTRL_FLIP_PAGE 10 /* Tell the vo to flip pages */
12335
189cd9abb0a1 forgot this, needed for vf_harddup
rfelker
parents: 10140
diff changeset
83 #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
84 #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
85 #define VFCTRL_FLUSH_FRAMES 13 /* For encoding - flush delayed frames */
16446
c82c0d407ec9 screenshot filter
henry
parents: 14878
diff changeset
86 #define VFCTRL_SCREENSHOT 14 /* Make a screenshot */
19521
0be2d3583f4f Add VFCTRL_DRAW_EOSD.
eugeni
parents: 18980
diff changeset
87 #define VFCTRL_INIT_EOSD 15 /* Select EOSD renderer */
0be2d3583f4f Add VFCTRL_DRAW_EOSD.
eugeni
parents: 18980
diff changeset
88 #define VFCTRL_DRAW_EOSD 16 /* Render EOSD */
20906
160974ca8bf2 Use vf control for reading pts from vf_vo
uau
parents: 19521
diff changeset
89 #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
90 #define VFCTRL_SET_DEINTERLACE 18 /* Set deinterlacing status */
c0bcec5150a3 Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents: 20906
diff changeset
91 #define VFCTRL_GET_DEINTERLACE 19 /* Get deinterlacing status */
5643
3d9de27d9bd0 OSD handled by vf control()
arpi
parents: 5565
diff changeset
92
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5562
diff changeset
93 #include "vfcap.h"
5562
e7619ffa7303 VFCAP flags added
arpi
parents: 5550
diff changeset
94
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17566
diff changeset
95 //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
96 #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
97
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17566
diff changeset
98
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
99 // functions:
5661
42e002c565cf mpi clear func
arpi
parents: 5643
diff changeset
100 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
101 mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h);
5550
7d1dfb59c6c0 encoders
arpi
parents: 5519
diff changeset
102
24968
f60d9ef45902 stage 1 of applying const to vf structs
rfelker
parents: 21430
diff changeset
103 vf_instance_t* vf_open_plugin(const vf_info_t* const* filter_list, vf_instance_t* next, const 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
104 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
105 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
106 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
107
24968
f60d9ef45902 stage 1 of applying const to vf structs
rfelker
parents: 21430
diff changeset
108 unsigned int vf_match_csp(vf_instance_t** vfp,const unsigned int* list,unsigned int preferred);
9934
89da8ec89558 vf_clone_mpi_attributes()
michael
parents: 9593
diff changeset
109 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
110 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
111 int vf_output_queued_frame(vf_instance_t *vf);
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5562
diff changeset
112
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
113 // default wrappers:
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
114 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
115 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
116 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
117 int vf_next_control(struct vf_instance_s* vf, int request, void* data);
28174
245a232deb93 Avoid flickering OSD with -vf yadif=1
reimar
parents: 26147
diff changeset
118 void vf_extra_flip(struct vf_instance_s* vf);
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
119 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
120 int vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi, double pts);
8367
14af7d96df34 Fix draw_slice() in passthrough mode.
arpi
parents: 7368
diff changeset
121 void vf_next_draw_slice (struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y);
5550
7d1dfb59c6c0 encoders
arpi
parents: 5519
diff changeset
122
5507
d0d029fda134 video filter layer - written from scratch, but inspired a lot by Fredrik Kuivinen's patch
arpi
parents:
diff changeset
123 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
124
5737
de47aebf654c filters uninit
arpi
parents: 5661
diff changeset
125 void vf_uninit_filter(vf_instance_t* vf);
de47aebf654c filters uninit
arpi
parents: 5661
diff changeset
126 void vf_uninit_filter_chain(vf_instance_t* vf);
de47aebf654c filters uninit
arpi
parents: 5661
diff changeset
127
14878
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
128 int vf_config_wrapper(struct vf_instance_s* vf,
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
129 int width, int height, int d_width, int d_height,
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14183
diff changeset
130 unsigned int flags, unsigned int outfmt);
25553
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 25223
diff changeset
131
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25553
diff changeset
132 #endif /* MPLAYER_VF_H */