Abstract:
Disclosed is a method for transmitting media data, comprises: acquiring streaming media data of a media file that a terminal requests to play; when it is determined that the terminal supports a media format of the streaming media data, sending the streaming media data to the terminal, and the terminal playing the streaming media data; when it is determined that the terminal does not support the media format of the streaming media data requested to be played, converting the media format of the streaming media data into a media format supported by the terminal; and sending the converted streaming media data to the terminal, and the terminal directly playing the converted streaming media data. Also disclosed is a virtual desktop server. The present invention can effectively save the CPU resources of the virtual desktop server.

Description:
TECHNICAL FIELD 
       [0001]    The present disclosure generally relates to virtual desktop technology, and more particularly, to a method for transmitting media data and virtual desktop server. 
       BACKGROUND 
       [0002]    In recent years, as the rapid development of cloud computing and mobile Internet, the virtual desktop technology becomes more and more popular in enterprise-level applications. Virtual desktop technology allows terminals to access user&#39;s desktop through a remote connection software so as to enable simplified management, optimized resource and the like. Virtual desktop technology may make the computer desktop system to be isolated from the local hardware. A terminal may be connected to a virtual desktop server through a network connection so that the calculation logic can be transferred to a virtual desktop server from a local, and then returned by the virtual desktop server to the local, thus enabling unified management of computing resources. 
         [0003]    In application of a virtual desktop, if a high-definition video is to be played on the virtual desktop, the following processes are required to be carried out: opening a media file on the virtual desktop by using a media player; capturing the screen of the desktop by the virtual desktop server to obtain image information displayed on the screen; compressing the image information by the virtual desktop server and transmitting the compressed image information to a terminal through network; decompressing and playing the image by the terminal after receiving the compressed image information. However, a large amount of resources of central processing unit (CPU) are occupied by the virtual desktop server in the compressing of image information, and thus the images are displayed slowly, unclear and even unable to be played. 
       SUMMARY 
       [0004]    In view of above, embodiments of the present disclosure aim to provide a method for transmitting media data and virtual desktop server, which can effectively save the CPU resources of the virtual desktop server. 
         [0005]    For this, the technical solution of embodiments of the present disclosure is achieved as follows. 
         [0006]    The present disclosure provides a method for transmitting media data. The method includes: 
         [0007]    streaming media data of a media file requested by a terminal is acquired; when it is determined that a media format of the streaming media data is supported by the terminal, the streaming media data is transmitted to the terminal, and the terminal plays the streaming media data; when it is determined that the media format of the streaming media data requested to be played is not supported by the terminal, the media format of the streaming media data is converted into a media format supported by the terminal; and the converted streaming media data is transmitted to the terminal, and the terminal plays the converted streaming media data. 
         [0008]    In the above solution, the determining whether the media format of the streaming media data is supported by the terminal may include: 
         [0009]    media formats of streaming media data that can be supported by the terminal are acquired; when the media formats of streaming media data that can be supported by the terminal includes the media format of the streaming media data requested by the terminal, it is determined that the media format of the streaming media data is supported by the terminal. 
         [0010]    In the above solution, when the acquiring of the streaming media data of the media file requested by the terminal fails, the method may further include: 
         [0011]    the media file is played, images to be played are compressed into the streaming media data that can be supported by the terminal in a manner of capturing the images, and the compressed streaming media data is transmitted to the terminal, and the terminal decompresses and plays the compressed streaming media data. 
         [0012]    In the above solution, when the media format of the streaming media data of the media file is failed to be converted into a media format supported by the terminal, the method may further include: 
         [0013]    the media file is played, images to be played are compressed into the streaming media data that can be supported by the terminal in a manner of capturing the images, and the compressed streaming media data is transmitted to the terminal, and the terminal decompresses and plays the compressed streaming media data. 
         [0014]    In the above solution, the media format of the streaming media data may include: Advanced Streaming Format (ASF), Widows Media Video (WMV), and Real Media (RM). 
         [0015]    An embodiment of the present disclosure provides a virtual desktop server. The virtual desktop server includes a media controller and a first processor; wherein, the media controller is configured to acquire streaming media data of a media file requested by a terminal; when it is determined that a media format of the streaming media data is supported by the terminal, the streaming media data is transmitted to the terminal, and the terminal plays the streaming media data; when it is determined that the media format of the streaming media data requested to be played is not supported by the terminal, the streaming media data is transmitted to the first processor; 
         [0016]    the first processor is configured to convert a media format of the streaming media data into a media format supported by the terminal; transmit the converted streaming media data to the terminal; and the converted streaming media data is played by the terminal. 
         [0017]    In the above solution, the media controller is further configured to acquire media formats of streaming media data that can be supported by the terminal; when the media formats of streaming media data that can be supported by the terminal includes the media format of the streaming media data requested by the terminal, determine that the media format of the streaming media data is supported by the terminal. 
         [0018]    In the above solution, the virtual desktop server further includes a second processor; 
         [0019]    the media controller is further configured to, when the acquisition of the streaming media data of the media file requested by the terminal fails, transmit the media file to the second processor; 
         [0020]    Correspondingly, the second processor is configured to play the media file, compress images to be played into the streaming media data that can be supported by the terminal in a manner of capturing the images, and transmit the compressed streaming media data to the terminal, and the terminal decompresses and plays the compressed streaming media data. 
         [0021]    In the above solution, the first processor is further configured to, when the media format of the streaming media data of the media file is failed to be converted into a media format supported by the terminal, transmit the media file to the second processor; 
         [0022]    Correspondingly, the second processor is further configured to play the media file, compress images to be played into the streaming media data that can be supported by the terminal in a manner of capturing the images, and transmit the compressed streaming media data to the terminal, and the terminal decompresses and plays the compressed streaming media data. 
         [0023]    In the above solution, the media format of the streaming media data may include ASF, WMV and RM. 
         [0024]    The embodiments of the present disclosure provide a virtual desktop server and a method for transmitting media data. The method includes that: by acquiring streaming media data of a media file requested by a terminal, and transmitting the streaming media data to the terminal when it is determined that a media format of the streaming media data is supported by the terminal, the terminal plays the streaming media data directly; when it is determined that the media format of the streaming media data requested to be played is not supported by the terminal, the media format of the streaming media data is converted into a media format supported by the terminal; and the converted streaming media data is transmitted to the terminal, and the terminal directly playing the converted streaming media data. As such, the media data may be transmitted in the format of streaming media data to the terminal for playing. Compared with the prior art, for the streaming media data that can be supported by the terminal, the information on screen is not needed to be captured and compressed, thus the CPU resources of the virtual desktop server can be effectively saved. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0025]      FIG. 1  is a schematic structure diagram of a virtual desktop server in accordance with an embodiment of the present disclosure; 
           [0026]      FIG. 2  is another schematic structure diagram of a virtual desktop server in accordance with an embodiment of the present disclosure; 
           [0027]      FIG. 3  is a schematic flowchart of a method for transmitting media data by the virtual desktop server in accordance with an embodiment of the present disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0028]    For more thorough understanding of features and technical content of the present disclosure, the embodiments of the present disclosure are described in further detail below by specific embodiments in conjunction with the accompanying drawings. The accompanying drawings are only illustrative and not intended to limit the embodiments of the present disclosure. 
         [0029]      FIG. 1  is a schematic structure diagram of a virtual desktop server in accordance with an embodiment of the present disclosure. As shown in  FIG. 1 , the virtual desktop server may include a media controller  11 , and a first processor  12 ; wherein, 
         [0030]    the media controller  11  is configured to acquire streaming media data of a media file requested by a terminal; when it is determined that a media format of the streaming media data is supported by the terminal, the streaming media data is transmitted to the terminal, and the terminal plays the streaming media data; when it is determined that the media format of the streaming media data requested to be played is supported by the terminal, the streaming media data is transmitted to the first processor  12 ; 
         [0031]    the first processor  12  is configured to convert a media format of the streaming media data into a media format supported by the terminal; transmit the converted streaming media data to the terminal; and the converted streaming media data is played directly by the terminal. 
         [0032]    Preferably, the media controller  11  is further configured to acquire media formats of streaming media data that can be supported by the terminal; when the media formats of streaming media data that can be supported by the terminal includes the media format of the streaming media data requested by the terminal, determine that the media format of the streaming media data is supported by the terminal. 
         [0033]    Here, the acquiring the media formats of streaming media data that can be supported by the terminal may include: 
         [0034]    the virtual desktop server may transmit a request message for acquiring the media format to the terminal; after receiving the request message, the terminal may transmit the media formats of streaming media data that can be supported by the terminal; 
         [0035]    alternatively, when the terminal is connected to network, the terminal may automatically report the media formats of streaming media data that can be supported by itself to the virtual desktop server; 
         [0036]    alternatively, the media formats of streaming media data that can be supported by the terminal may be stored on the virtual desktop server as registration information or subscription information. 
         [0037]    In practice, the media controller  11  and the first processor  12  in the virtual desktop server shown in  FIG. 1  may be implemented by a Central Processing Unit (CPU), a Digital Signal Processor (DSP), or a Field Programmable Gate Array (FPGA) in the virtual desktop server. 
         [0038]    Preferably, as shown in  FIG. 2 , on the basis of the virtual desktop server shown in  FIG. 1 , the virtual desktop server may further include a second processor  13 ; 
         [0039]    the media controller  11  is further configured to, when the acquisition of the streaming media data of the media file requested by the terminal fails, transmit the media file to the second processor  13 ; 
         [0040]    Correspondingly, the second processor  13  is further configured to play the media file, compress images to be played into the streaming media data that can be supported by the terminal in a manner of capturing the images, transmit the compressed streaming media data to the terminal, and the terminal decompresses and plays the compressed streaming media data; 
         [0041]    Preferably, the first processor  12  is further configured to, when the media format of the streaming media data of the media file is failed to be converted into a media format supported by the terminal, transmit the media file to the second processor  13 ; 
         [0042]    Correspondingly, the second processor  13  is further configured to play the media file, compress images to be played into the streaming media data that can be supported by the terminal in a manner of capturing the images, transmit the compressed streaming media data to the terminal, and the terminal decompresses and plays the compressed streaming media data. 
         [0043]    In the above solution, the media file may be stored in the virtual desktop server. 
         [0044]    In the above solution, the streaming media data may be media data that can be transmitted and played in a form of streaming. 
         [0045]    In the above solution, the media format of the streaming media data may include ASF, WMV and RM. 
         [0046]    In the above solution, the media formats that can be supported by the terminal may be media formats that can be played by the terminal, such as WMV and RM. 
         [0047]    In the above solution, the capturing of images may include that the pixel information for each frame of the image displayed on the screen is acquired when the media file is played. 
         [0048]    In practice, the media controller  11 , the first processor  12  and the second processor  13  in the virtual desktop server shown in  FIG. 2  may be implemented by a CPU, a DSP, or a FPGA in the virtual desktop server. 
         [0049]      FIG. 3  is a schematic flowchart of a method for transmitting media data by a virtual desktop server in accordance with an embodiment of the present disclosure. As shown in  FIG. 3 , the method may include: 
         [0050]    step  301 : streaming media data of a media file requested by a terminal is acquired. 
         [0051]    Here, the media file may be stored in the virtual desktop server. 
         [0052]    Here, the streaming media data may be media data that can be transmitted and played in a form of streaming. 
         [0053]    Preferably, step  301  may further include that: when the virtual desktop server fails to acquire the streaming media data of the media file requested by the terminal, the media file is played, images to be played are compressed into the streaming media data that can be supported by the terminal in a manner of capturing the images, and the compressed streaming media data is transmitted to the terminal, and the terminal decompresses and plays the compressed streaming media data. 
         [0054]    Here, the capturing of images may include that the pixel information for each frame of the image displayed on the screen is acquired when the media file is played. 
         [0055]    Here, the media formats that can be supported by the terminal may be media formats that can be played by the terminal, such as WMV and RM. 
         [0056]    Step  302 : it is determined whether the media format of the streaming media data can be supported by the terminal; if the media format can be supported by the terminal, step  303  may be performed; otherwise, step  304  may be performed. 
         [0057]    Here, the media format of the streaming media data may include ASF, WMV, and RM. 
         [0058]    Here, the determining whether the media format of the streaming media data can be supported by the terminal may include: 
         [0059]    the virtual desktop server may acquire the media formats of streaming media data that can be supported by the terminal; when the media formats of streaming media data that can be supported by the terminal includes the media format of the streaming media data requested by the terminal, it is determined that the media format of the streaming media data can be supported by the terminal; and when the media formats of streaming media data that can be supported by the terminal does not include the media format of the streaming media data requested by the terminal, it is determined that the media format of the streaming media data cannot be supported by the terminal. 
         [0060]    Here, the acquiring the media formats of streaming media data that can be supported by the terminal may include: 
         [0061]    the virtual desktop server may transmit a request message for acquiring the media format to the terminal; after receiving the request message, the terminal may transmit the media formats of streaming media data that can be supported by the terminal; 
         [0062]    alternatively, when the terminal is connected to network, the terminal may automatically report the media formats of streaming media data that can be supported by itself to the virtual desktop server; 
         [0063]    alternatively, the media formats of streaming media data that can be supported by the terminal may be stored on the virtual desktop server as registration information or subscription information. 
         [0064]    Step  303 : the streaming media data is transmitted to the terminal, and is played by0 the terminal. 
         [0065]    Step  304 : media format of the streaming media data is converted into a media format supported by the terminal; the converted streaming media data is transmitted to the terminal; and the converted streaming media data is played directly by the terminal. 
         [0066]    Preferably, step  304  may further include that: when the media format of the streaming media data is failed to be converted into the media formats that can be support by the terminal, the virtual desktop server plays the media file, compresses images being played into the streaming media data that can be supported by the terminal in a manner of capturing the images, transmits the compressed streaming media data to the terminal, and the terminal decompresses and plays the compressed streaming media data. 
         [0067]    The above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. 
       INDUSTRIAL APPLICABILITY 
       [0068]    The present disclosure provides a method for transmitting media data and a virtual desktop server. The method includes that: when it is determined that media format of streaming media data of a media file that is requested to play can be supported by a terminal, the streaming media data is received and played directly by the terminal; when it is determined that media format of streaming media data of a media file that is requested to play cannot be supported by a terminal, the media format of the streaming media data is converted into a media format that can be supported by the terminal, and then the converted streaming media data is received and played by the terminal. As such, media files may be transmitted in a format of streaming media data to the terminal for playing, thus the CPU resources of the virtual desktop server can be effectively saved.