Skip to content

Commit

Permalink
Market Release v7 Neon and x86 version
Browse files Browse the repository at this point in the history
  • Loading branch information
aatrala committed Jul 3, 2012
1 parent 7f327c2 commit 08a8b31
Show file tree
Hide file tree
Showing 206 changed files with 3,088 additions and 199 deletions.
2 changes: 1 addition & 1 deletion p/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.broov.player" android:versionCode="6" android:versionName="2.6"
package="com.broov.player" android:versionCode="7" android:versionName="2.7"
android:installLocation="auto">
<application android:icon="@drawable/icon"

Expand Down
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/AVPlayerMain$2.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/AVPlayerMain$3.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/AVPlayerMain$4.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/AVPlayerMain.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/AudioPlayer.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/AudioThread.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/BuildConfig.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/DemoRenderer.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/EventHandler.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Feedback$1.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Feedback$2.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Feedback.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/FileManager$1.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/FileManager.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Globals.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$array.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$attr.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$color.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$drawable.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$id.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$layout.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$string.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$style.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R$styleable.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/R.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$1.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$10.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$11.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$12.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$13.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$14.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$15.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$16.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$17.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$18.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$19.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$2$1.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$2$2.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$2.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$20.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$21.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$22.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$23.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$24.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$25.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$26.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$27.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$28.class
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$29.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$3$1.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$3.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$4.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$5.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$6.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$7.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$8.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings$9.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Settings.class
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/Utils.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/VideoPlayer$4.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added p/bin/classes/com/broov/player/VideoPlayer.class
Binary file not shown.
3 changes: 3 additions & 0 deletions p/bin/jarlist.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cache for current jar dependecy. DO NOT EDIT.
# format is <lastModified> <length> <SHA-1> <path>
# Encoding is UTF-8
2 changes: 1 addition & 1 deletion p/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<string name="debugmodestatement">Disabled by default. Should be enabled only during development. Prints debug logs while playing audio and video files</string>

<string name="avsyncmode">A/V Sync mode</string>
<string name="avsyncmodestatement">Default value is Audio Clock. Should be enabled only during development. Used as the clock reference while playing the file</string>
<string name="avsyncmodestatement">Default value is Audio Clock. Should be modified only during development. Used as the clock reference while playing the file</string>

<string name="advyuv2rgb">YUV 2 RGB</string>
<string name="advdisplaypixelformat">Display Pixel Format</string>
Expand Down
3 changes: 0 additions & 3 deletions p/src/com/broov/player/AVPlayerMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import java.io.File;

//import com.google.ads.AdRequest;
//import com.google.ads.AdSize;
//import com.google.ads.AdView;

