Design of streaming media player for IPTV set-top box

Publisher:HarmoniousCharmLatest update time:2012-07-17 Keywords:IPTV Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:IPTV Reference address:Design of streaming media player for IPTV set-top box

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

Introduction to IPTV test application scenarios
1 Introduction As of June 2007, more than 200 users around the world, including equipment manufacturers and operators, are using the industry-leading IPTV testing solution provided by IXIA (http://www.catr.cn/ctu/cshdt/200707/t20070706_597416.htm). Different users have different focuses on IPTV testing. IXIA's overa
[Test Measurement]
Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号