Gstreamer does not play multiple streams simultaneously

I am working on an application that requires playing multiple RTSP streams simultaneously using Gstreamer, it works fine with one stream, since I add a second stream, the first stream stops and the second starts playing, after several passages it also stops, and the application crashes.

Here is a screenshot of viewing APP streams APP screenview

and this screenshot when APP crashes

app crash screen

I have Gstreamer.framework updates, searched and tried different solutions. But nothing worked

Here is my sample code for pipelining threads

#import "VideoViewController.h"
#import "GStreamerBackend.h"
#import <UIKit/UIKit.h>

@interface VideoViewController () {
    GStreamerBackend *gst_backend;
    GStreamerBackend *gst_backend1;
    int media_width;                /* Width of the clip */
    int media_height;               /* height ofthe clip */
    Boolean dragging_slider;        /* Whether the time slider is being dragged or not */
    Boolean is_local_media;         /* Whether this clip is stored locally or is being streamed */
    Boolean is_playing_desired;     /* Whether the user asked to go to PLAYING */
}

in viewDidLoad:

url1= my first url
url2=my second URL

here I initialize my 2 threads.

gst_backend = [[GStreamerBackend alloc] init:self videoView:video_view];

gst_backend1 = [[GStreamerBackend alloc] init:self videoView:video_view1];

this delegate method is called:

-(void) gstreamerInitialized
{

        dispatch_async(dispatch_get_main_queue(), ^{
            firstInit=YES;
            play_button.enabled = TRUE;
            pause_button.enabled = TRUE;
            message_label.text = @"Ready";
            [gst_backend setUri:uri];
             [gst_backend1 setUri:uri2];
            //is_local_media = [uri hasPrefix:@"file://"];
            //is_playing_desired = NO;

           [gst_backend1 play];
             [gst_backend play];
        });

}

I think the problem is in the search path. enter image description here

enter image description here

+4

Source: https://habr.com/ru/post/1569269/