diff --git a/gst-sdk/tutorials/android-tutorial-1/AndroidManifest.xml b/gst-sdk/tutorials/android-tutorial-1/AndroidManifest.xml new file mode 100755 index 0000000000..1701aa602c --- /dev/null +++ b/gst-sdk/tutorials/android-tutorial-1/AndroidManifest.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/gst-sdk/tutorials/android-tutorial-1/default.properties b/gst-sdk/tutorials/android-tutorial-1/default.properties new file mode 100644 index 0000000000..85aac54016 --- /dev/null +++ b/gst-sdk/tutorials/android-tutorial-1/default.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-8 diff --git a/gst-sdk/tutorials/android-tutorial-1/jni/Android.mk b/gst-sdk/tutorials/android-tutorial-1/jni/Android.mk new file mode 100755 index 0000000000..b2a6cd3289 --- /dev/null +++ b/gst-sdk/tutorials/android-tutorial-1/jni/Android.mk @@ -0,0 +1,29 @@ +# Copyright (C) 2009 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := tutorial-1 +LOCAL_SRC_FILES := tutorial-1.c +LOCAL_LDLIBS := -L./ -lgstreamer_android +LOCAL_CFLAGS := $(shell pkg-config gstreamer-0.10 --cflags) +include $(BUILD_SHARED_LIBRARY) + +GSTREAMER_PLUGINS = coreelements +GSTREAMER_STATIC_PLUGINS_PATH=/home/fluendo/cerbero/dist/android_arm/lib/gstreamer-0.10/static +GSTREAMER_MK_PATH=/home/fluendo/cerbero/data/ndk-build/ +include $(GSTREAMER_MK_PATH)/gstreamer.mk + diff --git a/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c b/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c new file mode 100755 index 0000000000..076ced6c95 --- /dev/null +++ b/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include +#include +#include + +jstring +Java_com_gst_1sdk_1tutorials_tutorial_11_Tutorial1_gstVersion (JNIEnv* env, + jobject thiz ) +{ + return (*env)->NewStringUTF(env, gst_version_string()); +} + diff --git a/gst-sdk/tutorials/android-tutorial-1/res/values/strings.xml b/gst-sdk/tutorials/android-tutorial-1/res/values/strings.xml new file mode 100755 index 0000000000..b956d6d241 --- /dev/null +++ b/gst-sdk/tutorials/android-tutorial-1/res/values/strings.xml @@ -0,0 +1,4 @@ + + + Android tutorial 1 + diff --git a/gst-sdk/tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java b/gst-sdk/tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java new file mode 100755 index 0000000000..97e3a21144 --- /dev/null +++ b/gst-sdk/tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gst_sdk_tutorials.tutorial_1; + +import android.app.Activity; +import android.widget.TextView; +import android.os.Bundle; + +public class Tutorial1 extends Activity +{ + public native String gstVersion(); + + /* Called when the activity is first created. + @Override */ + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + /* Create a TextView and set its content. + * the text is retrieved by calling a native + * function. + */ + TextView tv = new TextView(this); + tv.setText( gstVersion() ); + setContentView(tv); + } + + static { + System.loadLibrary("gstreamer_android"); + System.loadLibrary("tutorial-1"); + } +}