From 3610ee76875aee2abde58789ba979061cf28f4b8 Mon Sep 17 00:00:00 2001 From: Matti Jokitulppo Date: Tue, 26 Apr 2016 12:04:22 +0300 Subject: [PATCH 1/3] Remove an exoplayer-related magic number from PlayerFragment --- .../java/fi/aalto/legroup/achso/playback/PlayerFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java b/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java index 3517caaa..dd22a72b 100644 --- a/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java +++ b/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java @@ -69,6 +69,9 @@ public final class PlayerFragment extends Fragment implements ExoPlayer.Listener // Number of framework renderers (currently video and audio) private static final int DOWNSTREAM_RENDERER_COUNT = 2; + // The total buffer size for storing video stream data, in bytes + private static final int EXO_BUFFER_SIZE = 1024 * 1024 * 8; + private State state = State.UNPREPARED; private FrameLayout videoContainer; @@ -185,7 +188,7 @@ public void prepare(Video video, AnnotationEditor annotationEditor) { extractor = new Mp4Extractor(); - ExtractorSampleSource source = new ExtractorSampleSource(videoUri, dataSource, extractor, DOWNSTREAM_RENDERER_COUNT, 5 * 1024 * 1024); + ExtractorSampleSource source = new ExtractorSampleSource(videoUri, dataSource, extractor, DOWNSTREAM_RENDERER_COUNT, EXO_BUFFER_SIZE); // The video renderer runs on another thread: we need to supply a handler on the main // thread in order to receive events. From cd18dcb4389fb1f7805116668bcbdbbd707dc466 Mon Sep 17 00:00:00 2001 From: Matti Jokitulppo Date: Tue, 26 Apr 2016 14:51:24 +0300 Subject: [PATCH 2/3] Start marker editing on all kinds of taps --- .../java/fi/aalto/legroup/achso/views/MarkerCanvas.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java b/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java index 89cf3eb7..4b2199ae 100644 --- a/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java +++ b/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java @@ -160,14 +160,9 @@ private class GestureListener extends GestureDetector.SimpleOnGestureListener { /** * Called when the canvas is tapped once. */ - @Override - public boolean onSingleTapUp(MotionEvent event) { - canvasTapped(event); - return true; - } - @Override public boolean onDown(MotionEvent event) { + canvasTapped(event); // Best practice to always return true here. // http://developer.android.com/training/gestures/detector.html#detect return true; From 46ca1c2d19f65d861b6ab08ac3fdc722087b0dd9 Mon Sep 17 00:00:00 2001 From: Matti Jokitulppo Date: Tue, 26 Apr 2016 14:56:04 +0300 Subject: [PATCH 3/3] Remove unnecessary best practices comment --- .../main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java b/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java index 4b2199ae..4c2732fe 100644 --- a/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java +++ b/app/src/main/java/fi/aalto/legroup/achso/views/MarkerCanvas.java @@ -163,8 +163,6 @@ private class GestureListener extends GestureDetector.SimpleOnGestureListener { @Override public boolean onDown(MotionEvent event) { canvasTapped(event); - // Best practice to always return true here. - // http://developer.android.com/training/gestures/detector.html#detect return true; }