关闭

在eclipse下android ndk直接编译librtmp。

661人阅读 评论(1) 收藏 举报

需要openssl的libcrypto.a,libssl.a

jni目录下

文件夹librtmp

文件夹openssl

文件Android.mk

Android.mk中

LOCAL_PATH:= $(call my-dir)
include $(LOCAL_PATH)/openssl/Android.mk
include $(LOCAL_PATH)/librtmp/Android.mk

openssl目录下

include,libcrypto.a,libssl.a,Android.mk

Android.mk中

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	libcrypto.a \

LOCAL_MODULE := crypto
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)


include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	libssl.a \

LOCAL_MODULE := ssl
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)

librtmp目录下

文件夹librtmp

文件Android.mk

Android.mk中

subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
		librtmp \
	))

SSL := $(LOCAL_PATH)/openssl
ifndef SSL
$(error "You must define SSL before starting")
endif

include $(LOCAL_PATH)/librtmp/librtmp/Android.mk
librtmp下就是源码和Android.mk

Android.mk中

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_C_INCLUDES += $(NDK_PROJECT_PATH)/librtmp \
	$(SSL)/include
LOCAL_SRC_FILES:= \
	amf.c \
	hashswf.c \
	log.c \
	parseurl.c \
	rtmp.c
LOCAL_SHARED_LIBRARIES  := crypto 
LOCAL_SHARED_LIBRARIES  += ssl
#LOCAL_CFLAGS += -I$(SSL)/include -DUSE_OPENSSL
LOCAL_LDLIBS += -L$(SSL)
LOCAL_LDLIBS += -lssl -lcrypto -lz
LOCAL_MODULE := librtmp

include $(BUILD_SHARED_LIBRARY)


右键运行,就可以编译通过

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:7104次
    • 积分:140
    • 等级:
    • 排名:千里之外
    • 原创:5篇
    • 转载:0篇
    • 译文:0篇
    • 评论:1条
    最新评论