changing souphttpsrc location property on android

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

changing souphttpsrc location property on android

Dani MR
Hi everyone,
I am trying to change the location uri for the souphttpsrc on android and this is the code I have written (based on tutorial5 for android):

/* Set playbin2's URI */
void gst_native_set_uri (JNIEnv* env, jobject thiz, jstring uri) {

    CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
    if (!data || !data->pipeline) return;
    const jbyte *char_uri = (*env)->GetStringUTFChars (env, uri, NULL);
    GstElement *http_src;//mod
    gchar *location;//mod
    gchar *next_location = g_strdup(char_uri);
    http_src = gst_bin_get_by_name (GST_BIN(data->pipeline), "http_src");//mod
    if(!http_src)//mod
        GST_DEBUG("GstElement http_src ERROR!");//mod
    else//mod
        GST_DEBUG("GstElement http_src OK");//mod
    GST_DEBUG ("Setting URI to %s", char_uri);

    /*This the modified part of the function*/
    data->target_state = GST_STATE_READY;//mod
    gst_element_set_state(data->pipeline, GST_STATE_READY);//mod
    GST_DEBUG("Pipeline state: READY");//mod

    g_object_get(G_OBJECT(http_src), "location", &location, NULL);//mod
    g_print("Current http-src location: %s", location);//mod
    g_object_set(G_OBJECT(http_src), "location", char_uri, NULL);//mod
    g_object_get(G_OBJECT(http_src), "location", &location, NULL);//mod
    g_print("Current http-src location: %s", location);//mod

    data->target_state = GST_STATE_PLAYING;//mod
    gst_element_set_state(data->pipeline, GST_STATE_PLAYING);//mod
    GST_DEBUG("Pipeline state: PLAYING");//mod

    gst_object_unref (http_src);//mod
    /*End of modified code*/

    (*env)->ReleaseStringUTFChars (env, uri, char_uri);
    data->duration = GST_CLOCK_TIME_NONE;
    data->is_live = (gst_element_set_state (data->pipeline, data->target_state) == GST_STATE_CHANGE_NO_PREROLL);

}

So as this function is called, when it used to be a playbin, just by adding the GST_STATE_READY and the g_object_set() for the uri worked fine. Now I have a working pipeline with a checked .ts and it initially works, but not when this function is called. The debug logs for the location property gets changed but what happens is that the app gets paused (no crash at all) with the outdated video. The initially working pipeline -using gst_parse_launch()- is:

souphttpsrc name=http_src location=http://192.168.0.32/videos/sintel.ts ! queue ! tsdemux name=demux 
demux. ! queue ! h264parse ! avdec_h264 ! videoconvert ! glimagesink name=video_sink 
demux. ! queue ! aacparse ! faad ! audioconvert ! autoaudiosink name=audio_sink


The related log is:

05-17 11:04:54.500 19858-19924/com.sample.app W/GStreamer+basesrc: 0:00:11.130733339 0x9e012490 gstbasesrc.c:2943:gst_base_src_loop:<http_src> error: Internal data flow error.
05-17 11:04:54.500 19858-19924/com.sample.app W/GStreamer+basesrc: 0:00:11.130925589 0x9e012490 gstbasesrc.c:2943:gst_base_src_loop:<http_src> error: streaming task paused, reason not-negotiated (-4)
05-17 11:04:54.500 19858-19924/com.sample.app W/GStreamer+queue: 0:00:11.131194839 0x9e012490 gstqueue.c:968:gst_queue_handle_sink_event:<queue3> error: Internal data flow error.
05-17 11:04:54.500 19858-19924/com.sample.app W/GStreamer+queue: 0:00:11.131370672 0x9e012490 gstqueue.c:968:gst_queue_handle_sink_event:<queue3> error: streaming task paused, reason not-negotiated (-4)

Can anyone give a clue for what I am missing?

Thanks in advance,

Dani

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Sebastian Dröge-3
On Di, 2016-05-17 at 11:12 +0200, Dani wrote:


> So as this function is called, when it used to be a playbin, just by
> adding the GST_STATE_READY and the g_object_set() for the uri worked
> fine. Now I have a working pipeline with a checked .ts and it
> initially works, but not when this function is called. The debug logs
> for the location property gets changed but what happens is that the
> app gets paused (no crash at all) with the outdated video. The
> initially working pipeline -using gst_parse_launch()- is:
>
> souphttpsrc name=http_src location=http://192.168.0.32/videos/sintel.
> ts ! queue ! tsdemux name=demux 
> demux. ! queue ! h264parse ! avdec_h264 ! videoconvert ! glimagesink
> name=video_sink 
> demux. ! queue ! aacparse ! faad ! audioconvert ! autoaudiosink
> name=audio_sink
>
>
> The related log is:
> [...]
Can you get a full log? But in general, re-using gst_parse_launch()
pipelines (that is, going back to READY/NULL and starting them again)
is generally not working well. It's better to recreate the whole
pipeline.

If you want to re-use pipelines, you better build them manually instead
and handle the linking of pads in your code.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Dani MR
Thanks for your suggestion,
you are right so what I have done is writing the pipeline, making, adding and linking elements one by one.
What happens to me now is that, when dynamically adding audio and video pads from tsdemux to their own queues before the parsers, they are refused and there is no playout.
The function for dynamically adding pads is (I know the conditional instructions are not implemented in an efficient way as I wrote them just to check where it failed):
static void dynamic_addpad(GstElement *src, GstPad *new_pad, CustomData *data) {
    char* pad_name = gst_pad_get_name(new_pad);
    g_print(" In dynamic ADDING PAD %s\n", pad_name);

    if (g_str_has_prefix(pad_name,"audio")) {
        GstElement *q_audio;
        q_audio = gst_bin_get_by_name (GST_BIN(data->pipeline), "queue_audio");
        GstPad *audiodemuxsink = gst_element_get_static_pad(q_audio,"sink");
        if(gst_pad_link(new_pad,audiodemuxsink) == GST_PAD_LINK_OK)
            g_print("Audio successfully linked!\n");
        else if(gst_pad_link(new_pad,audiodemuxsink) == GST_PAD_LINK_WRONG_HIERARCHY)
            g_print("Audio link wrong hierarchy!\n");
        else if(gst_pad_link(new_pad,audiodemuxsink) == GST_PAD_LINK_WAS_LINKED)
            g_print("Audio already linked!\n");
        else if(gst_pad_link(new_pad,audiodemuxsink) == GST_PAD_LINK_WRONG_DIRECTION)
            g_print("Audio link wrong direction!\n");
        else if(gst_pad_link(new_pad,audiodemuxsink) == GST_PAD_LINK_NOFORMAT)
            g_print("Audio link noformat!\n");
        else if(gst_pad_link(new_pad,audiodemuxsink) == GST_PAD_LINK_NOSCHED)
            g_print("Audio link nosched!\n");
        else if(gst_pad_link(new_pad,audiodemuxsink) == GST_PAD_LINK_REFUSED)
            g_print("Audio link refused!\n");
        g_print ("Sink pad link: '%s'\n", pad_name);
        gst_object_unref(q_audio);
    }
    else if (g_str_has_prefix(pad_name,"video")) {
        GstElement *q_video;
        q_video = gst_bin_get_by_name(GST_BIN(data->pipeline), "queue_video");
        GstPad *videodemuxsink = gst_element_get_static_pad(q_video,"sink");
        if(gst_pad_link(new_pad,videodemuxsink) == GST_PAD_LINK_OK)
            g_print("Video successfully linked!\n");
        else if(gst_pad_link(new_pad,videodemuxsink) == GST_PAD_LINK_WRONG_HIERARCHY)
            g_print("Video link wrong hierarchy!\n");
        else if(gst_pad_link(new_pad,videodemuxsink) == GST_PAD_LINK_WAS_LINKED)
            g_print("Video link already linked!\n");
        else if(gst_pad_link(new_pad,videodemuxsink) == GST_PAD_LINK_WRONG_DIRECTION)
            g_print("Video link wrong direction!\n");
        else if(gst_pad_link(new_pad,videodemuxsink) == GST_PAD_LINK_NOFORMAT)
            g_print("Video link noformat!\n");
        else if(gst_pad_link(new_pad,videodemuxsink) == GST_PAD_LINK_NOSCHED)
            g_print("Video link nosched!\n");
        else if(gst_pad_link(new_pad,videodemuxsink) == GST_PAD_LINK_REFUSED)
            g_print("Video link refused!\n");
        g_print ("Sink pad link: '%s'\n", pad_name);
        gst_object_unref(q_video);
    }
}
So the log prints the "Video link refused!" sentence and after that one:
05-23 12:38:58.675 8461-8526/com.sample.app W/GStreamer+mpegtspacketizer: 0:00:01.503897667 0x9e11a260 mpegtspacketizer.c:2509:mpegts_packetizer_pts_to_ts Not enough information to calculate proper timestamp
Which is understandable as there is no linking and therefore it has no info. There the log stops and the app does not crash but keeps a black video surface.
Anyway I know where the problem is (dynamic linking) but I would appreciate any suggestions to solve it, I don't know why there is a link refusement for both audio and video streams, with the gst-launch way it was working correctly at this point. And the pc-equivalent code works fine exactly as shown on this post.
The modifications implemented for the main method in android c source are as seen here:

