当前位置: 首页>>代码示例>>Java>>正文


Java DebugLog类代码示例

本文整理汇总了Java中tv.danmaku.ijk.media.player.pragma.DebugLog的典型用法代码示例。如果您正苦于以下问题:Java DebugLog类的具体用法?Java DebugLog怎么用?Java DebugLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DebugLog类属于tv.danmaku.ijk.media.player.pragma包,在下文中一共展示了DebugLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onInfo

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public boolean onInfo(IMediaPlayer mp, int what, int extra) {

  DebugLog.dfmt(TAG, "onInfo: (%d, %d)", what, extra);
  if (mOnInfoListener != null) {
    mOnInfoListener.onInfo(mp, what, extra);
  } else if (mMediaPlayer != null) {
    if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_START) {
      DebugLog.dfmt(TAG, "onInfo: (MEDIA_INFO_BUFFERING_START)");
      if (mMediaBufferingIndicator != null) {
        mMediaBufferingIndicator.setVisibility(View.VISIBLE);
      }
    } else if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_END) {
      DebugLog.dfmt(TAG, "onInfo: (MEDIA_INFO_BUFFERING_END)");
      if (mMediaBufferingIndicator != null) {
        mMediaBufferingIndicator.setVisibility(View.GONE);
      }
    }
  }

  return true;
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:23,代码来源:VideoPlayerView.java

