Recent

Author Topic: [SOLVED] What am I doing wrong with this LCLVLC video class?  (Read 5481 times)

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
[SOLVED] What am I doing wrong with this LCLVLC video class?
« on: March 19, 2018, 03:09:32 pm »
Hi everyone, I am having some difficulties (memory corruption) while creating/freeing a LCLVLC video player class.

I am using TLCLVLCPlayer.OnEOF event to free instances of TLCLVLCPlayer from "outside". For example, if you click at the video square, it will play the video and at the end of file it will be freed by another class.

Anyone could shed some light on this?

Here is the console output:

Ports available: /dev/ttyS31,/dev/ttyS30,/dev/ttyS29,/dev/ttyS28,/dev/ttyS27,/dev/ttyS26,/dev/ttyS25,/dev/ttyS24,/dev/ttyS23,/dev/ttyS22,/dev/ttyS21,/dev/ttyS20,/dev/ttyS19,/dev/ttyS18,/dev/ttyS17,/dev/ttyS16,/dev/ttyS15,/dev/ttyS14,/dev/ttyS13,/dev/ttyS12,/dev/ttyS11,/dev/ttyS10,/dev/ttyS9,/dev/ttyS8,/dev/ttyS7,/dev/ttyS6,/dev/ttyS5,/dev/ttyS4,/dev/ttyS3,/dev/ttyS2,/dev/ttyS1,/dev/ttyS0
[information] Application Title:stimulus_control_linux_64bits_debug
[debug] Application ThreadID:140737352415616

