GST pipelines refactor.

This commit is contained in:
Miroslav Šedivý
2020-11-01 20:18:19 +01:00
parent c10b2212d1
commit 16d762b6ae
5 changed files with 74 additions and 56 deletions

View File

@ -68,11 +68,6 @@ GstElement *gstreamer_send_create_pipeline(char *pipeline) {
return gst_parse_launch(pipeline, &error);
}
void gstreamer_send_destroy_pipeline(GstElement *pipeline) {
gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref(pipeline);
}
void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) {
SampleHandlerUserData *s = calloc(1, sizeof(SampleHandlerUserData));
s->pipelineId = pipelineId;
@ -95,4 +90,5 @@ void gstreamer_send_play_pipeline(GstElement *pipeline) {
void gstreamer_send_stop_pipeline(GstElement *pipeline) {
gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref(pipeline);
}

View File

@ -210,11 +210,6 @@ func CreatePipeline(pipelineStr string, codecName string, clockRate float32) (*P
return p, nil
}
// Destroy GStreamer Pipeline
func (p *Pipeline) DestroyPipeline() {
C.gstreamer_send_destroy_pipeline(p.Pipeline)
}
// Start starts the GStreamer Pipeline
func (p *Pipeline) Start() {
C.gstreamer_send_start_pipeline(p.Pipeline, C.int(p.id))

View File

@ -9,7 +9,6 @@
extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, int pipelineId);
GstElement *gstreamer_send_create_pipeline(char *pipeline);
void gstreamer_send_destroy_pipeline(GstElement *pipeline);
void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId);
void gstreamer_send_play_pipeline(GstElement *pipeline);