kernel32/tests: Add a test to check some fields in fake dlls.
[wine.git] / dlls / winegstreamer / gst_cbs.h
blob100a8dece449a8ee0d234b0e15ddf2740673b6d7
1 /*
2 * Copyright 2015 Andrew Eikum for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef GST_CBS_H
20 #define GST_CBS_H
22 #include "wine/list.h"
23 #include "windef.h"
24 #include <pthread.h>
26 typedef enum {
27 GST_AUTOPLUG_SELECT_TRY,
28 GST_AUTOPLUG_SELECT_EXPOSE,
29 GST_AUTOPLUG_SELECT_SKIP
30 } GstAutoplugSelectResult;
32 enum CB_TYPE {
33 WATCH_BUS,
34 EXISTING_NEW_PAD,
35 QUERY_FUNCTION,
36 ACTIVATE_MODE,
37 NO_MORE_PADS,
38 REQUEST_BUFFER_SRC,
39 EVENT_SRC,
40 EVENT_SINK,
41 GOT_DATA_SINK,
42 GOT_DATA,
43 REMOVED_DECODED_PAD,
44 AUTOPLUG_BLACKLIST,
45 UNKNOWN_TYPE,
46 RELEASE_SAMPLE,
47 TRANSFORM_PAD_ADDED,
48 QUERY_SINK
51 struct cb_data {
52 enum CB_TYPE type;
53 union {
54 struct watch_bus_data {
55 GstBus *bus;
56 GstMessage *msg;
57 gpointer user;
58 GstBusSyncReply ret;
59 } watch_bus_data;
60 struct existing_new_pad_data {
61 GstElement *bin;
62 GstPad *pad;
63 gpointer user;
64 } existing_new_pad_data;
65 struct query_function_data {
66 GstPad *pad;
67 GstObject *parent;
68 GstQuery *query;
69 gboolean ret;
70 } query_function_data;
71 struct activate_mode_data {
72 GstPad *pad;
73 GstObject *parent;
74 GstPadMode mode;
75 gboolean activate;
76 gboolean ret;
77 } activate_mode_data;
78 struct no_more_pads_data {
79 GstElement *decodebin;
80 gpointer user;
81 } no_more_pads_data;
82 struct request_buffer_src_data {
83 GstPad *pad;
84 GstObject *parent;
85 guint64 ofs;
86 guint len;
87 GstBuffer **buf;
88 GstFlowReturn ret;
89 } request_buffer_src_data;
90 struct event_src_data {
91 GstPad *pad;
92 GstObject *parent;
93 GstEvent *event;
94 gboolean ret;
95 } event_src_data;
96 struct event_sink_data {
97 GstPad *pad;
98 GstObject *parent;
99 GstEvent *event;
100 gboolean ret;
101 } event_sink_data;
102 struct got_data_sink_data {
103 GstPad *pad;
104 GstObject *parent;
105 GstBuffer *buf;
106 GstFlowReturn ret;
107 } got_data_sink_data;
108 struct got_data_data {
109 GstPad *pad;
110 GstObject *parent;
111 GstBuffer *buf;
112 GstFlowReturn ret;
113 } got_data_data;
114 struct removed_decoded_pad_data {
115 GstElement *bin;
116 GstPad *pad;
117 gpointer user;
118 } removed_decoded_pad_data;
119 struct autoplug_blacklist_data {
120 GstElement *bin;
121 GstPad *pad;
122 GstCaps *caps;
123 GstElementFactory *fact;
124 gpointer user;
125 GstAutoplugSelectResult ret;
126 } autoplug_blacklist_data;
127 struct unknown_type_data {
128 GstElement *bin;
129 GstPad *pad;
130 GstCaps *caps;
131 gpointer user;
132 } unknown_type_data;
133 struct release_sample_data {
134 gpointer data;
135 } release_sample_data;
136 struct transform_pad_added_data {
137 GstElement *filter;
138 GstPad *pad;
139 gpointer user;
140 } transform_pad_added_data;
141 struct query_sink_data {
142 GstPad *pad;
143 GstObject *parent;
144 GstQuery *query;
145 gboolean ret;
146 } query_sink_data;
147 } u;
149 int finished;
150 pthread_mutex_t lock;
151 pthread_cond_t cond;
152 struct list entry;
155 extern pthread_mutex_t cb_list_lock DECLSPEC_HIDDEN;
156 extern pthread_cond_t cb_list_cond DECLSPEC_HIDDEN;
157 extern struct list cb_list DECLSPEC_HIDDEN;
158 void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user) DECLSPEC_HIDDEN;
159 BOOL is_wine_thread(void) DECLSPEC_HIDDEN;
160 void mark_wine_thread(void) DECLSPEC_HIDDEN;
162 GstBusSyncReply watch_bus_wrapper(GstBus *bus, GstMessage *msg, gpointer user) DECLSPEC_HIDDEN;
163 void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
164 gboolean query_function_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
165 gboolean activate_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN;
166 void no_more_pads_wrapper(GstElement *decodebin, gpointer user) DECLSPEC_HIDDEN;
167 GstFlowReturn request_buffer_src_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) DECLSPEC_HIDDEN;
168 gboolean event_src_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN;
169 gboolean event_sink_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN;
170 GstFlowReturn got_data_sink_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN;
171 GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN;
172 void removed_decoded_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
173 GstAutoplugSelectResult autoplug_blacklist_wrapper(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *fact, gpointer user) DECLSPEC_HIDDEN;
174 void unknown_type_wrapper(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user) DECLSPEC_HIDDEN;
175 void release_sample_wrapper(gpointer data) DECLSPEC_HIDDEN;
176 void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
177 gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
179 #endif