static void *app_function (void *userdata) {
    [...]

    GST_DEBUG ("Creating pipeline in CustomData at %p", data);

    /* Create our own GLib Main Context and make it the default one */
    data->context = g_main_context_new ();
    g_main_context_push_thread_default(data->context);

    /* Build pipeline */
    data->pipeline = gst_pipeline_new ("pipeline");
    data->httpsrc = gst_element_factory_make ("souphttpsrc", "http_src");
    data->tsdemux = gst_element_factory_make ("tsdemux", "demux");
    data->queue_video = gst_element_factory_make("queue2", "queue_video");
    data->h264parse = gst_element_factory_make ("h264parse", "h264_parse");
    data->h264dec = gst_element_factory_make ("avdec_h264", "h264dec");
    data->video_convert = gst_element_factory_make("videoconvert","video_convert");
    data->videosink = gst_element_factory_make ("glimagesink", "video_sink");
    data->queue_audio = gst_element_factory_make ("queue2", "queue_audio");
    data->aacparse = gst_element_factory_make ("aacparse", "aacparse");
    data->faad = gst_element_factory_make ("faad", "faad");
    data->audio_convert = gst_element_factory_make("audioconvert", "audio_convert");
    data->audiosink = gst_element_factory_make ("autoaudiosink", "audio_sink");

    g_signal_connect (data->tsdemux, "pad-added", G_CALLBACK (dynamic_addpad), &data);

    gst_bin_add_many(GST_BIN(data->pipeline), data->httpsrc, data->tsdemux, data->queue_video, data->h264parse, data->h264dec, data->video_convert, data->videosink, data->queue_audio, data->aacparse, data->faad, data->audio_convert, data->audiosink, NULL);

    gst_element_link(data->httpsrc, data->tsdemux);
    gst_element_link_many(data->queue_video, data->h264parse, data->h264dec, data->video_convert, data->videosink, NULL);
    gst_element_link_many(data->queue_audio, data->aacparse, data->faad, data->audio_convert, data->audiosink, NULL);

    if (error) {
        gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
        g_clear_error (&error);
        set_ui_message(message, data);
        g_free (message);
        return NULL;
    }
    [...]
}
Thanks for your time,

Dani

El 18/05/16 a las 14:31, Sebastian Dröge escribió:
On Di, 2016-05-17 at 11:12 +0200, Dani wrote:
 
So as this function is called, when it used to be a playbin, just by
adding the GST_STATE_READY and the g_object_set() for the uri worked
fine. Now I have a working pipeline with a checked .ts and it
initially works, but not when this function is called. The debug logs
for the location property gets changed but what happens is that the
app gets paused (no crash at all) with the outdated video. The
initially working pipeline -using gst_parse_launch()- is:

souphttpsrc name=http_src location=http://192.168.0.32/videos/sintel.
ts ! queue ! tsdemux name=demux 
demux. ! queue ! h264parse ! avdec_h264 ! videoconvert ! glimagesink
name=video_sink 
demux. ! queue ! aacparse ! faad ! audioconvert ! autoaudiosink
name=audio_sink


The related log is:
[...]
Can you get a full log? But in general, re-using gst_parse_launch()
pipelines (that is, going back to READY/NULL and starting them again)
is generally not working well. It's better to recreate the whole
pipeline.

If you want to re-use pipelines, you better build them manually instead
and handle the linking of pads in your code.



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Sebastian Dröge-3
On Mo, 2016-05-23 at 13:07 +0200, Dani wrote:

> Anyway I know where the problem is (dynamic linking) but I would
> appreciate any suggestions to solve it, I don't know why there is a
> link refusement for both audio and video streams, with the gst-launch
> way it was working correctly at this point. And the pc-equivalent
> code works fine exactly as shown on this post.

Which of the link failure cases happens? The best way to debug this in
any case is to enable debug logs and to see what happens right before
the linking fails. That will tell you in great detail about the
problem.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Dani MR
In reply to this post by Sebastian Dröge-3
The link failure which happens from the tsdemux source to both audio and video queue's sink is GST_PAD_LINK_REFUSED and the debug log is not showing anything else related than what I wrote here on the first posts:

05-27 12:27:41.355 7565-7565/com.sample.app I/Choreographer: Skipped 50 frames!  The application may be doing too much work on its main thread.
05-27 12:27:41.435 7565-7630/com.sample.app I/GLib+stdout:  In dynamic ADDING PAD video_0065

05-27 12:27:41.435 7565-7630/com.sample.app I/GLib+stdout: Video link refused!
05-27 12:27:41.435 7565-7630/com.sample.app I/GLib+stdout: Sink pad link: 'video_0065'
05-27 12:27:41.440 7565-7630/com.sample.app I/GLib+stdout:  In dynamic ADDING PAD audio_0066
05-27 12:27:41.445 7565-7630/com.sample.app I/GLib+stdout: Audio link refused!
05-27 12:27:41.445 7565-7630/com.sample.app I/GLib+stdout: Sink pad link: 'audio_0066'
05-27 12:27:41.455 7565-7630/com.sample.app W/GStreamer+mpegtspacketizer: 0:00:01.667866333 0x9e11d260 mpegtspacketizer.c:2509:mpegts_packetizer_pts_to_ts Not enough information to calculate proper timestamp


What I have tried is to run the same pipeline but changing the tsdemux element for a qtdemux just to give it a try with an mp4 file. It happens the same failure so I am a bit confused as I think I am following the right steps to run this pipeline but with no success.

Thanks for your time,

Dani



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Sebastian Dröge-3
On Fr, 2016-05-27 at 12:43 +0200, Dani wrote:
> The link failure which happens from the tsdemux source to both audio
> and video queue's sink is GST_PAD_LINK_REFUSED and the debug log is
> not showing anything else related than what I wrote here on the first
> posts:
> [...]

