mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
Initial tutorial-1
This commit is contained in:
parent
d72831ea72
commit
ef7757b7ca
6 changed files with 136 additions and 0 deletions
17
gst-sdk/tutorials/android-tutorial-1/AndroidManifest.xml
Executable file
17
gst-sdk/tutorials/android-tutorial-1/AndroidManifest.xml
Executable file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.gst_sdk_tutorials.tutorial_1"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<uses-sdk android:minSdkVersion="3" />
|
||||
<application android:label="@string/app_name"
|
||||
android:debuggable="true">
|
||||
<activity android:name=".Tutorial1"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
14
gst-sdk/tutorials/android-tutorial-1/default.properties
Normal file
14
gst-sdk/tutorials/android-tutorial-1/default.properties
Normal file
|
@ -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
|
29
gst-sdk/tutorials/android-tutorial-1/jni/Android.mk
Executable file
29
gst-sdk/tutorials/android-tutorial-1/jni/Android.mk
Executable file
|
@ -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
|
||||
|
27
gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c
Executable file
27
gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c
Executable file
|
@ -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 <string.h>
|
||||
#include <jni.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
jstring
|
||||
Java_com_gst_1sdk_1tutorials_tutorial_11_Tutorial1_gstVersion (JNIEnv* env,
|
||||
jobject thiz )
|
||||
{
|
||||
return (*env)->NewStringUTF(env, gst_version_string());
|
||||
}
|
||||
|
4
gst-sdk/tutorials/android-tutorial-1/res/values/strings.xml
Executable file
4
gst-sdk/tutorials/android-tutorial-1/res/values/strings.xml
Executable file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Android tutorial 1</string>
|
||||
</resources>
|
|
@ -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");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue