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


Java Media.VideoTrack方法代码示例

本文整理汇总了Java中org.videolan.libvlc.Media.VideoTrack方法的典型用法代码示例。如果您正苦于以下问题:Java Media.VideoTrack方法的具体用法?Java Media.VideoTrack怎么用?Java Media.VideoTrack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.videolan.libvlc.Media的用法示例。


在下文中一共展示了Media.VideoTrack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appendVideo

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
private void appendVideo(StringBuilder textBuilder, Resources res, Media.VideoTrack track) {
    final double framerate = track.frameRateNum / (double) track.frameRateDen;
    if( track.width != 0 && track.height != 0 )
        textBuilder.append(res.getString(R.string.track_resolution_info, track.width, track.height));
    if( !Double.isNaN(framerate) )
        textBuilder.append(res.getString(R.string.track_framerate_info, framerate));
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:8,代码来源:MediaInfoAdapter.java

示例2: init

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
private void init(Media media) {
    mType = TYPE_ALL;

    if (media != null) {
        if (media.isParsed()) {
            mLength = media.getDuration();

            for (int i = 0; i < media.getTrackCount(); ++i) {
                final Media.Track track = media.getTrack(i);
                if (track == null)
                    continue;
                if (track.type == Media.Track.Type.Video) {
                    final Media.VideoTrack videoTrack = (VideoTrack) track;
                    mType = TYPE_VIDEO;
                    mWidth = videoTrack.width;
                    mHeight = videoTrack.height;
                } else if (mType == TYPE_ALL && track.type == Media.Track.Type.Audio){
                    mType = TYPE_AUDIO;
                }
            }
        }
        updateMeta(media);
        if (mType == TYPE_ALL && media.getType() == Media.Type.Directory)
            mType = TYPE_DIR;
    }

    if (mType == TYPE_ALL) {
        final String location = mUri.toString();
        int dotIndex = location.lastIndexOf(".");
        if (dotIndex != -1) {
            String fileExt = location.substring(dotIndex).toLowerCase(Locale.ENGLISH);
            if( Extensions.VIDEO.contains(fileExt) ) {
                mType = TYPE_VIDEO;
            } else if (Extensions.AUDIO.contains(fileExt)) {
                mType = TYPE_AUDIO;
            } else if (Extensions.SUBTITLES.contains(fileExt)) {
                mType = TYPE_SUBTITLE;
            } else if (Extensions.PLAYLIST.contains(fileExt)) {
                mType = TYPE_PLAYLIST;
            }
        }
    }
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:44,代码来源:MediaWrapper.java

示例3: init

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
private void init(Media media) {
    mType = TYPE_ALL;

    if (media != null) {
        if (media.isParsed()) {
            mLength = media.getDuration();

            for (int i = 0; i < media.getTrackCount(); ++i) {
                final Media.Track track = media.getTrack(i);
                if (track == null)
                    continue;
                if (track.type == Media.Track.Type.Video) {
                    final Media.VideoTrack videoTrack = (VideoTrack) track;
                    mType = TYPE_VIDEO;
                    mWidth = videoTrack.width;
                    mHeight = videoTrack.height;
                } else if (mType == TYPE_ALL && track.type == Media.Track.Type.Audio){
                    mType = TYPE_AUDIO;
                }
            }
        }
        updateMeta(media);
        if (mType == TYPE_ALL && media.getType() == Media.Type.Directory)
            mType = TYPE_DIR;
    }

    if (mType == TYPE_ALL) {
        final int index = mUri.toString().indexOf('?');
        String location;
        if (index == -1)
            location = mUri.toString();
        else
            location = mUri.toString().substring(0, index);
        int dotIndex = location.lastIndexOf(".");
        if (dotIndex != -1) {
            String fileExt = location.substring(dotIndex).toLowerCase(Locale.ENGLISH);
            if( Extensions.VIDEO.contains(fileExt) ) {
                mType = TYPE_VIDEO;
            } else if (Extensions.AUDIO.contains(fileExt)) {
                mType = TYPE_AUDIO;
            } else if (Extensions.SUBTITLES.contains(fileExt)) {
                mType = TYPE_SUBTITLE;
            } else if (Extensions.PLAYLIST.contains(fileExt)) {
                mType = TYPE_PLAYLIST;
            }
        }
    }
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:49,代码来源:MediaWrapper.java


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