(stimulus_control_linux_64bits_debug.bin:6783): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(stimulus_control_linux_64bits_debug.bin:6783): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[00007fff8c000958] vdpau_avcodec generic error: Xlib not initialized for threads
[00007fff8c000958] vdpau_avcodec generic error: Xlib is required for VDPAU
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[00007fff98001df8] vdpau_display vout display error: Xlib not initialized for threads
*** Error in `/home/rafael/git/stimulus_control/stimulus_control_linux_64bits_debug.bin': malloc(): memory corruption (fast): 0x00007fffb000d410 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7ffff4e777e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x82651)[0x7ffff4e82651]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7ffff4e84184]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_malloc+0x19)[0x7ffff6645719]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x32397)[0x7ffff7733397]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(gdk_region_union+0x65)[0x7ffff7733cb5]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x3d680)[0x7ffff773e680]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x3d5cb)[0x7ffff773e5cb]
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0(+0x3d7f6)[0x7ffff773e7f6]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_widget_queue_draw_area+0x1aa)[0x7ffff6da50ba]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_widget_queue_draw+0x83)[0x7ffff6dac013]
/home/rafael/git/stimulus_control/stimulus_control_linux_64bits_debug.bin[0x71c2fd]
======= Memory map: ========
00400000-009a4000 r-xp 00000000 08:03 11544753                           /home/rafael/git/stimulus_control/stimulus_control_linux_64bits_debug.bin
00ba4000-00e51000 rw-p 005a4000 08:03 11544753                           /home/rafael/git/stimulus_control/stimulus_control_linux_64bits_debug.bin
00e51000-01563000 rw-p 00000000 00:00 0                                  [heap]
7fff54000000-7fff54021000 rw-p 00000000 00:00 0
7fff54021000-7fff58000000 ---p 00000000 00:00 0
7fff5c000000-7fff5c0ad000 rw-p 00000000 00:00 0
7fff5c0ad000-7fff60000000 ---p 00000000 00:00 0
7fff61258000-7fff69ea1000 rw-p 00000000 00:00 0
7fff69ea1000-7fff6a199000 rw-s 00000000 00:05 5242909                    /SYSV00000000 (deleted)
7fff6a199000-7fff6a491000 rw-s 00000000 00:05 5210140                    /SYSV00000000 (deleted)
7fff6a491000-7fff6a789000 rw-s 00000000 00:05 5177369                    /SYSV00000000 (deleted)
7fff6a789000-7fff6a78b000 r-xp 00000000 08:03 55575399                   /usr/lib/vlc/plugins/misc/libdbus_screensaver_plugin.so
7fff6a78b000-7fff6a98a000 ---p 00002000 08:03 55575399                   /usr/lib/vlc/plugins/misc/libdbus_screensaver_plugin.so
7fff6a98a000-7fff6a98b000 r--p 00001000 08:03 55575399                   /usr/lib/vlc/plugins/misc/libdbus_screensaver_plugin.so
7fff6a98b000-7fff6a98c000 rw-p 00002000 08:03 55575399                   /usr/lib/vlc/plugins/misc/libdbus_screensaver_plugin.so
7fff6a98c000-7fff6a98d000 ---p 00000000 00:00 0
7fff6a98d000-7fff6aa8d000 rw-p 00000000 00:00 0
7fff6aa8d000-7fff6aa8f000 r-xp 00000000 08:03 48638476                   /usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1.0.0
7fff6aa8f000-7fff6ac8e000 ---p 00002000 08:03 48638476                   /usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1.0.0
7fff6ac8e000-7fff6ac8f000 r--p 00001000 08:03 48638476                   /usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1.0.0
7fff6ac8f000-7fff6ac90000 rw-p 00002000 08:03 48638476                   /usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1.0.0
7fff6ac90000-7fff6ac95000 r-xp 00000000 08:03 55575719                   /usr/lib/vlc/plugins/video_output/libxcb_window_plugin.so
7fff6ac95000-7fff6ae95000 ---p 00005000 08:03 55575719                   /usr/lib/vlc/plugins/video_output/libxcb_window_plugin.so
7fff6ae95000-7fff6ae96000 r--p 00005000 08:03 55575719                   /usr/lib/vlc/plugins/video_output/libxcb_window_plugin.so
7fff6ae96000-7fff6ae97000 rw-p 00006000 08:03 55575719                   /usr/lib/vlc/plugins/video_output/libxcb_window_plugin.so
7fff6ae97000-7fff6ae9c000 r-xp 00000000 08:03 55575701                   /usr/lib/vlc/plugins/vdpau/libvdpau_display_plugin.so
7fff6ae9c000-7fff6b09b000 ---p 00005000 08:03 55575701                   /usr/lib/vlc/plugins/vdpau/libvdpau_display_plugin.so
7fff6b09b000-7fff6b09c000 r--p 00004000 08:03 55575701                   /usr/lib/vlc/plugins/vdpau/libvdpau_display_plugin.so
7fff6b09c000-7fff6b09d000 rw-p 00005000 08:03 55575701                   /usr/lib/vlc/plugins/vdpau/libvdpau_display_plugin.so
7fff6b09d000-7fff6b09f000 r-xp 00000000 08:03 55575425                   /usr/lib/vlc/plugins/video_filter/libyuvp_plugin.so
7fff6b09f000-7fff6b29e000 ---p 00002000 08:03 55575425                   /usr/lib/vlc/plugins/video_filter/libyuvp_plugin.so
7fff6b29e000-7fff6b29f000 r--p 00001000 08:03 55575425                   /usr/lib/vlc/plugins/video_filter/libyuvp_plugin.so
7fff6b29f000-7fff6b2a0000 rw-p 00002000 08:03 55575425                   /usr/lib/vlc/plugins/video_filter/libyuvp_plugin.so
7fff6b2a0000-7fff6b2a2000 r-xp 00000000 08:03 55575464                   /usr/lib/vlc/plugins/video_chroma/libi422_i420_plugin.so
7fff6b2a2000-7fff6b4a1000 ---p 00002000 08:03 55575464                   /usr/lib/vlc/plugins/video_chroma/libi422_i420_plugin.so
7fff6b4a1000-7fff6b4a2000 r--p 00001000 08:03 55575464                   /usr/lib/vlc/plugins/video_chroma/libi422_i420_plugin.so
7fff6b4a2000-7fff6b4a3000 rw-p 00002000 08:03 55575464                   /usr/lib/vlc/plugins/video_chroma/libi422_i420_plugin.so
7fff6b4a3000-7fff6b4aa000 r-xp 00000000 08:03 55575467                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i420_plugin.so
7fff6b4aa000-7fff6b6a9000 ---p 00007000 08:03 55575467                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i420_plugin.so
7fff6b6a9000-7fff6b6aa000 r--p 00006000 08:03 55575467                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i420_plugin.so
7fff6b6aa000-7fff6b6ab000 rw-p 00007000 08:03 55575467                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i420_plugin.so
7fff6b6ab000-7fff6b6ad000 r-xp 00000000 08:03 55575461                   /usr/lib/vlc/plugins/video_chroma/libgrey_yuv_plugin.so
7fff6b6ad000-7fff6b8ad000 ---p 00002000 08:03 55575461                   /usr/lib/vlc/plugins/video_chroma/libgrey_yuv_plugin.so
7fff6b8ad000-7fff6b8ae000 r--p 00002000 08:03 55575461                   /usr/lib/vlc/plugins/video_chroma/libgrey_yuv_plugin.so
7fff6b8ae000-7fff6b8af000 rw-p 00003000 08:03 55575461                   /usr/lib/vlc/plugins/video_chroma/libgrey_yuv_plugin.so
7fff6b8af000-7fff6b8b5000 r-xp 00000000 08:03 55575468                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_plugin.so
7fff6b8b5000-7fff6bab4000 ---p 00006000 08:03 55575468                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_plugin.so
7fff6bab4000-7fff6bab5000 r--p 00005000 08:03 55575468                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_plugin.so
7fff6bab5000-7fff6bab6000 rw-p 00006000 08:03 55575468                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_plugin.so
7fff6bab6000-7fff6babb000 r-xp 00000000 08:03 55575460                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i422_plugin.so
7fff6babb000-7fff6bcba000 ---p 00005000 08:03 55575460                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i422_plugin.so
7fff6bcba000-7fff6bcbb000 r--p 00004000 08:03 55575460                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i422_plugin.so
7fff6bcbb000-7fff6bcbc000 rw-p 00005000 08:03 55575460                   /usr/lib/vlc/plugins/video_chroma/libyuy2_i422_plugin.so
7fff6bcbc000-7fff6bcc1000 r-xp 00000000 08:03 55575459                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_plugin.so
7fff6bcc1000-7fff6bec0000 ---p 00005000 08:03 55575459                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_plugin.so
7fff6bec0000-7fff6bec1000 r--p 00004000 08:03 55575459                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_plugin.so
7fff6bec1000-7fff6bec2000 rw-p 00005000 08:03 55575459                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_plugin.so
7fff6bec2000-7fff6bec9000 r-xp 00000000 08:03 55575470                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_plugin.so
7fff6bec9000-7fff6c0c8000 ---p 00007000 08:03 55575470                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_plugin.so
7fff6c0c8000-7fff6c0c9000 r--p 00006000 08:03 55575470                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_plugin.so
7fff6c0c9000-7fff6c0ca000 rw-p 00007000 08:03 55575470                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_plugin.so
7fff6c0ca000-7fff6c0cd000 r-xp 00000000 08:03 55575462                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_mmx_plugin.so
7fff6c0cd000-7fff6c2cc000 ---p 00003000 08:03 55575462                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_mmx_plugin.so
7fff6c2cc000-7fff6c2cd000 r--p 00002000 08:03 55575462                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_mmx_plugin.so
7fff6c2cd000-7fff6c2ce000 rw-p 00003000 08:03 55575462                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_mmx_plugin.so
7fff6c2ce000-7fff6c2da000 r-xp 00000000 08:03 55575466                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_mmx_plugin.so
7fff6c2da000-7fff6c4d9000 ---p 0000c000 08:03 55575466                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_mmx_plugin.so
7fff6c4d9000-7fff6c4da000 r--p 0000b000 08:03 55575466                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_mmx_plugin.so
7fff6c4da000-7fff6c4db000 rw-p 0000c000 08:03 55575466                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_mmx_plugin.so
7fff6c4db000-7fff6c4e0000 r-xp 00000000 08:03 55575465                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_sse2_plugin.so
7fff6c4e0000-7fff6c6df000 ---p 00005000 08:03 55575465                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_sse2_plugin.so
7fff6c6df000-7fff6c6e0000 r--p 00004000 08:03 55575465                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_sse2_plugin.so
7fff6c6e0000-7fff6c6e1000 rw-p 00005000 08:03 55575465                   /usr/lib/vlc/plugins/video_chroma/libi422_yuy2_sse2_plugin.so
7fff6c6e1000-7fff6c6fc000 r-xp 00000000 08:03 55575473                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_sse2_plugin.so
7fff6c6fc000-7fff6c8fb000 ---p 0001b000 08:03 55575473                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_sse2_plugin.so
7fff6c8fb000-7fff6c8fc000 r--p 0001a000 08:03 55575473                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_sse2_plugin.so
7fff6c8fc000-7fff6c8fd000 rw-p 0001b000 08:03 55575473                   /usr/lib/vlc/plugins/video_chroma/libi420_rgb_sse2_plugin.so
7fff6c8fd000-7fff6c982000 r-xp 00000000 08:03 48631668                   /usr/lib/x86_64-linux-gnu/libswscale-ffmpeg.so.3.1.101
7fff6c982000-7fff6cb81000 ---p 00085000 08:03 48631668                   /usr/lib/x86_64-linux-gnu/libswscale-ffmpeg.so.3.1.101
7fff6cb81000-7fff6cb83000 r--p 00084000 08:03 48631668                   /usr/lib/x86_64-linux-gnu/libswscale-ffmpeg.so.3.1.101
7fff6cb83000-7fff6cb84000 rw-p 00086000 08:03 48631668                   /usr/lib/x86_64-linux-gnu/libswscale-ffmpeg.so.3.1.101
7fff6cb84000-7fff6cb8c000 rw-p 00000000 00:00 0
7fff6cb8c000-7fff6cb91000 r-xp 00000000 08:03 55575469                   /usr/lib/vlc/plugins/video_chroma/libswscale_plugin.so
7fff6cb91000-7fff6cd90000 ---p 00005000 08:03 55575469                   /usr/lib/vlc/plugins/video_chroma/libswscale_plugin.so
7fff6cd90000-7fff6cd91000 r--p 00004000 08:03 55575469                   /usr/lib/vlc/plugins/video_chroma/libswscale_plugin.so
7fff6cd91000-7fff6cd92000 rw-p 00005000 08:03 55575469                   /usr/lib/vlc/plugins/video_chroma/libswscale_plugin.so
7fff6cd92000-7fff6cd96000 r-xp 00000000 08:03 55575471                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_mmx_plugin.so
7fff6cd96000-7fff6cf95000 ---p 00004000 08:03 55575471                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_mmx_plugin.so
7fff6cf95000-7fff6cf96000 r--p 00003000 08:03 55575471                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_mmx_plugin.so
7fff6cf96000-7fff6cf97000 rw-p 00004000 08:03 55575471                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_mmx_plugin.so
7fff6cf97000-7fff6cf9e000 r-xp 00000000 08:03 55575472                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_sse2_plugin.so
7fff6cf9e000-7fff6d19d000 ---p 00007000 08:03 55575472                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_sse2_plugin.so
7fff6d19d000-7fff6d19e000 r--p 00006000 08:03 55575472                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_sse2_plugin.so
7fff6d19e000-7fff6d19f000 rw-p 00007000 08:03 55575472                   /usr/lib/vlc/plugins/video_chroma/libi420_yuy2_sse2_plugin.so
7fff6d19f000-7fff6d30a000 r-xp 00000000 08:03 48638148                   /usr/lib/x86_64-linux-gnu/libsamplerate.so.0.1.8
7fff6d30a000-7fff6d509000 ---p 0016b000 08:03 48638148                   /usr/lib/x86_64-linux-gnu/libsamplerate.so.0.1.8
7fff6d509000-7fff6d50a000 r--p 0016a000 08:03 48638148                   /usr/lib/x86_64-linux-gnu/libsamplerate.so.0.1.8
7fff6d50a000-7fff6d50b000 rw-p 0016b000 08:03 48638148                   /usr/lib/x86_64-linux-gnu/libsamplerate.so.0.1.8
7fff6d50b000-7fff6d50d000 r-xp 00000000 08:03 55575560                   /usr/lib/vlc/plugins/audio_filter/libsamplerate_plugin.so
7fff6d50d000-7fff6d70c000 ---p 00002000 08:03 55575560                   /usr/lib/vlc/plugins/audio_filter/libsamplerate_plugin.so
7fff6d70c000-7fff6d70d000 r--p 00001000 08:03 55575560                   /usr/lib/vlc/plugins/audio_filter/libsamplerate_plugin.so
7fff6d70d000-7fff6d70e000 rw-p 00002000 08:03 55575560                   /usr/lib/vlc/plugins/audio_filter/libsamplerate_plugin.so
7fff6d70e000-7fff6d71d000 r-xp 00000000 08:03 55575665                   /usr/lib/vlc/plugins/text_renderer/libfreetype_plugin.so
7fff6d71d000-7fff6d91d000 ---p 0000f000 08:03 55575665                   /usr/lib/vlc/plugins/text_renderer/libfreetype_plugin.so
7fff6d91d000-7fff6d91e000 r--p 0000f000 08:03 55575665                   /usr/lib/vlc/plugins/text_renderer/libfreetype_plugin.so
7fff6d91e000-7fff6d91f000 rw-p 00010000 08:03 55575665                   /usr/lib/vlc/plugins/text_renderer/libfreetype_plugin.so
7fff6d91f000-7fff6d923000 r-xp 00000000 08:03 55575552                   /usr/lib/vlc/plugins/audio_filter/libscaletempo_plugin.so
7fff6d923000-7fff6db22000 ---p 00004000 08:03 55575552                   /usr/lib/vlc/plugins/audio_filter/libscaletempo_plugin.so
7fff6db22000-7fff6db23000 r--p 00003000 08:03 55575552                   /usr/lib/vlc/plugins/audio_filter/libscaletempo_plugin.so
7fff6db23000-7fff6db24000 rw-p 00004000 08:03 55575552                   /usr/lib/vlc/plugins/audio_filter/libscaletempo_plugin.so
7fff6db24000-7fff6db26000 r-xp 00000000 08:03 55575395                   /usr/lib/vlc/plugins/audio_mixer/libfloat_mixer_plugin.so
7fff6db26000-7fff6dd25000 ---p 00002000 08:03 55575395                   /usr/lib/vlc/plugins/audio_mixer/libfloat_mixer_plugin.so
7fff6dd25000-7fff6dd26000 r--p 00001000 08:03 55575395                   /usr/lib/vlc/plugins/audio_mixer/libfloat_mixer_plugin.so
7fff6dd26000-7fff6dd27000 rw-p 00002000 08:03 55575395                   /usr/lib/vlc/plugins/audio_mixer/libfloat_mixer_plugin.so
7fff6dd27000-7fff6dd2b000 r-xp 00000000 08:03 55314131                   /usr/lib/vlc/libvlc_vdpau.so.0.0.0
7fff6dd2b000-7fff6df2a000 ---p 00004000 08:03 55314131                   /usr/lib/vlc/libvlc_vdpau.so.0.0.0
7fff6df2a000-7fff6df2b000 r--p 00003000 08:03 55314131                   /usr/lib/vlc/libvlc_vdpau.so.0.0.0
7fff6df2b000-7fff6df2c000 rw-p 00004000 08:03 55314131                   /usr/lib/vlc/libvlc_vdpau.so.0.0.0
7fff6df2c000-7fff6df2f000 r-xp 00000000 08:03 55575702                   /usr/lib/vlc/plugins/vdpau/libvdpau_avcodec_plugin.so
7fff6df2f000-7fff6e12e000 ---p 00003000 08:03 55575702                   /usr/lib/vlc/plugins/vdpau/libvdpau_avcodec_plugin.so
7fff6e12e000-7fff6e12f000 r--p 00002000 08:03 55575702                   /usr/lib/vlc/plugins/vdpau/libvdpau_avcodec_plugin.so
7fff6e12f000-7fff6e130000 rw-p 00003000 08:03 55575702                   /usr/lib/vlc/plugins/vdpau/libvdpau_avcodec_plugin.so
7fff6e130000-7fff6e1fe000 r-xp 00000000 08:03 48638225                   /usr/lib/x86_64-linux-gnu/libtag.so.1.14.0
7fff6e1fe000-7fff6e3fd000 ---p 000ce000 08:03 48638225                   /usr/lib/x86_64-linux-gnu/libtag.so.1.14.0
7fff6e3fd000-7fff6e402000 r--p 000cd000 08:03 48638225                   /usr/lib/x86_64-linux-gnu/libtag.so.1.14.0
7fff6e402000-7fff6e403000 rw-p 000d2000 08:03 48638225                   /usr/lib/x86_64-linux-gnu/libtag.so.1.14.0
7fff6e403000-7fff6e419000 r-xp 00000000 08:03 55575606                   /usr/lib/vlc/plugins/meta_engine/libtaglib_plugin.so
7fff6e419000-7fff6e618000 ---p 00016000 08:03 55575606                   /usr/lib/vlc/plugins/meta_engine/libtaglib_plugin.so
7fff6e618000-7fff6e619000 r--p 00015000 08:03 55575606                   /usr/lib/vlc/plugins/meta_engine/libtaglib_plugin.so
7fff6e619000-7fff6e61a000 rw-p 00016000 08:03 55575606                   /usr/lib/vlc/plugins/meta_engine/libtaglib_plugin.so
« Last Edit: April 25, 2018, 01:06:30 am by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: What am I doing wrong with this LCLVLC video class?
« Reply #1 on: March 19, 2018, 03:40:51 pm »
Without example code I am not even beginning to answer your question.
I just checked a basic example and it works.

You just show the *results* of you doing something wrong, not the *cause* why that happened.....
Specialize a type, not a var.

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: What am I doing wrong with this LCLVLC video class?
« Reply #2 on: March 19, 2018, 03:47:23 pm »
Thank you very much for your attention Taddy, I will post some code in a few minutes. I found that the error is not happening without the -Xs option (Strip symbols from executable).
Be mindful and excellent with each other.
https://github.com/cpicanco/

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: What am I doing wrong with this LCLVLC video class?
« Reply #3 on: March 19, 2018, 04:13:04 pm »
Lets start with the definition, the external class is a TGraphicControl descendent that is responsible for "managing" media sources and user input on the gui components of those sources. The "TKey" name would be better as "TResponseKey" or "TMediaKey" or something like that:

Code: Pascal  [Select][+][-]
  1.   TKey = class(TGraphicControl)
  2.   private
  3.     FAudioPlayer : TBassStream;
  4.     FSchedule: TSchedule;
  5.     FStimulus: TBitmap;
  6.     //FGifImage: TJvGIFAnimator;
  7.  
  8.     FVideoPlayer : TVLCVideoPlayer; <<<<<<<<<<<<<<<<<<<#################### here it is
  9.     FEdge: TColor;
  10.     FFileName: string;
  11.     FKind: TKind;
  12.     FEditMode: Boolean;
  13.     FResponseCount: Integer;
  14.     FLoopNumber: Integer;
  15.     FLastResponseLog : string;
  16.     procedure SetFileName(AFilename: string);
  17.   private
  18.     FOnConsequence: TNotifyEvent;
  19.     FOnResponse: TNotifyEvent;
  20.     FOnEndMedia: TNotifyEvent;
  21.     procedure AutoDestroy(Sender: TObject);
  22.     procedure Consequence(Sender: TObject);
  23.     function GetShortName: string;
  24.     procedure Response(Sender: TObject);
  25.     procedure KeyMouseDown(Sender: TObject; Button: TMouseButton;
  26.       Shift: TShiftState; X, Y: Integer);
  27.     procedure VideoResponse(Sender : TObject);
  28.     procedure VideoClick(Sender : TObject);
  29.   protected
  30.     procedure SetVisible(AValue:Boolean); override;
  31.   public
  32.     constructor Create(AOwner: TComponent); override;
  33.     destructor Destroy; override;
  34.     procedure Paint; override;
  35.     procedure Play;
  36.     procedure Stop;
  37.     procedure FullScreen;
  38.     procedure Centralize(AControl : TControl = nil);
  39.     procedure AutoDestroyIn(AInterval : integer);
  40.     procedure SetOriginalSize;
  41.     property Schedule : TSchedule read FSchedule;
  42.     property Edge : TColor read FEdge write FEdge;
  43.     property EditMode: Boolean read FEditMode write FEditMode;
  44.     property Filename : string read FFileName write SetFileName;
  45.     property Loops : Integer read FLoopNumber write FLoopNumber;
  46.     property Kind: TKind read FKind;
  47.     property LastResponseLog : string read FLastResponseLog;
  48.     property ResponseCount : integer read FResponseCount;
  49.     property ShortName : string read GetShortName;
  50.   public
  51.     property OnConsequence: TNotifyEvent read FOnConsequence write FOnConsequence;
  52.     property OnResponse: TNotifyEvent read FOnResponse write FOnResponse;
  53.     property OnEndMedia: TNotifyEvent read FOnEndMedia write FOnEndMedia;
  54.   public
  55.     property OnClick;
  56.     property OnDblClick;
  57.     property Color;
  58.     property Caption;
  59.     property Font;
  60.     property OnMouseDown;
  61.   end;      

I will be ommiting some code for the sake of simplicity. Full code can be found here:

https://github.com/cpicanco/stimulus_control/blob/47a1684b61bf8e88ceaa67dbf179c596ff7cb7fe/src/units/video.vlc.pas
https://github.com/cpicanco/stimulus_control/blob/47a1684b61bf8e88ceaa67dbf179c596ff7cb7fe/src/units/video.contract.pas
https://github.com/cpicanco/stimulus_control/blob/47a1684b61bf8e88ceaa67dbf179c596ff7cb7fe/src/units/controls.stimuli.key.pas

And a minimal example can be found here:

https://github.com/cpicanco/stimulus_control/tree/47a1684b61bf8e88ceaa67dbf179c596ff7cb7fe/tests/vlc

PLEASE NOTE THAT IT IS A (FOREVER AND EVER) WORK IN PROGRESS. So don't think you be able to execute/compile all this stuff out-of-the-box.

Now, the internal class (TVLCVideoPlayer) has an unmodified TLCLVLCPlayer Lazarus class:

Code: Pascal  [Select][+][-]
  1.   TVLCVideoPlayer = class(TComponent, IVideoPlayer)
  2.   private
  3.     FEndOfFileEvent : TNotifyEvent;
  4.     FBackground : TCustomControl;
  5.     {$IFDEF LINUX}
  6.     FHack : TWinControl;
  7.     {$ENDIF}
  8.     FOnClick: TNotifyEvent;
  9.     FPlayer : TLCLVLCPlayer; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=========== here
  10.     FCurrentVideoItem : TVLCMediaItem;
  11.     //FButton : TButton;
  12.     procedure Click(Sender : TObject);
  13.     procedure EndOfFile(Sender : TObject);
  14.     procedure SetOnClick(AValue: TNotifyEvent);
  15.   public
  16.     constructor Create(AWinControl : TWinControl); reintroduce;
  17.     destructor Destroy; override;
  18.     class function Exist : Boolean;
  19.     procedure FullScreen;
  20.     procedure LoadFromFile(AFilename : string);
  21.     procedure Play;
  22.     procedure Stop;
  23.     procedure Hide;
  24.     procedure Show;
  25.     procedure SetBounds(ALeft, ATop, AWidth, AHeight : integer);
  26.     procedure SetEndOfFileEvent(AEndOfFileEvent : TNotifyEvent);
  27.     property OnClick : TNotifyEvent read FOnClick write SetOnClick;
  28.   end;        

You may notice that I am not using interfaces directly (because it is a work in progress), but the ultimate goal is to talk with interfaces only. But we don't need to go any further on this topic.

The main point is the trick way the TVLCVideoPlayer class is being created:

Code: Pascal  [Select][+][-]
  1. constructor TVLCVideoPlayer.Create(AWinControl : TWinControl);
  2. begin
  3.   inherited Create(AWinControl);
  4.   FBackground := TCustomControl.Create(Self);
  5.   FBackground.Width  := 300;
  6.   FBackground.Height := 300;
  7.   FBackground.Left := 490;
  8.   FBackground.Top := 0;
  9.   FBackground.Parent := AWinControl;
  10.   FBackground.Color:=$00000;
  11.   FBackground.Cursor:=crHandPoint;
  12.   FBackground.OnClick:=@Click;
  13.  
  14.   FPlayer := TLCLVLCPlayer.Create(Self);
  15.   {$IFDEF LINUX}
  16.   // for some unknown reason we need
  17.   // one more ParentWindow layer on top
  18.   // to have easy control over
  19.   // video top left
  20.   FHack := TWinControl.Create(Self);
  21.   FHack.Parent := FBackground;
  22.   FPlayer.ParentWindow := FHack;
  23.   {$ENDIF}
  24.  
  25.   {$IFDEF WINDOWS}
  26.   FPlayer.ParentWindow := FBackground;
  27.   {$ENDIF}
  28.   FPlayer.UseEvents := True;
  29.   FPlayer.OnEOF:=@EndOfFile;
  30.  
  31.   FCurrentVideoItem := TVLCMediaItem.Create(nil);
  32. end;  


A TWinControl is being used to constrain the bounds of the video window to where it should be. Without it, the control would be "lost" at the TKey.Parent (that is a TForm). I don't know why, so don't ask me :D. This hack should not affect the way the "TLCLVLCPlayer.OnEOF" event works though.

Any doubt, please ask me at will.

Best,
Rafael
« Last Edit: March 19, 2018, 04:19:35 pm by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: What am I doing wrong with this LCLVLC video class?
« Reply #4 on: March 21, 2018, 03:33:13 pm »
So, I have found that the error is not happening without the -Xs option (Strip symbols from executable). But now I have a weird scenario. Everything seems to work on linux, but there is a crash on windows. I would really appreciate any help in debugging this. Right now I am adapting a stand alone test case (the one I mentioned earlier), so that anyone will be able to test out of the box.

Be mindful and excellent with each other.
https://github.com/cpicanco/

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: What am I doing wrong with this LCLVLC video class?
« Reply #5 on: March 21, 2018, 03:53:50 pm »
It is more likely to be an alignment issue: try {$Packrecords C} at the top of your units.
Specialize a type, not a var.

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: What am I doing wrong with this LCLVLC video class?
« Reply #6 on: March 21, 2018, 04:02:21 pm »
Hi Thaddy, do you mean ALL units? Or just the ones related to VLC?
Be mindful and excellent with each other.
https://github.com/cpicanco/

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: What am I doing wrong with this LCLVLC video class?
« Reply #7 on: March 21, 2018, 04:13:02 pm »
Any VLC units. and all units where you declare your own structures for VLC calls/parameters. (Record Parameters, specifically!)
In that case you will need to have the proper alignment.
So: any of your own units that reference VLC code should be safe.
« Last Edit: March 21, 2018, 04:17:51 pm by Thaddy »
Specialize a type, not a var.

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: What am I doing wrong with this LCLVLC video class?
« Reply #8 on: April 25, 2018, 01:06:09 am »
I have found the error.  The problem was in the "constructor Create(AWinControl : TWinControl); reintroduce;" procedure. I was using the Parent (AWinControl) also as an Owner.

Now the constructor is  "Create(AOwner: TComponent; AParent : TWinControl); reintroduce;" and everything works just fine:
Code: Pascal  [Select][+][-]
  1. constructor TVLCVideoPlayer.Create(AOwner: TComponent; AParent : TWinControl);
  2. begin
  3.   inherited Create(AOwner);
  4.  
  5.   FBackground := TCustomControl.Create(Self);
  6.   FBackground.Width  := 300;
  7.   FBackground.Height := 300;
  8.   FBackground.Left := 490;
  9.   FBackground.Top := 0;
  10.   FBackground.Parent := AParent;
  11.   FBackground.Color:=$00000;
  12.   FBackground.Cursor:=crHandPoint;
  13.   FBackground.OnClick:=@Click;
  14.  
  15. {...}
  16.  
  17. end;
Be mindful and excellent with each other.
https://github.com/cpicanco/

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: [SOLVED] What am I doing wrong with this LCLVLC video class?
« Reply #9 on: April 25, 2018, 01:12:43 am »
Here is the stand alone test:

https://github.com/cpicanco/stimulus_control/tree/4d7990fab8ee36830b4214d86d237b982be4d113/tests/vlc


This test is very simple. Just compile and click in 'X' to close the form. If no error have occurred, then your fine.
« Last Edit: April 25, 2018, 01:18:05 am by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

 

TinyPortal © 2005-2018