See my mail from Wednesday, we need more information like a full debug
log of what is happening there. Basically more information is needed to
know why exactly the linking is failing.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Dani MR
Thanks, I was working on how to get the full debug, after coding inside the function JNI_OnLoad these instructions:

setenv("GST_DEBUG", "*:5", 1);
setenv("GST_DEBUG_NO_COLOR", "1", 1);
This is the debug log I get (I think I have copied the full log related to this issue):
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegts: 0:00:04.591262585 0x9e12ea60 gstmpegtssection.c:657:_parse_pmt Parsing 100 Program Map Table
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegts: 0:00:04.591303627 0x9e12ea60 gstmpegtssection.c:694:_parse_pmt [0] Stream type 0x1b found
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegts: 0:00:04.591341877 0x9e12ea60 gstmpegtssection.c:694:_parse_pmt [1] Stream type 0x0f found
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591383127 0x9e12ea60 mpegtsbase.c:840:mpegts_base_apply_pmt Applying PMT (program_number:100, pid:0x0064)
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591424877 0x9e12ea60 mpegtsbase.c:518:mpegts_base_is_same_program Different pcr_pid (new:0x0065, old:0xffff)
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591461127 0x9e12ea60 mpegtsbase.c:636:mpegts_base_activate_program Activating program 100
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591505502 0x9e12ea60 mpegtsbase.c:651:mpegts_base_activate_program program 0x0064, registration_id 00000000 (....)
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591548335 0x9e12ea60 mpegtsbase.c:446:mpegts_base_program_add_stream pid:0x0065, stream_type:0x01b
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591601960 0x9e12ea60 mpegtsbase.c:462:mpegts_base_program_add_stream PID 0x0065, registration_id 00000000 (....)
05-30 10:07:54.905 9128-9246/? I/GLib+stdout: 7 - gst_ts_demux_stream_added
05-30 10:07:54.905 9128-9246/? I/GLib+stdout: Create a pad
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591686460 0x9e12ea60 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x0a in stream 0x0065 (stream_type 0x1b)
05-30 10:07:54.905 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.591728835 0x9e12ea60 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x59 in stream 0x0065 (stream_type 0x1b)
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.591946627 0x9e12ea60 gstpad.c:1055:gst_pad_set_active:<'':video_0065> activating pad from none
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592000002 0x9e12ea60 gstpad.c:971:pre_activate:<'':video_0065> setting pad into push mode, unset flushing
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592051960 0x9e12ea60 gstpad.c:1197:gst_pad_activate_mode:<'':video_0065> activated in push mode
05-30 10:07:54.905 9128-9246/? I/GStreamer+GST_ELEMENT_PADS: 0:00:04.592100460 0x9e12ea60 gstelement.c:897:gst_element_get_static_pad found pad demux:sink
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_EVENT: 0:00:04.592164877 0x9e12ea60 gstevent.c:302:gst_event_new_custom creating new event 0xaf14b9d8 stream-start 10254
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592214960 0x9e12ea60 gstpad.c:3747:check_sticky:<'':video_0065> pushing all sticky events
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592263460 0x9e12ea60 gstpad.c:5179:gst_pad_push_event_unchecked:<'':video_0065> Dropping event stream-start because pad is not linked
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592311544 0x9e12ea60 gstpad.c:3718:push_sticky:<'':video_0065> pad was not linked, mark pending
05-30 10:07:54.905 9128-9246/? I/GStreamer+GST_EVENT: 0:00:04.592367169 0x9e12ea60 gstevent.c:679:gst_event_new_caps creating caps event video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_EVENT: 0:00:04.592410669 0x9e12ea60 gstevent.c:302:gst_event_new_custom creating new event 0xaf14ba20 caps 12814
05-30 10:07:54.905 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592451460 0x9e12ea60 gstpad.c:4966:store_sticky_event:<'':video_0065> notify caps
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592500210 0x9e12ea60 gstpad.c:3747:check_sticky:<'':video_0065> pushing all sticky events
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.592602127 0x9e12ea60 gstpad.c:3679:push_sticky:<'':video_0065> event stream-start was already received
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.593115710 0x9e12ea60 gstpad.c:5179:gst_pad_push_event_unchecked:<'':video_0065> Dropping event caps because pad is not linked
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.593179294 0x9e12ea60 gstpad.c:3718:push_sticky:<'':video_0065> pad was not linked, mark pending
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.593880335 0x9e12ea60 gstpad.c:1851:gst_pad_set_query_function_full:<'':video_0065> queryfunc set to 0x9f49bbc1
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.594441419 0x9e12ea60 gstpad.c:1818:gst_pad_set_event_function_full:<'':video_0065> eventfunc for set to 0x9f49baa9
05-30 10:07:54.910 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.594510252 0x9e12ea60 mpegtsbase.c:446:mpegts_base_program_add_stream pid:0x0066, stream_type:0x00f
05-30 10:07:54.910 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.594574002 0x9e12ea60 mpegtsbase.c:462:mpegts_base_program_add_stream PID 0x0066, registration_id 00000000 (....)
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: 7 - gst_ts_demux_stream_added
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: Create a pad
05-30 10:07:54.910 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.594645627 0x9e12ea60 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x0a in stream 0x0066 (stream_type 0x0f)
05-30 10:07:54.910 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.594689877 0x9e12ea60 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x59 in stream 0x0066 (stream_type 0x0f)
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.594963085 0x9e12ea60 gstpad.c:1055:gst_pad_set_active:<'':audio_0066> activating pad from none
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595025085 0x9e12ea60 gstpad.c:971:pre_activate:<'':audio_0066> setting pad into push mode, unset flushing
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595080960 0x9e12ea60 gstpad.c:1197:gst_pad_activate_mode:<'':audio_0066> activated in push mode
05-30 10:07:54.910 9128-9246/? I/GStreamer+GST_ELEMENT_PADS: 0:00:04.595136544 0x9e12ea60 gstelement.c:897:gst_element_get_static_pad found pad demux:sink
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_EVENT: 0:00:04.595210377 0x9e12ea60 gstevent.c:302:gst_event_new_custom creating new event 0xaf14ba68 stream-start 10254
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595273502 0x9e12ea60 gstpad.c:3747:check_sticky:<'':audio_0066> pushing all sticky events
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595330252 0x9e12ea60 gstpad.c:5179:gst_pad_push_event_unchecked:<'':audio_0066> Dropping event stream-start because pad is not linked
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595386919 0x9e12ea60 gstpad.c:3718:push_sticky:<'':audio_0066> pad was not linked, mark pending
05-30 10:07:54.910 9128-9246/? I/GStreamer+GST_EVENT: 0:00:04.595470794 0x9e12ea60 gstevent.c:679:gst_event_new_caps creating caps event audio/mpeg, mpegversion=(int)2, stream-format=(string)adts
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_EVENT: 0:00:04.595519877 0x9e12ea60 gstevent.c:302:gst_event_new_custom creating new event 0xaf14bab0 caps 12814
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595572627 0x9e12ea60 gstpad.c:4966:store_sticky_event:<'':audio_0066> notify caps
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595648252 0x9e12ea60 gstpad.c:3747:check_sticky:<'':audio_0066> pushing all sticky events
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595701044 0x9e12ea60 gstpad.c:3679:push_sticky:<'':audio_0066> event stream-start was already received
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595758169 0x9e12ea60 gstpad.c:5179:gst_pad_push_event_unchecked:<'':audio_0066> Dropping event caps because pad is not linked
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595802210 0x9e12ea60 gstpad.c:3718:push_sticky:<'':audio_0066> pad was not linked, mark pending
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595900919 0x9e12ea60 gstpad.c:1851:gst_pad_set_query_function_full:<'':audio_0066> queryfunc set to 0x9f49bbc1
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_PADS: 0:00:04.595952294 0x9e12ea60 gstpad.c:1818:gst_pad_set_event_function_full:<'':audio_0066> eventfunc for set to 0x9f49baa9
05-30 10:07:54.910 9128-9246/? D/GStreamer+mpegtsbase: 0:00:04.596009252 0x9e12ea60 mpegtsbase.c:446:mpegts_base_program_add_stream pid:0x0065, stream_type:0x0ff
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: 1 - gst_ts_demux_program_started
05-30 10:07:54.910 9128-9246/? D/GStreamer+tsdemux: 0:00:04.596063752 0x9e12ea60 tsdemux.c:1681:gst_ts_demux_program_started Current program -1, new program 100 requested program -1
05-30 10:07:54.910 9128-9246/? D/GStreamer+tsdemux: 0:00:04.596114877 0x9e12ea60 tsdemux.c:1596:activate_pad_for_stream:<demux> Activating pad '':video_0065 for stream 0xaf139300
05-30 10:07:54.910 9128-9246/? I/GStreamer+GST_ELEMENT_PADS: 0:00:04.596166752 0x9e12ea60 gstelement.c:646:gst_element_add_pad:<demux> adding pad 'video_0065'
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_REFCOUNTING: 0:00:04.596218127 0x9e12ea60 gstobject.c:692:gst_object_set_parent:<'':video_0065> set parent (ref and sink)
05-30 10:07:54.910 9128-9246/? I/GLib+stdout:  In dynamic ADDING PAD video_0065
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: //////////-6//////////
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: Video link refused!
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: Sink pad link: 'video_0065'
05-30 10:07:54.910 9128-9246/? D/GStreamer+tsdemux: 0:00:04.596522585 0x9e12ea60 tsdemux.c:1599:activate_pad_for_stream:<demux:video_0065> done adding pad
05-30 10:07:54.910 9128-9246/? D/GStreamer+tsdemux: 0:00:04.596576502 0x9e12ea60 tsdemux.c:1596:activate_pad_for_stream:<demux> Activating pad '':audio_0066 for stream 0xaf139240
05-30 10:07:54.910 9128-9246/? I/GStreamer+GST_ELEMENT_PADS: 0:00:04.596627752 0x9e12ea60 gstelement.c:646:gst_element_add_pad:<demux> adding pad 'audio_0066'
05-30 10:07:54.910 9128-9246/? D/GStreamer+GST_REFCOUNTING: 0:00:04.596679377 0x9e12ea60 gstobject.c:692:gst_object_set_parent:<'':audio_0066> set parent (ref and sink)
05-30 10:07:54.910 9128-9246/? I/GLib+stdout:  In dynamic ADDING PAD audio_0066
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: //////////-6//////////
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: Audio link refused!
05-30 10:07:54.910 9128-9246/? I/GLib+stdout: Sink pad link: 'audio_0066'
05-30 10:07:54.910 9128-9246/? D/GStreamer+tsdemux: 0:00:04.596907252 0x9e12ea60 tsdemux.c:1599:activate_pad_for_stream:<demux:audio_0066> done adding pad
Thanks for your time,

Dani



El 30/05/16 a las 07:50, Sebastian Dröge escribió:
On Fr, 2016-05-27 at 12:43 +0200, Dani wrote:
The link failure which happens from the tsdemux source to both audio
and video queue's sink is GST_PAD_LINK_REFUSED and the debug log is
not showing anything else related than what I wrote here on the first
posts:
 [...]
See my mail from Wednesday, we need more information like a full debug
log of what is happening there. Basically more information is needed to
know why exactly the linking is failing.



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Sebastian Dröge-3
On Mo, 2016-05-30 at 10:22 +0200, Dani wrote:
> Thanks, I was working on how to get the full debug, after coding inside the function JNI_OnLoad these instructions:
>
> setenv("GST_DEBUG", "*:5", 1);
> setenv("GST_DEBUG_NO_COLOR", "1", 1);
> This is the debug log I get (I think I have copied the full log related to this issue):
> [...]

Thanks, can you get the same with debug level 6? This one here does not
contain many lines that should be there about the pad linking process,
but a few of those should already be there with 5.

In any case it's failing to link the pad not for one of the common
reasons, but for the "fallback" error case GST_PAD_LINK_REFUSED

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Dani MR
First of all thanks for your fast reply, here's the debug log with level 6:

D/GStreamer+mpegts(16393): 0:00:05.820160711 0x9e236660 gstmpegtssection.c:657:_parse_pmt Parsing 100 Program Map Table
D/GStreamer+mpegts(16393): 0:00:05.820202044 0x9e236660 gstmpegtssection.c:694:_parse_pmt [0] Stream type 0x1b found
D/GStreamer+mpegts(16393): 0:00:05.820241711 0x9e236660 gstmpegtssection.c:694:_parse_pmt [1] Stream type 0x0f found
D/GStreamer+mpegtsbase(16393): 0:00:05.820281211 0x9e236660 mpegtsbase.c:840:mpegts_base_apply_pmt Applying PMT (program_number:100, pid:0x0064)
D/GStreamer+mpegtsbase(16393): 0:00:05.820322253 0x9e236660 mpegtsbase.c:518:mpegts_base_is_same_program Different pcr_pid (new:0x0065, old:0xffff)
D/GStreamer+mpegtsbase(16393): 0:00:05.820360336 0x9e236660 mpegtsbase.c:636:mpegts_base_activate_program Activating program 100
D/GStreamer+mpegtsbase(16393): 0:00:05.820406336 0x9e236660 mpegtsbase.c:651:mpegts_base_activate_program program 0x0064, registration_id 00000000 (....)
D/GStreamer+mpegtsbase(16393): 0:00:05.820446461 0x9e236660 mpegtsbase.c:446:mpegts_base_program_add_stream pid:0x0065, stream_type:0x01b
D/GStreamer+mpegtsbase(16393): 0:00:05.820499044 0x9e236660 mpegtsbase.c:462:mpegts_base_program_add_stream PID 0x0065, registration_id 00000000 (....)
I/GLib+stdout(16393): 7 - gst_ts_demux_stream_added
I/GLib+stdout(16393): Create a pad 
D/GStreamer+mpegtsbase(16393): 0:00:05.820569711 0x9e236660 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x0a in stream 0x0065 (stream_type 0x1b)
D/GStreamer+mpegtsbase(16393): 0:00:05.820609544 0x9e236660 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x59 in stream 0x0065 (stream_type 0x1b)
V/GStreamer+tsdemux(16393): 0:00:05.820658919 0x9e236660 tsdemux.c:1131:create_pad_for_stream Attempting to create pad for stream 0x0065 with stream_type 27
V/GStreamer+tsdemux(16393): 0:00:05.820802794 0x9e236660 tsdemux.c:1445:create_pad_for_stream stream:0xaf0a2300 creating pad with name video_0065 and caps video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
D/GStreamer+GST_PADS(16393): 0:00:05.820893669 0x9e236660 gstpad.c:1055:gst_pad_set_active:<'':video_0065> activating pad from none
D/GStreamer+GST_PADS(16393): 0:00:05.820945794 0x9e236660 gstpad.c:971:pre_activate:<'':video_0065> setting pad into push mode, unset flushing
D/GStreamer+GST_PADS(16393): 0:00:05.820995878 0x9e236660 gstpad.c:1197:gst_pad_activate_mode:<'':video_0065> activated in push mode
I/GStreamer+GST_ELEMENT_PADS(16393): 0:00:05.821050086 0x9e236660 gstelement.c:897:gst_element_get_static_pad found pad demux:sink
D/GStreamer+GST_EVENT(16393): 0:00:05.821119586 0x9e236660 gstevent.c:302:gst_event_new_custom creating new event 0xaf059dd8 stream-start 10254
V/GStreamer+GST_PADS(16393): 0:00:05.821170253 0x9e236660 gstpad.c:4901:store_sticky_event:<'':video_0065> Removing pending EOS events
V/GStreamer+GST_PADS(16393): 0:00:05.821217961 0x9e236660 gstpad.c:4960:store_sticky_event:<'':video_0065> stored sticky event stream-start
D/GStreamer+GST_PADS(16393): 0:00:05.821268878 0x9e236660 gstpad.c:3747:check_sticky:<'':video_0065> pushing all sticky events
D/GStreamer+GST_PADS(16393): 0:00:05.821324044 0x9e236660 gstpad.c:5179:gst_pad_push_event_unchecked:<'':video_0065> Dropping event stream-start because pad is not linked
D/GStreamer+GST_PADS(16393): 0:00:05.821373128 0x9e236660 gstpad.c:3718:push_sticky:<'':video_0065> pad was not linked, mark pending
I/GStreamer+GST_EVENT(16393): 0:00:05.821463919 0x9e236660 gstevent.c:679:gst_event_new_caps creating caps event video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
D/GStreamer+GST_EVENT(16393): 0:00:05.821518419 0x9e236660 gstevent.c:302:gst_event_new_custom creating new event 0xaf059e20 caps 12814
V/GStreamer+GST_PADS(16393): 0:00:05.821571544 0x9e236660 gstpad.c:4960:store_sticky_event:<'':video_0065> stored sticky event caps
D/GStreamer+GST_PADS(16393): 0:00:05.821618794 0x9e236660 gstpad.c:4966:store_sticky_event:<'':video_0065> notify caps
D/GStreamer+GST_PADS(16393): 0:00:05.822378753 0x9e236660 gstpad.c:3747:check_sticky:<'':video_0065> pushing all sticky events
D/GStreamer+GST_PADS(16393): 0:00:05.822447836 0x9e236660 gstpad.c:3679:push_sticky:<'':video_0065> event stream-start was already received
D/GStreamer+GST_PADS(16393): 0:00:05.822511253 0x9e236660 gstpad.c:5179:gst_pad_push_event_unchecked:<'':video_0065> Dropping event caps because pad is not linked
D/GStreamer+GST_PADS(16393): 0:00:05.822563003 0x9e236660 gstpad.c:3718:push_sticky:<'':video_0065> pad was not linked, mark pending
D/GStreamer+GST_PADS(16393): 0:00:05.823260628 0x9e236660 gstpad.c:1851:gst_pad_set_query_function_full:<'':video_0065> queryfunc set to 0x9f49abc1
D/GStreamer+GST_PADS(16393): 0:00:05.823732961 0x9e236660 gstpad.c:1818:gst_pad_set_event_function_full:<'':video_0065> eventfunc for set to 0x9f49aaa9
D/GStreamer+mpegtsbase(16393): 0:00:05.823804253 0x9e236660 mpegtsbase.c:446:mpegts_base_program_add_stream pid:0x0066, stream_type:0x00f
D/GStreamer+mpegtsbase(16393): 0:00:05.823859419 0x9e236660 mpegtsbase.c:462:mpegts_base_program_add_stream PID 0x0066, registration_id 00000000 (....)
I/GLib+stdout(16393): 7 - gst_ts_demux_stream_added
I/GLib+stdout(16393): Create a pad 
D/GStreamer+mpegtsbase(16393): 0:00:05.823926419 0x9e236660 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x0a in stream 0x0066 (stream_type 0x0f)
D/GStreamer+mpegtsbase(16393): 0:00:05.823971294 0x9e236660 mpegtsbase.c:276:mpegts_get_descriptor_from_stream Searching for tag 0x59 in stream 0x0066 (stream_type 0x0f)
V/GStreamer+tsdemux(16393): 0:00:05.824013544 0x9e236660 tsdemux.c:1131:create_pad_for_stream Attempting to create pad for stream 0x0066 with stream_type 15
V/GStreamer+tsdemux(16393): 0:00:05.824198086 0x9e236660 tsdemux.c:1445:create_pad_for_stream stream:0xaf0a2240 creating pad with name audio_0066 and caps audio/mpeg, mpegversion=(int)2, stream-format=(string)adts
D/GStreamer+GST_PADS(16393): 0:00:05.824301419 0x9e236660 gstpad.c:1055:gst_pad_set_active:<'':audio_0066> activating pad from none
D/GStreamer+GST_PADS(16393): 0:00:05.824353128 0x9e236660 gstpad.c:971:pre_activate:<'':audio_0066> setting pad into push mode, unset flushing
D/GStreamer+GST_PADS(16393): 0:00:05.824403586 0x9e236660 gstpad.c:1197:gst_pad_activate_mode:<'':audio_0066> activated in push mode
I/GStreamer+GST_ELEMENT_PADS(16393): 0:00:05.824464961 0x9e236660 gstelement.c:897:gst_element_get_static_pad found pad demux:sink
D/GStreamer+GST_EVENT(16393): 0:00:05.824523044 0x9e236660 gstevent.c:302:gst_event_new_custom creating new event 0xaf059e68 stream-start 10254
V/GStreamer+GST_PADS(16393): 0:00:05.824568544 0x9e236660 gstpad.c:4901:store_sticky_event:<'':audio_0066> Removing pending EOS events
V/GStreamer+GST_PADS(16393): 0:00:05.826548128 0x9e236660 gstpad.c:4960:store_sticky_event:<'':audio_0066> stored sticky event stream-start
D/GStreamer+GST_PADS(16393): 0:00:05.826614628 0x9e236660 gstpad.c:3747:check_sticky:<'':audio_0066> pushing all sticky events
D/GStreamer+GST_PADS(16393): 0:00:05.826671044 0x9e236660 gstpad.c:5179:gst_pad_push_event_unchecked:<'':audio_0066> Dropping event stream-start because pad is not linked
D/GStreamer+GST_PADS(16393): 0:00:05.826720836 0x9e236660 gstpad.c:3718:push_sticky:<'':audio_0066> pad was not linked, mark pending
I/GStreamer+GST_EVENT(16393): 0:00:05.826791961 0x9e236660 gstevent.c:679:gst_event_new_caps creating caps event audio/mpeg, mpegversion=(int)2, stream-format=(string)adts
D/GStreamer+GST_EVENT(16393): 0:00:05.826841419 0x9e236660 gstevent.c:302:gst_event_new_custom creating new event 0xaf059eb0 caps 12814
V/GStreamer+GST_PADS(16393): 0:00:05.826887294 0x9e236660 gstpad.c:4960:store_sticky_event:<'':audio_0066> stored sticky event caps
D/GStreamer+GST_PADS(16393): 0:00:05.826936044 0x9e236660 gstpad.c:4966:store_sticky_event:<'':audio_0066> notify caps
D/GStreamer+GST_PADS(16393): 0:00:05.826991544 0x9e236660 gstpad.c:3747:check_sticky:<'':audio_0066> pushing all sticky events
D/GStreamer+GST_PADS(16393): 0:00:05.827037461 0x9e236660 gstpad.c:3679:push_sticky:<'':audio_0066> event stream-start was already received
D/GStreamer+GST_PADS(16393): 0:00:05.829128586 0x9e236660 gstpad.c:5179:gst_pad_push_event_unchecked:<'':audio_0066> Dropping event caps because pad is not linked
D/GStreamer+GST_PADS(16393): 0:00:05.829180544 0x9e236660 gstpad.c:3718:push_sticky:<'':audio_0066> pad was not linked, mark pending
D/GStreamer+GST_PADS(16393): 0:00:05.831112211 0x9e236660 gstpad.c:1851:gst_pad_set_query_function_full:<'':audio_0066> queryfunc set to 0x9f49abc1
D/GStreamer+GST_PADS(16393): 0:00:05.831169336 0x9e236660 gstpad.c:1818:gst_pad_set_event_function_full:<'':audio_0066> eventfunc for set to 0x9f49aaa9
D/GStreamer+mpegtsbase(16393): 0:00:05.831219794 0x9e236660 mpegtsbase.c:446:mpegts_base_program_add_stream pid:0x0065, stream_type:0x0ff
I/GLib+stdout(16393): 1 - gst_ts_demux_program_started
D/GStreamer+tsdemux(16393): 0:00:05.831277711 0x9e236660 tsdemux.c:1681:gst_ts_demux_program_started Current program -1, new program 100 requested program -1
V/GStreamer+tsdemux(16393): 0:00:05.831323461 0x9e236660 tsdemux.c:1687:gst_ts_demux_program_started program 100 started
D/GStreamer+tsdemux(16393): 0:00:05.831374169 0x9e236660 tsdemux.c:1596:activate_pad_for_stream:<demux> Activating pad '':video_0065 for stream 0xaf0a2300
I/GStreamer+GST_ELEMENT_PADS(16393): 0:00:05.831427128 0x9e236660 gstelement.c:646:gst_element_add_pad:<demux> adding pad 'video_0065'
D/GStreamer+GST_REFCOUNTING(16393): 0:00:05.831483003 0x9e236660 gstobject.c:692:gst_object_set_parent:<'':video_0065> set parent (ref and sink)
I/GLib+stdout(16393):  In dynamic ADDING PAD video_0065
I/GLib+stdout(16393): //////////-6//////////
I/GLib+stdout(16393): Video link refused!
I/GLib+stdout(16393): Sink pad link: 'video_0065'
D/GStreamer+tsdemux(16393): 0:00:05.831770086 0x9e236660 tsdemux.c:1599:activate_pad_for_stream:<demux:video_0065> done adding pad
D/GStreamer+tsdemux(16393): 0:00:05.831826253 0x9e236660 tsdemux.c:1596:activate_pad_for_stream:<demux> Activating pad '':audio_0066 for stream 0xaf0a2240
I/GStreamer+GST_ELEMENT_PADS(16393): 0:00:05.831879503 0x9e236660 gstelement.c:646:gst_element_add_pad:<demux> adding pad 'audio_0066'
D/GStreamer+GST_REFCOUNTING(16393): 0:00:05.831936544 0x9e236660 gstobject.c:692:gst_object_set_parent:<'':audio_0066> set parent (ref and sink)
I/GLib+stdout(16393):  In dynamic ADDING PAD audio_0066
I/GLib+stdout(16393): //////////-6//////////
I/GLib+stdout(16393): Audio link refused!
I/GLib+stdout(16393): Sink pad link: 'audio_0066'
D/GStreamer+tsdemux(16393): 0:00:05.832146503 0x9e236660 tsdemux.c:1599:activate_pad_for_stream:<demux:audio_0066> done adding pad

