Skip to content

Commit

Permalink
Merge branch 'upstream-tracker'
Browse files Browse the repository at this point in the history
  • Loading branch information
RuralHunter committed Aug 21, 2018
2 parents e91ed09 + 57c7b75 commit e9be9fc
Show file tree
Hide file tree
Showing 14 changed files with 1,965 additions and 35 deletions.
15 changes: 13 additions & 2 deletions android/src/com/lonelycoder/mediaplayer/GLWActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ public void onServiceDisconnected(ComponentName name) {

public boolean onKeyUp(int keyCode, KeyEvent event) {

if(mGLWView.keyUp(keyCode, event))
if(mGLWView != null && mGLWView.keyUp(keyCode, event))
return true;
return super.onKeyUp(keyCode, event);
}


public boolean onKeyDown(int keyCode, KeyEvent event) {

if(mGLWView.keyDown(keyCode, event))
if(mGLWView != null && mGLWView.keyDown(keyCode, event))
return true;
return super.onKeyDown(keyCode, event);
}
Expand Down Expand Up @@ -189,4 +189,15 @@ public void run() {
});
}

@Override
public void sysHome() {
runOnUiThread(new Runnable() {
public void run() {
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);
}
});
}
}
39 changes: 20 additions & 19 deletions android/src/com/lonelycoder/mediaplayer/GLWView.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,28 @@ public GLWView(Context ctx, VideoRendererProvider vrp) {
setRenderer(new Renderer());
// setRenderMode(RENDERMODE_WHEN_DIRTY);
getHolder().setFormat(PixelFormat.TRANSLUCENT);
setZOrderMediaOverlay(true);

setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent e) {

final int source = e.getSource();
final int action = e.getAction();
final float x = e.getX();
final float y = e.getY();
final long ts = e.getEventTime();

queueEvent(new Runnable() {
public void run() {
Core.glwMotion(glwId, source, action, (int)x, (int)y, ts);
}
});
return true;
}
});
}

@Override
public boolean onTouchEvent(final MotionEvent e) {

Rect r = new Rect();
if(getGlobalVisibleRect(r)) {
final int source = e.getSource();
final int action = e.getAction();
final float x = e.getX() - r.left;
final float y = e.getY() - r.top;
final long ts = e.getEventTime();

queueEvent(new Runnable() {
public void run() {
Core.glwMotion(glwId, source, action, (int)x, (int)y, ts);
}
});
}
return true;
}

public boolean keyDown(int keyCode, KeyEvent event) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ interface VideoRendererProvider {

public void disableScreenSaver();
public void enableScreenSaver();
public void sysHome();
}
2 changes: 1 addition & 1 deletion configure.android
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ for opt do
ANDROID_ABI=armeabi
BUILD=android.api15_armv7
TOOLCHAIN=${TOPDIR}/build.${BUILD}/toolchain/bin/arm-linux-androideabi-
ARCH_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
ARCH_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -funwind-tables"
ARCH_LDFLAGS="-march=armv7-a -Wl,--fix-cortex-a8"
LIBAV_ARCH_FLAGS="--cross-prefix=${TOOLCHAIN} --enable-cross-compile --arch=armv7 --target-os=android --enable-shared --disable-static --as=${TOOLCHAIN}gcc"
CC=${TOOLCHAIN}clang
Expand Down
Loading

0 comments on commit e9be9fc

Please sign in to comment.