Problem with "crop-*" variables in VOUT
Posted: 28 Sep 2009 13:35
Hello! I'm trying to write simple application with LibVLC and have a problem. I need to crop video, so I've written the following code (roughly):
It resembles corresponding functionality in qt4 plugin. I got debug messages from main thread:
Code: Select all
vout_thread_t *vout = 0;
vlc_object_t *main = libvlc_get_vlc_instance(vlcInstance);
if (main)
{
vlc_object_release(main);
vout = (vout_thread_t *) vlc_object_find(main, VLC_OBJECT_VOUT, FIND_CHILD);
}
if (vout)
{
var_SetInteger(vout, "crop-top", top);
var_SetInteger(vout, "crop-bottom", bottom);
var_SetInteger(vout, "crop-left", left);
var_SetInteger(vout, "crop-right", right);
vlc_object_release(vout);
}
As you see, I've made rather remarkable crop. More to that, var_GetInteger(vout, "crop-left") returns correct value of 500. But, the crop actually does not occur. Video is just the same size as it were. But if I move the window, it stretches video to that same size - 204x576. Which is kind of weird, for I had no problem with "aspect-ratio" or "crop" variables. I should metion that I also tie VLC output window to my window with libvlc_media_player_set_hwnd call. Any ideas why this strange behavior is observed?14:09:52.093: [VLCLOG] [DBG] video output.main: cropping picture 704x576 to 0,0,704x576
14:09:52.093: [VLCLOG] [DBG] video output.main: window size: 768x576
14:09:52.093: [VLCLOG] [DBG] video output.main: cropping picture 704x576 to 0,0,704x576
14:09:52.093: [VLCLOG] [DBG] video output.main: window size: 222x576
14:09:52.093: [VLCLOG] [DBG] video output.main: cropping picture 704x576 to 500,0,204x576
14:09:52.093: [VLCLOG] [DBG] video output.main: window size: 222x576
14:09:52.093: [VLCLOG] [DBG] video output.main: cropping picture 704x576 to 500,0,204x576