• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IjkMediaFormat类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: showMediaInfo

import tv.danmaku.ijk.media.player.misc.IjkMediaFormat; //导入依赖的package包/类
public void showMediaInfo() {
    if (mMediaPlayer == null)
        return;

    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);

    TableLayoutBinder builder = new TableLayoutBinder(getContext());
    builder.appendSection(R.string.mi_player);
    builder.appendRow2(R.string.mi_player, MediaPlayerCompat.getName(mMediaPlayer));
    builder.appendSection(R.string.mi_media);
    builder.appendRow2(R.string.mi_resolution, buildResolution(mVideoWidth, mVideoHeight, mVideoSarNum, mVideoSarDen));
    builder.appendRow2(R.string.mi_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) {
                builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index) + " " + getContext().getString(R.string.mi__selected_video_track));
            } else if (index == selectedAudioTrack) {
                builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index) + " " + getContext().getString(R.string.mi__selected_audio_track));
            } else if (index == selectedSubtitleTrack) {
                builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index) + " " + getContext().getString(R.string.mi__selected_subtitle_track));
            } else {
                builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index));
            }
            builder.appendRow2(R.string.mi_type, buildTrackType(trackType));
            builder.appendRow2(R.string.mi_language, buildLanguage(trackInfo.getLanguage()));

            IMediaFormat mediaFormat = trackInfo.getFormat();
            if (mediaFormat == null) {
            } else if (mediaFormat instanceof IjkMediaFormat) {
                switch (trackType) {
                    case ITrackInfo.MEDIA_TRACK_TYPE_VIDEO:
                        builder.appendRow2(R.string.mi_codec, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        builder.appendRow2(R.string.mi_profile_level, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        builder.appendRow2(R.string.mi_pixel_format, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PIXEL_FORMAT_UI));
                        builder.appendRow2(R.string.mi_resolution, mediaFormat.getString(IjkMediaFormat.KEY_IJK_RESOLUTION_UI));
                        builder.appendRow2(R.string.mi_frame_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_FRAME_RATE_UI));
                        builder.appendRow2(R.string.mi_bit_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    case ITrackInfo.MEDIA_TRACK_TYPE_AUDIO:
                        builder.appendRow2(R.string.mi_codec, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        builder.appendRow2(R.string.mi_profile_level, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        builder.appendRow2(R.string.mi_sample_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_SAMPLE_RATE_UI));
                        builder.appendRow2(R.string.mi_channels, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CHANNEL_UI));
                        builder.appendRow2(R.string.mi_bit_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    default:
                        break;
                }
            }
        }
    }

    AlertDialog.Builder adBuilder = builder.buildAlertDialogBuilder();
    adBuilder.setTitle(R.string.media_information);
    adBuilder.setNegativeButton(R.string.close, null);
    adBuilder.show();
}
 
开发者ID:bigjelly,项目名称:ShaddockVideoPlayer,代码行数:66,代码来源:IjkVideoView.java


示例2: showMediaInfo

import tv.danmaku.ijk.media.player.misc.IjkMediaFormat; //导入依赖的package包/类
public void showMediaInfo() {
    if (mMediaPlayer == null)
        return;

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

    TableLayoutBinder builder = new TableLayoutBinder(getContext());
    builder.appendSection(R.string.mi_player);
    builder.appendRow2(R.string.mi_player, MediaPlayerCompat.getName(mMediaPlayer));
    builder.appendSection(R.string.mi_media);
    builder.appendRow2(R.string.mi_resolution, buildResolution(mVideoWidth, mVideoHeight, mVideoSarNum, mVideoSarDen));
    builder.appendRow2(R.string.mi_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) {
                builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index) + " " + getContext().getString(R.string.mi__selected_video_track));
            } else if (index == selectedAudioTrack) {
                builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index) + " " + getContext().getString(R.string.mi__selected_audio_track));
            } else {
                builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index));
            }
            builder.appendRow2(R.string.mi_type, buildTrackType(trackType));
            builder.appendRow2(R.string.mi_language, buildLanguage(trackInfo.getLanguage()));

            IMediaFormat mediaFormat = trackInfo.getFormat();
            if (mediaFormat == null) {
            } else if (mediaFormat instanceof IjkMediaFormat) {
                switch (trackType) {
                    case ITrackInfo.MEDIA_TRACK_TYPE_VIDEO:
                        builder.appendRow2(R.string.mi_codec, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        builder.appendRow2(R.string.mi_profile_level, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        builder.appendRow2(R.string.mi_pixel_format, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PIXEL_FORMAT_UI));
                        builder.appendRow2(R.string.mi_resolution, mediaFormat.getString(IjkMediaFormat.KEY_IJK_RESOLUTION_UI));
                        builder.appendRow2(R.string.mi_frame_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_FRAME_RATE_UI));
                        builder.appendRow2(R.string.mi_bit_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    case ITrackInfo.MEDIA_TRACK_TYPE_AUDIO:
                        builder.appendRow2(R.string.mi_codec, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        builder.appendRow2(R.string.mi_profile_level, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        builder.appendRow2(R.string.mi_sample_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_SAMPLE_RATE_UI));
                        builder.appendRow2(R.string.mi_channels, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CHANNEL_UI));
                        builder.appendRow2(R.string.mi_bit_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    default:
                        break;
                }
            }
        }
    }

    AlertDialog.Builder adBuilder = builder.buildAlertDialogBuilder();
    adBuilder.setTitle(R.string.media_information);
    adBuilder.setNegativeButton(R.string.close, null);
    adBuilder.show();
}
 
