Problem with "crop-*" variables in VOUT

This forum is about all development around libVLC.
uj2
Blank Cone
Blank Cone
Posts: 11
Joined: 28 Jul 2009 16:28

Problem with "crop-*" variables in VOUT

Postby uj2 » 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):

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); }
It resembles corresponding functionality in qt4 plugin. I got debug messages from main thread:
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
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?

Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 40 guests