The full debug (gstreamer related) is on this link, as it weighs ~20MB: https://www.dropbox.com/s/gied1nqdov3uitu/android_debug_full_log.txt?dl=0

Thanks for your time,

Dani

El 31/05/16 a las 08:20, Sebastian Dröge escribió:
On Mo, 2016-05-30 at 10:22 +0200, Dani wrote:
Thanks, I was working on how to get the full debug, after coding inside the function JNI_OnLoad these instructions:

setenv("GST_DEBUG", "*:5", 1);
setenv("GST_DEBUG_NO_COLOR", "1", 1);
This is the debug log I get (I think I have copied the full log related to this issue):
[...]
Thanks, can you get the same with debug level 6? This one here does not
contain many lines that should be there about the pad linking process,
but a few of those should already be there with 5.

In any case it's failing to link the pad not for one of the common
reasons, but for the "fallback" error case GST_PAD_LINK_REFUSED



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Sebastian Dröge-3
On Di, 2016-05-31 at 10:30 +0200, Dani wrote:

> I/GLib+stdout(16393):  In dynamic ADDING PAD audio_0066 
> I/GLib+stdout(16393): //////////-6////////// 
> I/GLib+stdout(16393): Audio link refused! 
> I/GLib+stdout(16393): Sink pad link: 'audio_0066' 
> D/GStreamer+tsdemux(16393): 0:00:05.832146503 0x9e236660
> tsdemux.c:1599:activate_pad_for_stream:<demux:audio_0066> done adding
> pad

