Skip to content

Commit f968062

Browse files
committed
initial
0 parents  commit f968062

File tree

21 files changed

+450
-0
lines changed

21 files changed

+450
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# FFmpeg shared libraries
2+
FFmpegWrapper/libs/armeabi
3+
4+
local.properties
5+
*.iml
6+
gen
7+
.gradle/
8+
lint.xml
9+
.DS_STORE
10+
.idea/
11+
build
12+
*.class
13+
obj

FFmpegWrapper/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jni/include/*
2+
/build

FFmpegWrapper/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'com.android.tools.build:gradle:0.5.+'
7+
}
8+
}
9+
apply plugin: 'android'
10+
11+
repositories {
12+
mavenCentral()
13+
}
14+
15+
android {
16+
compileSdkVersion 18
17+
buildToolsVersion "18.1.1"
18+
19+
defaultConfig {
20+
minSdkVersion 8
21+
targetSdkVersion 18
22+
}
23+
}
24+
25+
dependencies {
26+
}

FFmpegWrapper/jni/Android.mk

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
LOCAL_PATH := $(call my-dir)
2+
3+
include $(CLEAR_VARS)
4+
5+
# TODO: Observe $(TARGET_ARCH) and adjust appropriately. For now, we only have armeabi libraries
6+
7+
# Prebuilt FFmpeg
8+
9+
LOCAL_MODULE:= libavcodec
10+
LOCAL_SRC_FILES:= ../libs/armeabi/lib/libavcodec-55.so
11+
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
12+
include $(PREBUILT_SHARED_LIBRARY)
13+
14+
include $(CLEAR_VARS)
15+
16+
LOCAL_MODULE:= libavfilter
17+
LOCAL_SRC_FILES:= ../libs/armeabi/lib/libavfilter-3.so
18+
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
19+
include $(PREBUILT_SHARED_LIBRARY)
20+
21+
include $(CLEAR_VARS)
22+
23+
LOCAL_MODULE:= libavformat
24+
LOCAL_SRC_FILES:= ../libs/armeabi/lib/libavformat-55.so
25+
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
26+
include $(PREBUILT_SHARED_LIBRARY)
27+
28+
include $(CLEAR_VARS)
29+
30+
LOCAL_MODULE:= libavutil
31+
LOCAL_SRC_FILES:= ../libs/armeabi/lib/libavutil-52.so
32+
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
33+
include $(PREBUILT_SHARED_LIBRARY)
34+
35+
include $(CLEAR_VARS)
36+
37+
LOCAL_MODULE:= libswresample
38+
LOCAL_SRC_FILES:= ../libs/armeabi/lib/libswresample-0.so
39+
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
40+
include $(PREBUILT_SHARED_LIBRARY)
41+
42+
include $(CLEAR_VARS)
43+
44+
LOCAL_MODULE:= libswscale
45+
LOCAL_SRC_FILES:= ../libs/armeabi/lib/libswscale-2.so
46+
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
47+
include $(PREBUILT_SHARED_LIBRARY)
48+
49+
# Our Wrapper
50+
51+
include $(CLEAR_VARS)
52+
53+
LOCAL_LDLIBS += -llog -lz
54+
LOCAL_SHARED_LIBRARIES := libavformat libavcodec libswscale libavutil
55+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
56+
LOCAL_SRC_FILES := FFmpegWrapper.c
57+
LOCAL_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon
58+
LOCAL_MODULE := FFmpegWrapper
59+
60+
include $(BUILD_SHARED_LIBRARY)

FFmpegWrapper/jni/FFmpegWrapper.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <jni.h>
2+
#include <android/log.h>
3+
4+
5+
#define LOG_TAG "FFmpegWrapper"
6+
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
7+
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
8+
9+
void Java_net_openwatch_FFmpegWrapper_FFmpegWrapper_test(JNIEnv * env, jobject this){
10+
LOGI("What's up?");
11+
}

FFmpegWrapper/libs/WHEREARETHELIBS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please see [FFmpeg-Android](https://github.com/OnlyInAmerica/FFmpeg-Android) repository for directions on how to generate the shared libraries for this project.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="net.openwatch.ffmpegwrapper"
3+
android:versionCode="1"
4+
android:versionName="1.0">
5+
6+
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" />
7+
8+
<application android:allowBackup="true"
9+
android:label="@string/app_name"
10+
android:icon="@drawable/ic_launcher"
11+
android:theme="@style/AppTheme">
12+
13+
</application>
14+
15+
</manifest>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package net.openwatch.ffmpegwrapper;
2+
3+
/**
4+
* Created by davidbrodsky on 10/17/13.
5+
*/
6+
public class FFmpegWrapper {
7+
8+
static {
9+
System.loadLibrary("FFmpegWrapper");
10+
}
11+
12+
public static native void test();
13+
}
9.18 KB
Loading
5.11 KB
Loading

0 commit comments

Comments
 (0)