Reduce Gstreamer Android aar size by removing unused plugins files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Reduce Gstreamer Android aar size by removing unused plugins files

farhad7d7
Recently i successfully developed an android module for video 'VP8' and 'H264' and audio 'Opus' streaming by gstreamer android. it works fine but the problem is aar size. it's about 50mb. is there any way that i could reduce the size by removing unused plugins file?

This is Android.mk :

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := gpodstreamer
LOCAL_SRC_FILES := ginitializer.c gstreamer.c gdecoder.c gencoder.c g_audio_encoder.c g_audio_decoder.c g_rtpopusplayer.c g_rtpopusrecorder.c
LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_LDLIBS := -llog -landroid
include $(BUILD_SHARED_LIBRARY)

ifndef GSTREAMER_ROOT_ANDROID
$(error GSTREAMER_ROOT_ANDROID is not defined!)
endif


ifeq ($(TARGET_ARCH_ABI),armeabi)
GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/arm
else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/armv7
else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/arm64
else ifeq ($(TARGET_ARCH_ABI),x86)
GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/x86
else ifeq ($(TARGET_ARCH_ABI),x86_64)
GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/x86_64
else
$(error Target arch ABI not supported: $(TARGET_ARCH_ABI))
endif


GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk

GSTREAMER_PLUGINS         := libav videoparsersbad opengl rtp rtpmanager coreelements app vpx videoconvert x264 videofilter opus autodetect audioconvert audioresample audiorate


GSTREAMER_EXTRA_DEPS      := gstreamer-plugins-base-1.0 gstreamer-rtp-1.0 gmodule-2.0 glib-2.0 gstreamer-app-1.0 gstreamer-video-1.0
GSTREAMER_EXTRA_LIBS      := -liconv
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
Gstreamer Elements that i use in LOCAL_SRC_FILES:



1.Video Codecs ( Vp8 & H264 ) :

 appsrc,
videoflip,
queue,
x264enc,
rtph264pay,
h264parse,
 vp8enc,
 rtpvp8pay,
rtpvp8depay,
vp8dec,
rtph264depay,
videoconvert,
avdec_h264,
rtpjitterbuffer,
glimagesink,
appsink.

2. Audio Codec ( Opus ) :

opusenc,
rtpopuspay,
rtpopusdepay,
opusdec,
audioconvert.