2 * winegstreamer Unix library interface
4 * Copyright 2020-2021 Zebediah Figura for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINEGSTREAMER_UNIX_PRIVATE_H
22 #define __WINE_WINEGSTREAMER_UNIX_PRIVATE_H
28 #include <gst/audio/audio.h>
32 GST_DEBUG_CATEGORY_EXTERN(wine
);
33 #define GST_CAT_DEFAULT wine
35 extern NTSTATUS
wg_init_gstreamer(void *args
);
37 extern GstStreamType
stream_type_from_caps(GstCaps
*caps
);
38 extern GstElement
*create_element(const char *name
, const char *plugin_set
);
39 GstElement
*factory_create_element(GstElementFactory
*factory
);
40 extern GList
*find_element_factories(GstElementFactoryListType type
, GstRank min_rank
,
41 GstCaps
*element_sink_caps
, GstCaps
*element_src_caps
);
42 extern GstElement
*find_element(GstElementFactoryListType type
,
43 GstCaps
*element_sink_caps
, GstCaps
*element_src_caps
);
44 extern bool append_element(GstElement
*container
, GstElement
*element
, GstElement
**first
, GstElement
**last
);
45 extern bool link_src_to_sink(GstPad
*src_pad
, GstPad
*sink_pad
);
46 extern bool link_src_to_element(GstPad
*src_pad
, GstElement
*element
);
47 extern bool link_element_to_sink(GstElement
*element
, GstPad
*sink_pad
);
48 extern bool push_event(GstPad
*pad
, GstEvent
*event
);
49 extern void set_max_threads(GstElement
*element
);
53 extern void wg_format_from_caps(struct wg_format
*format
, const GstCaps
*caps
);
54 extern bool wg_format_compare(const struct wg_format
*a
, const struct wg_format
*b
);
55 extern GstCaps
*wg_format_to_caps(const struct wg_format
*format
);
56 extern uint32_t wg_channel_mask_from_gst(const GstAudioInfo
*info
);
60 extern NTSTATUS
wg_transform_create(void *args
);
61 extern NTSTATUS
wg_transform_destroy(void *args
);
62 extern NTSTATUS
wg_transform_get_output_type(void *args
);
63 extern NTSTATUS
wg_transform_set_output_type(void *args
);
64 extern NTSTATUS
wg_transform_push_data(void *args
);
65 extern NTSTATUS
wg_transform_read_data(void *args
);
66 extern NTSTATUS
wg_transform_get_status(void *args
);
67 extern NTSTATUS
wg_transform_drain(void *args
);
68 extern NTSTATUS
wg_transform_flush(void *args
);
69 extern NTSTATUS
wg_transform_notify_qos(void *args
);
73 static inline BOOL
is_mf_video_area_empty(const MFVideoArea
*area
)
75 return !area
->OffsetX
.value
&& !area
->OffsetY
.value
&& !area
->Area
.cx
&& !area
->Area
.cy
;
78 extern GstCaps
*caps_from_media_type(const struct wg_media_type
*media_type
);
79 extern NTSTATUS
caps_to_media_type(GstCaps
*caps
, struct wg_media_type
*media_type
,
80 UINT32 video_plane_align
);
84 extern NTSTATUS
wg_muxer_create(void *args
);
85 extern NTSTATUS
wg_muxer_destroy(void *args
);
86 extern NTSTATUS
wg_muxer_add_stream(void *args
);
87 extern NTSTATUS
wg_muxer_start(void *args
);
88 extern NTSTATUS
wg_muxer_push_sample(void *args
);
89 extern NTSTATUS
wg_muxer_read_data(void *args
);
90 extern NTSTATUS
wg_muxer_finalize(void *args
);
94 static inline BYTE
*wg_sample_data(struct wg_sample
*sample
)
96 return (BYTE
*)(UINT_PTR
)sample
->data
;
99 /* wg_allocator_release_sample can be used to release any sample that was requested. */
100 typedef struct wg_sample
*(*wg_allocator_request_sample_cb
)(gsize size
, void *context
);
101 extern GstAllocator
*wg_allocator_create(void);
102 extern void wg_allocator_destroy(GstAllocator
*allocator
);
103 extern void wg_allocator_provide_sample(GstAllocator
*allocator
, struct wg_sample
*sample
);
104 extern void wg_allocator_release_sample(GstAllocator
*allocator
, struct wg_sample
*sample
,
107 #endif /* __WINE_WINEGSTREAMER_UNIX_PRIVATE_H */