Java Code Examples for tv.danmaku.ijk.media.player.IMediaPlayer#getVideoSarDen()

The following examples show how to use tv.danmaku.ijk.media.player.IMediaPlayer#getVideoSarDen() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IjkVideoView.java    From AndroidTvDemo with Apache License 2.0 6 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen)
{
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0)
    {
        if (mRenderView != null)
        {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 2
Source File: IjkVideoView.java    From TvPlayer with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 3
Source File: IjkVideoView.java    From GiraffePlayer with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 4
Source File: IjkVideoView.java    From WliveTV with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 5
Source File: IjkVideoView.java    From IjkPlayerDemo with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 6
Source File: IjkVideoView.java    From ZZShow with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 7
Source File: IjkVideoView.java    From MD with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 8
Source File: IjkVideoView.java    From LivePlayback with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 9
Source File: IjkVideoView.java    From talk-android with MIT License 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 10
Source File: MediaPlayerView.java    From HeroVideo-master with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 11
Source File: ParsingPlayerProxy.java    From ParsingPlayer with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoHeight = mp.getVideoHeight();
    mVideoWidth = mp.getVideoWidth();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mStateListener != null)
            mStateListener.onVideoSizeChanged(mVideoWidth, mVideoHeight,
                    mVideoSarNum, mVideoSarDen);
    }
}
 
Example 12
Source File: IjkVideoView.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 13
Source File: IjkVideoView.java    From MKVideoPlayer with MIT License 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 14
Source File: IjkVideoView.java    From ShareBox with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 15
Source File: PlayerView.java    From VRPlayer with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {

        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 16
Source File: MediaPlayerView.java    From HeroVideo-master with Apache License 2.0 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 17
Source File: IjkVideoView.java    From DanDanPlayForAndroid with MIT License 5 votes vote down vote up
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();
    if (mVideoWidth != 0 && mVideoHeight != 0) {
        if (mRenderView != null) {
            mRenderView.setVideoSize(mVideoWidth, mVideoHeight);
            mRenderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
        }
        // REMOVED: getHolder().setFixedSize(mVideoWidth, mVideoHeight);
        requestLayout();
    }
}
 
Example 18
Source File: XMediaPlayer.java    From XPlayer2 with Apache License 2.0 5 votes vote down vote up
@Override
public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDe) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    mVideoSarNum = mp.getVideoSarNum();
    mVideoSarDen = mp.getVideoSarDen();

    if (mMediaPlayerListener != null) {
        mMediaPlayerListener.onVideoSizeChanged(this, width, height, sarNum, sarDe);
    }
}
 
Example 19
Source File: InfoUtil.java    From DMusic with Apache License 2.0 4 votes vote down vote up
public static void showMediaInfo(Context context, IMediaPlayer mMediaPlayer) {
    if (mMediaPlayer == null)
        return;

    int mVideoWidth = mMediaPlayer.getVideoWidth();
    int mVideoHeight = mMediaPlayer.getVideoHeight();
    int mVideoSarNum = mMediaPlayer.getVideoSarNum();
    int mVideoSarDen = mMediaPlayer.getVideoSarDen();

    int selectedVideoTrack = MediaPlayerCompat.getSelectedTrack(mMediaPlayer, ITrackInfo.MEDIA_TRACK_TYPE_VIDEO);
    int selectedAudioTrack = MediaPlayerCompat.getSelectedTrack(mMediaPlayer, ITrackInfo.MEDIA_TRACK_TYPE_AUDIO);
    int selectedSubtitleTrack = MediaPlayerCompat.getSelectedTrack(mMediaPlayer, ITrackInfo.MEDIA_TRACK_TYPE_TIMEDTEXT);

    //media_information
    ULog.d("Player" + MediaPlayerCompat.getName(mMediaPlayer));
    ULog.d("Resolution" + buildResolution(mVideoWidth, mVideoHeight, mVideoSarNum, mVideoSarDen));
    ULog.d("Length" + buildTimeMilli(mMediaPlayer.getDuration()));

    ITrackInfo trackInfos[] = mMediaPlayer.getTrackInfo();
    if (trackInfos != null) {
        int index = -1;
        for (ITrackInfo trackInfo : trackInfos) {
            index++;

            int trackType = trackInfo.getTrackType();
            if (index == selectedVideoTrack) {
                ULog.d("Stream #" + index + " mi__selected_video_track");
            } else if (index == selectedAudioTrack) {
                ULog.d("Stream #" + index + " mi__selected_audio_track");
            } else if (index == selectedSubtitleTrack) {
                ULog.d("Stream #" + index + " mi__selected_subtitle_track");
            } else {
                ULog.d("Stream #" + index);
            }
            ULog.d("Type" + buildTrackType(context, trackType));
            String language = TextUtils.isEmpty(trackInfo.getLanguage()) ? "und" : trackInfo.getLanguage();
            ULog.d("Language:" + language);

            IMediaFormat mediaFormat = trackInfo.getFormat();
            if (mediaFormat == null) {
            } else if (mediaFormat instanceof IjkMediaFormat) {
                switch (trackType) {
                    case ITrackInfo.MEDIA_TRACK_TYPE_VIDEO:
                        ULog.d("Codec:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        ULog.d("Profile level:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        ULog.d("Pixel format:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PIXEL_FORMAT_UI));
                        ULog.d("Resolution:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_RESOLUTION_UI));
                        ULog.d("Frame rate:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_FRAME_RATE_UI));
                        ULog.d("Bit rate:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    case ITrackInfo.MEDIA_TRACK_TYPE_AUDIO:
                        ULog.d("Codec:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        ULog.d("Profile level:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        ULog.d("Sample rate:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_SAMPLE_RATE_UI));
                        ULog.d("Channels:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_CHANNEL_UI));
                        ULog.d("Bit rate:" + mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    default:
                        break;
                }
            }
        }
    }
}
 
Example 20
Source File: IjkVideoView.java    From DMusic with Apache License 2.0 4 votes vote down vote up
private void setArgs(IMediaPlayer mp) {
    videoWidth = mp.getVideoWidth();
    videoHeight = mp.getVideoHeight();
    videoSarNum = mp.getVideoSarNum();
    videoSarDen = mp.getVideoSarDen();
}