Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c76ae2ad authored by emancebo's avatar emancebo Committed by Gerrit Code Review
Browse files

Merge "Reduce logspam in video player" into cm-11.0

parents a10b88e0 5cf33927
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ import android.bluetooth.BluetoothProfile;
public class MovieActivity extends Activity {
    @SuppressWarnings("unused")
    private static final String  TAG = "MovieActivity";
    private static final boolean LOG = true;
    private static final boolean LOG = false;
    public  static final String  KEY_LOGO_BITMAP = "logo-bitmap";
    public  static final String  KEY_TREAT_UP_AS_BACK = "treat-up-as-back";
    private static final String  VIDEO_SDP_MIME_TYPE = "application/sdp";
+52 −18
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
        AnimationListener {

    private static final String TAG = "Gallery3D/MovieControllerOverlay";
    private static final boolean LOG = true;
    private static final boolean LOG = false;

    private ScreenModeManager mScreenModeManager;
    private ScreenModeExt mScreenModeExt = new ScreenModeExt();
@@ -88,7 +88,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
        hideAnimation.setAnimationListener(this);

        enableRewindAndForward = true;
        if (LOG) {
            Log.v(TAG, "enableRewindAndForward is " + enableRewindAndForward);
        }
        mControllerRewindAndForwardExt.init(context);
        mScreenModeExt.init(context, mTimeBar);
        mBackground.setClickable(true);
@@ -281,7 +283,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
    @Override
    public void setViewEnabled(boolean isEnabled) {
        if (mListener.onIsRTSP()) {
            if (LOG) {
                Log.v(TAG, "setViewEnabled is " + isEnabled);
            }
            mOverlayExt.setCanScrubbing(isEnabled);
            mPlayPauseReplayView.setEnabled(isEnabled);
            if (enableRewindAndForward) {
@@ -299,7 +303,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
    @Override
    public void setPlayPauseReplayResume() {
        if (mListener.onIsRTSP()) {
            if (LOG) {
                Log.v(TAG, "setPlayPauseReplayResume is enabled is true");
            }
            mPlayPauseReplayView.setEnabled(true);
        }
    }
@@ -685,7 +691,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
            addView(mScreenView, wrapContent);

            if (enableRewindAndForward) {
                if (LOG) {
                    Log.v(TAG, "ScreenModeExt enableRewindAndForward");
                }
                mSeprator = new ImageView(context);
                // default next screen mode
                mSeprator.setImageResource(R.drawable.ic_separator_line);
@@ -696,8 +704,10 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
                addView(mSeprator, wrapContent);

            } else {
                if (LOG) {
                    Log.v(TAG, "ScreenModeExt unenableRewindAndForward");
                }
            }

            // for screen layout
            Bitmap screenButton = BitmapFactory.decodeResource(context.getResources(),
@@ -784,7 +794,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
        private int mTimeBarHeight = 0;

        void init(Context context) {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt init");
            }
            mTimeBarHeight = mTimeBar.getPreferredHeight();
            Bitmap button = BitmapFactory.decodeResource(context.getResources(),
                    R.drawable.ic_menu_forward);
@@ -833,39 +845,55 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
        @Override
        public void onClick(View v) {
            if (v == mStop) {
                if (LOG) {
                    Log.v(TAG, "ControllerRewindAndForwardExt onClick mStop");
                }
                mListenerForRewind.onStopVideo();
            } else if (v == mRewind) {
                if (LOG) {
                    Log.v(TAG, "ControllerRewindAndForwardExt onClick mRewind");
                }
                mListenerForRewind.onRewind();
            } else if (v == mForward) {
                if (LOG) {
                    Log.v(TAG, "ControllerRewindAndForwardExt onClick mForward");
                }
                mListenerForRewind.onForward();
            }
        }

        public void onStartHiding() {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onStartHiding");
            }
            startHideAnimation(mContollerButtons);
        }

        public void onCancelHiding() {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onCancelHiding");
            }
            mContollerButtons.setAnimation(null);
        }

        public void onHide() {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onHide");
            }
            mContollerButtons.setVisibility(View.INVISIBLE);
        }

        public void onShow() {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onShow");
            }
            mContollerButtons.setVisibility(View.VISIBLE);
        }

        public void onLayout(int l, int r, int b) {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onLayout");
            }
            int cl = (r - l - getAddedRightPadding()) / 2;
            int cr = cl + getAddedRightPadding();
            mContollerButtons.layout(cl, b - mTimeBar.getPreferredHeight(), cr, b);
@@ -877,14 +905,18 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements

        @Override
        public void setIListener(IRewindAndForwardListener listener) {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt setIListener " + listener);
            }
            mListenerForRewind = listener;
        }

        @Override
        public void showControllerButtonsView(boolean canStop, boolean canRewind, boolean canForward) {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt showControllerButtonsView " + canStop
                    + canRewind + canForward);
            }
            // show ui
            mStop.setEnabled(canStop);
            mRewind.setEnabled(canRewind);
@@ -955,7 +987,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements

        public void setViewEnabled(boolean isEnabled) {
            // TODO Auto-generated method stub
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt setViewEnabled is " + isEnabled);
            }
            mRewind.setEnabled(isEnabled);
            mForward.setEnabled(isEnabled);
        }