示例2: onError

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public boolean onError(IMediaPlayer player, int frameworkErr, int implErr) {
    DebugLog.dfmt(TAG, "Error: %d, %d", frameworkErr, implErr);
    mCurrentState = STATE_ERROR;
    mTargetState = STATE_ERROR;
    if (mMediaController != null)
        mMediaController.hide();
    if (mOnErrorListener != null)
        if (mOnErrorListener.onError(mMediaPlayer, frameworkErr, implErr))
            return true;
    if (getWindowToken() != null){
        int message = frameworkErr == IMediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK
                ? R.string.video_error_text_invalid_progressive_playback : R.string.video_error_text_unknown;
        new AlertDialog.Builder(mContext)
                .setTitle(R.string.video_error_title)
                .setMessage(message)
                .setPositiveButton(R.string.video_error_button, (error, whichButton) -> {
                    if (mOnCompletionListener != null)
                        mOnCompletionListener.onCompletion(mMediaPlayer);
                })
                .setCancelable(false)
                .show();
    }
    return true;
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:26,代码来源:VideoPlayerView.java

示例3: onInfo

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public boolean onInfo(IMediaPlayer player, int what, int extra) {
    DebugLog.dfmt(TAG, "onInfo: (%d, %d)", what, extra);
    if (mOnInfoListener != null)
        mOnInfoListener.onInfo(player, what, extra);
    else if (mMediaPlayer != null){
        if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_START){
            DebugLog.dfmt(TAG, "onInfo: (MEDIA_INFO_BUFFERING_START)");
            if (mMediaBufferingIndicator != null)
                mMediaBufferingIndicator.setVisibility(VISIBLE);
        } else if (what == IMediaPlayer.MEDIA_INFO_BUFFERING_END){
            DebugLog.dfmt(TAG, "onInfo: (MEDIA_INFO_BUFFERING_END)");
            if (mMediaBufferingIndicator != null)
                mMediaBufferingIndicator.setVisibility(GONE);
        }
    }
    return true;
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:19,代码来源:VideoPlayerView.java

示例4: onControlResolveSegmentUrl

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@CalledByNative
private static String onControlResolveSegmentUrl(Object weakThiz, int segment) {
    DebugLog.ifmt(TAG, "onControlResolveSegmentUrl %d", segment);
    if (weakThiz == null || !(weakThiz instanceof WeakReference<?>))
        return null;

    @SuppressWarnings("unchecked")
    WeakReference<IjkMediaPlayer> weakPlayer = (WeakReference<IjkMediaPlayer>) weakThiz;
    IjkMediaPlayer player = weakPlayer.get();
    if (player == null)
        return null;

    OnControlMessageListener listener = player.mOnControlMessageListener;
    if (listener == null)
        return null;

    return listener.onControlResolveSegmentUrl(segment);
}
 
开发者ID:hejunlin2013,项目名称:LivePlayback,代码行数:19,代码来源:IjkMediaPlayer.java

示例5: onNativeInvoke

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@CalledByNative
private static boolean onNativeInvoke(Object weakThiz, int what, Bundle args) {
    DebugLog.ifmt(TAG, "onNativeInvoke %d", what);
    if (weakThiz == null || !(weakThiz instanceof WeakReference<?>))
        return false;

    @SuppressWarnings("unchecked")
    WeakReference<IjkMediaPlayer> weakPlayer = (WeakReference<IjkMediaPlayer>) weakThiz;
    IjkMediaPlayer player = weakPlayer.get();
    if (player == null)
        return false;

    OnNativeInvokeListener listener = player.mOnNativeInvokeListener;
    if (listener == null)
        return false;

    return listener.onNativeInvoke(what, args);
}
 
开发者ID:hejunlin2013,项目名称:LivePlayback,代码行数:19,代码来源:IjkMediaPlayer.java

示例6: onVideoSizeChanged

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height,
                               int sarNum, int sarDen) {

  DebugLog.dfmt(TAG, "onVideoSizeChanged: (%dx%d)", width, height);
  mVideoWidth = mp.getVideoWidth();
  mVideoHeight = mp.getVideoHeight();
  mVideoSarNum = sarNum;
  mVideoSarDen = sarDen;
  if (mVideoWidth != 0 && mVideoHeight != 0) {
    setVideoLayout(mVideoLayout);
  }
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:13,代码来源:VideoPlayerView.java

示例7: onPrepared

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
public void onPrepared(IMediaPlayer mp) {

      DebugLog.d(TAG, "onPrepared");
      mCurrentState = STATE_PREPARED;
      mTargetState = STATE_PLAYING;

      if (mOnPreparedListener != null) {
        mOnPreparedListener.onPrepared(mMediaPlayer);
      }
      if (mMediaController != null) {
        mMediaController.setEnabled(true);
      }
      mVideoWidth = mp.getVideoWidth();
      mVideoHeight = mp.getVideoHeight();

      long seekToPosition = mSeekWhenPrepared;

      if (seekToPosition != 0) {
        seekTo(seekToPosition);
      }
      if (mVideoWidth != 0 && mVideoHeight != 0) {
        setVideoLayout(mVideoLayout);
        if (mSurfaceWidth == mVideoWidth
            && mSurfaceHeight == mVideoHeight) {
          if (mTargetState == STATE_PLAYING) {
            start();
            if (mMediaController != null) {
              mMediaController.show();
            }
          } else if (!isPlaying()
              && (seekToPosition != 0 || getCurrentPosition() > 0)) {
            if (mMediaController != null) {
              mMediaController.show(0);
            }
          }
        }
      } else if (mTargetState == STATE_PLAYING) {
        start();
      }
    }
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:41,代码来源:VideoPlayerView.java

示例8: onCompletion

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
public void onCompletion(IMediaPlayer mp) {

      DebugLog.d(TAG, "onCompletion");
      mCurrentState = STATE_PLAYBACK_COMPLETED;
      mTargetState = STATE_PLAYBACK_COMPLETED;
      if (mMediaController != null) {
        mMediaController.hide();
      }
      if (mOnCompletionListener != null) {
        mOnCompletionListener.onCompletion(mMediaPlayer);
      }
    }
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:13,代码来源:VideoPlayerView.java

示例9: onError

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
public boolean onError(IMediaPlayer mp, int framework_err, int impl_err) {

      DebugLog.dfmt(TAG, "Error: %d, %d", framework_err, impl_err);
      mCurrentState = STATE_ERROR;
      mTargetState = STATE_ERROR;
      if (mMediaController != null) {
        mMediaController.hide();
      }

      if (mOnErrorListener != null) {
        if (mOnErrorListener.onError(mMediaPlayer, framework_err,
            impl_err)) {
          return true;
        }
      }

      if (getWindowToken() != null) {
        int message = framework_err == IMediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK
                      ?
                      R.string.video_error_text_invalid_progressive_playback
                      : R.string.video_error_text_unknown;

        new AlertDialog.Builder(mContext)
            .setTitle(R.string.video_error_title)
            .setMessage(message)
            .setPositiveButton(
                R.string.video_error_button,
                (dialog, whichButton) -> {

                  if (mOnCompletionListener != null) {
                    mOnCompletionListener
                        .onCompletion(mMediaPlayer);
                  }
                }).setCancelable(false).show();
      }
      return true;
    }
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:38,代码来源:VideoPlayerView.java

示例10: onSeekComplete

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public void onSeekComplete(IMediaPlayer mp) {

  DebugLog.d(TAG, "onSeekComplete");
  if (mOnSeekCompleteListener != null) {
    mOnSeekCompleteListener.onSeekComplete(mp);
  }
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:9,代码来源:VideoPlayerView.java

示例11: onVideoSizeChanged

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public void onVideoSizeChanged(IMediaPlayer player, int width, int height, int sarNum, int sarDen) {
    DebugLog.dfmt(TAG, "onVideoSizeChanged: (%dx%d)", width, height);
    mVideoWidth = player.getVideoWidth();
    mVideoHeight = player.getVideoHeight();
    mVideoSarNum = sarNum;
    mVideoSarDen = sarDen;
    if (mVideoWidth != 0 && mVideoHeight != 0){
        setVideoLayout(mVideoLayout);
    }
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:12,代码来源:VideoPlayerView.java

示例12: onPrepared

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public void onPrepared(IMediaPlayer player) {
    DebugLog.d(TAG, "OnPrepare");
    mCurrentState = STATE_PREPARED;
    mTargetState = STATE_PLAYING;
    if (mOnPreparedListener != null){
        mOnPreparedListener.onPrepared(player);
    }
    if (mMediaController != null){
        mMediaController.setEnabled(true);
    }
    mVideoWidth = player.getVideoWidth();
    mVideoHeight = player.getVideoHeight();
    long seekToPosition = mSeekWhenPrepared;
    if (seekToPosition != 0){
        seekTo(seekToPosition);
    }
    if (mVideoWidth != 0 && mVideoHeight != 0){
        setVideoLayout(mVideoLayout);
        if (mSurfaceWidth == mVideoWidth && mSurfaceHeight == mVideoHeight){
            if (mTargetState == STATE_PLAYING){
                start();
                if (mMediaController != null)
                    mMediaController.show();
            } else if (!isPlaying() && (seekToPosition != 0 || getCurrentPosition() > 0)){
                if (mMediaController != null)
                    mMediaController.show(0);
            }
        }
    } else if (mTargetState == STATE_PLAYING){
        start();
    }
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:34,代码来源:VideoPlayerView.java

示例13: onCompletion

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public void onCompletion(IMediaPlayer iMediaPlayer) {
    DebugLog.d(TAG, "onCompletion");
    mCurrentState = STATE_PLAYBACK_COMPLETED;
    mTargetState = STATE_PLAYBACK_COMPLETED;
    if (mMediaController != null)
        mMediaController.hide();
    if (mOnCompletionListener != null)
        mOnCompletionListener.onCompletion(mMediaPlayer);
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:11,代码来源:VideoPlayerView.java

示例14: setVideoLayout

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
private void setVideoLayout(int layout) {
    ViewGroup.LayoutParams params = getLayoutParams();
    Pair<Integer, Integer> resolution = ScreenResolution.getResolution(mContext);
    int windowWidth = resolution.first, windowHeight = resolution.second;
    float windowRatio = windowWidth / (float)windowHeight;
    int sarNum = mVideoSarNum;
    int sarDen = mVideoSarDen;
    if (mVideoWidth > 0 && mVideoHeight > 0){
        float videoRatio = mVideoWidth / (float)mVideoHeight;
        if (sarNum > 0 && sarDen > 0){
            videoRatio = videoRatio * sarNum / sarDen;
        }
        mSurfaceWidth = mVideoWidth;
        mSurfaceHeight = mVideoHeight;

        if (VIDEO_LAYOUT_ORIGIN == layout && mSurfaceWidth < windowWidth && mSurfaceHeight < windowHeight){
            params.width = (int) (mSurfaceHeight * videoRatio);
            params.height = mSurfaceHeight;
        } else if (layout == VIDEO_LAYOUT_ZOOM){
            params.width = windowRatio > videoRatio ? windowWidth : (int) (videoRatio * windowHeight);
            params.height = windowRatio < videoRatio ? windowHeight : (int) (windowWidth / videoRatio);
        } else {
            boolean full = layout == VIDEO_LAYOUT_STRETCH;
            params.width = (full || windowRatio < videoRatio) ? windowWidth : (int) (videoRatio * windowHeight);
            params.height = (full || windowRatio > videoRatio) ? windowHeight : (int) (windowWidth / videoRatio);
        }
        setLayoutParams(params);
        getHolder().setFixedSize(mSurfaceWidth, mSurfaceHeight);
        DebugLog.dfmt(TAG,
                "VIDEO: %dx%dx%f[SAR:%d:%d], Surface: %dx%d, LP: %dx%d, Window: %dx%dx%f",
                mVideoWidth, mVideoHeight, videoRatio, mVideoSarNum,
                mVideoSarDen, mSurfaceWidth, mSurfaceHeight, params.width,
                params.height, windowWidth, windowHeight, windowRatio);
    }
    mVideoLayout = layout;
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:37,代码来源:VideoPlayerView.java

示例15: setScreenOnWhilePlaying

import tv.danmaku.ijk.media.player.pragma.DebugLog; //导入依赖的package包/类
@Override
public void setScreenOnWhilePlaying(boolean screenOn) {
    if (mScreenOnWhilePlaying != screenOn) {
        if (screenOn && mSurfaceHolder == null) {
            DebugLog.w(TAG,
                    "setScreenOnWhilePlaying(true) is ineffective without a SurfaceHolder");
        }
        mScreenOnWhilePlaying = screenOn;
        updateSurfaceScreenOn();
    }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:12,代码来源:IjkMediaPlayer.java


注:本文中的tv.danmaku.ijk.media.player.pragma.DebugLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。