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