问题描述
我正在将使用MrMaffen vlc播放器的较旧的android代码转换为较新的vlc库。我已经在播放视频了-但是它的大小并没有确定。这是在onNewVideoLayout函数中处理的-不会被调用。以下createVLCPlayer函数中的哪一行会导致onNewVideoLayout触发?
private void createVLCPlayer(String pPath){
releaseVLCPlayer();
try {
// Create LibVLC
ArrayList<String> options = new ArrayList<>();
options.add("-vvv"); // verbosity. This has to do with VLC logging.
this.m_libVLC = new LibVLC( this,options);
//this.m_libVLC = new LibVLC( this,options);
org.videolan.libvlc.MediaPlayer.EventListener m_PlayerListener = new MyPlayerListener(this);
if(this.m_shHolder == null){
this.m_shHolder = this.m_svSurface.getHolder();
}
this.m_shHolder.setKeepScreenOn(true);
// Create media player
this.m_mpPlayer = new org.videolan.libvlc.MediaPlayer(this.m_libVLC);
this.m_mpPlayer.setEventListener(m_PlayerListener);
this.m_mpPlayer.setAudioTrack(-1);
//this.m_mpPlayer.setSubtitleFile("");
// Set up video output
final IVLCVout vout = this.m_mpPlayer.getVLCVout();
vout.setVideoView(this.m_svSurface);
//vout.setwindowSize(m_svSurface.getWidth(),m_svSurface.getHeight());
vout.addCallback(this);
vout.attachViews();
Uri uri = Uri.parse(pPath);
Media m = new Media(this.m_libVLC,uri);
boolean blnTabletHWA = g.getTablet_VLC_HWA();
m.setHWDecoderEnabled(blnTabletHWA,blnTabletHWA); // Force Hardware acceleration.
m.addOption(":network-caching=" + g.getCCTVNetworkCaching());
if (g.useTCPForCCTV()){
m.addOption(":rtsp-tcp");
}
m.addOption(":no-audio");
m.addOption(":rtsp-frame-buffer-size=150000");
//m.addOption(":sout=#transcode{vcodec=mp1v,vb=1024,acodec=none}:std{mux=mpeg1}");
//m.addOption(":live-caching=0");
this.m_mpPlayer.setMedia(m);
this.m_mpPlayer.play();
this.m_esService.execute(new Runnable() {
@Override
public void run() {
NativeCodeLogger.logVLCToFile(g);
}
});
//this.displayProgressDialog();
} catch (Exception e) {
Toast.makeText(this,"Error creating player!",Toast.LENGTH_LONG).show();
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)