S3C2410 and Linux movie list system design

Abstract: With the rapid development of digital information technology and network technology, embedded systems based on them have also been widely used in various fields of people's life and work. This paper introduces the implementation process of the movie list system design based on S3C2410 and embedded Linux operating system. The system is built on the embedded development platform, and uses Framebuffer to realize various effects display of JPEG format pictures and texts and control of peripheral mouse.

This article refers to the address: http://

introduction

With the advancement of new media and the growing development of online media products, the Internet will "subvert" the traditional status of television. The new media provides a rich media format and a variety of viewing methods, such as on-demand, look back, download, etc., making it interactive and longer life cycle. Therefore, the emergence of interactive network television (IPTV) is an inevitable result. The movie list is the most important source of digital multimedia content in IPTV. The TV program navigation system is mainly used to describe the information of all programs provided to TV viewers. It is one of the important technologies that constitute interactive TV. In the IPTV service, the user can learn related information such as the name, playing time and content outline of the TV movie program through the movie list function, and realize fast retrieval and access to the program, and perform channel selection or video on demand operations.

1 System environment selection and configuration

1.1 System software and hardware platform selection

Embedded system refers to application-centered, computer-based, software and hardware tailoring, suitable for application systems with special requirements for functions, reliability, cost, size and power consumption. The embedded system consists of embedded microprocessor, peripheral hardware device, embedded operating system and user application. This system chooses x86 processor and

The Linux operating system is used as the system development environment, and the embedded ARM series microprocessor and embedded Linux operating system are used as the system operation platform.

As a school laboratory open fund project, this system selects the existing JXARM9-2410 teaching experiment system in the college laboratory for design and implementation. The JXARM9-2410 experimental box uses Samsung's S3C2410 microprocessor, which is a low-power, high-integration ARM920T-based microprocessor designed for handheld devices. It integrates an external memory controller, LCD controller, ADC and touch screen interface, and is now widely used in PDA, mobile communications, routers, industrial control and other fields. Common general-purpose embedded operating systems are Linux, VxWorks, Windows CE, and so on. Linux is a Unix-based operating system that supports ARM, MIPS, ALPHA, x86, PowerPC and other embedded microprocessors. The biggest feature of the Linux operating system is open source and tailorability. In addition, the Linux operating system has the advantages of high efficiency and stability, good portability, support for multiple file systems, etc., which is beneficial to Linux in embedded devices. Applications.

1.2 compiler selection and configuration

This system uses C language to write source code, compile and generate programs on ARM platform, so you need to install standard C development environment and cross compiler arm-linux-gcc in Linux environment. Use the command sudo apt-getinstall gcc g++ libgccl libg++make gdb to install the C development environment. The steps to install the cross compiler are as follows:

1 Download the compiler source file arm-linux-gcc-3.4.1.tar.bz2 and use the tar command to extract the file.

2 Copy the arm folder formed after decompression to the usr/local/ directory. Now the cross-compiled assembly is in the /usr/local/arm/3.4.1/bin directory.

3 Modify the environment variables, add the path of the cross compiler to the PATH, and use the command source/root/.bashrc to make the new environment variables take effect.

2 ARM9 embedded movie list software design

The main task in this system is to search the catalogue of existing movie information, generate a movie program menu through analysis, and display the available information mainly in the form of a list by means of pictures and texts, giving the user an intuitive Operator interface to get useful information about the show.

2.1 Framebuffer initialization

Framebuffer is a graphics device driver interface for the Linux kernel that provides an abstract description of the LCD controller. It abstracts the memory on the LCD controller into a character device. The application can access the memory of the LCD controller through a defined interface and directly read/write the display buffer. The user only needs to write data directly to the Framebuffer display buffer to update the output of the display. The device files of Framebuffer are generally /dev/fb0, /dev/fb1, etc., and their usage is as follows:

S3C2410 and Linux movie list system design

2.2 Picture display

This system uses the Libjpeg library to display images under Linux. Libjpeg is a widely used jpeg compression/decompression function library that can read and write JPEG image files. Usually such files are suffixed with .jpg or .jpeg. With the Libjpeg library, an application can read one or more scan lines from a jpeg compressed image each time, such as color space conversion, downsampling/incremental sampling, color quantization, etc., by Libjpeg. For Libjpeg, the image data is a two-dimensional pixel matrix. For a color image, each pixel is usually represented by three components, namely R, G, B, each component is represented by one byte, so each component ranges from 0 to 255; for grayscale images Each pixel is usually represented by one component, and one component is also represented by one byte, ranging from 0 to 255. Therefore, in this system, the JPEG picture that needs to be displayed in the system is decoded into a bmp pixel point, and then the image space is displayed by writing the application space through the Framebuffer device. The process of decoding JPEG pictures by Libjpeg is as follows:

