linux下传输ts流,2013-5-29 实现Android上播放TCP传输的TS数据流

#!/bin/bash

######################################################

# Usage:

# put this script in top of FFmpeg source tree

# ./build_android

# It generates binary for following architectures:

# ARMv6

# ARMv6+VFP

# ARMv7+VFPv3-d16 (Tegra2)

# ARMv7+Neon (Cortex-A8)

# Customizing:

# 1. Feel free to change ./configure parameters for more features

# 2. To adapt other ARM variants

# set $CPU and $OPTIMIZE_CFLAGS

# call build_one

######################################################

NDK=/tool/android-ndk-r8e

PLATFORM=$NDK/platforms/android-8/arch-arm/

PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86_64

function build_one

{

./configure --target-os=linux

--prefix=$PREFIX

--enable-cross-compile

--extra-libs="-lgcc"

--arch=arm

--cc=$PREBUILT/bin/arm-linux-androideabi-gcc

--cross-prefix=$PREBUILT/bin/arm-linux-androideabi-

--nm=$PREBUILT/bin/arm-linux-androideabi-nm

--sysroot=$PLATFORM

--extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS "

--disable-shared

--enable-static

--extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog"

--disable-everything

--enable-demuxer=mov

--enable-demuxer=h264

--enable-demuxer=mpegts

--disable-ffplay

--enable-protocol=file

--enable-avformat

--enable-avcodec

--enable-decoder=rawvideo

--enable-decoder=mjpeg

--enable-decoder=h263

--enable-decoder=mpeg4

--enable-decoder=h264

--enable-parser=h264

--disable-network

--enable-zlib

--disable-avfilter

--disable-ffprobe

--disable-avdevice

$ADDITIONAL_CONFIGURE_FLAG

make clean

make -j4 install

$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o

$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a

}

#arm v6

#CPU=armv6

#OPTIMIZE_CFLAGS="-marm -march=$CPU"

#PREFIX=./android/$CPU

#ADDITIONAL_CONFIGURE_FLAG=

#build_one

#arm v7vfpv3

#CPU=armv7-a

#OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "

#PREFIX=./android/$CPU

#ADDITIONAL_CONFIGURE_FLAG=

#build_one

#arm v7vfp

#CPU=armv7-a

#OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU "

#PREFIX=./android/$CPU-vfp

#ADDITIONAL_CONFIGURE_FLAG=

#build_one

#arm v7n

CPU=armv7-a

OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mtune=cortex-a8"

PREFIX=./android/$CPU

ADDITIONAL_CONFIGURE_FLAG=--enable-neon

build_one

#arm v6+vfp

#CPU=armv6

#OPTIMIZE_CFLAGS="-DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU"

#PREFIX=./android/${CPU}_vfp

#ADDITIONAL_CONFIGURE_FLAG=

#build_one

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值