Skip to content

Commit c8387f3

Browse files
committed
merge of experimental branch
2 parents 13486fa + e95e721 commit c8387f3

File tree

188 files changed

+2893
-30668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+2893
-30668
lines changed

Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LOCAL_PATH:= $(TOP_LOCAL_PATH)
1+
LOCAL_PATH := $(call my-dir)
22
include $(CLEAR_VARS)
33

44
LOCAL_SRC_FILES := $(call all-subdir-java-files)
@@ -12,6 +12,6 @@ include $(BUILD_PACKAGE)
1212
# ============================================================
1313

1414
# Also build all of the sub-targets under this one: the shared library.
15-
IN_NDK := false
15+
IN_NDK := true
1616
WITH_PLAYER := true
1717
include $(call all-makefiles-under,$(LOCAL_PATH))

AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</activity>
2626

2727
</application>
28-
<uses-sdk android:minSdkVersion="3" />
28+
<uses-sdk android:minSdkVersion="4" />
2929
<uses-permission android:name="android.permission.WAKE_LOCK"/>
3030
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
3131
</manifest>

Application.mk

Lines changed: 0 additions & 3 deletions
This file was deleted.

default.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system use,
7+
# "build.properties", and override values to adapt the script to your
8+
# project structure.
9+
10+
# Project target.
11+
target=android-4
12+
# Indicates whether an apk should be generated for each density.
13+
split.density=false

jni/Android.mk

100755100644
File mode changed.

jni/include/android/Errors.h

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Copyright (C) 2007 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ANDROID_ERRORS_H
18+
#define ANDROID_ERRORS_H
19+
20+
#include <sys/types.h>
21+
#include <errno.h>
22+
23+
namespace android {
24+
25+
// use this type to return error codes
26+
#ifdef HAVE_MS_C_RUNTIME
27+
typedef int status_t;
28+
#else
29+
typedef int32_t status_t;
30+
#endif
31+
32+
/* the MS C runtime lacks a few error codes */
33+
34+
/*
35+
* Error codes.
36+
* All error codes are negative values.
37+
*/
38+
39+
// Win32 #defines NO_ERROR as well. It has the same value, so there's no
40+
// real conflict, though it's a bit awkward.
41+
#ifdef _WIN32
42+
# undef NO_ERROR
43+
#endif
44+
45+
enum {
46+
OK = 0, // Everything's swell.
47+
NO_ERROR = 0, // No errors.
48+
49+
UNKNOWN_ERROR = 0x80000000,
50+
51+
NO_MEMORY = -ENOMEM,
52+
INVALID_OPERATION = -ENOSYS,
53+
BAD_VALUE = -EINVAL,
54+
BAD_TYPE = 0x80000001,
55+
NAME_NOT_FOUND = -ENOENT,
56+
PERMISSION_DENIED = -EPERM,
57+
NO_INIT = -ENODEV,
58+
ALREADY_EXISTS = -EEXIST,
59+
DEAD_OBJECT = -EPIPE,
60+
FAILED_TRANSACTION = 0x80000002,
61+
JPARKS_BROKE_IT = -EPIPE,
62+
#if !defined(HAVE_MS_C_RUNTIME)
63+
BAD_INDEX = -EOVERFLOW,
64+
NOT_ENOUGH_DATA = -ENODATA,
65+
WOULD_BLOCK = -EWOULDBLOCK,
66+
TIMED_OUT = -ETIMEDOUT,
67+
UNKNOWN_TRANSACTION = -EBADMSG,
68+
#else
69+
BAD_INDEX = -E2BIG,
70+
NOT_ENOUGH_DATA = 0x80000003,
71+
WOULD_BLOCK = 0x80000004,
72+
TIMED_OUT = 0x80000005,
73+
UNKNOWN_TRANSACTION = 0x80000006,
74+
#endif
75+
};
76+
77+
// Restore define; enumeration is in "android" namespace, so the value defined
78+
// there won't work for Win32 code in a different namespace.
79+
#ifdef _WIN32
80+
# define NO_ERROR 0L
81+
#endif
82+
83+
}; // namespace android
84+
85+
// ---------------------------------------------------------------------------
86+
87+
#endif // ANDROID_ERRORS_H

jni/include/android/audiotrack.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ int AndroidAudioTrack_register();
9393
int AndroidAudioTrack_set(int streamType,
9494
uint32_t sampleRate,
9595
int format,
96-
int channels,
97-
int buffSizeInBytes);
96+
int channels);
9897

9998
int AndroidAudioTrack_start();
10099

jni/include/android/surface.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (C) 2011 Petr Havlena [email protected]
23
* Copyright (C) 2009 The Android Open Source Project
34
*
45
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,13 +21,13 @@
2021
#include <stdint.h>
2122
#include <jni.h>
2223

23-
#define ANDROID_SURFACE_RESULT_SUCCESS 0
24-
#define ANDROID_SURFACE_RESULT_NOT_VALID -1
25-
#define ANDROID_SURFACE_RESULT_COULDNT_LOCK -2
26-
#define ANDROID_SURFACE_RESULT_COULDNT_UNLOCK_AND_POST -3
27-
#define ANDROID_SURFACE_RESULT_COULDNT_INIT_BITMAP_SURFACE -4
28-
#define ANDROID_SURFACE_RESULT_COULDNT_INIT_BITMAP_CLIENT -5
29-
#define ANDROID_SURFACE_RESULT_JNI_EXCEPTION -6
24+
#define ANDROID_SURFACE_RESULT_SUCCESS 0
25+
#define ANDROID_SURFACE_RESULT_NOT_VALID -1
26+
#define ANDROID_SURFACE_RESULT_COULDNT_LOCK -2
27+
#define ANDROID_SURFACE_RESULT_COULDNT_UNLOCK_AND_POST -3
28+
#define ANDROID_SURFACE_RESULT_COULDNT_INIT_BITMAP_SURFACE -4
29+
#define ANDROID_SURFACE_RESULT_COULDNT_INIT_BITMAP_CLIENT -5
30+
#define ANDROID_SURFACE_RESULT_JNI_EXCEPTION -6
3031

3132
#ifdef __cplusplus
3233
extern "C" {
@@ -36,7 +37,7 @@ int AndroidSurface_register(JNIEnv* env, jobject jsurface);
3637

3738
int AndroidSurface_getPixels(int width, int height, void** pixels);
3839

39-
int AndroidSurface_updateSurface();
40+
int AndroidSurface_updateSurface(bool autoscale = true);
4041

4142
int AndroidSurface_unregister();
4243

jni/include/drivers_map.h

Lines changed: 0 additions & 52 deletions
This file was deleted.

jni/jni/Android.mk

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
11
LOCAL_PATH := $(call my-dir)
22
include $(CLEAR_VARS)
33

4+
IN_NDK := true
5+
46
LOCAL_CFLAGS := -D__STDC_CONSTANT_MACROS
57

68
WITH_CONVERTOR := true
9+
WITH_PLAYER := true
710

8-
#ifeq ($(WITH_PLAYER),true)
11+
ifeq ($(WITH_PLAYER),true)
912
LOCAL_CFLAGS += -DBUILD_WITH_PLAYER
10-
#endif
13+
endif
1114

1215
ifeq ($(WITH_CONVERTOR),true)
1316
LOCAL_CFLAGS += -DBUILD_WITH_CONVERTOR
1417
endif
1518

1619
LOCAL_C_INCLUDES += \
17-
$(LOCAL_PATH)/../libffmpeg \
18-
$(LOCAL_PATH)/../include
20+
$(LOCAL_PATH)/../libffmpeg \
21+
$(LOCAL_PATH)/../libmediaplayer \
22+
$(LOCAL_PATH)/../include
1923

2024
LOCAL_SRC_FILES := \
21-
onLoad.cpp \
22-
com_media_ffmpeg_FFMpegAVFrame.cpp \
23-
com_media_ffmpeg_FFMpegAVInputFormat.c \
24-
com_media_ffmpeg_FFMpegAVRational.c \
25-
com_media_ffmpeg_FFMpegAVFormatContext.c \
26-
com_media_ffmpeg_FFMpegAVCodecContext.cpp \
27-
com_media_ffmpeg_FFMpegUtils.cpp
28-
25+
onLoad.cpp \
26+
com_media_ffmpeg_FFMpegAVFrame.cpp \
27+
com_media_ffmpeg_FFMpegAVInputFormat.c \
28+
com_media_ffmpeg_FFMpegAVRational.c \
29+
com_media_ffmpeg_FFMpegAVFormatContext.c \
30+
com_media_ffmpeg_FFMpegAVCodecContext.cpp \
31+
com_media_ffmpeg_FFMpegUtils.cpp
2932

3033
ifeq ($(WITH_CONVERTOR),true)
3134
LOCAL_SRC_FILES += \
32-
com_media_ffmpeg_FFMpeg.c \
33-
../libffmpeg/cmdutils.c
35+
com_media_ffmpeg_FFMpeg.c \
36+
../libffmpeg/cmdutils.c
3437
endif
3538

36-
#ifeq ($(WITH_PLAYER),true)
39+
ifeq ($(WITH_PLAYER),true)
3740
LOCAL_SRC_FILES += \
38-
com_media_ffmpeg_android_FFMpegPlayerAndroid.cpp
39-
#endif
41+
com_media_ffmpeg_FFMpegPlayer.cpp
42+
#com_media_ffmpeg_android_FFMpegPlayerAndroid.cpp
43+
endif
4044

4145
ifeq ($(IN_NDK),true)
4246
LOCAL_LDLIBS := -llog
@@ -46,8 +50,7 @@ LOCAL_SHARED_LIBRARIES := liblog
4650
endif
4751

4852
LOCAL_SHARED_LIBRARIES := libjniaudio libjnivideo
49-
50-
LOCAL_STATIC_LIBRARIES := libavcodec libavformat libavutil libpostproc libswscale
53+
LOCAL_STATIC_LIBRARIES := libavcodec libavformat libavutil libpostproc libswscale libmediaplayer
5154

5255
LOCAL_MODULE := libffmpeg_jni
5356

0 commit comments

Comments
 (0)