That's still not very useful unfortunately. Can you show your code, and
if it's still like last time please only try linking the pads once and
then just print the return value of gst_pad_link(). Feel free to print
it as an integer too instead of having all the if-else cases there.

However your code should really print a lot of debug output because of
the 7 links it should be doing before printing the "link refused"
message.


Also unrelated to all this, use queue and not queue2 in your pipeline.
queue2 is mostly for network buffering, not thread decoupling :)

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Dani MR
Thanks for your answer, these are the changes I have done to the code:
static void dynamic_addpad(GstElement *src, GstPad *new_pad, CustomData *data) {
    char* pad_name = gst_pad_get_name(new_pad);
    g_print(" In dynamic ADDING PAD %s\n", pad_name);

    if (g_str_has_prefix(pad_name,"audio")) {
        GstElement *q_audio;// = (GstElement *)data->queue_audio;
        q_audio = gst_bin_get_by_name (GST_BIN(data->pipeline), "queue_audio");
        GstPad *audiodemuxsink = gst_element_get_static_pad(q_audio,"sink");
        GstPadLinkReturn ret = gst_pad_link(new_pad, audiodemuxsink);
        g_print("'%s' dynamic link returns: %d\n", pad_name, (int) ret);
        gst_object_unref(q_audio);
    }
    else if (g_str_has_prefix(pad_name,"video")) {
        GstElement *q_video;// = (GstElement *) data->queue_video;
        q_video = gst_bin_get_by_name(GST_BIN(data->pipeline), "queue_video");
        GstPad *videodemuxsink = gst_element_get_static_pad(q_video,"sink");
        GstPadLinkReturn ret = gst_pad_link(new_pad,videodemuxsink);
        g_print("'%s' dynamic link returns: %d\n", pad_name, (int) ret);
        gst_object_unref(q_video);
    }
}

