mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
catch errors from gst pipeline.
This commit is contained in:
@ -63,9 +63,8 @@ GstFlowReturn gstreamer_send_new_sample_handler(GstElement *object, gpointer use
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
||||
GstElement *gstreamer_send_create_pipeline(char *pipeline) {
|
||||
GError *error = NULL;
|
||||
return gst_parse_launch(pipeline, &error);
|
||||
GstElement *gstreamer_send_create_pipeline(char *pipeline, GError **error) {
|
||||
return gst_parse_launch(pipeline, error);
|
||||
}
|
||||
|
||||
void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) {
|
||||
|
@ -208,8 +208,15 @@ func CreatePipeline(pipelineStr string) (*Pipeline, error) {
|
||||
pipelinesLock.Lock()
|
||||
defer pipelinesLock.Unlock()
|
||||
|
||||
var err *C.GError
|
||||
gstPipeline := C.gstreamer_send_create_pipeline(pipelineStrUnsafe, &err)
|
||||
if err != nil {
|
||||
defer C.g_error_free(err)
|
||||
return nil, fmt.Errorf("%s", C.GoString(err.message))
|
||||
}
|
||||
|
||||
p := &Pipeline{
|
||||
Pipeline: C.gstreamer_send_create_pipeline(pipelineStrUnsafe),
|
||||
Pipeline: gstPipeline,
|
||||
Sample: make(chan types.Sample),
|
||||
Src: pipelineStr,
|
||||
id: len(pipelines),
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, int pipelineId);
|
||||
|
||||
GstElement *gstreamer_send_create_pipeline(char *pipeline);
|
||||
GstElement *gstreamer_send_create_pipeline(char *pipeline, GError **error);
|
||||
|
||||
void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId);
|
||||
void gstreamer_send_play_pipeline(GstElement *pipeline);
|
||||
|
Reference in New Issue
Block a user