libvlc_log_open example

This forum is about all development around libVLC.
morz
New Cone
New Cone
Posts: 4
Joined: 22 Mar 2010 04:46

libvlc_log_open example

Postby morz » 25 Mar 2010 16:51

Hi, I'm using libVLC in my QT application. Everything works great. I just one to know, how to display output message (log) in my application (e.g: textEdit) instead of displaying on console(default)?

I just read the libVLC api and found libvlc_log_open function. How to use it?

To summarize, I want to:
1) Display message log in widget
2) Trigger an event when got new message log

Thanks.

morz
New Cone
New Cone
Posts: 4
Joined: 22 Mar 2010 04:46

Re: libvlc_log_open example

Postby morz » 26 Mar 2010 11:02

I figured out my self :

This code for QT :

1)

Code: Select all

libvlc_event_attach( em, libvlc_MediaPlayerPositionChanged,callback, this, &_vlcexcep );
2)

Code: Select all

void MainWindow::callback( const libvlc_event_t *ev, void *param ) { MainWindow* self = reinterpret_cast<MainWindow*>( param ); switch(ev->type){ case libvlc_MediaPlayerPositionChanged : self->emit changeMediaPlayerPosition(); break; } }
3)

Code: Select all

void MainWindow::mediaPlayerPositionChanged(){ libvlc_log_iterator_t * _logt_iter = libvlc_log_get_iterator (_logt, &_vlcexcep); raise (&_vlcexcep); libvlc_log_message_t p_buffer; while(libvlc_log_iterator_has_next(_logt_iter, &_vlcexcep)){ libvlc_log_iterator_next( _logt_iter ,&p_buffer, &_vlcexcep); QByteArray message(p_buffer.psz_message); qDebug() << message; } }


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests