我正在使用libvlc在我的GUI应用程序上使用QT 4播放视频.当我向前搜索视频时它工作正常,但是当我寻找视频时,它会卡住我的意思是帧不会改变而我的回调函数就是视频输出没有接到任何电话.
void videoPrerender(void *p_video_data,
uint8_t **pp_pixel_buffer,
int size)
{
// Locking
//printf("cbVideoPrerender %i\n",size);
//printf("vtest: %lld\n",(long long int)p_video_data);
VLCPlayer* player = reinterpret_cast<VLCPlayer*>(p_video_data);
player->m_mutex.lock();
if ((size > player->m_videoBufferSize) || !player->m_videoBuffer)
{
printf("Reallocate raw video buffer\n");
if(player->m_videoBuffer) free(player->m_videoBuffer);
player->m_videoBuffer = (uint8_t *)malloc(size);
player->m_videoBufferSize = size;
}
*pp_pixel_buffer = player->m_videoBuffer;
}
void videoPostrender(void *p_video_data,
uint8_t *p_pixel_buffer,
int width,
int height,
int pixel_pitch,
int size,
int64_t pts)
{
Q_UNUSED(p_pixel_buffer)
Q_UNUSED(size)
//printf("cbVideoPostrender %i\n",size);
// Unlocking
VLCPlayer* player = reinterpret_cast<VLCPlayer*>(p_video_data);
player->m_mutex.unlock();
player->m_frameWidth = width;
player->m_frameHeight = …Run Code Online (Sandbox Code Playgroud)