static void *app_function (void *userdata) {
    JavaVMAttachArgs args;
    GstBus *bus;
    CustomData *data = (CustomData *)userdata;
    GSource *timeout_source;
    GSource *bus_source;
    GError *error = NULL;
    guint flags;

    GST_DEBUG ("Creating pipeline in CustomData at %p", data);

    /* Create our own GLib Main Context and make it the default one */
    data->context = g_main_context_new ();
    g_main_context_push_thread_default(data->context);

    /* Build pipeline */
    data->pipeline = gst_pipeline_new ("pipeline");
    data->httpsrc = gst_element_factory_make ("souphttpsrc", "http_src");
    data->tsdemux = gst_element_factory_make ("tsdemux", "demux");
    data->queue_video = gst_element_factory_make("queue", "queue_video");
    data->h264parse = gst_element_factory_make ("h264parse", "h264_parse");
    data->h264dec = gst_element_factory_make ("avdec_h264", "h264dec");
    data->video_convert = gst_element_factory_make("videoconvert","video_convert");
    data->videosink = gst_element_factory_make ("glimagesink", "video_sink");
    data->queue_audio = gst_element_factory_make ("queue", "queue_audio");
    data->aacparse = gst_element_factory_make ("aacparse", "aacparse");
    data->faad = gst_element_factory_make ("faad", "faad");
    data->audio_convert = gst_element_factory_make("audioconvert", "audio_convert");
    data->audiosink = gst_element_factory_make ("autoaudiosink", "audio_sink");

    g_signal_connect (data->tsdemux, "pad-added", G_CALLBACK (dynamic_addpad), &data);

    gst_bin_add_many(GST_BIN(data->pipeline), data->httpsrc, data->tsdemux, data->queue_video, data->h264parse, data->h264dec, data->video_convert, data->videosink, data->queue_audio, data->aacparse, data->faad, data->audio_convert, data->audiosink, NULL);

    gst_element_link(data->httpsrc, data->tsdemux);
    gst_element_link_many(data->queue_video, data->h264parse, data->h264dec, data->video_convert, data->videosink, NULL);
    gst_element_link_many(data->queue_audio, data->aacparse, data->faad, data->audio_convert, data->audiosink, NULL);

    GstElement *http_src;
    http_src = gst_bin_get_by_name(GST_BIN(data->pipeline), "http_src");
    g_object_set(G_OBJECT(http_src), "location", "http://192.168.0.32/videos/video.ts", NULL);
    gst_object_unref(http_src);

    if (error) {
        gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
        g_clear_error (&error);
        set_ui_message(message, data);
        g_free (message);
        return NULL;
    }

    /* Disable subtitles */
    /*g_object_get (data->pipeline, "flags", &flags, NULL);
    flags &= ~GST_PLAY_FLAG_TEXT;
    g_object_set (data->pipeline, "flags", flags, NULL);
*/
    /* Set the pipeline to READY, so it can already accept a window handle, if we have one */
    data->target_state = GST_STATE_READY;
    gst_element_set_state(data->pipeline, GST_STATE_READY);

    /* Instruct the bus to emit signals for each received message, and connect to the interesting signals */
    bus = gst_element_get_bus (data->pipeline);
    bus_source = gst_bus_create_watch (bus);
    g_source_set_callback (bus_source, (GSourceFunc) gst_bus_async_signal_func, NULL, NULL);
    g_source_attach (bus_source, data->context);
    g_source_unref (bus_source);
    g_signal_connect (G_OBJECT (bus), "message::error", (GCallback)error_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::eos", (GCallback)eos_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::state-changed", (GCallback)state_changed_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::duration", (GCallback)duration_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::buffering", (GCallback)buffering_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::clock-lost", (GCallback)clock_lost_cb, data);
    gst_object_unref (bus);

    /* Register a function that GLib will call 4 times per second */
    timeout_source = g_timeout_source_new (250);
    g_source_set_callback (timeout_source, (GSourceFunc)refresh_ui, data, NULL);
    g_source_attach (timeout_source, data->context);
    g_source_unref (timeout_source);

    /* Create a GLib Main Loop and set it to run */
    GST_DEBUG ("Entering main loop... (CustomData:%p)", data);
    data->main_loop = g_main_loop_new (data->context, FALSE);
    check_initialization_complete (data);
    g_main_loop_run (data->main_loop);
    GST_DEBUG ("Exited main loop");
    g_main_loop_unref (data->main_loop);
    data->main_loop = NULL;

    /* Free resources */
    g_main_context_pop_thread_default(data->context);
    g_main_context_unref (data->context);
    data->target_state = GST_STATE_NULL;
    gst_element_set_state (data->pipeline, GST_STATE_NULL);
    gst_object_unref (data->pipeline);

    return NULL;
}
The full debug has been uploaded to this link: https://www.dropbox.com/s/bujeg6sc4381dtr/logcat060620160943.txt?dl=0 If it may have to do something with this issue, I am using ubuntu 14.04 64b, Android Studio 1.5.1 (December 1st 2015 built) and ndk r10e-rc4 (64-bit). The gradle version is 2.8 and the android plugin version is 1.5.0. Thanks for your time, Dani
El 03/06/16 a las 07:47, Sebastian Dröge escribió:
On Di, 2016-05-31 at 10:30 +0200, Dani wrote:
 
I/GLib+stdout(16393):  In dynamic ADDING PAD audio_0066 
I/GLib+stdout(16393): //////////-6////////// 
I/GLib+stdout(16393): Audio link refused! 
I/GLib+stdout(16393): Sink pad link: 'audio_0066' 
D/GStreamer+tsdemux(16393): 0:00:05.832146503 0x9e236660
tsdemux.c:1599:activate_pad_for_stream:<demux:audio_0066> done adding
pad
That's still not very useful unfortunately. Can you show your code, and
if it's still like last time please only try linking the pads once and
then just print the return value of gst_pad_link(). Feel free to print
it as an integer too instead of having all the if-else cases there.

However your code should really print a lot of debug output because of
the 7 links it should be doing before printing the "link refused"
message.


Also unrelated to all this, use queue and not queue2 in your pipeline.
queue2 is mostly for network buffering, not thread decoupling :)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Sebastian Dröge-3
On Mo, 2016-06-06 at 10:06 +0200, Dani wrote:
> Thanks for your answer, these are the changes I have done to the
> code:
> [...]
> The full debug has been uploaded to this link:
> https://www.dropbox.com/s/bujeg6sc4381dtr/logcat060620160943.txt?dl=0
> If it may have to do something with this issue, I am using ubuntu
> 14.04 64b, Android Studio 1.5.1 (December 1st 2015 built) and ndk
> r10e-rc4 (64-bit). The gradle version is 2.8 and the android plugin
> version is 1.5.0. Thanks for your time, Dani

Try using a stable GStreamer version, 1.6.x or 1.8.x for example.


The log still does not contain anything meaningful, but the only way
how this can fail like this if either one of the two pads is NULL or
the first is not a source pad, or the second is not a sink pad.
Please check if you have two valid pad pointers there.

If that all does not help, please try to write a minimal testcase for
this problem so someone can reproduce it. Ideally a command line
application that also runs outside Android.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: changing souphttpsrc location property on android

Dani MR
In reply to this post by Dani MR
I have been able to solve this problem by changing this instruction:
g_signal_connect (data->demux, "pad-added", G_CALLBACK (dynamic_addpad), &data);
For this one, slightly different (no &):
g_signal_connect (data->demux, "pad-added", G_CALLBACK (dynamic_addpad), data);
This way the manual pipeline works perfectly!

Regards,

Dani

