The open source code live555 is an SDK for implementing streaming media transmission functions. Use playCommon.cpp in the testProgs folder of the SDK to design the transmission module of the IP TV set-top box, and together with the playback module, form the streaming media player of the IPTV set-top box. playCommon.cpp is the bridge connecting the server and the client. Its working principle is that when the client requests data from the server, it obtains the SDP description information from the URL of the server and creates a multimedia session based on the SDP, and finally plays the data stream.
This paper introduces the design process of the streaming media player for IPTV set-top boxes. The transmission module of IPTV set-top boxes is developed by using the function of playCommON.cpp in the live555 open source code and combining the software structure design of IPTV set-top boxes. Then the transmission module is connected to the middleware through the message queue, and connected to the playback module through the entry function of the playback module, and finally the streaming media player of IPTV set-top boxes is formed. The player has been tested and has stable performance.
1 IPTV set-top box streaming media player design
1.1 IPTV set-top box software structure
The software code implementation of the set-top box is divided into four parts: hardware driver, operating system, middleware, and application layer, as shown in Figure 1.
Figure 1 Set-top box software structure
1) Hardware driver connects the underlying hardware and the upper operating system. 2) The operating system used here is the free open source code Linux. 3) Middleware isolates the upper application layer from the underlying operating system and the software adaptation layer of the hardware. The core modules of the middleware mainly include: (1) Browser: Get the URL from the server and display the corresponding EPG page. (2) Graphical user interface management: Provides user interface control (such as buttons, lists) and graphic functions such as graphic image drawing for the application. 4) The application layer realizes the playback of audio and video media files.
1.2 IPTV set-top box streaming media player system architecture
In the Live555 open source code, playCommon.cpp realizes the function of using a computer as a receiving terminal, receiving and playing with VLC software, and finally displaying it on the computer. The research content is to integrate playCommon.cpp into the software code of the set-top box, and finally realize the function of using the IPTV set-top box as a receiving terminal, playing it, and displaying it on the TV. This puts forward new requirements for the design of the code: On the one hand, playCommon.cpp obtains the URL of the server by entering rtsp://local IP address: port number/file name to be played in the RTSP column of VLC. However, for the IPTV set-top box, the URL obtained by the transmission module is the corresponding URL when the user selects the program on the EPG through the remote control. This URL is read by the browser in the middleware, so it is necessary to connect the middleware and the transmission module. On the other hand, the data stream sent by playCommon.cpp is received and played by VLC, while for the IPTV set-top box, the data stream sent by the transmission module is received and played by the playback module. Therefore, it is necessary to connect the transmission module and the playback module.
In order to connect the middleware, input module and playback module, a message queue is designed to realize data communication among the three modules. In addition, the program also designs pt hread create () to create the thread rt spmain () to realize the concurrency of the program. The system architecture of the IPTV player is shown in Figure 2.
Figure 2 IPTV player system architecture
1.3 Program Structure Analysis
1.3.1 Transmission module.
1) main function (1) void initMsgQ () initializes the message queue. dataQid represents the message queue of data, which contains some data transmitted on the network. Finally, the data in the message queue is sent to the player through the void send data to player () function. msgkeyQid represents the message queue of message key value. The transmission module receives the remote control key value instructions obtained from the middleware and sends them to the player to implement operations such as fast forward, fast rewind, stop, and play. fromeMiddleQid represents the message queue of the middleware. The transmission module receives the URL sent from the middleware as the destination address when the client player requests data from the server. playerStateQid represents the message queue of the playback status. The transmission module is used to send and receive the status of the player and control whether the player is on-demand, live or time-shifted. (2) phread_create(&g_session_thread_info,&tattr,(void*(*)(void*))rtsp_main,(void*)&urlInform); creates the rtsp_main() thread. Ensure that the communication of the message queue and the transmission of the streaming media run simultaneously.
2) rtsp_main function. (1) recvMiddlewareMsg(fromeMiddleQid,url): The value of url passed from the middleware is assigned to the variable url. (The definition of url is completed in the middleware, so it needs to be obtained from the middleware); (2) Functions in playCommon.cpp: When the client sends a request to the server, the server responds to the request, creates a media session and plays the data stream. (3) main_player_entry(gTrans. first Create): The client receives the stream and calls the player's entry function to initialize the player. (4) void send_data_to_player(): Call the player, send the data received from the Internet to the player, and start playing.
1.3.2 Playback module
The playback module is shown in Figure 3. It mainly completes the playback of files in on-demand, live broadcast, and time-shift modes, as well as the control of the playback status, such as fast forward, fast rewind, pause, play, etc. 1) process_playback_state() calls different functions according to on-demand, live broadcast, and time-shift. The same is to set audio and video synchronization. 2) handle_playback_state(state,time) sets different timestamps (state Tmp.multiple) to control the playback status.
Figure 3 Playback module structure diagram
2 Conclusion
The software function modules of IPTV set-top box mainly include: streaming media transmission module, media player module, electronic program menu module, and WEB browser module. Among them, streaming media transmission module and media player module together constitute the set-top box player; electronic program menu module and WEB browser module together constitute the basic module of middleware. The focus of the research is the player. The IPTV set-top box made by the design method has been produced and has stable performance after testing.
Previous article:Five common mistakes when buying audio equipment
Next article:Hushan AVK300 audio machine experience
Recommended ReadingLatest update time:2024-11-17 00:38
- Popular Resources
- Popular amplifiers
- Virtualization Technology Practice Guide - High-efficiency and low-cost solutions for small and medium-sized enterprises (Wang Chunhai)
- The authoritative guide to AR development: Based on AR Foundation (Wang Xiangchun)
- CVPR 2023 Paper Summary: Adversarial Attack and Defense
- Modern communication application practice
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- TI C66x DSP QM queue reserve method
- GD32E231Cx builds its own project OK, share it with everyone
- How to deal with audio noise
- Terasic C5P FPGA development board and Intel Up2 Squared Grove development kit released
- I don't understand part of the charging circuit. Please explain it to me.
- EEWORLD University - Introduction to Switching Power Supply Circuit Design
- Help Silicon: Simulation or burning of soc_blinky or soc_empty project fails
- The live broadcast with prizes has started! Today at 10:00 am, basic oscilloscope training is waiting for you!!!
- Sugar gliders Part 9: Design and implementation of a sugar glider data monitoring subsystem based on RSL10
- Sources and suppression of high-frequency noise components