+30 −12
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public class MoviePlayer implements
        MediaPlayer.OnBufferingUpdateListener {
    @SuppressWarnings("unused")
    private static final String TAG = "MoviePlayer";
    private static final boolean LOG = true;
    private static final boolean LOG = false;

    private static final String KEY_VIDEO_POSITION = "video-position";
    private static final String KEY_RESUMEABLE_TIME = "resumeable-timeout";
@@ -205,7 +205,9 @@ public class MoviePlayer implements
                mKeyguardLocked = false;
                mCanResumed = false;
            } else if (Intent.ACTION_SHUTDOWN.equals(intent.getAction())) {
                if (LOG) {
                    Log.v(TAG, "Intent.ACTION_SHUTDOWN received");
                }
                mActivityContext.finish();
            }
        }
@@ -770,10 +772,14 @@ public class MoviePlayer implements
    public boolean onIsRTSP() {
        if (MovieUtils.isRtspStreaming(mMovieItem.getUri(), mMovieItem
                .getMimeType())) {
            if (LOG) {
                Log.v(TAG, "onIsRTSP() is RTSP");
            }
            return true;
        }
        if (LOG) {
            Log.v(TAG, "onIsRTSP() is not RTSP");
        }
        return false;
    }

@@ -831,9 +837,11 @@ public class MoviePlayer implements
    }

    public void updateRewindAndForwardUI() {
        if (LOG) {
            Log.v(TAG, "updateRewindAndForwardUI");
            Log.v(TAG, "updateRewindAndForwardUI== getCurrentPosition = " +  mVideoView.getCurrentPosition());
            Log.v(TAG, "updateRewindAndForwardUI==getDuration =" +  mVideoView.getDuration());
        }
        if (mControllerRewindAndForwardExt != null) {
            mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
                    .canStop(), mVideoView.canSeekBackward()
@@ -1492,7 +1500,9 @@ public class MoviePlayer implements

        @Override
        public void onStopVideo() {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onStopVideo()");
            }
            if (mPlayerExt.canStop()) {
                mPlayerExt.stopVideo();
                mControllerRewindAndForwardExt.showControllerButtonsView(false,
@@ -1502,7 +1512,9 @@ public class MoviePlayer implements

        @Override
        public void onRewind() {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onRewind()");
            }
            if (mVideoView != null && mVideoView.canSeekBackward()) {
                mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
                        .canStop(),
@@ -1511,7 +1523,9 @@ public class MoviePlayer implements
                int targetDuration = mVideoView.getCurrentPosition()
                        - stepValue < 0 ? 0 : mVideoView.getCurrentPosition()
                        - stepValue;
                if (LOG) {
                    Log.v(TAG, "onRewind targetDuration " + targetDuration);
                }
                mVideoView.seekTo(targetDuration);
            } else {
                mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
@@ -1522,7 +1536,9 @@ public class MoviePlayer implements

        @Override
        public void onForward() {
            if (LOG) {
                Log.v(TAG, "ControllerRewindAndForwardExt onForward()");
            }
            if (mVideoView != null && mVideoView.canSeekForward()) {
                mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
                        .canStop(),
@@ -1532,7 +1548,9 @@ public class MoviePlayer implements
                        + stepValue > mVideoView.getDuration() ? mVideoView
                        .getDuration() : mVideoView.getCurrentPosition()
                        + stepValue;
                if (LOG) {
                    Log.v(TAG, "onForward targetDuration " + targetDuration);
                }
                mVideoView.seekTo(targetDuration);
            } else {
                mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
+4 −4
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public class TimeBar extends View {
    private static final int TEXT_SIZE_IN_DP = 14;

    private static final String TAG = "Gallery3D/TimeBar";
    private static final boolean LOG = true;
    private static final boolean LOG = false;
    public static final int UNKNOWN = -1;

    protected final Listener mListener;
@@ -397,7 +397,7 @@ interface ITimeBarLayoutExt {

class TimeBarInfoExtImpl implements ITimeBarInfoExt {
    private static final String TAG = "TimeBarInfoExtensionImpl";
    private static final boolean LOG = true;
    private static final boolean LOG = false;
    private static final String ELLIPSE = "...";

    private Paint mInfoPaint;
@@ -462,7 +462,7 @@ class TimeBarInfoExtImpl implements ITimeBarInfoExt {

class TimeBarSecondaryProgressExtImpl implements ITimeBarSecondaryProgressExt {
    private static final String TAG = "TimeBarSecondaryProgressExtensionImpl";
    private static final boolean LOG = true;
    private static final boolean LOG = false;

    private int mBufferPercent;
    private Rect mSecondaryBar;
@@ -497,7 +497,7 @@ class TimeBarSecondaryProgressExtImpl implements ITimeBarSecondaryProgressExt {

class TimeBarLayoutExtImpl implements ITimeBarLayoutExt {
    private static final String TAG = "TimeBarLayoutExtensionImpl";
    private static final boolean LOG = true;
    private static final boolean LOG = false;

    private int mTextPadding;
    private int mVPaddingInPx;
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ import android.provider.MediaStore;

public class MovieItem implements IMovieItem {
    private static final String TAG = "MovieItem";
    private static final boolean LOG = true;
    private static final boolean LOG = false;

    private Uri mUri;
    private String mMimeType;
Loading