Gstreamer hangs application for 2 minutes on first usage of nativePlay or nativePause

Matthew Ruth mruth at sbimagingsystems.com
Thu Feb 4 15:49:38 PST 2016


I'm unable to redirect Gstreamer debug to logcat in Android Studio, even using "setenv("GST_DEBUG","GST_ELEMENT_*:7",NULL);" in c, and redirecting the device stderr to logcat through "adb shell setprop log.redirect-studio true", so I'm unable to access all gstreamer debug statements, however I do have GST_DEBUG() statements in my c code.

A little more info: I'm toggling a stream on and off, using nativePlay() and nativePause(). Normally on the first try I will toggle on, the app will freeze/hang for about 2 minutes right after calling nativePlay() (shown through debug), then eventually the app will come back with "state changed to pause", then "state changed to pause" again. From here calling nativePlay() is successful with no hang whatsoever.
________________________________________
From: gstreamer-android [gstreamer-android-bounces at lists.freedesktop.org] on behalf of Matthew Ruth [mruth at sbimagingsystems.com]
Sent: Thursday, February 04, 2016 12:38 PM
To: Discussions about GStreamer on Android
Subject: RE: Gstreamer hangs application for 2 minutes on first usage of nativePlay or nativePause

I'll enable the debug logs and see if Android Studio can pick up anything, but since it's hanging the app I'm not sure if it'll able to run the log statements properly. Moreso, I know it's on the call to nativePlay() because when I comment that line out it runs very smoothly, unless it's the case that the nativePlay() call is actually calling nativeInit() first?
________________________________________
From: gstreamer-android [gstreamer-android-bounces at lists.freedesktop.org] on behalf of Sebastian Dröge [sebastian at centricular.com]
Sent: Tuesday, February 02, 2016 3:48 PM
To: Discussions about GStreamer on Android
Subject: Re: Gstreamer hangs application for 2 minutes on first usage of nativePlay or nativePause

On Di, 2016-02-02 at 23:28 +0000, Matthew Ruth wrote:
> As the title states, I have a gstreamer application that is working
> on Android Studio. I'm using a Gstreamer pipeline to stream video
> wirelessly, and it works well each time except for the first time I
> call one of the native functions nativePlay or nativePause. I thought
> it had to do with actually initializing Gstreamer but I see that
> Gstreamer is initialized for me before onResume, so it should be
> initialized before I attempt to call these functions.
>
> My question is, what is it about the first function call of
> nativePlay() or nativePause() that is hanging my app for 2 minutes
> (Skipping 7,000 frames of video stream), but when it finishes and I
> try it again it works perfectly?
>
> Also, more importantly, how can I circumvent that wait time?

There should be no waiting time to begin with :) You'll have to debug
what exactly it's doing in that time, it shouldn't happen.

I would start by enabling debug logs in GStreamer and check where it
waits all the time. And are you sure it's nativePlay() and not
GStreamer.init()?

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

_______________________________________________
gstreamer-android mailing list
gstreamer-android at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-android


More information about the gstreamer-android mailing list