-
Notifications
You must be signed in to change notification settings - Fork 1
/
gst_helpers.h
50 lines (40 loc) · 1.65 KB
/
gst_helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _GST_HELPERS__H_
#define _GST_HELPERS__H_
#include <gst/gst.h>
/* Structure to contain all our information, so we can pass it to callbacks */
typedef struct _GstreamerData {
GstElement * pipeline;
GstElement * decodebin1;
GstElement * decodebin2;
GstElement * decodebin3;
GstElement * videoscale1;
GstElement * videoscale2;
GstElement * videoscale3;
GstElement * video_scaled_caps1;
GstElement * video_scaled_caps2;
GstElement * video_scaled_caps3;
GstElement * video_mixer;
GstElement * convert_preview;
GstElement * sink_preview;
// XXX Do not call the following if Twitch is not setup
GstElement * tee;
GstElement * queue_preview;
GstElement * queue_streaming;
GstElement * video_encoder_streaming;
GstElement * queue_encoded;
GstElement * muxer_streaming;
GstElement * queue_muxed;
GstElement * sink_rtmp;
} GstreamerData;
/* A factory function that creates all necessary GstElements, struct */
/* Exits on error. */
GstreamerData create_data();
void link_pipeline_elements(GstreamerData * data, gboolean with_twitch);
void setup_video_placement(GstreamerData * data, int output_width, int output_height);
void setup_file_sources(GstreamerData * data, gchar * filepath1, gchar * filepath2, gchar * filepath3);
void setup_twitch_streaming(GstreamerData * data, gchar * twitch_api_key, gchar * twich_server);
void clean_unused_streaming_gst_elements(GstreamerData * data);
/* Try to change pipeline state to desired state */
/* Exits the program if request cannot be fulfilled */
void try_change_pipeline_state(GstElement * pipeline, GstState state);
#endif /* _GST_HELPERS__H_ */