Archived
2
0
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
neko-custom/server/internal/capture/gst/gst.h

28 lines
1.2 KiB
C
Raw Permalink Normal View History

2021-11-08 05:09:00 +13:00
#pragma once
2020-01-13 21:05:38 +13:00
2022-09-17 22:43:17 +12:00
#include <stdio.h>
2020-01-13 21:05:38 +13:00
#include <gst/gst.h>
2021-11-08 05:09:00 +13:00
#include <gst/app/gstappsrc.h>
2020-01-13 21:05:38 +13:00
2022-09-17 22:43:17 +12:00
typedef struct GstPipelineCtx {
int pipelineId;
GstElement *pipeline;
GstElement *appsink;
GstElement *appsrc;
} GstPipelineCtx;
2020-01-13 21:05:38 +13:00
extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, int pipelineId);
2022-09-17 22:43:17 +12:00
extern void goPipelineLog(char *level, char *msg, int pipelineId);
2020-01-13 21:05:38 +13:00
2022-09-17 22:43:17 +12:00
GstPipelineCtx *gstreamer_pipeline_create(char *pipelineStr, int pipelineId, GError **error);
void gstreamer_pipeline_attach_appsink(GstPipelineCtx *ctx, char *sinkName);
void gstreamer_pipeline_attach_appsrc(GstPipelineCtx *ctx, char *srcName);
void gstreamer_pipeline_play(GstPipelineCtx *ctx);
void gstreamer_pipeline_pause(GstPipelineCtx *ctx);
void gstreamer_pipeline_destory(GstPipelineCtx *ctx);
void gstreamer_pipeline_push(GstPipelineCtx *ctx, void *buffer, int bufferLen);
2020-01-19 12:30:09 +13:00
2022-09-17 22:43:17 +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);