本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
示例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;
}
示例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();
}
}