El 06/06/16 a las 10:06, Dani escribió:
Thanks for your answer, these are the changes I have done to the code:
static void dynamic_addpad(GstElement *src, GstPad *new_pad, CustomData *data) {
    char* pad_name = gst_pad_get_name(new_pad);
    g_print(" In dynamic ADDING PAD %s\n", pad_name);

    if (g_str_has_prefix(pad_name,"audio")) {
        GstElement *q_audio;// = (GstElement *)data->queue_audio;
        q_audio = gst_bin_get_by_name (GST_BIN(data->pipeline), "queue_audio");
        GstPad *audiodemuxsink = gst_element_get_static_pad(q_audio,"sink");
        GstPadLinkReturn ret = gst_pad_link(new_pad, audiodemuxsink);
        g_print("'%s' dynamic link returns: %d\n", pad_name, (int) ret);
        gst_object_unref(q_audio);
    }
    else if (g_str_has_prefix(pad_name,"video")) {
        GstElement *q_video;// = (GstElement *) data->queue_video;
        q_video = gst_bin_get_by_name(GST_BIN(data->pipeline), "queue_video");
        GstPad *videodemuxsink = gst_element_get_static_pad(q_video,"sink");
        GstPadLinkReturn ret = gst_pad_link(new_pad,videodemuxsink);
        g_print("'%s' dynamic link returns: %d\n", pad_name, (int) ret);
        gst_object_unref(q_video);
    }
}

static void *app_function (void *userdata) {
    JavaVMAttachArgs args;
    GstBus *bus;
    CustomData *data = (CustomData *)userdata;
    GSource *timeout_source;
    GSource *bus_source;
    GError *error = NULL;
    guint flags;

    GST_DEBUG ("Creating pipeline in CustomData at %p", data);

    /* Create our own GLib Main Context and make it the default one */
    data->context = g_main_context_new ();
    g_main_context_push_thread_default(data->context);

    /* Build pipeline */
    data->pipeline = gst_pipeline_new ("pipeline");
    data->httpsrc = gst_element_factory_make ("souphttpsrc", "http_src");
    data->tsdemux = gst_element_factory_make ("tsdemux", "demux");
    data->queue_video = gst_element_factory_make("queue", "queue_video");
    data->h264parse = gst_element_factory_make ("h264parse", "h264_parse");
    data->h264dec = gst_element_factory_make ("avdec_h264", "h264dec");
    data->video_convert = gst_element_factory_make("videoconvert","video_convert");
    data->videosink = gst_element_factory_make ("glimagesink", "video_sink");
    data->queue_audio = gst_element_factory_make ("queue", "queue_audio");
    data->aacparse = gst_element_factory_make ("aacparse", "aacparse");
    data->faad = gst_element_factory_make ("faad", "faad");
    data->audio_convert = gst_element_factory_make("audioconvert", "audio_convert");
    data->audiosink = gst_element_factory_make ("autoaudiosink", "audio_sink");

    g_signal_connect (data->tsdemux, "pad-added", G_CALLBACK (dynamic_addpad), &data);

    gst_bin_add_many(GST_BIN(data->pipeline), data->httpsrc, data->tsdemux, data->queue_video, data->h264parse, data->h264dec, data->video_convert, data->videosink, data->queue_audio, data->aacparse, data->faad, data->audio_convert, data->audiosink, NULL);

    gst_element_link(data->httpsrc, data->tsdemux);
    gst_element_link_many(data->queue_video, data->h264parse, data->h264dec, data->video_convert, data->videosink, NULL);
    gst_element_link_many(data->queue_audio, data->aacparse, data->faad, data->audio_convert, data->audiosink, NULL);

    GstElement *http_src;
    http_src = gst_bin_get_by_name(GST_BIN(data->pipeline), "http_src");
    g_object_set(G_OBJECT(http_src), "location", "http://192.168.0.32/videos/video.ts", NULL);
    gst_object_unref(http_src);

    if (error) {
        gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message);
        g_clear_error (&error);
        set_ui_message(message, data);
        g_free (message);
        return NULL;
    }

    /* Disable subtitles */
    /*g_object_get (data->pipeline, "flags", &flags, NULL);
    flags &= ~GST_PLAY_FLAG_TEXT;
    g_object_set (data->pipeline, "flags", flags, NULL);
*/
    /* Set the pipeline to READY, so it can already accept a window handle, if we have one */
    data->target_state = GST_STATE_READY;
    gst_element_set_state(data->pipeline, GST_STATE_READY);

    /* Instruct the bus to emit signals for each received message, and connect to the interesting signals */
    bus = gst_element_get_bus (data->pipeline);
    bus_source = gst_bus_create_watch (bus);
    g_source_set_callback (bus_source, (GSourceFunc) gst_bus_async_signal_func, NULL, NULL);
    g_source_attach (bus_source, data->context);
    g_source_unref (bus_source);
    g_signal_connect (G_OBJECT (bus), "message::error", (GCallback)error_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::eos", (GCallback)eos_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::state-changed", (GCallback)state_changed_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::duration", (GCallback)duration_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::buffering", (GCallback)buffering_cb, data);
    g_signal_connect (G_OBJECT (bus), "message::clock-lost", (GCallback)clock_lost_cb, data);
    gst_object_unref (bus);

    /* Register a function that GLib will call 4 times per second */
    timeout_source = g_timeout_source_new (250);
    g_source_set_callback (timeout_source, (GSourceFunc)refresh_ui, data, NULL);
    g_source_attach (timeout_source, data->context);
    g_source_unref (timeout_source);

    /* Create a GLib Main Loop and set it to run */
    GST_DEBUG ("Entering main loop... (CustomData:%p)", data);
    data->main_loop = g_main_loop_new (data->context, FALSE);
    check_initialization_complete (data);
    g_main_loop_run (data->main_loop);
    GST_DEBUG ("Exited main loop");
    g_main_loop_unref (data->main_loop);
    data->main_loop = NULL;

    /* Free resources */
    g_main_context_pop_thread_default(data->context);
    g_main_context_unref (data->context);
    data->target_state = GST_STATE_NULL;
    gst_element_set_state (data->pipeline, GST_STATE_NULL);
    gst_object_unref (data->pipeline);

    return NULL;
}
The full debug has been uploaded to this link: https://www.dropbox.com/s/bujeg6sc4381dtr/logcat060620160943.txt?dl=0 If it may have to do something with this issue, I am using ubuntu 14.04 64b, Android Studio 1.5.1 (December 1st 2015 built) and ndk r10e-rc4 (64-bit). The gradle version is 2.8 and the android plugin version is 1.5.0. Thanks for your time, Dani
El 03/06/16 a las 07:47, Sebastian Dröge escribió:
On Di, 2016-05-31 at 10:30 +0200, Dani wrote:
 
I/GLib+stdout(16393):  In dynamic ADDING PAD audio_0066 
I/GLib+stdout(16393): //////////-6////////// 
I/GLib+stdout(16393): Audio link refused! 
I/GLib+stdout(16393): Sink pad link: 'audio_0066' 
D/GStreamer+tsdemux(16393): 0:00:05.832146503 0x9e236660
tsdemux.c:1599:activate_pad_for_stream:<demux:audio_0066> done adding
pad
That's still not very useful unfortunately. Can you show your code, and
if it's still like last time please only try linking the pads once and
then just print the return value of gst_pad_link(). Feel free to print
it as an integer too instead of having all the if-else cases there.

However your code should really print a lot of debug output because of
the 7 links it should be doing before printing the "link refused"
message.


Also unrelated to all this, use queue and not queue2 in your pipeline.
queue2 is mostly for network buffering, not thread decoupling :)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel