vmem output in 1.1.4
Posted: 21 Sep 2010 15:12
I've tried to update my project with libvlc 1.1.4 but I noticed some of the basic high level api for setting up the VLC instance have changed.
I followed the new sample code at http://wiki.videolan.org/LibVLC_Tutorial
Is it necessary to define the media and then the media player or I can create a media player and then associate a media to it as in the old version?
I used libvlc_media_add_option to set up the vmem output, but now it does not work any longer, is there something to change to enable vmem with 1.1.4?
If it has already been covered in another thread or tutorial could you please give me the link?
This is the old code I used to set up vmem, now it does not crash but all I see is black
I followed the new sample code at http://wiki.videolan.org/LibVLC_Tutorial
Is it necessary to define the media and then the media player or I can create a media player and then associate a media to it as in the old version?
I used libvlc_media_add_option to set up the vmem output, but now it does not work any longer, is there something to change to enable vmem with 1.1.4?
If it has already been covered in another thread or tutorial could you please give me the link?
This is the old code I used to set up vmem, now it does not crash but all I see is black
Code: Select all
sprintf( clock, ":vmem-lock=%lld", (long long int)(intptr_t)lock );
sprintf( cunlock, ":vmem-unlock=%lld", (long long int)(intptr_t)unlock );
sprintf( cdata, ":vmem-data=%lld", (long long int)(intptr_t)ctx );
sprintf( width, ":vmem-width=%i", VIDEO_WIDTH );
sprintf( height, ":vmem-height=%i", VIDEO_HEIGHT );
sprintf( chroma, ":vmem-chroma=%s", "RV32" );
sprintf( pitch, ":vmem-pitch=%i", VIDEO_WIDTH * 4 );
// List of options
char const* media_options[] =
{
":vout=vmem",
width, height,
chroma, pitch,
clock, cunlock,
cdata
};
int media_options_size = sizeof( media_options )
/ sizeof( *media_options );
// Adding each option from the array to the media
for ( int i = 0; i < media_options_size; ++i )
{
libvlc_media_add_option( m_vlcMedia, media_options[i], &m_ex );
catchException();
}
// Put the media into the mediaplayer
libvlc_media_player_set_media( m_vlcMediaplayer, m_vlcMedia, &m_ex );
catchException();