开发者ID:xHiNewDayx,项目名称:OKPlayer,代码行数:63,代码来源:IjkVideoView.java


示例3: showMediaInfo

import tv.danmaku.ijk.media.player.misc.IjkMediaFormat; //导入依赖的package包/类
public void showMediaInfo() {
    if (mMediaPlayer == null)
        return;

    TableLayoutBinder builder = new TableLayoutBinder(getContext());
    builder.appendSection(R.string.mi_player);
    builder.appendRow2(R.string.mi_player, mMediaPlayer.getClass().getSimpleName());
    builder.appendSection(R.string.mi_media);
    builder.appendRow2(R.string.mi_resolution, buildResolution(mVideoWidth, mVideoHeight, mVideoSarNum, mVideoSarDen));
    builder.appendRow2(R.string.mi_length, buildTimeMilli(mMediaPlayer.getDuration()));

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

            int trackType = trackInfo.getTrackType();
            builder.appendSection(getContext().getString(R.string.mi_stream_fmt1, index));
            builder.appendRow2(R.string.mi_type, buildTrackType(trackType));

            IMediaFormat mediaFormat = trackInfo.getFormat();
            if (mediaFormat == null) {
            } else if (mediaFormat instanceof IjkMediaFormat) {
                switch (trackType) {
                    case ITrackInfo.MEDIA_TRACK_TYPE_VIDEO:
                        builder.appendRow2(R.string.mi_codec, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        builder.appendRow2(R.string.mi_profile_level, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        builder.appendRow2(R.string.mi_pixel_format, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PIXEL_FORMAT_UI));
                        builder.appendRow2(R.string.mi_resolution, mediaFormat.getString(IjkMediaFormat.KEY_IJK_RESOLUTION_UI));
                        builder.appendRow2(R.string.mi_frame_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_FRAME_RATE_UI));
                        builder.appendRow2(R.string.mi_bit_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    case ITrackInfo.MEDIA_TRACK_TYPE_AUDIO:
                        builder.appendRow2(R.string.mi_codec, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_LONG_NAME_UI));
                        builder.appendRow2(R.string.mi_profile_level, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CODEC_PROFILE_LEVEL_UI));
                        builder.appendRow2(R.string.mi_sample_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_SAMPLE_RATE_UI));
                        builder.appendRow2(R.string.mi_channels, mediaFormat.getString(IjkMediaFormat.KEY_IJK_CHANNEL_UI));
                        builder.appendRow2(R.string.mi_bit_rate, mediaFormat.getString(IjkMediaFormat.KEY_IJK_BIT_RATE_UI));
                        break;
                    default:
                        break;
                }
            }
        }
    }

    AlertDialog.Builder adBuilder = builder.buildAlertDialogBuilder();
    adBuilder.setTitle(R.string.media_information);
    adBuilder.setNegativeButton(R.string.close, null);
    adBuilder.show();
}
 
开发者ID:hejunlin2013,项目名称:LivePlayback,代码行数:53,代码来源:IjkVideoView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultFilterInvocationSecurityMetadataSource类代码示例发布时间:2022-05-22
下一篇:
Java YoutubeAudioSourceManager类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap