在我的Android应用中,我使用libvlc 3.1.1读取DVB流。因此,我构建了我的libvlc指定参数,构建了媒体播放器,然后从与我的DVB流相对应的URI构建媒体。
正常工作。现在,我想在创建VLClib之后动态设置SID(" -program = 769"(,以避免繁重的库加载。有什么想法吗?
我阅读了此文档:https://wiki.videolan.org/documentation:advanced_use_of_vlc/
final ArrayList<String> args = new ArrayList<>();
args.add("--video-filter=deinterlace");
args.add("--aout=opensles");
args.add("--deinterlace=-1");
args.add("--sout-deinterlace-mode=bob");
args.add("--vbi-opaque");
// args.add("--program=769"); -> That is working
mLibVLC = new LibVLC(this, args);
mMediaPlayer = new MediaPlayer(mLibVLC);
mMediaPlayer.setEventListener(event -> {
...
}
final IVLCVout vlcVout = mMediaPlayer.getVLCVout();
vlcVout.setVideoView(mVideoSurface);
vlcVout.setSubtitlesView(mSubtitlesSurface);
mMediaPlayer.getVLCVout().attachViews(this);
[...]
if (mMediaPlayer.isPlaying()) {
mMediaPlayer.stop();
}
final Media media = new Media(mLibVLC, uri);
// There, I would like to set the SID(=program number)
media.setHWDecoderEnabled(true, false);
mMediaPlayer.setMedia(media);
mMediaPlayer.play();
media.release();
我认为您可以将其设置为媒体选项:
media.addOption(":program=769");