Don't understand error

Kenairod doriank at hotmail.fr
Fri Mar 28 09:36:25 PDT 2014


Well, here is the C code I'm using to create the Pipeline.

const gchar * serverIpAddress;

// .....

/* Main method for the native code. This is executed on its own thread. */
static void *app_function (void *userdata) {

// .....

  /* Build pipeline */
  const gchar * part1 = "tcpclientsrc host=";
  gchar* pipeline_definition;
  pipeline_definition = malloc(109); //Number of characters in the pipeline
definition
  strcpy(pipeline_definition, part1); // copy the part 1 into the new var
  strcat(pipeline_definition, serverIpAddress); // add the ip address
  const gchar *  part2 = " port=5000 ! gdpdepay ! rtph264depay ! ffdec_h264
! autovideosink sync=false";
  strcat(pipeline_definition, part2);

  data->pipeline = gst_parse_launch(pipeline_definition, &error);

// .....

}

JNIEXPORT void JNICALL
Java_com_gst_sdk_tutorials_tutorial_3_Tutorial3_nativeSetIpserver(JNIEnv *
env, jobject obj, jstring ipAddress)
{
        const char *temp = (*env)->GetStringUTFChars(env, ipAddress, 0);
        serverIpAddress = temp;
        (*env)->ReleaseStringUTFChars(env, ipAddress, temp);
}

/* List of implemented native methods */
static JNINativeMethod native_methods[] = {

        // .....

  { "nativeSetIpserver", "(Ljava/lang/String;)V", (void *)
Java_com_gst_sdk_tutorials_tutorial_3_Tutorial3_nativeSetIpserver}
};




And here is my Android code :

public class Tutorial3 extends Activity implements SurfaceHolder.Callback {

        // .....

    private native void nativeSetIpserver(String ip);

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        // Initialize the connection for the commands
        Intent intent = getIntent();
	String address = intent.getStringExtra(AddressActivity.EXTRA_MESSAGE);
		
	nativeSetIpserver(address);
        
        // Initialize GStreamer and warn if it fails
        try {
            GStreamer.init(this);
        } catch (Exception e) {
            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
            finish(); 
            return;
        }

        setContentView(R.layout.main);

        nativePlay();

        SurfaceView sv = (SurfaceView)
this.findViewById(R.id.surface_video);
        SurfaceHolder sh = sv.getHolder();
        sh.addCallback(this);

        nativeInit();
    }


As I get this error, I don't think I'm using the right method, but I don't
see other ways to pass the IP address to the Pipeline...



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Don-t-understand-error-tp4666168p4666171.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list