S3C2410 and Linux movie list system design

After calling the jpeg_start_decompress() function, you need to allocate storage space for all the pixels on the decompressed scan line. The size of this space is determined by the width and height of the image output and the number of bytes per pixel. The output_width and output_height of the JPEG decompressed object cinfo represent the width and height of the image output, respectively, and output_components represents the number of bytes.

S3C2410 and Linux movie list system design

The scan lines are read in the order from top to bottom, that is, the scan line at the top of the image is first read into the storage space by jpeg_read_scanlines(), followed by the second scan line, and finally the bottom edge of the image. The scan line is read into the storage space.

S3C2410 and Linux movie list system design

2.3 text display

Display text under Linux using the FreeType library. The FreeType library is a highly modular library with object-oriented thinking. It is an open source, high quality portable font engine. It provides a unified interface to access a variety of font format files, including TrueType, OpenType, Type1, CID, CFF, Windows FON/FNT, X11 PCF and more. The system uses dot matrix to display the font, that is, to obtain the dot matrix representation of the Chinese character first, and then decide whether to assign a value to the corresponding pixel on the screen according to whether each bit in the dot is 1. The structure FT_Bitmap that holds the font attributes in the FreeType library, including bitmap rows, columns, and the number of bytes per line. The steps to use the FreeType library are as follows:

S3C2410 and Linux movie list system design

2.4 mouse events

The most common mouse currently has a PS/2 mouse and a USB mouse. However, there is not much difference between the two layers of the application layer. The PS/2 mouse has four working modes: reset mode, streaming mode, remote mode, and detection mode. Stream mode is the default mode of operation, and any action of the mouse in streaming mode is reported to the host.

(1) Analysis and drawing of the mouse

The device file for the mouse is /dev/input/mice. When the mouse has motion (move, button, scroll), you can use the cat/dev/input/mice command to get the action data and display it on the screen. However, most of them are garbled. The reason is that the mouse motion data read is not necessarily a visible character from 0 to 127.

The main code to implement mouse parsing is as follows:

S3C2410 and Linux movie list system design

Through the above analysis of the mouse protocol data, the mouse button event and the relative increment of the x and y directions are obtained. As long as a set of variables is declared, the dx and dy are accumulated to obtain the absolute coordinates of the mouse on the screen.

S3C2410 and Linux movie list system design

The drawing of the mouse first needs to define a mouse logo. Before drawing the mouse mark on the screen, save the original image of the corresponding position of the screen (the size of the mouse mark), and then draw the logo of the mouse. When the mouse moves to a new position, it can be restored according to the saved original image in the original position, and can be repeatedly saved and drawn in the new position.

(2) mouse button event control

Take the button A event as an example. The main implementation code is as follows:

S3C2410 and Linux movie list system design

By parsing the mouse information. Judge D0, that is, the button information of the left button. When it is 1, it indicates that the left button is pressed. At this time, the corresponding function can be called by the state of whether the mouse is pressed.

3 system implementation

The main interface of the system includes system time display, movie poster arrangement, movie name, page turning and end button, as shown in Figure 1. Click the page flip button to go to the next page of the movie. Click on the movie poster image to enter the introduction bar of the movie, showing a detailed description of the movie, as shown in Figure 2. Click the end button, the program enters the exit interface, and the program ends after 3 s.

S3C2410 and Linux movie list system design
S3C2410 and Linux movie list system design

Conclusion

This paper mainly introduces the movie list product designed and implemented under the Linux operating system using JXARM9-2410 teaching experiment box. The system realizes the functions of displaying pictures and characters, mouse button events, etc., and has completed the basic functions of the movie list. The implementation of the button event provides the system with interactive functions, which lays the foundation for further production of IPTV. For the subsequent research design of the system, there are still places that can be further expanded and improved. For example, the USB function, network communication function and touch screen function can be extended on the system to further improve the design of the upper operation interface. As a school laboratory open fund project, the realization and completion of the system also provides more professional teaching materials to the college, which is conducive to motivating the students to learn and improve the quality and level of teaching.

Replacement Bulb Lamp With Housing

Replacement Projector Lamp with housing has one more case than the bare bulb lamp, which can be directly put into the projector and more convenient than the installation of the bare bulblamp. The projection effect is the same as the compatible projector lamp, with stable light source and brightness, which can support daily life use

Replacement Bulb Lamp With Housing,Bulb Lamp,Dynamic Projector Lamp,Led Projector Lamp

Shenzhen Happybate Trading Co.,LTD , https://www.szhappybateprojectors.com