From 037aeaf7646cdf08c6996f5cf438bbabf759979d Mon Sep 17 00:00:00 2001 From: Oliver Woodman Date: Thu, 5 Jan 2017 14:57:31 +0000 Subject: [PATCH] Some minor cleanup --- .../exoplayer2/ui/SimpleExoPlayerView.java | 10 +++---- .../exoplayer2/upstream/DataSource.java | 2 +- .../video/MediaCodecVideoRenderer.java | 8 ++++-- .../drawable-v21/exo_controls_fastforward.xml | 27 ++++++++++++++---- .../res/drawable-v21/exo_controls_next.xml | 27 ++++++++++++++---- .../res/drawable-v21/exo_controls_pause.xml | 27 ++++++++++++++---- .../res/drawable-v21/exo_controls_play.xml | 27 ++++++++++++++---- .../drawable-v21/exo_controls_previous.xml | 27 ++++++++++++++---- .../res/drawable-v21/exo_controls_rewind.xml | 27 ++++++++++++++---- .../exo_controls_fastforward.png | Bin 712 -> 0 bytes .../drawable-xxxhdpi/exo_controls_next.png | Bin 532 -> 0 bytes .../drawable-xxxhdpi/exo_controls_pause.png | Bin 188 -> 0 bytes .../drawable-xxxhdpi/exo_controls_play.png | Bin 484 -> 0 bytes .../exo_controls_previous.png | Bin 522 -> 0 bytes .../drawable-xxxhdpi/exo_controls_rewind.png | Bin 690 -> 0 bytes 15 files changed, 143 insertions(+), 39 deletions(-) delete mode 100644 library/src/main/res/drawable-xxxhdpi/exo_controls_fastforward.png delete mode 100644 library/src/main/res/drawable-xxxhdpi/exo_controls_next.png delete mode 100644 library/src/main/res/drawable-xxxhdpi/exo_controls_pause.png delete mode 100644 library/src/main/res/drawable-xxxhdpi/exo_controls_play.png delete mode 100644 library/src/main/res/drawable-xxxhdpi/exo_controls_previous.png delete mode 100644 library/src/main/res/drawable-xxxhdpi/exo_controls_rewind.png diff --git a/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java b/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java index 8ac0c64082a..3349e05eda7 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java +++ b/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java @@ -202,7 +202,7 @@ public SimpleExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr int playerLayoutId = R.layout.exo_simple_player_view; boolean useArtwork = true; - int defaultArtwork = 0; + int defaultArtworkId = 0; boolean useController = true; int surfaceType = SURFACE_TYPE_SURFACE_VIEW; int resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT; @@ -214,8 +214,8 @@ public SimpleExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr playerLayoutId = a.getResourceId(R.styleable.SimpleExoPlayerView_player_layout_id, playerLayoutId); useArtwork = a.getBoolean(R.styleable.SimpleExoPlayerView_use_artwork, useArtwork); - defaultArtwork = a.getResourceId(R.styleable.SimpleExoPlayerView_default_artwork, - defaultArtwork); + defaultArtworkId = a.getResourceId(R.styleable.SimpleExoPlayerView_default_artwork, + defaultArtworkId); useController = a.getBoolean(R.styleable.SimpleExoPlayerView_use_controller, useController); surfaceType = a.getInt(R.styleable.SimpleExoPlayerView_surface_type, surfaceType); resizeMode = a.getInt(R.styleable.SimpleExoPlayerView_resize_mode, resizeMode); @@ -257,8 +257,8 @@ public SimpleExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr // Artwork view. artworkView = (ImageView) findViewById(R.id.exo_artwork); this.useArtwork = useArtwork && artworkView != null; - if (defaultArtwork != 0) { - this.defaultArtwork = BitmapFactory.decodeResource(context.getResources(), defaultArtwork); + if (defaultArtworkId != 0) { + defaultArtwork = BitmapFactory.decodeResource(context.getResources(), defaultArtworkId); } // Subtitle view. diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/DataSource.java b/library/src/main/java/com/google/android/exoplayer2/upstream/DataSource.java index 0ddf17cbe9e..4a2354e1803 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/DataSource.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/DataSource.java @@ -65,7 +65,7 @@ interface Factory { * @param buffer The buffer into which the read data should be stored. * @param offset The start offset into {@code buffer} at which data should be written. * @param readLength The maximum number of bytes to read. - * @return The number of bytes read, or {@link C#RESULT_END_OF_INPUT} if no data is avaliable + * @return The number of bytes read, or {@link C#RESULT_END_OF_INPUT} if no data is available * because the end of the opened range has been reached. * @throws IOException If an error occurs reading from the source. */ diff --git a/library/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java b/library/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java index f68b72fb654..d1bf5ac260c 100644 --- a/library/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/video/MediaCodecVideoRenderer.java @@ -438,10 +438,12 @@ protected boolean processOutputBuffer(long positionUs, long elapsedRealtimeUs, M } /** - * Returns true if the current frame should be dropped. + * Returns whether the buffer being processed should be dropped. * - * @param earlyUs Time indicating how early the frame is. Negative values indicate late frame. - * @param elapsedRealtimeUs Wall clock time. + * @param earlyUs The time until the buffer should be presented in microseconds. A negative value + * indicates that the buffer is late. + * @param elapsedRealtimeUs {@link android.os.SystemClock#elapsedRealtime()} in microseconds, + * measured at the start of the current iteration of the rendering loop. */ protected boolean shouldDropOutputBuffer(long earlyUs, long elapsedRealtimeUs) { // Drop the frame if we're more than 30ms late rendering the frame. diff --git a/library/src/main/res/drawable-v21/exo_controls_fastforward.xml b/library/src/main/res/drawable-v21/exo_controls_fastforward.xml index 945d70eef3f..4b86e109e96 100644 --- a/library/src/main/res/drawable-v21/exo_controls_fastforward.xml +++ b/library/src/main/res/drawable-v21/exo_controls_fastforward.xml @@ -1,8 +1,25 @@ + + android:width="32dp" + android:height="32dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + + - diff --git a/library/src/main/res/drawable-v21/exo_controls_next.xml b/library/src/main/res/drawable-v21/exo_controls_next.xml index c96f1e4afee..6305bcbc900 100644 --- a/library/src/main/res/drawable-v21/exo_controls_next.xml +++ b/library/src/main/res/drawable-v21/exo_controls_next.xml @@ -1,8 +1,25 @@ + + android:width="32dp" + android:height="32dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + + - diff --git a/library/src/main/res/drawable-v21/exo_controls_pause.xml b/library/src/main/res/drawable-v21/exo_controls_pause.xml index 69a17cb9a17..45cd68bed6c 100644 --- a/library/src/main/res/drawable-v21/exo_controls_pause.xml +++ b/library/src/main/res/drawable-v21/exo_controls_pause.xml @@ -1,8 +1,25 @@ + + android:width="32dp" + android:height="32dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + + - diff --git a/library/src/main/res/drawable-v21/exo_controls_play.xml b/library/src/main/res/drawable-v21/exo_controls_play.xml index c21978f7f23..c8c4cdb127d 100644 --- a/library/src/main/res/drawable-v21/exo_controls_play.xml +++ b/library/src/main/res/drawable-v21/exo_controls_play.xml @@ -1,8 +1,25 @@ + + android:width="32dp" + android:height="32dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + + - diff --git a/library/src/main/res/drawable-v21/exo_controls_previous.xml b/library/src/main/res/drawable-v21/exo_controls_previous.xml index c5789d5fe4e..9564a2a350f 100644 --- a/library/src/main/res/drawable-v21/exo_controls_previous.xml +++ b/library/src/main/res/drawable-v21/exo_controls_previous.xml @@ -1,8 +1,25 @@ + + android:width="32dp" + android:height="32dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + + - diff --git a/library/src/main/res/drawable-v21/exo_controls_rewind.xml b/library/src/main/res/drawable-v21/exo_controls_rewind.xml index 6ecb8f8a27f..976b7061709 100644 --- a/library/src/main/res/drawable-v21/exo_controls_rewind.xml +++ b/library/src/main/res/drawable-v21/exo_controls_rewind.xml @@ -1,8 +1,25 @@ + + android:width="32dp" + android:height="32dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + + - diff --git a/library/src/main/res/drawable-xxxhdpi/exo_controls_fastforward.png b/library/src/main/res/drawable-xxxhdpi/exo_controls_fastforward.png deleted file mode 100644 index af0435a8b7c85ab6703fdd2251971a5fc3a9d389..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 712 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H3?#oinD`S&H3s;ExVjhk{2x%j<@0C>&@oyi zL4Lsuj}>&fe+%qqIq&d&b@b=zY>C&~d2aig9G*V=xP``Mj(nNr@15hDuX~qYzMbR5 zz`%IM)5S5QBJS@|+ zdk*yle>Gy`9qV8Jj*JuUInO>t`~v^F{b@I4zewMoe|eiyjopI!hPvm~3oM>CoWHkn zUSlBN50?WaY=4h__bI=_Txay_Wy9SwKWYwCF#kRHHDd3+rhnJI$Hc>p@;3t;<-Qtj z)bE1IQ-b!Ae{&pUp0@ZG*fjt9@4g=%BS-XCojS$x#rB*cFf}lEy85}Sb4q9e0Nizq AFaQ7m diff --git a/library/src/main/res/drawable-xxxhdpi/exo_controls_next.png b/library/src/main/res/drawable-xxxhdpi/exo_controls_next.png deleted file mode 100644 index 50916cf0e79d2b8b88c767c63e0060fd3f43b710..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 532 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H3?#oinD`S&cf zkY6wZ&-C-z60i5O{O)EGp7uM$AmVy4i}iNbf<>R|?*0Gop7utOv*pdno1fLRGmHEun{D^fTskEPOi1mr zmaAHy&Ck4Q?&*eK6_Xi5_bW>VJg%1v`1(tU`PKViwvhcVWf=a}oNl;vUWMVUn$dz~ z@kR@NEi7iZaxRwPu>zw6JLdrl4~AooOa^>X4TT#RdYV}iWK0+yCjg~*4_HJn96N}R zVoQ+GVR*a%tSdTz@$uB(T+{#;51s%3 diff --git a/library/src/main/res/drawable-xxxhdpi/exo_controls_pause.png b/library/src/main/res/drawable-xxxhdpi/exo_controls_pause.png deleted file mode 100644 index 6a5c59335e108d3fc995791d886b4b158e1c809d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?I3?vN&YJLDI(Ey(iSN8&+{}^EVDaKns1#Bfj ze!&d!4iW+?+N{j~fFc2&E{-7;ac|EomX@QS3j3^P6+KyyBiBNS_J`6e zjsh%>8yGG!nQ(7l;1?S_TA2;rE@GTf_K?A6cLu|BdQuIU;=Bj8aI+`eas^5s0!m*5N*4g7 zO`y_z2ex#xVd@4+%V5_HGhF7t%1m~6umTwyez7NfUsmwXlfeNb?CI*~vd$@?2>>4k Bw*vqG diff --git a/library/src/main/res/drawable-xxxhdpi/exo_controls_previous.png b/library/src/main/res/drawable-xxxhdpi/exo_controls_previous.png deleted file mode 100644 index 00f7b97d1b374194e102bfd2220ef3c996092851..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 522 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H3?#oinD`S&r3LtexVjhk{HHz0oA&Ai&_>0Q zAirRS&*>sIr|-}I&GLLP$7Gr2_dNSm+zpC@*I(YOaoxLJApFZeC0zyvMk7xb$B>G+ zx7YUuH77{0CW;u!I~uAqdH$(=|6lFx9V272+jHK|tmJyO=fYjBrBi~uG(p75f4BZV zewq55NlxxGOOO6qp97gIj2OR{r!xI2p2}HqcRFW9)jA`_*GoeVTsy^b=D3#dhcXS} z4L+e<4KK?XeD*UZ{1Roj{GMS(9qWNF)(p$y84dpOL8O=xe#tUiUJsOFN0thQ=n8eH zzsj(u(P%-nybMEc{8^?Ahxr=zsdGBmv$H#VzQ}lChbgvpz;8L|wu?@SqvA7mqLL_J3xpcus<& zMV&tiXN4!%>DIV?eUx`ZzLo!Gehf?F`Il$rvg{7~F=6@E#Sau}Ja(>)1qsUE_1rMO zmH(%O1y@`PzvaBUt^z;iyu2J(5Y=)%V(;$B4_>L%cx)^dOtG6^=YDXR7?2WL7gocIgq34(Vn^sT$ z^74yz&#!`Cfg4sf`Y(@XUoH3};TNl0t-)WF8(R+?zr4Pg`NPF8**(81ewA*RKXJX} zHI);!XScFCzPW$&a~sRf^();3QvU5VG38*IAEPAnWM5h-lj8&CWv=Wi`|l?+9kzQ? zB;feQ_{oK+GyU_`xPKpfoNy!k#PhbJe||8ZJyiF>BH{+W96MM%(Y`{4=eJ@WH@DxR z=Q8^vKUAdI+4HsiHHbIn{&wj3lzdaJY0(cJKTcq@Kd?3RVBe1i&l#GkA1nq5c-*|A zv!cfDGe!u=$M4ad^u1@~