vlc+mfc,搭建简单的播放器

核心代码如下

const char* const m_vlcArgs[] = {
              "-I", "dummy", /* Don't use any interface */
              "--ignore-config", /* Don't use VLC's config */ 
                };

    libvlc_exception_init(&m_vlcEx);
    m_vlcInst = libvlc_new(sizeof(m_vlcArgs) / sizeof(m_vlcArgs[0]), m_vlcArgs, &m_vlcEx);




m_vlcMedia = libvlc_media_new(m_vlcInst, strVPath.GetBuffer(0), &m_vlcEx);
        m_vlcMplay = libvlc_media_player_new_from_media(m_vlcMedia, &m_vlcEx);
        libvlc_media_release(m_vlcMedia);

        libvlc_media_player_set_drawable(m_vlcMplay, (libvlc_drawable_t)m_hWndVideo, &m_vlcEx);
    


    libvlc_media_player_play(m_vlcMplay, &m_vlcEx);

strVPath是本地视频地址,不支持中文路径,不过UTF-8编码后应该就支持了

显示控件是STATIC_PIC就可

代码下载

http://download.csdn.net/download/waphj/3928796

posted @ 2013-09-23 19:08  crowinhell  阅读(890)  评论(0编辑  收藏  举报