import android.app.Dialog;
import android.app.AlertDialog;
Expand Down
1 change: 0 additions & 1 deletion p/src/com/broov/player/VideoPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public void onCallStateChanged(int state, String incomingNumber) {
System.out.println("Triggered");
demoRenderer.nativePlayerPause();
}
//System.out.println("call sate ringing");
//seekBarUpdater.stopIt();
} else if(state == TelephonyManager.CALL_STATE_OFFHOOK) {
//A call is dialing, active or on hold
Expand Down
2 changes: 1 addition & 1 deletion p86/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.broov.playerx86" android:versionCode="6" android:versionName="2.4"
package="com.broov.playerx86" android:versionCode="7" android:versionName="2.6"
android:installLocation="auto" >
<application android:icon="@drawable/icon"

Expand Down
5 changes: 3 additions & 2 deletions p86/compile.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#/Users/apple/Downloads/android-ndk-r8/ndk-build clean
/Users/apple/Downloads/android-ndk-r8/ndk-build clean
/Users/apple/Downloads/android-ndk-r8/ndk-build

cp ../p/native/ffmpeg/ffmpeg-0.11.1/android/x86/libffmpeg.so libs/x86/.

#cp native/ffmpeg/ffmpeg-0.11.1/android/armv6_vfp/libffmpeg.so libs/armeabi/.
#cp native/ffmpeg/ffmpeg-0.11.1/android/armv7-a/libffmpeg.so libs/armeabi-v7a/.
#cp native/ffmpeg/ffmpeg-0.11.1/android/armv5te/libffmpeg.so libs/armeabi/.
cp ../p/native/ffmpeg/ffmpeg-0.11.1/android/x86/libffmpeg.so libs/x86/.
39 changes: 39 additions & 0 deletions p86/diffs/diff_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Only in ../p/.: README
Only in ../p/./bin: classes
Only in ../p/./bin: jarlist.cache
Only in ../p/./bin: res
Files ./.project and ../p/./.project differ
Files ./compile.sh and ../p/./compile.sh differ
Only in .: diff_list.txt
Only in .: files_to_change.txt
Only in ../p/./gen/com/broov: player
Only in ./gen/com/broov: playerx86
Only in ../p/./jni: Android.mk.neon
Only in ../p/.: native
Only in ../p/./jni/app: Android.mk.neon
Only in ./jni/app: Android.mk.no_neon
Only in ../p/./jni/app: Android.mk.org
Only in ../p/./jni/app/src: optimization.c
Only in ../p/./jni/bzip2: mips
Only in ../p/./jni/sdl: Android.mk.neon
Only in ../p/./jni/sdl/src/audio: .SDL_audio.c.swn
Only in ./jni/sdl/src/audio: .SDL_audio.c.swo
Only in ./jni/sdl/src/audio: .SDL_audio.c.swp
Only in ./jni/sdl/src/audio/android: .SDL_androidaudio.c.swp

Files ./jni/sdl/src/audio/android/SDL_androidaudio.c and ../p/./jni/sdl/src/audio/android/SDL_androidaudio.c differ

Files ./AndroidManifest.xml and ../p/./AndroidManifest.xml differ
Files ./jni/Android.mk and ../p/./jni/Android.mk differ
Files ./jni/Application.mk and ../p/./jni/Application.mk differ
Files ./jni/app/Android.mk and ../p/./jni/app/Android.mk differ
Files ./jni/app/src/native_main.cpp and ../p/./jni/app/src/native_main.cpp differ
Files ./jni/app/src/video_player.cpp and ../p/./jni/app/src/video_player.cpp differ
Files ./jni/sdl/Android.mk and ../p/./jni/sdl/Android.mk differ
Files ./jni/yuv2rgb/Android.mk and ../p/./jni/yuv2rgb/Android.mk differ
Files ./project.properties and ../p/./project.properties differ
Files ./res/layout/audio_player.xml and ../p/./res/layout/audio_player.xml differ
Files ./res/layout/video_player.xml and ../p/./res/layout/video_player.xml differ

Only in ../p/./src/com/broov: player
Only in ./src/com/broov: playerx86
36 changes: 36 additions & 0 deletions p86/diffs/files_to_change.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
AndroidManifest.xml: package="com.broov.playerx86" android:versionCode="2" android:versionName="1.2"
jni/Android.mk:SDL_JAVA_PACKAGE_PATH := com_broov_playerx86
jni/Android.mk:SDL_SHARED_LIBRARIES_PATH := /data/data/com.broov.playerx86/lib
jni/Android.mk:SDL_CURDIR_PATH := /data/data/com.broov.playerx86/files

jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerInit(JNIEnv* env, jobject obj, jstring jfileName, jint subtitleShow, jint subtitleFontSize, jint subtitleEncodingType)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerExit(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerMain(JNIEnv* env, jobject obj,
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerDuration(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerTotalDuration(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerPlay(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerPause(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerForward(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerRewind(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerPrev(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerNext(JNIEnv* env, jobject obj)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerSeek(JNIEnv* env, jobject obj, jint percentage)
jni/app/src/native_main.cpp:Java_com_broov_playerx86_DemoRenderer_nativePlayerSetAspectRatio(JNIEnv* env, jobject obj, jint aspectRatio)
jni/sdl/Android.mk: -DSDL_JAVA_PACKAGE_PATH="com_broov_playerx86" \
jni/sdl/src/audio/android/SDL_androidaudio.c:JNIEXPORT jint JNICALL Java_com_broov_playerx86_AudioThread_nativeAudioInitJavaCallbacks (JNIEnv * jniEnv, jobject thiz)
res/layout/audio_player.xml: <com.broov.playerx86.GLSurfaceView_SDL android:id="@+id/glsurfaceview"
res/layout/video_player.xml: <com.broov.playerx86.GLSurfaceView_SDL android:id="@+id/glsurfaceview" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="fill_parent"></com.broov.playerx86.GLSurfaceView_SDL>
src/com/broov/playerx86/AudioPlayer.java:package com.broov.playerx86;
src/com/broov/playerx86/AudioThread.java:package com.broov.playerx86;
src/com/broov/playerx86/AVPlayerMain.java:package com.broov.playerx86;
src/com/broov/playerx86/DemoGLSurfaceView.java:package com.broov.playerx86;
src/com/broov/playerx86/DemoRenderer.java:package com.broov.playerx86;
src/com/broov/playerx86/DirectoryInfo.java:package com.broov.playerx86;
src/com/broov/playerx86/EventHandler.java:package com.broov.playerx86;
src/com/broov/playerx86/Feedback.java:package com.broov.playerx86;
src/com/broov/playerx86/FileManager.java:package com.broov.playerx86;
src/com/broov/playerx86/Globals.java:package com.broov.playerx86;
src/com/broov/playerx86/GLSurfaceView_SDL.java:package com.broov.playerx86;
src/com/broov/playerx86/Settings.java:package com.broov.playerx86;
src/com/broov/playerx86/Utils.java:package com.broov.playerx86;
src/com/broov/playerx86/VideoPlayer.java:package com.broov.playerx86;
1 change: 1 addition & 0 deletions p86/gen/com/broov/playerx86/R.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static final class array {
Used in View/Feedback options.java
Used in View/Feedback options.java
Used in View/Feedback options.java
Used in View/Feedback options.java
Used in View/Feedback options.java
*/
public static final int Category=0x7f040000;
Expand Down
1 change: 1 addition & 0 deletions p86/jni/app/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ APP_SUBDIRS += $(patsubst $(LOCAL_PATH)/%, %, $(shell find $(LOCAL_PATH)/resourc

LOCAL_CFLAGS := $(foreach D, $(APP_SUBDIRS), -I$(LOCAL_PATH)/$(D)) \
-D__STDC_CONSTANT_MACROS \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-I$(AVPLAYER_PATH_BASE)"/native/ffmpeg/ffmpeg-0.11.1" \
-I$(AVPLAYER_PATH)"/jni/sdl/include" \
-I$(AVPLAYER_PATH)"/jni/sdl_ttf" \
Expand Down
2 changes: 2 additions & 0 deletions p86/jni/app/src/b_sdl.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if 0
#include <pthread.h>

pthread_mutex_t* b_CreateMutex(void)
Expand Down Expand Up @@ -164,3 +165,4 @@ void b_WaitThread(pthread_t *handle)
{
pthread_join(*handle, 0);
}
#endif
147 changes: 145 additions & 2 deletions p86/jni/app/src/broov_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@

#define BROOV_VIDEO_SKIP
#define BROOV_VIDEO_THREAD
#define BROOV_SEEK_DURATION_FIX

#define BROOV_LOCK_MGR
#define BROOV_LATEST_FFMPEG

#define BROOV_SEEK_DURATION_FIX
#define BROOV_SEEK_DURATION_SECOND_FIX

//#define BROOV_FRAME_SEEK
//#define BROOV_BACKWARD_FRAME_SEEK

//#define BROOV_USE_DESTINATION_WIDTH
//#define BROOV_VERSION_1_2_AUDIO

Expand Down Expand Up @@ -352,8 +358,17 @@ static void stream_seek_special(VideoState *is, int64_t pos, int64_t rel, int se
is->seek_rel = rel;
is->seek_flags &= ~AVSEEK_FLAG_BYTE;

#ifdef BROOV_FRAME_SEEK
is->seek_flags &= ~AVSEEK_FLAG_FRAME;
if (seek_by_bytes == 2) {
is->seek_flags |= AVSEEK_FLAG_FRAME;
} else if (seek_by_bytes) {
is->seek_flags |= AVSEEK_FLAG_BYTE;
}
#else
if (seek_by_bytes)
is->seek_flags |= AVSEEK_FLAG_BYTE;
#endif
is->seek_req_special = 1;
is->seek_req = 1;
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek Requested:%d", g_seek_duration);
Expand Down Expand Up @@ -1795,8 +1810,10 @@ static void stream_component_close(VideoState *is, int stream_index)

packet_queue_end(&is->audioq);
av_free_packet(&is->audio_pkt);
#ifndef BROOV_VERSION_1_2_AUDIO
if (is->swr_ctx)
swr_free(&is->swr_ctx);
#endif
is->audio_buf = NULL;
av_freep(&is->frame);
break;
Expand Down Expand Up @@ -2393,6 +2410,7 @@ int process_a_ui_event(VideoState *is)
} else {
pos = get_master_clock(cur_stream);
pos += incr;
//__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "StreamSeek pos:%lf increment:%lf", pos, incr);
stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);
}
}
Expand Down Expand Up @@ -2569,17 +2587,59 @@ int process_a_ui_event(VideoState *is)
}else {
pos = avio_tell(cur_stream->pFormatCtx->pb);
}

#ifdef BROOV_FRAME_SEEK
if (cur_stream->video_st >= 0 && cur_stream->video_current_pos>=0){
int64_t desiredFrameNumber = av_rescale(incr*1000,
cur_stream->pFormatCtx->streams[cur_stream->videoStream]->time_base.den,
cur_stream->pFormatCtx->streams[cur_stream->videoStream]->time_base.num);
desiredFrameNumber/=1000;
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Frame number:%ld", desiredFrameNumber);
stream_seek_special(cur_stream, 0, desiredFrameNumber, 2);
} else {
#ifdef BROOV_SEEK_DURATION_SECOND_FIX
incr = (incr - player_duration());
#else
incr = (player_duration() - incr);
#endif
if (cur_stream->pFormatCtx->bit_rate)
incr *= cur_stream->pFormatCtx->bit_rate / 8.0;
else
incr *= 180000.0;
pos += incr;
stream_seek_special(cur_stream, pos, incr, 1);

}
#else
#ifdef BROOV_SEEK_DURATION_SECOND_FIX
incr = (incr - player_duration());
#else
//Get the relative increment or decrement in secs value
incr = (player_duration() - incr);
#endif
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "ByteSeek increment:%lf", incr);

if (cur_stream->pFormatCtx->bit_rate)
incr *= cur_stream->pFormatCtx->bit_rate / 8.0;
else
incr *= 180000.0;
pos += incr;
stream_seek_special(cur_stream, pos, incr, 1);
#endif
} else {
#ifdef BROOV_SEEK_DURATION_SECOND_FIX
//Get the relative increment or decrement in secs value
incr = (double)(int)((int)incr - player_duration());
//__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "NormalSeek increment:%lf", incr);
pos = get_master_clock(cur_stream);
pos += incr;
//__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "NormalSeek pos:%lf increment:%lf", pos, incr);
stream_seek_special(cur_stream, (int64_t)(pos* AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);
#else
//pos = get_master_clock(cur_stream);
//pos += incr;
stream_seek_special(cur_stream, (int64_t)(incr * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);
#endif
}

#else
Expand Down Expand Up @@ -2903,19 +2963,58 @@ static int decode_thread(void *arg)
if (is->seek_req_special) {
#ifdef BROOV_SEEK_DURATION_FIX

#ifdef BROOV_FRAME_SEEK
if (is->seek_flags & AVSEEK_FLAG_FRAME) {
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek to frame triggered");
ret = avformat_seek_file(is->pFormatCtx, is->videoStream, 0, is->seek_rel, is->seek_rel, AVSEEK_FLAG_FRAME);
if (ret < 0) {
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "could not seek to position %0.3f\n", (double)is->seek_rel/ AV_TIME_BASE);
}
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek call avformat_seek_file over");
is->seek_flags &= ~AVSEEK_FLAG_FRAME;
} else {
int64_t seek_target = is->seek_pos;
int64_t seek_min= is->seek_rel > 0 ? seek_target - is->seek_rel + 2: INT64_MIN;
int64_t seek_max= is->seek_rel < 0 ? seek_target - is->seek_rel - 2: INT64_MAX;
//FIXME the +-2 is due to rounding being not done in the correct direction in generation
//of the seek_pos/seek_rel variables
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek to pos triggered");
ret = avformat_seek_file(is->pFormatCtx, -1, seek_min, seek_target, seek_max, is->seek_flags);
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek call avformat_seek_file over");

}
#else
int64_t seek_target = is->seek_pos;
int64_t seek_min= is->seek_rel > 0 ? seek_target - is->seek_rel + 2: INT64_MIN;
int64_t seek_max= is->seek_rel < 0 ? seek_target - is->seek_rel - 2: INT64_MAX;
//FIXME the +-2 is due to rounding being not done in the correct direction in generation
//of the seek_pos/seek_rel variables
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek to pos triggered");
//__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek to pos byte or normal triggered");
ret = avformat_seek_file(is->pFormatCtx, -1, seek_min, seek_target, seek_max, is->seek_flags);
if (ret < 0) {
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "could not seek to position %0.3f\n", (double)seek_target);
}

//__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek call avformat_seek_file over");
#endif
#else
#ifdef BROOV_BACKWARD_FRAME_SEEK
/* add the stream start time */
if (is->pFormatCtx->start_time != AV_NOPTS_VALUE)
is->seek_pos+= pFormatCtx->start_time;
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek to pos triggered backward");
ret = av_seek_frame(is->pFormatCtx, -1, is->seek_pos, AVSEEK_FLAG_BACKWARD);
if (ret < 0) {
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "could not seek to position %0.3f\n", (double)is->seek_pos/ AV_TIME_BASE);
}
__android_log_print(ANDROID_LOG_INFO, "BroovPlayer", "Seek call avformat_seek_file over");

#else
/* add the stream start time */
if (is->pFormatCtx->start_time != AV_NOPTS_VALUE)
is->seek_pos+= pFormatCtx->start_time;
ret = avformat_seek_file(is->pFormatCtx, -1, INT64_MIN, is->seek_pos, INT64_MAX, 0);
#endif
#endif
if (!(ret<0)) {
g_current_duration = g_seek_duration;
Expand Down Expand Up @@ -3804,3 +3903,47 @@ int get_frames_to_skip()
}

#endif /* #ifdef BROOV_FRAME_RATE */

#ifdef BROOV_FRAME_SEEK
#if 0
bool seekMs(int tsms)
{
//printf("**** SEEK TO ms %d. LLT: %d. LT: %d. LLF: %d. LF: %d. LastFrameOk: %d\n",tsms,LastLastFrameTime,LastFrameTime,LastLastFrameNumber,LastFrameNumber,(int)LastFrameOk);

// Convert time into frame number
DesiredFrameNumber = ffmpeg::av_rescale(tsms,pFormatCtx->streams[videoStream]->time_base.den,pFormatCtx->streams[videoStream]->time_base.num);
DesiredFrameNumber/=1000;

return seekFrame(DesiredFrameNumber);
}

bool seekFrame(ffmpeg::int64_t frame)
{

//printf("**** seekFrame to %d. LLT: %d. LT: %d. LLF: %d. LF: %d. LastFrameOk: %d\n",(int)frame,LastLastFrameTime,LastFrameTime,LastLastFrameNumber,LastFrameNumber,(int)LastFrameOk);

// Seek if:
// - we don't know where we are (Ok=false)
// - we know where we are but:
// - the desired frame is after the last decoded frame (this could be optimized: if the distance is small, calling decodeSeekFrame may be faster than seeking from the last key frame)
// - the desired frame is smaller or equal than the previous to the last decoded frame. Equal because if frame==LastLastFrameNumber we don't want the LastFrame, but the one before->we need to seek there
if( (LastFrameOk==false) || ((LastFrameOk==true) && (frame<=LastLastFrameNumber || frame>LastFrameNumber) ) )
{
//printf("\t avformat_seek_file\n");
if(ffmpeg::avformat_seek_file(pFormatCtx,videoStream,0,frame,frame,AVSEEK_FLAG_FRAME)<0)
return false;

avcodec_flush_buffers(pCodecCtx);

DesiredFrameNumber = frame;
LastFrameOk=false;
}
//printf("\t decodeSeekFrame\n");

return decodeSeekFrame(frame);

return true;
}
#endif
#endif

2 changes: 1 addition & 1 deletion p86/jni/yuv2rgb/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LOCAL_MODULE := yuv2rgb
LOCAL_CFLAGS := -I$(AVPLAYER_PATH)"/jni/yuv2rgb/include" -D__STDC_CONSTANT_MACROS
LOCAL_CFLAGS += $(CC_OPTIMIZE_FLAG)

LOCAL_SRC_FILES := src/yuv2rgb16tab.c src/yuv420rgb8888.s src/yuv420rgb565.s
LOCAL_SRC_FILES := src/yuv2rgb16tab.c src/yuv420rgb8888.S src/yuv420rgb565.S
#LOCAL_SRC_FILES := src/yuv2rgb16tab.c src/yuv420rgb8888.s src/yuv420rgb565.s src/yuv422rgb565.s src/yuv2rgb555.s src/yuv2rgbX.s src/yuv420rgb888.s src/yuv422rgb565.s src/yuv422rgb888.s src/yuv422rgb8888.s src/yuv444rgb565.s src/yuv444rgb888.s src/yuv444rgb8888.s

ifeq ($(TARGET_ARCH_ABI),x86)
Expand Down
2 changes: 1 addition & 1 deletion p86/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-8
target=android-15
Binary file added p86/res/drawable-hdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 08a8b31

Please sign in to comment.