android-libvlc-onNewVideoLayout不触发-什么脱节通常会导致onNewVideoLayout触发?

问题描述

我正在将使用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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...