Thanks for your help.<br><br>We tried to write a script and used  setenv to set the PATH for environment variable but it is not working. <br>We
 tried to call setenv inside gst-launch.c  and also inside the script 
file to set the PATH for the environment variables but it did not work.<br>

>From the JNI layer from the native code from we tried to call the main 
function of the gst-launch.c passing the command line arguments for 
gst-launch command as string variables. Before calling the main function
 we have set all the environment variables using setenv.But still this 
option also didn't work.<br>

<br>This is the code snippet for the caling the gst-launc main function inside JNI layer<br><br>JNIEXPORT void JNICALL Java_uk_co_videokit_gstreamer_<blockquote class="gmail_quote">Gstreamer_run(JNIEnv *env, jobject obj, jobjectArray args)<br>
{<br>        LOGD("run() called");<br>

        int i = 0;<br>        int argc = 0;<br>        char **argv = NULL;<br>        setenv ("GST_REGISTRY", "/data/data/videokit.gstream/cache/registry.bin", 1);<br>        setenv ("GST_PLUGIN_PATH", "/data/data/videokit.gstream/lib", 1);<br>


        setenv ("LD_LIBRARY_PATH", "/data/data/videokit.gstream/lib",1);<br>        setenv ("PATH", "/data/data/videokit.gstream/bin",1);<br>        setenv ("GST_PLUGIN_SCANNER","/data/data/videokit.gstream/bin/gst-plugin-scanner",1);<br>


        setenv ("GST_OMX_CONFIG_DIR","/data/data/videokit.gstream/conf",1);<br><br>        if (args != NULL) {<br>                argc = (*env)->GetArrayLength(env, args);<br>                argv = (char **) malloc(sizeof(char *) * argc);<br>


<br>                for(i=0;i<argc;i++)<br>                {<br>                        jstring str = (jstring)(*env)->GetObjectArrayElement(env, args, i);<br>                        argv[i] = (char *)(*env)->GetStringUTFChars(env, str, NULL);<br>


                                  }<br>        }<br><br>        LOGD("run passing off to main()");<br>main(argc,argv);<br>}<br><br><br><br>Regards<span><font color="#888888"><br>Anees</font></span><div>
<div><br></div></div></blockquote><br><br><div class="gmail_quote">On Tue, Jul 3, 2012 at 7:13 PM, Anees Alappat <span dir="ltr"><<a href="mailto:aneesalappatt@gmail.com" target="_blank">aneesalappatt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for your help.<br><br>We tried to write a script and used  setenv to set the PATH for environment variable but it is not working. <br>We tried to call setenv inside gst-launch.c  and also inside the script file to set the PATH for the environment variables but it did not work.<br>


>From the JNI layer from the native code from we tried to call the main function of the gst-launch.c passing the command line arguments for gst-launch command as string variables. Before calling the main function we have set all the environment variables using setenv.But still this option also didn't work.<br>


<br>This is the code snippet for the caling the gst-launc main function inside JNI layer<br><br>JNIEXPORT void JNICALL Java_uk_co_videokit_gstreamer_Gstreamer_run(JNIEnv *env, jobject obj, jobjectArray args)<br>{<br>        LOGD("run() called");<br>


        int i = 0;<br>        int argc = 0;<br>        char **argv = NULL;<br>        setenv ("GST_REGISTRY", "/data/data/videokit.gstream/cache/registry.bin", 1);<br>        setenv ("GST_PLUGIN_PATH", "/data/data/videokit.gstream/lib", 1);<br>


        setenv ("LD_LIBRARY_PATH", "/data/data/videokit.gstream/lib",1);<br>        setenv ("PATH", "/data/data/videokit.gstream/bin",1);<br>        setenv ("GST_PLUGIN_SCANNER","/data/data/videokit.gstream/bin/gst-plugin-scanner",1);<br>


        setenv ("GST_OMX_CONFIG_DIR","/data/data/videokit.gstream/conf",1);<br><br>        if (args != NULL) {<br>                argc = (*env)->GetArrayLength(env, args);<br>                argv = (char **) malloc(sizeof(char *) * argc);<br>


<br>                for(i=0;i<argc;i++)<br>                {<br>                        jstring str = (jstring)(*env)->GetObjectArrayElement(env, args, i);<br>                        argv[i] = (char *)(*env)->GetStringUTFChars(env, str, NULL);<br>


                                  }<br>        }<br><br>        LOGD("run passing off to main()");<br>main(argc,argv);<br>}<br><br><br><br>Regards<span><font color="#888888"><br>Anees</font></span><div>
<div><br><br><div class="gmail_quote">On Tue, Jul 3, 2012 at 10:11 AM, Anees Alappat <span dir="ltr"><<a href="mailto:aneesalappatt@gmail.com" target="_blank">aneesalappatt@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr"><<a href="mailto:gstreamer-android-request@lists.freedesktop.org" target="_blank">gstreamer-android-request@lists.freedesktop.org</a>></span><br>



Date: Tue, Jul 3, 2012 at 12:30 AM<br>Subject: gstreamer-android Digest, Vol 14, Issue 1<br>To: <a href="mailto:gstreamer-android@lists.freedesktop.org" target="_blank">gstreamer-android@lists.freedesktop.org</a><br><br>


<br>Send gstreamer-android mailing list submissions to<br>

        <a href="mailto:gstreamer-android@lists.freedesktop.org" target="_blank">gstreamer-android@lists.freedesktop.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-android" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-android</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:gstreamer-android-request@lists.freedesktop.org" target="_blank">gstreamer-android-request@lists.freedesktop.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:gstreamer-android-owner@lists.freedesktop.org" target="_blank">gstreamer-android-owner@lists.freedesktop.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of gstreamer-android digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. gstreamer running on Android app? (Anees Alappat)<br>
   2. Re: gstreamer running on Android app? (Enrique Oca?a Gonz?lez)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 2 Jul 2012 17:42:15 +0530<br>
From: Anees Alappat <<a href="mailto:aneesalappatt@gmail.com" target="_blank">aneesalappatt@gmail.com</a>><br>
To: <a href="mailto:gstreamer-android@lists.freedesktop.org" target="_blank">gstreamer-android@lists.freedesktop.org</a><br>
Subject: gstreamer running on Android app?<br>
Message-ID:<br>
        <<a href="mailto:CAJYLsdkBszkZzyCPuWuQtO0GMtG4oQGj8u%2BGggOh3gpuVz_gig@mail.gmail.com" target="_blank">CAJYLsdkBszkZzyCPuWuQtO0GMtG4oQGj8u+GggOh3gpuVz_gig@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi,<br>
We could succesfully port Gstreamer framework to Android going through the<br>
link<br>
<a href="http://gstreamer.freedesktop.org/wiki/GstreamerAndroid_InstallInstructions" target="_blank">http://gstreamer.freedesktop.org/wiki/GstreamerAndroid_InstallInstructions</a><br>
<br>
Through adb shell, we could run gstreamer commands to view mp4 files as<br>
well as mpegts files using gst-launch command. To view the video/ausio, we<br>
used audioflingersink as well as surfaceflingersink.<br>
For this purpose, all the gstreamer related environment variables have to<br>
be exported manually through the adb shell.<br>
We would like to run the gst-launch as an application in the Android phone<br>
without exporting the variables using adb shell. Is there any method for<br>
this?<br>
<br>
I am exporting the following below mentioned environment variables in the<br>
adb shell.<br>
<br>
export LD_LIBRARY_PATH=/data/data/com.android.freedesktop.gstreamer/lib/<br>
<br>
export PATH=/data/data/com.android.freedesktop.gstreamer/bin:$PATH<br>
<br>
export GST_PLUGIN_PATH=/data/data/com.android.freedesktop.gstreamer/lib/<br>
<br>
export<br>
GST_PLUGIN_SCANNER=/data/data/com.android.freedesktop.gstreamer/bin/gst-plugin-scanner<br>
<br>
export GST_OMX_CONFIG_DIR=/data/data/com.android.freedesktop.gstreamer/conf/<br>
<br>
export GST_REGISTRY_REUSE_PLUGIN_SCANNER=no<br>
<br>
Thanks & Regards<br>
Anees<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.freedesktop.org/archives/gstreamer-android/attachments/20120702/24f4c169/attachment-0001.html" target="_blank">http://lists.freedesktop.org/archives/gstreamer-android/attachments/20120702/24f4c169/attachment-0001.html</a>><br>




<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 2 Jul 2012 15:53:00 +0200<br>
From: Enrique Oca?a Gonz?lez <<a href="mailto:eocanha@igalia.com" target="_blank">eocanha@igalia.com</a>><br>
To: <a href="mailto:gstreamer-android@lists.freedesktop.org" target="_blank">gstreamer-android@lists.freedesktop.org</a><br>
Subject: Re: gstreamer running on Android app?<br>
Message-ID: <<a href="mailto:201207021553.00470.eocanha@igalia.com" target="_blank">201207021553.00470.eocanha@igalia.com</a>><br>
Content-Type: Text/Plain;  charset="iso-8859-15"<br>
<br>
On Lunes, 2 de Julio de 2012 14:12:15 Anees Alappat escribi?:<br>
<br>
> For this purpose, all the gstreamer related environment variables have to<br>
> be exported manually through the adb shell.<br>
> We would like to run the gst-launch as an application in the Android phone<br>
> without exporting the variables using adb shell. Is there any method for<br>
> this?<br>
<br>
Maybe some of these suggestions could be useful to you:<br>
<br>
- Writing a wrapper in shell script (eg: gst-launch.sh) that does the variable<br>
exports before calling the actual gst-launch executable. Execute the script<br>
invoking /system/bin/sh <script-name>.<br>
- Writing a wrapper C program that does the variable exports using setenv()<br>
and then exec() the actual executable.<br>
- Modify the gst-launch sources to add the setenv()s there.<br>
<br>
Cheers.<br>
<br>
--<br>
Enrique Oca?a<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
gstreamer-android mailing list<br>
<a href="mailto:gstreamer-android@lists.freedesktop.org" target="_blank">gstreamer-android@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-android" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-android</a><br>
<br>
<br>
End of gstreamer-android Digest, Vol 14, Issue 1<br>
************************************************<br>
</div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>