[ youyeetoo3568 ] Adding the VideoView Control to Nanogui, Supporting RTSP Video Stream Retrieval and Display
This chapter documents the development of the VideoView control for Nanogui, along with the successful testing of RTSP video stream retrieval and display on a camera from Hikvision. During the development, I encountered a segmentation fault issue, which was swiftly addressed by exporting the core file and utilizing GDB to pinpoint the crash's origin. Throughout this process, I once again appreciated the joy of using Buildroot for development. However, at present, the Nanogui-based program I’ve developed has not been integrated into Buildroot. Integrating Nanogui into Buildroot remains a future goal.
- Fixing ffmpeg compilation errors with constant "undefined av_xxxx" warnings.
- Utilizing aarch64-linux-gdb through Buildroot to trace and resolve segment fault issues.
- Compiling Buildroot on Solus and addressing associated compilation errors.
1.Linking to the ffmpeg library consistently encounters errors.
Let's start by examining the error messages:
Later, referring to solutions found online, it was discovered that there were missing headers when referencing the ffmpeg library.
1 #ifdef __cplusplus
2 extern "C" {
3 #endif
4 xxxxx /* ffmpeg header file */
5 #ifdef __cplusplus
6 }
7 #endif
Because ffmpeg is primarily developed in C, when referencing the relevant header files, it is necessary to provide compatibility for C++ source files. Otherwise, it won't be able to reference the corresponding functions correctly.
The complete source code for the videoview control has been uploaded to my forked nanogui repository. I won't list it here, but I'll show pictures related to successfully displaying the video:
After successfully linking and compiling ffmpeg, when running the executable program, I encountered a segment fault. I attempted to use gdbserver and configure gdb for localization. However, I found that aarch64-linux-gdb was not compiled by default. I had to enable the compilation of host gdb in buildroot by opening the following macros:
BR2_PACKAGE_HOST_GDB=y
BR2_PACKAGE_HOST_GDB_TUI=y
BR2_GDB_VERSION_8_1=y
BR2_GDB_VERSION=“8.1.1"
After compilation, modify the core configuration on the board to enable the generation of core files: ulimit -c unlimited. Then, send the core file to the PC, and use the command aarch64-linux-gdb example1 core to debug example1 (I modified example1.cpp directly in my development). Remember to modify the sysroot and solib-search, and this part can be placed in the.gdbinit file in the current directory:
set solib-search-path /home/yangyongsheng/Projects/debian_yy3568/YY3568-Debian10/buildroot/output/rockchip_rk3568/host/aarch64-buildroot-linux-gnu/sysroot/
set sysroot ~/Projects/debian_yy3568/YY3568-Debian10/buildroot/output/rockchip_rk3568/host/aarch64-buildroot-linux-gnu/sysroot/
Remember to modify the ~/.gdbinit file:
set
auto-
load
safe-
path
/
3. Compiling Buildroot on Solus
On my laptop at home, I have Solus installed. While the software package availability on Solus may not be as extensive as Fedora, I encountered some issues during the compilation process. Fortunately, after a few days of investigation, I successfully compiled Buildroot. Throughout this troubleshooting process, I found Solus to be still quite user-friendly. For packages not available in the official repositories, manual downloading of the source code and installation was necessary. Here, I've listed some of the packages I downloaded:
├── libdb
├── libnsl
├── libtirpc
├── libxcrypt
Especially during the compilation of Python 2.7, I consistently encountered errors. The terminal provided only warning messages, leading me on a somewhat convoluted path as I searched for ways to eliminate these warnings. The issue might be attributed to "unbuffer" because using the default "unbuffer" in Buildroot's menuconfig did not display the menuconfig configuration interface on Solus (I needed to enable gdb compilation options). However, running make menuconfig directly in Buildroot's root directory worked. To circumvent this problem, I opted to forcefully modify menuconfig without using "brmake" and used "make" instead. In case of encountering this issue again, I'll need to navigate to the corresponding Buildroot root directory and run "make" to identify the root cause of the error. It turned out that the error occurred during the linking of "crypt, " and I resolved it by forcibly creating a symbolic link from "/lib/libcrypt.so."
▸ ll /lib/libcrypt.so lrwxrwxrwx root root 26 B Sun Aug 13 13:44:40 2023 /lib/libcrypt.so ⇒ /usr/local/lib/libcrypt.so
Now, let's showcase some screenshots of the joyful compilation process using Buildroot on Solus
Through this process, I also discovered a website for a collection of software packages: https://dev.getsol.us/source. It contains the configuration and compilation dependencies for Python 2.7 related to Solus. Finally, I successfully compiled the Python 2.7 selected by Buildroot.
Comments
Please log in or sign up to comment.