2016-01-12 20:35:04 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Andrew Eikum for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GST_CBS_H
|
|
|
|
#define GST_CBS_H
|
|
|
|
|
|
|
|
#include "wine/list.h"
|
|
|
|
#include "windef.h"
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
GST_AUTOPLUG_SELECT_TRY,
|
|
|
|
GST_AUTOPLUG_SELECT_EXPOSE,
|
|
|
|
GST_AUTOPLUG_SELECT_SKIP
|
|
|
|
} GstAutoplugSelectResult;
|
|
|
|
|
|
|
|
enum CB_TYPE {
|
|
|
|
WATCH_BUS,
|
|
|
|
EXISTING_NEW_PAD,
|
|
|
|
QUERY_FUNCTION,
|
2016-01-14 20:23:04 +01:00
|
|
|
ACTIVATE_MODE,
|
2016-01-12 20:35:04 +01:00
|
|
|
NO_MORE_PADS,
|
|
|
|
REQUEST_BUFFER_SRC,
|
|
|
|
EVENT_SRC,
|
|
|
|
EVENT_SINK,
|
|
|
|
GOT_DATA_SINK,
|
|
|
|
REMOVED_DECODED_PAD,
|
|
|
|
AUTOPLUG_BLACKLIST,
|
|
|
|
UNKNOWN_TYPE,
|
2020-03-20 21:00:23 +01:00
|
|
|
QUERY_SINK,
|
|
|
|
GSTDEMUX_MAX
|
2016-01-12 20:35:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_data {
|
|
|
|
enum CB_TYPE type;
|
|
|
|
union {
|
|
|
|
struct watch_bus_data {
|
|
|
|
GstBus *bus;
|
|
|
|
GstMessage *msg;
|
|
|
|
gpointer user;
|
|
|
|
GstBusSyncReply ret;
|
|
|
|
} watch_bus_data;
|
2020-03-20 20:54:09 +01:00
|
|
|
struct pad_added_data {
|
|
|
|
GstElement *element;
|
2016-01-12 20:35:04 +01:00
|
|
|
GstPad *pad;
|
|
|
|
gpointer user;
|
2020-03-20 20:54:09 +01:00
|
|
|
} pad_added_data;
|
2016-01-12 20:35:04 +01:00
|
|
|
struct query_function_data {
|
|
|
|
GstPad *pad;
|
2016-01-14 20:23:04 +01:00
|
|
|
GstObject *parent;
|
2016-01-12 20:35:04 +01:00
|
|
|
GstQuery *query;
|
|
|
|
gboolean ret;
|
|
|
|
} query_function_data;
|
2016-01-14 20:23:04 +01:00
|
|
|
struct activate_mode_data {
|
2016-01-12 20:35:04 +01:00
|
|
|
GstPad *pad;
|
2016-01-14 20:23:04 +01:00
|
|
|
GstObject *parent;
|
|
|
|
GstPadMode mode;
|
2016-01-12 20:35:04 +01:00
|
|
|
gboolean activate;
|
|
|
|
gboolean ret;
|
2016-01-14 20:23:04 +01:00
|
|
|
} activate_mode_data;
|
2016-01-12 20:35:04 +01:00
|
|
|
struct no_more_pads_data {
|
2020-03-20 20:54:09 +01:00
|
|
|
GstElement *element;
|
2016-01-12 20:35:04 +01:00
|
|
|
gpointer user;
|
|
|
|
} no_more_pads_data;
|
2020-03-20 20:54:09 +01:00
|
|
|
struct getrange_data {
|
2016-01-12 20:35:04 +01:00
|
|
|
GstPad *pad;
|
2016-01-14 20:23:04 +01:00
|
|
|
GstObject *parent;
|
2016-01-12 20:35:04 +01:00
|
|
|
guint64 ofs;
|
|
|
|
guint len;
|
|
|
|
GstBuffer **buf;
|
|
|
|
GstFlowReturn ret;
|
2020-03-20 20:54:09 +01:00
|
|
|
} getrange_data;
|
2016-01-12 20:35:04 +01:00
|
|
|
struct event_src_data {
|
|
|
|
GstPad *pad;
|
2016-01-14 20:23:04 +01:00
|
|
|
GstObject *parent;
|
2016-01-12 20:35:04 +01:00
|
|
|
GstEvent *event;
|
|
|
|
gboolean ret;
|
|
|
|
} event_src_data;
|
|
|
|
struct event_sink_data {
|
|
|
|
GstPad *pad;
|
2016-01-14 20:23:04 +01:00
|
|
|
GstObject *parent;
|
2016-01-12 20:35:04 +01:00
|
|
|
GstEvent *event;
|
|
|
|
gboolean ret;
|
|
|
|
} event_sink_data;
|
|
|
|
struct got_data_sink_data {
|
|
|
|
GstPad *pad;
|
2016-01-14 20:23:04 +01:00
|
|
|
GstObject *parent;
|
2016-01-12 20:35:04 +01:00
|
|
|
GstBuffer *buf;
|
|
|
|
GstFlowReturn ret;
|
|
|
|
} got_data_sink_data;
|
2020-03-20 20:54:09 +01:00
|
|
|
struct pad_removed_data {
|
|
|
|
GstElement *element;
|
2016-01-12 20:35:04 +01:00
|
|
|
GstPad *pad;
|
|
|
|
gpointer user;
|
2020-03-20 20:54:09 +01:00
|
|
|
} pad_removed_data;
|
2016-01-12 20:35:04 +01:00
|
|
|
struct autoplug_blacklist_data {
|
|
|
|
GstElement *bin;
|
|
|
|
GstPad *pad;
|
|
|
|
GstCaps *caps;
|
|
|
|
GstElementFactory *fact;
|
|
|
|
gpointer user;
|
|
|
|
GstAutoplugSelectResult ret;
|
|
|
|
} autoplug_blacklist_data;
|
|
|
|
struct unknown_type_data {
|
|
|
|
GstElement *bin;
|
|
|
|
GstPad *pad;
|
|
|
|
GstCaps *caps;
|
|
|
|
gpointer user;
|
|
|
|
} unknown_type_data;
|
2016-01-14 20:23:04 +01:00
|
|
|
struct query_sink_data {
|
|
|
|
GstPad *pad;
|
|
|
|
GstObject *parent;
|
|
|
|
GstQuery *query;
|
|
|
|
gboolean ret;
|
|
|
|
} query_sink_data;
|
2016-01-12 20:35:04 +01:00
|
|
|
} u;
|
|
|
|
|
|
|
|
int finished;
|
|
|
|
pthread_mutex_t lock;
|
|
|
|
pthread_cond_t cond;
|
|
|
|
struct list entry;
|
|
|
|
};
|
|
|
|
|
|
|
|
void mark_wine_thread(void) DECLSPEC_HIDDEN;
|
2020-03-20 21:00:23 +01:00
|
|
|
void perform_cb_gstdemux(struct cb_data *data) DECLSPEC_HIDDEN;
|
2016-01-12 20:35:04 +01:00
|
|
|
|
|
|
|
GstBusSyncReply watch_bus_wrapper(GstBus *bus, GstMessage *msg, gpointer user) DECLSPEC_HIDDEN;
|
2016-01-14 20:23:04 +01:00
|
|
|
void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
|
|
|
|
gboolean query_function_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
|
|
|
|
gboolean activate_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN;
|
2016-01-12 20:35:04 +01:00
|
|
|
void no_more_pads_wrapper(GstElement *decodebin, gpointer user) DECLSPEC_HIDDEN;
|
2016-01-14 20:23:04 +01:00
|
|
|
GstFlowReturn request_buffer_src_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) DECLSPEC_HIDDEN;
|
|
|
|
gboolean event_src_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN;
|
|
|
|
gboolean event_sink_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN;
|
|
|
|
GstFlowReturn got_data_sink_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN;
|
|
|
|
GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN;
|
2016-01-12 20:35:04 +01:00
|
|
|
void removed_decoded_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
|
|
|
|
GstAutoplugSelectResult autoplug_blacklist_wrapper(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *fact, gpointer user) DECLSPEC_HIDDEN;
|
|
|
|
void unknown_type_wrapper(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user) DECLSPEC_HIDDEN;
|
|
|
|
void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
|
2016-01-14 20:23:04 +01:00
|
|
|
gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN;
|
2016-01-12 20:35:04 +01:00
|
|
|
|
|
|
|
#endif
|