winegstreamer: Don't force request_buffer_src() onto a Wine thread.
[wine.git] / dlls / winegstreamer / gst_cbs.h
blob4afde78ba7d64e6e13d99b8367a17aa4d2636da9
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 EXISTING_NEW_PAD,
34 ACTIVATE_MODE,
35 QUERY_SINK,
36 GSTDEMUX_MAX,
37 BYTESTREAM_WRAPPER_PULL,
38 BYTESTREAM_QUERY,
39 BYTESTREAM_PAD_MODE_ACTIVATE,
40 BYTESTREAM_PAD_EVENT_PROCESS,
41 MF_SRC_BUS_WATCH,
42 MF_SRC_STREAM_ADDED,
43 MF_SRC_STREAM_REMOVED,
44 MF_SRC_NO_MORE_PADS,
45 MEDIA_SOURCE_MAX,
48 struct cb_data {
49 enum CB_TYPE type;
50 union {
51 struct watch_bus_data {
52 GstBus *bus;
53 GstMessage *msg;
54 gpointer user;
55 GstBusSyncReply ret;
56 } watch_bus_data;
57 struct pad_added_data {
58 GstElement *element;
59 GstPad *pad;
60 gpointer user;
61 } pad_added_data;
62 struct query_function_data {
63 GstPad *pad;
64 GstObject *parent;
65 GstQuery *query;
66 gboolean ret;
67 } query_function_data;
68 struct activate_mode_data {
69 GstPad *pad;
70 GstObject *parent;
71 GstPadMode mode;
72 gboolean activate;
73 gboolean ret;
74 } activate_mode_data;
75 struct no_more_pads_data {
76 GstElement *element;
77 gpointer user;
78 } no_more_pads_data;
79 struct getrange_data {
80 GstPad *pad;
81 GstObject *parent;
82 guint64 ofs;
83 guint len;
84 GstBuffer **buf;
85 GstFlowReturn ret;
86 } getrange_data;
87 struct event_src_data {
88 GstPad *pad;
89 GstObject *parent;
90 GstEvent *event;
91 gboolean ret;
92 } event_src_data;
93 struct pad_removed_data {
94 GstElement *element;
95 GstPad *pad;
96 gpointer user;
97 } pad_removed_data;
98 struct query_sink_data {
99 GstPad *pad;
100 GstObject *parent;
101 GstQuery *query;
102 gboolean ret;
103 } query_sink_data;
104 } u;
106 int finished;
107 pthread_mutex_t lock;
108 pthread_cond_t cond;
109 struct list entry;
112 void mark_wine_thread(void) DECLSPEC_HIDDEN;
113 void perform_cb_gstdemux(struct cb_data *data) DECLSPEC_HIDDEN;
114 void perform_cb_media_source(struct cb_data *data) DECLSPEC_HIDDEN;
116 void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
117 gboolean activate_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN;
118 GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN;
119 void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
120 gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
121 GstFlowReturn bytestream_wrapper_pull_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) DECLSPEC_HIDDEN;
122 gboolean bytestream_query_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
123 gboolean bytestream_pad_mode_activate_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN;
124 gboolean bytestream_pad_event_process_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN;
125 GstBusSyncReply mf_src_bus_watch_wrapper(GstBus *bus, GstMessage *message, gpointer user) DECLSPEC_HIDDEN;
126 void mf_src_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
127 void mf_src_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
128 void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user) DECLSPEC_HIDDEN;
130 #endif