Skip to content

Commit

Permalink
mmap changes: half done
Browse files Browse the repository at this point in the history
  • Loading branch information
roman10 committed Dec 5, 2011
1 parent 4712ae3 commit 9a9a8e6
Show file tree
Hide file tree
Showing 20 changed files with 696 additions and 609 deletions.
18 changes: 11 additions & 7 deletions jni/andzop.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ void *dump_dependency_function(void *arg) {
LOGI(10, "dump dependency for video %d packet %d", l_params->videoFileIndex, l_i);
dep_decode_a_video_packet(l_params->videoFileIndex);
}
fclose(gVideoCodecCtxDepList[l_params->videoFileIndex]->g_mbPosF);
fclose(gVideoCodecCtxDepList[l_params->videoFileIndex]->g_mbStPosF);
fclose(gVideoCodecCtxDepList[l_params->videoFileIndex]->g_mbEdPosF);
fclose(gVideoCodecCtxDepList[l_params->videoFileIndex]->g_intraDepF);
fclose(gVideoCodecCtxDepList[l_params->videoFileIndex]->g_interDepF);
fclose(gVideoCodecCtxDepList[l_params->videoFileIndex]->g_dcPredF);
Expand All @@ -102,7 +103,7 @@ JNIEXPORT void JNICALL Java_feipeng_andzop_render_RenderView_naClose(JNIEnv *pEn
#endif
#if defined(SELECTIVE_DECODING) || defined(NORM_DECODE_DEBUG)
/*close all dependency files*/
fclose(gVideoCodecCtxList[l_i]->g_mbPosF);
// fclose(gVideoCodecCtxList[l_i]->g_mbPosF);
fclose(gVideoCodecCtxList[l_i]->g_intraDepF);
fclose(gVideoCodecCtxList[l_i]->g_interDepF);
fclose(gVideoCodecCtxList[l_i]->g_dcPredF);
Expand Down Expand Up @@ -302,18 +303,21 @@ JNIEXPORT jint JNICALL Java_feipeng_andzop_render_RenderView_naRenderAFrame(JNIE
#ifdef ANDROID_BUILD
sprintf(l_depIntraFileName, "%s_intra_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(l_depInterFileName, "%s_inter_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(l_depMbPosFileName, "%s_mbpos_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbStPosFileName, "%s_mbstpos_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbEdPosFileName, "%s_mbedpos_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(l_depMbPosFileName, "%s_mbedpos_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(l_depDcpFileName, "%s_dcp_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
#else
sprintf(l_depIntraFileName, "./%s_intra_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(l_depInterFileName, "./%s_inter_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(l_depMbPosFileName, "./%s_mbpos_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbStPosFileName, "./%s_mbstpos_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbEdPosFileName, "./%s_mbedpos_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
sprintf(l_depDcpFileName, "./%s_dcp_gop%d.txt", gVideoFileNameList[gCurrentDecodingVideoFileIndex], g_decode_gop_num);
#endif
gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbPosF = fopen(l_depMbPosFileName, "r");
/*gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbPosF = fopen(l_depMbPosFileName, "r");
if (gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbPosF == NULL) {
LOGE(1, "cannot open mb pos file: %s", l_depMbPosFileName);
}
}*/
gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_dcPredF = fopen(l_depDcpFileName, "r");
if (gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_dcPredF == NULL) {
LOGE(1, "cannot open dcp file: %s", l_depDcpFileName);
Expand Down Expand Up @@ -364,7 +368,7 @@ JNIEXPORT jint JNICALL Java_feipeng_andzop_render_RenderView_naRenderAFrame(JNIE
++g_decode_gop_num; //increase the counter
//close the dependency files
fclose(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_gopF);
fclose(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbPosF);
// fclose(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_mbPosF);
fclose(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_dcPredF);
fclose(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_intraDepF);
fclose(gVideoCodecCtxList[gCurrentDecodingVideoFileIndex]->g_interDepF);
Expand Down
116 changes: 91 additions & 25 deletions jni/dependency.c

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion jni/dependency.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include <stdio.h>
#include <stdlib.h>

#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
/*ffmpeg headers*/
#include <libavutil/avstring.h>
//#include <libavutil/colorspace.h>
Expand Down
Binary file modified jni/ffmpeg/android/armv7-a/bin/ffmpeg
Binary file not shown.
Binary file modified jni/ffmpeg/android/armv7-a/bin/ffprobe
Binary file not shown.
5 changes: 4 additions & 1 deletion jni/ffmpeg/android/armv7-a/include/libavcodec/avcodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -2924,7 +2924,10 @@ typedef struct AVCodecContext {
char *dep_mb_pos_file_name;
char *dep_dcp_file_name;*/
/*file pointers for writing to dependency files*/
FILE *g_mbPosF;
FILE *g_mbStPosF;
FILE *g_mbEdPosF;
char g_mbStPosFileName[100];
char g_mbEdPosFileName[100];
FILE *g_intraDepF;
FILE *g_interDepF;
FILE *g_dcPredF;
Expand Down
Binary file modified jni/ffmpeg/android/armv7-a/lib/libavcodec.a
Binary file not shown.
Binary file modified jni/ffmpeg/android/armv7-a/lib/libavformat.a
Binary file not shown.
Binary file modified jni/ffmpeg/android/armv7-a/lib/libavutil.a
Binary file not shown.
Binary file modified jni/ffmpeg/android/armv7-a/lib/libswscale.a
Binary file not shown.
Binary file modified jni/ffmpeg/android/armv7-a/libffmpeg.so
Binary file not shown.
2 changes: 1 addition & 1 deletion jni/ffmpeg/android/armv7-a/share/man/man1/ffmpeg.1
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "FFMPEG 1"
.TH FFMPEG 1 "2011-10-13" " " " "
.TH FFMPEG 1 "2011-12-04" " " " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
Expand Down
2 changes: 1 addition & 1 deletion jni/ffmpeg/android/armv7-a/share/man/man1/ffprobe.1
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "FFPROBE 1"
.TH FFPROBE 1 "2011-10-13" " " " "
.TH FFPROBE 1 "2011-12-04" " " " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
Expand Down
2 changes: 1 addition & 1 deletion jni/ffmpeg/build_andriod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# call build_one
######################################################

NDK=~/Desktop/android/android-ndk-r5b
NDK=~/Desktop/android/android-ndk-r7
PLATFORM=$NDK/platforms/android-8/arch-arm/
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86

Expand Down
2 changes: 1 addition & 1 deletion jni/ffmpeg/config.fate
Original file line number Diff line number Diff line change
@@ -1 +1 @@
config:arm::generic:linux:gcc 4.4.3 (GCC):--target-os=linux --prefix=./android/armv7-a --enable-cross-compile --extra-libs=-lgcc --arch=arm --cc=/home/roman10/Desktop/android/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --cross-prefix=/home/roman10/Desktop/android/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- --nm=/home/roman10/Desktop/android/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-nm --sysroot=/home/roman10/Desktop/android/android-ndk-r5b/platforms/android-8/arch-arm/ --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 -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a ' --disable-shared --enable-static --extra-ldflags='-Wl,-rpath-link=/home/roman10/Desktop/android/android-ndk-r5b/platforms/android-8/arch-arm//usr/lib -L/home/roman10/Desktop/android/android-ndk-r5b/platforms/android-8/arch-arm//usr/lib -nostdlib -lc -lm -ldl -llog' --disable-everything --enable-demuxer=mov --enable-demuxer=h264 --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-avdevice --enable-pthreads
config:arm::generic:linux:gcc 4.4.3 (GCC):--target-os=linux --prefix=./android/armv7-a --enable-cross-compile --extra-libs=-lgcc --arch=arm --cc=/home/roman10/Desktop/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --cross-prefix=/home/roman10/Desktop/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- --nm=/home/roman10/Desktop/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-nm --sysroot=/home/roman10/Desktop/android/android-ndk-r7/platforms/android-8/arch-arm/ --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 -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a ' --disable-shared --enable-static --extra-ldflags='-Wl,-rpath-link=/home/roman10/Desktop/android/android-ndk-r7/platforms/android-8/arch-arm//usr/lib -L/home/roman10/Desktop/android/android-ndk-r7/platforms/android-8/arch-arm//usr/lib -nostdlib -lc -lm -ldl -llog' --disable-everything --enable-demuxer=mov --enable-demuxer=h264 --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-avdevice --enable-pthreads
2 changes: 1 addition & 1 deletion jni/ffmpeg/config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "--target-os=linux --prefix=./android/armv7-a --enable-cross-compile --extra-libs=-lgcc --arch=arm --cc=/home/roman10/Desktop/android/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --cross-prefix=/home/roman10/Desktop/android/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- --nm=/home/roman10/Desktop/android/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-nm --sysroot=/home/roman10/Desktop/android/android-ndk-r5b/platforms/android-8/arch-arm/ --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 -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a ' --disable-shared --enable-static --extra-ldflags='-Wl,-rpath-link=/home/roman10/Desktop/android/android-ndk-r5b/platforms/android-8/arch-arm//usr/lib -L/home/roman10/Desktop/android/android-ndk-r5b/platforms/android-8/arch-arm//usr/lib -nostdlib -lc -lm -ldl -llog' --disable-everything --enable-demuxer=mov --enable-demuxer=h264 --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-avdevice --enable-pthreads"
#define FFMPEG_CONFIGURATION "--target-os=linux --prefix=./android/armv7-a --enable-cross-compile --extra-libs=-lgcc --arch=arm --cc=/home/roman10/Desktop/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --cross-prefix=/home/roman10/Desktop/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- --nm=/home/roman10/Desktop/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-nm --sysroot=/home/roman10/Desktop/android/android-ndk-r7/platforms/android-8/arch-arm/ --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 -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a ' --disable-shared --enable-static --extra-ldflags='-Wl,-rpath-link=/home/roman10/Desktop/android/android-ndk-r7/platforms/android-8/arch-arm//usr/lib -L/home/roman10/Desktop/android/android-ndk-r7/platforms/android-8/arch-arm//usr/lib -nostdlib -lc -lm -ldl -llog' --disable-everything --enable-demuxer=mov --enable-demuxer=h264 --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-avdevice --enable-pthreads"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define FFMPEG_DATADIR "./android/armv7-a/share/ffmpeg"
#define CC_TYPE "gcc"
Expand Down
Loading

0 comments on commit 9a9a8e6

Please sign in to comment.