2021-01-12 03:57:14 +13:00
|
|
|
#pragma once
|
2020-10-23 03:54:50 +13:00
|
|
|
|
2021-12-06 05:52:25 +13:00
|
|
|
#include <stdio.h>
|
2020-10-23 03:54:50 +13:00
|
|
|
#include <gst/gst.h>
|
2021-01-12 03:57:14 +13:00
|
|
|
#include <gst/app/gstappsrc.h>
|
2020-10-23 03:54:50 +13:00
|
|
|
|
2021-12-06 06:16:26 +13:00
|
|
|
typedef struct GstPipelineCtx {
|
|
|
|
int pipelineId;
|
|
|
|
GstElement *pipeline;
|
2021-12-06 10:06:42 +13:00
|
|
|
GstElement *appsink;
|
|
|
|
GstElement *appsrc;
|
2021-12-06 06:16:26 +13:00
|
|
|
} GstPipelineCtx;
|
|
|
|
|
2020-10-23 03:54:50 +13:00
|
|
|
extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, int pipelineId);
|
2021-12-06 06:16:26 +13:00
|
|
|
extern void goPipelineLog(char *level, char *msg, int pipelineId);
|
2020-10-23 03:54:50 +13:00
|
|
|
|
2021-12-06 06:16:26 +13:00
|
|
|
GstPipelineCtx *gstreamer_pipeline_create(char *pipelineStr, int pipelineId, GError **error);
|
|
|
|
void gstreamer_pipeline_attach_appsink(GstPipelineCtx *ctx, char *sinkName);
|
2021-12-06 10:06:42 +13:00
|
|
|
void gstreamer_pipeline_attach_appsrc(GstPipelineCtx *ctx, char *srcName);
|
2021-12-06 06:16:26 +13:00
|
|
|
void gstreamer_pipeline_play(GstPipelineCtx *ctx);
|
|
|
|
void gstreamer_pipeline_pause(GstPipelineCtx *ctx);
|
|
|
|
void gstreamer_pipeline_destory(GstPipelineCtx *ctx);
|
2021-12-06 10:06:42 +13:00
|
|
|
void gstreamer_pipeline_push(GstPipelineCtx *ctx, void *buffer, int bufferLen);
|
2021-11-29 10:19:06 +13:00
|
|
|
|
2022-09-11 09:18:16 +12:00
|
|
|
gboolean gstreamer_pipeline_set_prop_int(GstPipelineCtx *ctx, char *binName, char *prop, gint value);
|
|
|
|
gboolean gstreamer_pipeline_set_caps_framerate(GstPipelineCtx *ctx, const gchar* binName, gint numerator, gint denominator);
|
|
|
|
gboolean gstreamer_pipeline_set_caps_resolution(GstPipelineCtx *ctx, const gchar* binName, gint width, gint height);
|
|
|
|
|
2020-10-23 03:54:50 +13:00
|
|
|
void gstreamer_init(void);
|
2021-12-06 05:52:25 +13:00
|
|
|
void gstreamer_loop(void);
|