WO2018126852A1 - 媒体数据播放方法、电子设备和计算机可读存储介质 - Google Patents

媒体数据播放方法、电子设备和计算机可读存储介质 Download PDF

Info

Publication number
WO2018126852A1
WO2018126852A1 PCT/CN2017/115568 CN2017115568W WO2018126852A1 WO 2018126852 A1 WO2018126852 A1 WO 2018126852A1 CN 2017115568 W CN2017115568 W CN 2017115568W WO 2018126852 A1 WO2018126852 A1 WO 2018126852A1
Authority
WO
WIPO (PCT)
Prior art keywords
media
media data
native
factory
playing
Prior art date
Application number
PCT/CN2017/115568
Other languages
English (en)
French (fr)
Inventor
周代国
孙涛
张力
张晓明
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018126852A1 publication Critical patent/WO2018126852A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/765Interface circuits between an apparatus for recording and another apparatus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4431OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB characterized by the use of Application Program Interface [API] libraries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL

Definitions

  • the present application relates to the field of media data processing technologies, and in particular, to a media data playing method, an electronic device, and a computer readable storage medium.
  • Media data including audio data, video data, or a combination thereof, is an important medium for storing and transmitting information.
  • the operating system can provide the ability to process media data, and applications running on the operating system can play media data by means of the media data processing capability provided by the operating system.
  • the media data processing capabilities provided by the operating system are limited and do not support playback of all media data formats.
  • some versions of the Android operating system do not support MPEG2 encoded video, and MPEG stands for Moving Picture Experts Group, which means the Moving Picture Experts Group.
  • MPEG stands for Moving Picture Experts Group, which means the Moving Picture Experts Group.
  • the user needs to manually install a playback application that can play a media data format that is not supported by the operating system, and jump to the playback application to play each time when the unsupported media data format needs to be played, resulting in an operating system. Poor compatibility with media data.
  • a media data playing method an electronic device, and a computer readable storage medium are provided.
  • a method for playing media data comprising:
  • An electronic device comprising a memory and a processor, the memory storing computer readable instructions, wherein the computer readable instructions are executed by the processor, such that the processor performs the step of: acquiring a media data address; Calling the standard media data playing interface by using the media data address as a calling parameter; triggering to detect whether the native media playing mode supports playing media data corresponding to the media data address by calling the standard media data playing interface; Matching the original media play mode for the media data when the play is supported; matching the extended media play mode for the media data when detecting that the play is not supported; and playing the media according to the matched media play mode. data.
  • a non-transitory computer readable storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of: acquiring a media data address; calling the standard media data playing interface by using the media data address as a calling parameter; and triggering to detect whether the native media playing mode supports playing the media corresponding to the media data address by calling the standard media data playing interface Data; matching the original media playing mode for the media data when detecting the supported playing; matching the extended media playing mode for the media data when detecting the unsupported playing; and according to the matched media playing mode Playing the media data.
  • FIG. 1 is a schematic diagram of an internal structure of an electronic device for implementing a media data playing method in an embodiment
  • FIG. 2 is a schematic flow chart of a method for playing media data in an embodiment
  • FIG. 3 is a schematic flow chart of a method for playing media data in another embodiment
  • FIG. 4 is a schematic flow chart of a step of calling an extended media factory by calling a standard media data playing interface to detect whether a native media factory supports playing media data corresponding to a media data address;
  • FIG. 5 is a flow diagram showing the steps of injecting custom code into a native media service process to add an extended media factory in one embodiment
  • FIG. 6 is a schematic flowchart of a step of triggering to detect whether a native media play mode supports playing media data corresponding to a media data address by calling a standard media data play interface in an embodiment
  • FIG. 7 is a schematic flow chart of steps of injecting custom code into a native media service process to add an extended media factory in a specific application scenario
  • FIG. 8 is a schematic flowchart of a method for playing media data in a specific application scenario.
  • FIG. 9 is a structural block diagram of an electronic device in an embodiment
  • FIG. 10 is a structural block diagram of an electronic device in another embodiment.
  • FIG. 1 is a schematic diagram of an internal structure of an electronic device for implementing a media data playing method in an embodiment.
  • the electronic device includes a processor, memory, network interface, display screen, and input device connected by a system bus.
  • the memory comprises a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the electronic device stores an operating system, and can also store computer readable instructions that, when executed by the processor, cause the processor to implement the media data playing method.
  • the internal memory can also store computer readable instructions that, when executed by the processor, cause the processor to perform a media data playback method.
  • the network interface of the electronic device is used to download file format or streaming media data.
  • the display screen of the electronic device may be a liquid crystal display or an electronic ink display screen
  • the input device of the electronic device may be a touch layer covered on the display screen, or may be a button, a trackball or a touchpad provided on the outer casing of the electronic device, and It can be an external keyboard, trackpad or mouse.
  • the electronic device may be a personal computer or a mobile electronic device including at least one of a mobile phone, a tablet, a personal digital assistant, or a wearable device.
  • FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied.
  • the specific electronic device may be More or fewer components than those shown in Figure 1 are included, or some components are combined, or have different component arrangements.
  • FIG. 2 is a schematic flow chart of a method for playing media data in an embodiment. This embodiment is mainly illustrated by the method applied to the electronic device in FIG. 1 described above. Referring to FIG. 2, the method for playing media data specifically includes the following steps:
  • the media data address is data indicating the location of the media data, and may be a storage path of the media data locally on the electronic device, or may be a URL of the media data.
  • the URL is an abbreviation of Uniform Resource Locator, which means a uniform resource locator, which is a representation of the location and access mode of resources that can be obtained from the network, and is the address of a standard resource on the network.
  • the media data address can be obtained locally or via the electronic device.
  • the media can be called media.
  • S204 The standard media data playing interface is invoked by using the media data address as a calling parameter.
  • the standard media data playback interface is a standard application program provided by the operating system.
  • API Application Programming Interface
  • the standard media data playback interface is the MediaPlayer interface provided by the SDK (Software Development Kit) of the Android operating system.
  • SDK Software Development Kit
  • Windows Windows
  • Mac OS Apple Desktop Operating System
  • iOS Apple Mobile Operating System
  • the electronic device can obtain a media data address through an application running on the operating system, invoke a standard media data playing interface through the application, and input a media data address to the standard media data playing interface. Calling the standard media data play interface generates a corresponding media data play object that runs in the process of the application.
  • the media data corresponding to the media data address is the media data represented by the media data address.
  • the media playback mode refers to the computer processing logic for playing media data.
  • Native refers to integration by the operating system itself. The original concept is used to indicate the relationship with the operating system and does not mean that the technology involved is prior art.
  • the native media playback mode refers to the media playback mode that comes with the operating system. Support for playing media data means that the corresponding media data can be played.
  • the electronic device can directly detect whether the native media playing mode supports playing media data corresponding to the media data address through a standard media data playing interface.
  • the electronic device can also call other functions through the standard media data playing interface to detect whether the native media playing mode supports playing the media data corresponding to the media data address.
  • the electronic device when detecting that the native media playing mode supports playing media data corresponding to the media data address, uses the native media playing mode as a media playing mode that matches the media data.
  • the electronic device uses the extended media playing mode as the media that matches the media data. Play mode.
  • the extended media playing mode is a non-native media playing mode, and an extended media playing mode can be added by an application running on the operating system.
  • the extended media playback mode includes computer processing logic for playing media data that is not supported by the native media playback mode, and may further include computer processing logic for playing media data supported by the native media playback mode.
  • the electronic device when detecting that the native media playing mode supports playing media data corresponding to the media data address, uses a native media playing mode to implement playing of the media data.
  • the electronic device detects that the native media playing mode does not support playing the media data corresponding to the media data address, uses the extended media playing mode to implement the playing of the media data.
  • the media data playing method can play the original media playing mode or does not support playing the media data corresponding to the media data address, thereby realizing the expansion of the playing capability and improving the compatibility.
  • the native media playing mode is preferred in playback, and the extended media playing mode is adopted when the native media playing mode does not support playing, so as to ensure the stability of the playing as much as possible.
  • the playback of the media support mode and the media data that does not support playback can be realized.
  • the application having the media data requirement does not need to be additionally improved, and the universal is improved. Sex.
  • the native media player uses a native media factory; the extended media player uses an extended media factory.
  • the media factory is a factory for processing media data.
  • the media factory can be a Simple Factory, a Factory Method, or an Abstract Factory.
  • the factory method pattern is an object-oriented design pattern that can be used to create objects without specifying the specific type of the object.
  • the factory method pattern defines an interface for creating objects, letting the class implementing the interface determine which class to instantiate, and deferring the instantiation of the class into subclasses.
  • the media factory is used to create a player instance that is used to play media data.
  • Native different media factories for creating player instances in different scenarios.
  • native media factories such as StagefrightPlayerFactory, NuPlayerFactory or SonivoxPlayerFactory.
  • the StagefrightPlayerFactory is the default media factory for the Android operating system for general local video playback.
  • the NuPlayerFactory is used for streaming media playback, such as RTSP (Real Time Streaming Protocol) or m3u8 format streaming media.
  • SonivoxPlayerFactory is used for playback of media files such as the MIDI (Musical Instrument Digital Interface) format.
  • An extended media factory that can be used only to create player instances that do not support media data for the operating system.
  • the extended media factory can also be used to create media instances that can play media data supported by the operating system and play media data that the operating system does not support.
  • Player data created by the extended media factory can play media data that is not supported by the operating system.
  • the media factory is used, and the playback logic of the operating system is used to realize the expansion of the operating system playback capability with small changes.
  • step S212 includes creating a corresponding player instance with the matched media factory and playing the media data through the created player instance.
  • the electronic device can open and read the media data corresponding to the media data address through the player instance, decode the media data, and play the video and/or audio.
  • the electronic device can also synchronize the played audio and video through the player instance.
  • the player instance is an instance of the MediaPlayerBase type.
  • step S206 includes invoking an extended media factory by invoking a standard media data play interface to detect whether the native media factory supports playing media data corresponding to the media data address.
  • the extended media factory includes computer processing logic that detects whether the native media factory supports playing media data corresponding to the media data address.
  • the extended media factory can be detected by its own logic or by calling native function detection.
  • the extended media factory can match the original media playing mode for the media data when detecting that the native media playing mode supports playing the media data; the extended media factory can detect that the native media playing mode does not support playing the media data. When the media data matches the extended media playback mode.
  • the calling the extended media factory by calling the standard media data play interface to detect whether the native media factory supports playing the media data corresponding to the media data address, including: by calling the a standard media data playing interface, traversing a media factory in the media factory collection, and performing support ability scoring on the media data; the media factory set includes a native media factory and an extended media factory; corresponding to each media factory traversed The capability score is supported to determine whether the native media play mode supports playing media data corresponding to the media data address.
  • the method includes: Traversing to the extended media factory, detecting whether the native media factory supports playing the media data corresponding to the media data address; when detecting the supported playback, obtaining the corresponding media factory corresponding to the extended media factory A support capability score assigned to the media data; when it is detected that playback is not supported, a support capability score corresponding to the extended media factory and used to allocate the extended media factory to the media data is obtained.
  • the support capability score corresponding to the extended media factory and for assigning the native media factory to the media data is obtained when the support for playback is detected, including: when support for playback is detected The minimum of the range of ability scores will be supported as a support ability score corresponding to the extended media factory. And when it is detected that the playback is not supported, obtaining a support capability score corresponding to the extended media factory and for allocating the extended media factory to the media data, including: supporting capability when detecting that the playback is not supported The maximum value in the score range as a support ability score corresponding to the extended media factory.
  • the method includes: Traversing to the native media factory, detecting whether the native media factory traversed to itself supports playing the media data corresponding to the media data address; when detecting the supported playback, obtaining the corresponding media factory corresponding to the traversal, and Used to traverse to a support rating score assigned to the media data by the native media factory; when support for playback is detected, obtaining a native media factory traversed to the traversal, and for not assigning the traversed native media factory to the media Data support ability score.
  • the support capability score for assigning the traversed native media factory to the media data is, for example, 1
  • the support capability score for not assigning the traversed native media factory to the media data is, for example, 0. .
  • the determining whether the native media playing mode supports playing media data corresponding to the media data address according to a support capability score corresponding to each media factory traversed includes: media traversing The maximum support ability score is selected in the corresponding support ability score of the factory; when the maximum support ability score corresponds to the original media factory, determining that the native media play mode supports playing the media data corresponding to the media data address; When the maximum support capability score corresponds to the extended media factory, it is determined that the native media play mode does not support playing the media data corresponding to the media data address.
  • FIG. 3 is a schematic flow chart of a method for playing media data in another embodiment. Referring to FIG. 3, the method specifically includes the following steps:
  • S304 The standard media data playing interface is invoked by using the media data address as a calling parameter.
  • the media data is supported by the media factory in the media factory collection by calling a standard media data playing interface, and the media factory collection includes a native media factory and an extended media factory.
  • the media factory collection is a collection of more than one media factory, including at least one native media factory and at least one extended media factory.
  • Each media factory in the media factory collection includes a scoring function and a player instance creation function.
  • the scoring function is used to score the support media data address and output the corresponding support ability score.
  • the player instance creation function is used to create the corresponding player instance.
  • the electronic device can traverse the media factory set through the native media service process, and support the media data corresponding to the media data address by using a scoring function of each media factory in the media factory collection. Score, get the corresponding support ability score.
  • the corresponding output indicates whether the native media factory supports the support capability score of the media data corresponding to the media data address.
  • the support ability score has a support ability score range, which may include two or more values.
  • S308 detecting, by traversing the native media factory, whether the native media factory traversed to support the media data corresponding to the media data address; and when detecting the support for playing, obtaining the corresponding media factory corresponding to the traversal, and A support capability score for assigning a native media factory traversed to the media data; when support for playback is detected, obtaining a native media factory corresponding to the traversed native media factory and for not traversing to the native media factory Support for media data support scores.
  • S310 detecting, by traversing to the extended media factory, whether the native media factory supports playing media data corresponding to the media data address; when detecting support for playing, obtaining the corresponding media factory and for using the original media
  • the support capability score assigned by the factory to the media data when it is detected that the play is not supported, a support ability score corresponding to the extended media factory and used to allocate the extended media factory to the media data is obtained.
  • the electronic device may output less than the native device corresponding to the traversed extended media factory when determining that the media data corresponding to the media data address is supported by the native media factory.
  • Support scores for support scores for media factories are positively correlated with the support capability.
  • the electronic device may output a greater than corresponding to the traversed extended media factory when determining that the media data corresponding to the media data address is supported by the native media factory.
  • Support ability scores for support ability scores in native media factories are not limited to native media factories.
  • the electronic device may output an extended media factory output corresponding to the traversal greater than the native media factory when determining that the media data corresponding to the media data address is not supported by the native media factory.
  • a support ability score that supports the ability score.
  • the electronic device may output less than the corresponding extended media factory output when determining that the media data corresponding to the media data address is not supported by the native media factory.
  • S312 Match the media data to the corresponding media factory according to the support capability score corresponding to each media factory traversed in the media factory collection.
  • the electronic device may take the maximum value of the support capability scores obtained by traversing the media factory set, and match the media factory corresponding to the maximum value to the media data corresponding to the media data address. If the support capability score is negatively correlated with the support capability, the electronic device may take the minimum value of the support capability scores obtained by traversing the media factory set, and match the media factory corresponding to the minimum value to the media data corresponding to the media data address.
  • the electronic device can create a corresponding player instance according to the matched media factory to play the media data through the created player instance.
  • the logic of the original matching media factory can be utilized to realize the expansion of the operating system media data processing capability.
  • the development workload is reduced, and the native logic of the operating system is less involved, which can reduce the new defects caused by modifying the native logic of the operating system.
  • step S310 includes: when the support for the play is detected, the minimum value of the support capability score range is taken as the support ability score corresponding to the extended media factory; when the support is not supported, the support capability is supported. The maximum value in the score range as a support ability score corresponding to the extended media factory.
  • the output is output.
  • the extended media factory scores 0 for this media data support. Even if the extended media factory supports the media data corresponding to the media data address, the minimum value in the support capability score range is still output.
  • the extended media factory outputting the media data support capability score is 1.
  • the maximum of the support ability scores is a native media factory's ability to support media data. If the media data corresponding to the media data address is not supported by the native media factory, the maximum of the traversed support capability scores is an extended media factory's ability to support the media data.
  • the logic of the original media system for determining the matching media factory can be used to expand the processing capability of the operating system media data, thereby reducing the development workload and operating the system natively. Less logical intervention can reduce the number of new defects caused by modifying the operating system's native logic.
  • the step of calling the extended media factory by calling the standard media data playing interface to detect whether the native media factory supports playing the media data corresponding to the media data address comprises the following steps:
  • the electronic device when the electronic device invokes the standard media data playing interface, the electronic device transmits the media data address to the native media service process through the standard media data playing interface.
  • the native media service process is a MediaServer process, and the electronic device passes the media data address to the MediaServer process through the standard media data play interface MediaPlayer.
  • the native media factory and the extended media factory are stored in the global address space of the native media service process.
  • the electronic device can determine whether the media data corresponding to the media data address is supported by the native media factory through the native media service process.
  • the global address space of the native media service process is the address space requested by the native media service process, and the data in the address space can be operated by the native media service process.
  • the extended media factory is added to the global address space of the native media service process to implement playback of media data supported by the native media factory and not supported, and reduced.
  • the development workload is less involved in the native logic of the operating system, which can reduce the situation that new defects are caused by modifying the native logic of the operating system.
  • the media data playing method further includes the step of injecting custom code into the native media service process to add the extended media factory.
  • the step of injecting custom code into the native media service process to add the extended media factory specifically includes the following steps:
  • the electronic device can inject custom code into the native media service process through a custom process.
  • step S502 may be performed after obtaining the corresponding management authority.
  • the custom process is a non-operating system native process.
  • Custom code is non-operating system native code that extends the media data processing capabilities of the operating system.
  • custom code injection can be achieved through the Ptrace() function.
  • the initial process is the first user-level process that the operating system starts after it has finished booting. In the Android operating system, the initial process is the init process.
  • the custom process can be started after the operating system has booted. In one embodiment, the custom process can be launched following the startup of the operating system.
  • the initial process can start the custom process based on the custom program path configured in the startup configuration file.
  • the initial process may start the custom process according to the customized program path configured in the startup configuration file after receiving the operating system startup completion notification configured in the startup configuration file.
  • the initial process is the init process
  • the startup configuration file is the init.rc file.
  • the custom process can be configured as a service in the startup configuration file; the custom process is configured to be disabled, meaning that it does not start with the operating system startup; the custom process is configured to receive the operating system boot Start after notification.
  • the electronic device acquires the address of the memory allocation function of the native media service process through the custom process, and pauses the native media service process, so as to allocate the memory space by calling the memory allocation function of the native media service process according to the obtained address.
  • This memory space belongs to native media The global address space of the service process.
  • the electronic device copies the custom code into the allocated memory space through a custom process, and modifies the execution location of the native media service process to the start address of the custom code in the allocated memory space, thereby restoring the native media service process.
  • the native media service process executes the custom code upon recovery from the pause.
  • the custom code is executed, the state of the media service process is saved first, then the specified code file is loaded, and the custom logic in the code file is executed to add the extended media factory in the global address space of the native media service process. Unload the code file and restore the state of the saved media service process.
  • step S506 After detecting that the native media service process is closed, after the native media service process is restarted, the process returns to step S502.
  • the electronic device can listen to the process shutdown notification issued by the operating system when the native media service process is closed by the custom process.
  • the process returns to step S502.
  • the native media service process is restarted by the operating system after the native media service process is closed.
  • the custom process waits for the operating system to restart the native media service process, and returns to step S502 to continue to inject the definition code into the native media service process through the custom process.
  • the extension of the operating system media data processing capability can be realized, and the modification is not required on the basis of the operating system source code, and the operating system source code cannot be obtained.
  • An extension of the operating system media data processing capabilities can be implemented.
  • the situation that the native media service process is closed can be automatically found, and the custom code is re-injected after the native media service process is restarted, thereby ensuring the effectiveness of expanding the operating system media data processing capability.
  • step S206 includes the following steps:
  • the custom interface is named the same name as the standard media data playback interface, so the custom interface is called when the standard media data playback interface is called.
  • the easy-to-name native standard media data playback interface retains the content of the standard media data playback interface, and its name is changed to a name different from the original name of the standard media data playback interface.
  • the electronic device can call the standard media data playing interface of the renamed name through the custom interface, thereby calling the scoring function of each native media factory to obtain the support ability score of the media data corresponding to the media data address.
  • the electronic device can determine whether the native media factory supports playing the media data corresponding to the media data address according to the support capability score.
  • the interface name is skillfully utilized to implement the extension of the operating system media data processing capability.
  • the processing logic changes less, and the intervention of the operating system native logic is minimized. It can reduce the situation that new defects are caused by modifying the native logic of the operating system.
  • step S208 includes matching the native media play mode to the media data through the renamed native standard media data play interface when the support for play is detected.
  • step S210 includes: matching the extended media playing mode for the media data through the custom interface when detecting that the playback is not supported.
  • the electronic device can directly pass the renamed native standard media data playing interface when detecting that the native media factory supports playing the media data through the renamed native standard media data playing interface.
  • the electronic device specifies the computer processing logic defined in the custom interface named standard media data playing interface. Defines the extended media playback mode defined by the interface.
  • the native media factory supports the media data through the easy-to-name native standard media data playing interface, and still matches the original media for the media data through the renamed native standard media data playing interface when detecting the support. Play mode.
  • the media data playing interface determines that the native media factory does not support the media data
  • the media interface is matched with the extended media playback mode through the custom interface. Minimizing the involvement of the operating system's native logic can reduce the number of new bugs caused by modifying the operating system's native logic.
  • detecting whether the native media playing mode supports the media data corresponding to the playing media data address comprises: determining that the native media playing mode does not support playing the media data corresponding to the media data address when at least one of the following is satisfied :
  • the number of channels of the media data can be obtained through the MediaExtractor function (a function of extracting media information) in the media playback frame StagefrightPlayer.
  • a typical video has two channels, one for the audio channel and the other for the video channel. If the number of channels of the media data returned by the MediaExtractor function is 0, it means that the electronic device does not support the media data, that is, the media data is not supported by the native media factory.
  • the encoding format of the media data may be obtained through a MediaExtractor function, and specifically may be an encoding format of audio and/or video. If the MediaExtractor function returns information indicating that the encoding format failed to be obtained, the electronic device does not support the media data, that is, the native media factory does not support the media data.
  • whether the acquired encoding format is supported by the native decoder can be determined by a function of the OMX interface (an interface for decoding), and if not, it is determined that the acquired encoding format is not native. Supported by the decoder. Specifically, the terminal may first determine whether the conditions 1) and 2) are true, and determine whether the condition 3) is established if the conditions 1) and 2) are not established.
  • a plurality of determination conditions are provided to quickly determine whether the media data is supported by the native media factory, and an efficient judgment can be made as to whether the media data is supported by the native media factory.
  • the custom process injects custom code into the MediaServer process and adds the extended media factory to the MediaServer process's global address space through custom code. If the custom process listens to the process shutdown notification sent by the operating system when the native media service process is closed, in response to the process shutdown notification, after the native media service process restarts, the custom code is continuously injected into the MediaServer process.
  • the MediaPlayer interface provided by the SDK of the Android operating system is called, and the media data address is transmitted to the MediaPlayerService in the MediaServer process through the MediaPlayer interface.
  • the MediaPlayerService in the MediaServer process calls the media factory interface MediaPlayerFactory, and the MediaPlayerFactory traverses the media factory collection to respectively support the media data corresponding to the media data address.
  • the native media factory supports playing the media data, the corresponding output capability score greater than 0 and less than or equal to 1 is output.
  • a support capability score of greater than or equal to 0 and less than 1 is output.
  • the output capability value is 0; if it is determined that the native media factory does not support playing media data, the output value is 1 support.
  • Ability score MediaPlayerFactory finally selects the media support factory corresponding to the largest support capability score to create a player instance MediaplayerBase. The MediaServer process decodes the media data through the player instance and outputs it to the application through the SDK for output by the application.
  • FIG. 9 is a structural block diagram of an electronic device 900 in an embodiment.
  • the internal structure of the electronic device 900 can correspond to the structure shown in FIG. 2.
  • Each of the following modules can be partially or partially passed through software and hardware. Or a combination of them to achieve. .
  • the electronic device 900 includes an address obtaining module 901, a standard media data playing interface calling module 902, a media playing mode matching module 903, and a playing module 904.
  • the address obtaining module 901 is configured to obtain a media data address.
  • the standard media data playing interface calling module 902 is configured to invoke the standard media data playing interface by using the media data address as a calling parameter.
  • the media play mode matching module 903 is configured to trigger, by calling a standard media data play interface, whether the native media play mode supports playing media data corresponding to the media data address, and when the support for play is detected, the media data is matched with the original media. Play mode; when it detects that playback is not supported, it matches the extended media play mode for media data.
  • the playing module 904 is configured to play the media data according to the matched media playing mode.
  • the electronic device 900 can implement playback when the native media playback mode supports playback or does not support playing media data corresponding to the media data address, thereby realizing the expansion of the playback capability and improving compatibility.
  • the native media playing mode is preferred in playback, and the extended media playing mode is adopted when the native media playing mode does not support playing, so as to ensure the stability of the playing as much as possible.
  • the playback of the media support mode and the media data that does not support playback can be realized.
  • the application having the media data requirement does not need to be additionally improved, and the universal is improved. Sex.
  • the native media player uses a native media factory; the extended media player uses an extended media factory.
  • the media factory is used, and the playback logic of the operating system is used to realize the expansion of the operating system playback capability with small changes.
  • the media play mode matching module 903 is further configured to invoke the extended media factory by calling a standard media data play interface to detect whether the native media factory supports playing media data corresponding to the media data address.
  • the media play mode matching module 903 is further configured to: traverse the media factory in the media factory collection by calling the standard media data play interface, and perform support capability scoring on the media data; the media factory The set includes a native media factory and an extended media factory; determining whether the native media play mode supports playing media data corresponding to the media data address according to a support capability score corresponding to each media factory traversed.
  • the media play mode matching module 903 is further configured to detect, by the extended media factory traversed, whether the native media factory supports playing media data corresponding to the media data address; when detecting support for playing Obtaining a support capability score corresponding to the extended media factory and for assigning the native media factory to the media data; when detecting that the playback is not supported, obtaining the corresponding media factory and for expanding The media factory assigns a support ability score to the media data.
  • the media play mode matching module 903 is further configured to: when the support for the play is detected, the minimum value of the support capability score range is used as the support capability score corresponding to the extended media factory; When playback is supported, the maximum value in the capability score range will be supported as a support capability score corresponding to the extended media factory.
  • the media play mode matching module 903 is further configured to detect, by traversing the native media factory, whether the native media factory itself traversed supports playing media data corresponding to the media data address; When support for playback is detected, a support capability score corresponding to the native media factory traversed to and traversed to the native media factory is assigned to the media data; when support for playback is detected, the traversal is obtained and traversed to The native media factory corresponds to and is used to not assign the native media factory traversed to the support capability score of the media data.
  • the media play mode matching module 903 is further configured to: screen a maximum support ability score from a support capability score corresponding to each media factory traversed; when the maximum support capability score corresponds to a native media factory, Determining that the native media play mode supports playing the media data corresponding to the media data address; when the maximum support capability score corresponds to the extended media factory, determining that the native media play mode does not support playing the media data address Corresponding media data.
  • the media play mode matching module 903 is further configured to: pass a media data address to the native media service process by calling a standard media data play interface; and invoke the added in the global address space by the native media service process.
  • An extended media factory to detect whether the native media factory supports playing media data corresponding to the media data address.
  • the extended media factory is added to the global address space of the native media service process to implement playback of media data supported by the native media factory and not supported, thereby reducing development workload and operating system native. Less logical intervention can reduce the number of new defects caused by modifying the operating system's native logic.
  • FIG. 10 is a block diagram showing the structure of an electronic device 900 in another embodiment.
  • the electronic device 900 further includes: an injection module 905, configured to inject a custom code into the native media service process; and add an extended media factory in the global address space of the native media service process through the custom code; When the native media service process is closed, the custom code is injected into the native media service process after the native media service process is restarted.
  • the extension of the operating system media data processing capability can be realized, and the modification is not required on the basis of the operating system source code, and the operating system source code cannot be obtained.
  • An extension of the operating system media data processing capabilities can be implemented.
  • the situation that the native media service process is closed can be automatically found, and the custom code is re-injected after the native media service process is restarted, thereby ensuring the effectiveness of expanding the operating system media data processing capability.
  • the media play mode matching module 903 is further configured to invoke an unnamed native standard media data play interface by calling a custom interface named as a standard media data play interface; playing the native standard media data by calling the name name The interface detects whether the native media playing mode supports playing media data corresponding to the media data address.
  • the interface name is skillfully utilized to implement the extension of the operating system media data processing capability.
  • the processing logic changes less, and the intervention of the operating system native logic is minimized. It can reduce the situation that new defects are caused by modifying the native logic of the operating system.
  • the media play mode matching module 903 is further configured to match the original media play mode to the media data by using the renamed native standard media data play interface when detecting the support play; when detecting that the play is not supported
  • the media playing mode for media data matching extension includes: when detecting that the playback is not supported, matching the extended media playing mode for the media data through the customized interface.
  • the native media factory supports the media data through the easy-to-name native standard media data playing interface, and still matches the original media for the media data through the renamed native standard media data playing interface when detecting the support. Play mode.
  • the media interface is matched with the extended media playback mode through the custom interface. Minimizing the involvement of the operating system's native logic can reduce the number of new bugs caused by modifying the operating system's native logic.
  • the media play mode matching module 903 is further configured to: when the at least one of the following is met, determine that the native media play mode does not support the media data corresponding to the play media data address;
  • a plurality of determination conditions are provided to quickly determine whether the media data is supported by the native media factory, and an efficient judgment can be made as to whether the media data is supported by the native media factory.
  • Non-volatile storage media such as Read-Only Memory (ROM), or random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

一种媒体数据播放方法,包括:获取媒体数据地址;以媒体数据地址为调用参数,调用标准媒体数据播放接口;通过调用标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放媒体数据地址所对应的媒体数据;当检测到支持播放时,为媒体数据匹配原生的媒体播放方式;当检测到不支持播放时,为媒体数据匹配扩展的媒体播放方式;及根据匹配的媒体播放方式播放媒体数据。

Description

媒体数据播放方法、电子设备和计算机可读存储介质
本申请要求于2017年01月04日提交中国专利局,申请号为201710005498.4、发明名称为“媒体数据播放方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及媒体数据处理技术领域,特别是涉及一种媒体数据播放方法、电子设备和计算机可读存储介质。
背景技术
媒体数据包括音频数据、视频数据或者其结合,是用于存储和传递信息的一种重要媒介。目前操作系统可以提供处理媒体数据的能力,运行于操作系统上的应用程序就可以借助操作系统提供的媒体数据处理能力来播放媒体数据。
然而,操作系统提供的媒体数据处理能力是有限的,并不能支持所有媒体数据格式的播放。比如某些版本的安卓操作系统就不支持MPEG2编码格式的视频,其中MPEG表示Moving Picture Experts Group,意为活动图像专家组。这种情况下需要用户手动安装可以播放操作系统不支持的媒体数据格式的播放应用程序,并每次在需要播放该不支持的媒体数据格式时跳转到该播放应用程序进行播放,导致操作系统对媒体数据的兼容性差。
发明内容
根据本申请的各种实施例,提供一种媒体数据播放方法、电子设备和计算机可读存储介质。
一种媒体数据播放方法,包括:
获取媒体数据地址;
以所述媒体数据地址为调用参数,调用标准媒体数据播放接口;
通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据;
当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式;
当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式;
根据匹配的所述媒体播放方式播放所述媒体数据。
一种电子设备,包括存储器和处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:获取媒体数据地址;以所述媒体数据地址为调用参数,调用标准媒体数据播放接口;通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据;当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式;当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式;及根据匹配的所述媒体播放方式播放所述媒体数据。
一种非易失性的计算机可读存储介质,存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:获取媒体数据地址;以所述媒体数据地址为调用参数,调用标准媒体数据播放接口;通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据;当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式;当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式;及根据匹配的所述媒体播放方式播放所述媒体数据。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为一个实施例中用于实现媒体数据播放方法的电子设备的内部结构示意图;
图2为一个实施例中媒体数据播放方法的流程示意图;
图3为另一个实施例中媒体数据播放方法的流程示意图;
图4为一个实施例中通过调用标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据的步骤的流程示意图;
图5为一个实施例中向原生媒体服务进程注入自定义代码以添加扩展的媒体工厂的步骤的流程示意图;
图6为一个实施例中通过调用标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放媒体数据地址所对应的媒体数据的步骤的流程示意图;
图7为一个具体应用场景中向原生媒体服务进程注入自定义代码以添加扩展的媒体工厂的步骤的流程示意图;
图8为一个具体应用场景中媒体数据播放方法的流程示意图。
图9为一个实施例中电子设备的结构框图;
图10为另一个实施例中电子设备的结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
图1为一个实施例中用于实现媒体数据播放方法的电子设备的内部结构示意图。参照图1,该电子设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,存储器包括非易失性存储介质和内存储器。该电子设备的非易失性存储介质存储有操作系统,还可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器实现媒体数据播放方法。该内存储器中也可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行媒体数据播放方法。电子设备的网络接口用于下载文件形式或者流式的媒体数据。电子设备的显示屏可以是液晶显示屏或者电子墨水显示屏,电子设备的输入装置可以是显示屏上覆盖的触摸层,也可以是电子设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。该电子设备可以是个人计算机或者移动电子设备,移动电子设备包括手机、平板电脑、个人数字助理或者穿戴式设备等中的至少一种。本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图1中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
图2为一个实施例中媒体数据播放方法的流程示意图。本实施例主要以该方法应用于上述图1中的电子设备来举例说明。参照图2,该媒体数据播放方法具体包括如下步骤:
S202,获取媒体数据地址。
其中,媒体数据地址是表示媒体数据所在位置的数据,可以是媒体数据在电子设备本地的存储路径,也可以是媒体数据的URL。URL是Uniform Resource Locator的缩写,表示统一资源定位符,是对可以从网络上得到的资源的位置和访问方式的表示,是网络上标准资源的地址。媒体数据地址可从电子设备本地或网络获取。媒体可以称为media。
S204,以媒体数据地址为调用参数,调用标准媒体数据播放接口。
其中,标准媒体数据播放接口是操作系统提供的一种标准的应用程序编 程接口(Application Programming Interface,API),用于提供媒体数据处理能力。在安卓(Android)操作系统中,标准媒体数据播放接口为安卓操作系统的SDK(Software Development Kit,软件开发工具包)所提供的MediaPlayer接口。在视窗(Windows)操作系统、苹果桌面操作系统(Mac OS)以及苹果移动操作系统(iOS)中也存在相应的标准媒体数据播放接口。
具体地,电子设备可通过运行于操作系统上的应用程序获取媒体数据地址,通过该应用程序调用标准媒体数据播放接口,并向该标准媒体数据播放接口传入媒体数据地址。调用标准媒体数据播放接口会生成相应的媒体数据播放对象,该媒体数据播放对象运行在应用程序的进程中。
S206,通过调用标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放媒体数据地址所对应的媒体数据。
其中,媒体数据地址所对应的媒体数据,是媒体数据地址所表示的媒体数据。媒体播放方式是指播放媒体数据的计算机处理逻辑。原生是指由操作系统自身所集成。原生的概念用来表示与操作系统的关系,并不表示所涉及的技术为现有技术。原生的媒体播放方式,是指操作系统自带的媒体播放方式。支持播放媒体数据,是指能够播放相应的媒体数据。
具体地,电子设备具体可通过标准媒体数据播放接口,直接检测原生的媒体播放方式是否支持播放媒体数据地址所对应的媒体数据。电子设备也可以通过标准媒体数据播放接口调用其它函数,以检测原生的媒体播放方式是否支持播放媒体数据地址所对应的媒体数据。
S208,当检测到支持播放时,为媒体数据匹配原生的媒体播放方式。
具体地,电子设备在检测到原生的媒体播放方式支持播放媒体数据地址所对应的媒体数据时,将原生的媒体播放方式作为与媒体数据匹配的媒体播放方式。
S210,当检测到不支持播放时,为媒体数据匹配扩展的媒体播放方式。
具体地,电子设备在检测到原生的媒体播放方式不支持播放媒体数据地址所对应的媒体数据时,将扩展的媒体播放方式作为与媒体数据匹配的媒体 播放方式。
其中,扩展的媒体播放方式是非原生的媒体播放方式,可以通过运行于操作系统上的应用程序添加扩展的媒体播放方式。扩展的媒体播放方式,包括播放原生的媒体播放方式所不支持的媒体数据的计算机处理逻辑,还可以进一步包括播放原生的媒体播放方式所支持的媒体数据的计算机处理逻辑。
S212,根据匹配的媒体播放方式播放媒体数据。
具体地,电子设备在检测到原生的媒体播放方式支持播放媒体数据地址所对应的媒体数据时,采用原生的媒体播放方式,实现对媒体数据的播放。电子设备在检测到原生的媒体播放方式不支持播放媒体数据地址所对应的媒体数据时,采用扩展的媒体播放方式,实现对媒体数据的播放。
上述媒体数据播放方法,对于原生的媒体播放方式支持播放或者不支持播放媒体数据地址所对应的媒体数据的情况,都可以实现播放,实现了播放能力的扩展,提高了兼容性。而且在播放时优先采用原生的媒体播放方式,在原生的媒体播放方式不支持播放时,才采用扩展的媒体播放方式,可尽可能保证播放的稳定性。再者,统一通过调用标准媒体数据播放接口,就可以实现对原生的媒体播放方式支持播放以及不支持播放的媒体数据的播放,具有播放媒体数据需求的应用程序不需要做额外改进,提高了通用性。
在一个实施例中,原生的媒体播放方式采用原生的媒体工厂;扩展的媒体播放方式采用扩展的媒体工厂。
其中,媒体工厂是用于处理媒体数据的工厂。媒体工厂可以是简单工厂模式(Simple Factory)、工厂方法模式(Factory Method)或者抽象工厂模式(Abstract Factory)。工厂方法模式是一种面向对象设计模式,可用于在不指定对象具体类型的情况下创建对象。工厂方法模式定义一个创建对象的接口,让实现该接口的类来决定实例化哪个类,将类的实例化推迟到子类中进行。媒体工厂用于创建播放器实例,该播放器实例用于播放媒体数据。
原生的不同媒体工厂,分别用于创建不同场景下的播放器实例。安卓操作系统中,原生的媒体工厂如StagefrightPlayerFactory、NuPlayerFactory或者 SonivoxPlayerFactory。其中StagefrightPlayerFactory是安卓操作系统默认的媒体工厂,用于一般的本地视频播放。NuPlayerFactory用于流媒体播放,如RTSP(Real Time Streaming Protocol,实时流传输协议)或m3u8格式的流媒体。SonivoxPlayerFactory用于MIDI(Musical Instrument Digital Interface)格式等媒体文件的播放。
扩展的媒体工厂,可以仅用于创建播放操作系统所不支持媒体数据的播放器实例。扩展的媒体工厂,也可以用于创建即能播放操作系统所支持媒体数据,又能播放操作系统所不支持媒体数据的播放器实例。通过扩展的媒体工厂所创建的播放器实例,能够播放操作系统所不支持的媒体数据。
本实施例中,采用媒体工厂,利用操作中系统原生的播放逻辑,可以通过小的改动实现操作系统播放能力的扩展。
在一个实施例中,步骤S212包括:采用匹配的媒体工厂创建相应的播放器实例,通过创建的播放器实例播放媒体数据。具体地,电子设备可通过播放器实例打开媒体数据地址所对应的媒体数据并读取,解码媒体数据并播放,输出视频和/或音频。电子设备还可以通过播放器实例对播放的音频和视频进行同步。在安卓操作系统中,播放器实例是MediaPlayerBase类型的实例。
在一个实施例中,步骤S206包括:通过调用标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据。
具体地,扩展的媒体工厂包括检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据的计算机处理逻辑。扩展的媒体工厂具体可通过自身逻辑检测,也可以调用原生的函数检测。
进一步地,扩展的媒体工厂可以在检测到原生的媒体播放方式支持播放媒体数据时,为媒体数据匹配原生的媒体播放方式;扩展的媒体工厂可以在检测到原生的媒体播放方式不支持播放媒体数据时,为媒体数据匹配扩展的媒体播放方式。
本实施例中,通过调用扩展的媒体工厂,实现原生的媒体工厂是否支持 播放媒体数据地址所对应的媒体数据的检测,对操作系统改动小。
在一个实施例中,所述通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据,包括:通过调用所述标准媒体数据播放接口,遍历媒体工厂集合中的媒体工厂,对所述媒体数据进行支持能力评分;所述媒体工厂集合包括原生的媒体工厂和扩展的媒体工厂;根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
在一个实施例中,所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据之前,所述方法包括:通过遍历至的扩展的媒体工厂,检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据;当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分;当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分。
在一个实施例中,所述当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分,包括:当检测到支持播放时,将支持能力评分范围中的最小值,作为对应于扩展的媒体工厂的支持能力评分。所述当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分,包括:当检测到不支持播放时,将支持能力评分范围中的最大值,作为对应于扩展的媒体工厂的支持能力评分。
在一个实施例中,所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据之前,所述方法包括:通过遍历至的原生的媒体工厂,检测遍历至的原生的媒体工厂自身是否支持播放所述媒体数据地址所对应的媒体数据;当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于将遍历至的 原生的媒体工厂分配予所述媒体数据的支持能力评分;当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于不将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分。其中,用于将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分比如为1,用于不将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分比如为0。
在一个实施例中,所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据,包括:从遍历的各媒体工厂对应的支持能力评分中筛选出最大的支持能力评分;当最大的支持能力评分对应原生的媒体工厂时,确定所述原生的媒体播放方式支持播放所述媒体数据地址所对应的媒体数据;当最大的支持能力评分对应扩展的媒体工厂时,确定所述原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据。
图3为另一个实施例中媒体数据播放方法的流程示意图。参照图3,该方法具体包括如下步骤:
S302,获取媒体数据地址。
S304,以媒体数据地址为调用参数,调用标准媒体数据播放接口。
S306,通过调用标准媒体数据播放接口,遍历媒体工厂集合中的媒体工厂,对媒体数据进行支持能力评分;媒体工厂集合包括原生的媒体工厂和扩展的媒体工厂。
其中,媒体工厂集合是多于一个的媒体工厂构成的集合,包括至少一个原生的媒体工厂和至少一个扩展的媒体工厂。媒体工厂集合中的每个媒体工厂包括评分函数和播放器实例创建函数。评分函数用于对输入的媒体数据地址进行支持能力评分,输出相应的支持能力评分。播放器实例创建函数用于创建相应的播放器实例。
具体地,电子设备在调用标准媒体数据播放接口时,可通过原生媒体服务进程遍历媒体工厂集合,通过媒体工厂集合中的每个媒体工厂的评分函数对媒体数据地址所对应的媒体数据进行支持能力评分,得到相应的支持能力 评分。在遍历至原生的媒体工厂时,则对应输出表示原生的媒体工厂是否支持媒体数据地址所对应的媒体数据的支持能力评分。支持能力评分具有支持能力评分范围,该支持能力评分范围可以包括两种或多于两种的取值。
S308,通过遍历至的原生的媒体工厂,检测遍历至的原生的媒体工厂自身是否支持播放媒体数据地址所对应的媒体数据;检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于将遍历至的原生的媒体工厂分配予媒体数据的支持能力评分;当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于不将遍历至的原生的媒体工厂分配予媒体数据的支持能力评分。
S310,通过遍历至的扩展的媒体工厂,检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据;当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予媒体数据的支持能力评分;当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予媒体数据的支持能力评分。
具体地,若支持能力评分与支持能力正相关,则电子设备可在判定媒体数据地址所对应的媒体数据被原生的媒体工厂支持时,对应于遍历的扩展的媒体工厂,输出小于对应于原生的媒体工厂的支持能力评分的支持能力评分。
在一个实施例中,若支持能力评分与支持能力负相关,则电子设备可在判定媒体数据地址所对应的媒体数据被原生的媒体工厂支持时,对应于遍历的扩展的媒体工厂,输出大于对应于原生的媒体工厂的支持能力评分的支持能力评分。
若支持能力评分与支持能力正相关,则电子设备可在判定媒体数据地址所对应的媒体数据不被原生的媒体工厂支持时,对应于遍历的扩展的媒体工厂输出大于对应于原生的媒体工厂的支持能力评分的支持能力评分。
在一个实施例中,若支持能力评分与支持能力负相关,则电子设备可在判定媒体数据地址所对应的媒体数据不被原生的媒体工厂支持时,对应于遍历的扩展的媒体工厂输出小于对应于原生的媒体工厂的支持能力评分的支持 能力评分。
S312,根据媒体工厂集合中遍历的各媒体工厂对应的支持能力评分,为媒体数据匹配相应的媒体工厂。
具体地,若支持能力评分与支持能力正相关,则电子设备可取遍历媒体工厂集合得到的支持能力评分中的最大值,将该最大值对应的媒体工厂匹配予媒体数据地址所对应的媒体数据。若支持能力评分与支持能力负相关,则电子设备可取遍历媒体工厂集合得到的支持能力评分中的最小值,将该最小值对应的媒体工厂匹配予媒体数据地址所对应的媒体数据。
S314,根据匹配的媒体工厂播放媒体数据。
具体地,电子设备可根据匹配的媒体工厂创建相应的播放器实例,从而通过创建的播放器实例播放媒体数据。
本实施例中,通过扩展的媒体工厂对媒体数据的评分逻辑,就可以利用原生的确定匹配媒体工厂的逻辑,实现对操作系统媒体数据处理能力的扩展。减少了开发工作量,对操作系统原生逻辑介入比较少,可减少因修改操作系统原生逻辑带来新缺陷的情况。
在一个实施例中,步骤S310包括:当检测到支持播放时,将支持能力评分范围中的最小值,作为对应于扩展的媒体工厂的支持能力评分;当检测到不支持播放时,将支持能力评分范围中的最大值,作为对应于扩展的媒体工厂的支持能力评分。
具体地,假设支持能力评分范围中的最大值为1,最小值为0,则在遍历至扩展的媒体工厂时,若判定媒体数据地址所对应的媒体数据被原生的媒体工厂支持,则输出该扩展的媒体工厂对该媒体数据的支持能力评分为0。即使扩展的媒体工厂支持媒体数据地址所对应的媒体数据,也仍然输出支持能力评分范围中的最小值。在遍历至扩展的媒体工厂时,若判定媒体数据地址所对应的媒体数据不被原生的媒体工厂支持,则输出该扩展的媒体工厂对该媒体数据的支持能力评分为1。
若媒体数据地址所对应的媒体数据被原生的媒体工厂支持,则遍历得到 的支持能力评分中的最大值为一个原生的媒体工厂对媒体数据的支持能力评分。若媒体数据地址所对应的媒体数据不被原生的媒体工厂支持,则遍历得到的支持能力评分中的最大值为一个扩展的媒体工厂对媒体数据的支持能力评分。
本实施例中,通过修改扩展的媒体工厂对媒体数据的评分逻辑,就可以利用原生的确定匹配媒体工厂的逻辑实现对操作系统媒体数据处理能力的扩展,减少了开发工作量,对操作系统原生逻辑介入比较少,可减少因修改操作系统原生逻辑带来新缺陷的情况。
如图4所示,在一个实施例中,通过调用标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据的步骤具体包括如下步骤:
S402,通过调用标准媒体数据播放接口,向原生媒体服务进程传入媒体数据地址。
具体地,电子设备在调用标准媒体数据播放接口时,通过该标准媒体数据播放接口向原生媒体服务进程传入媒体数据地址。在安卓操作系统中,原生媒体服务进程为MediaServer进程,电子设备通过标准媒体数据播放接口MediaPlayer向MediaServer进程传入媒体数据地址。
S404,调用通过原生媒体服务进程的全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据。
具体地,原生的媒体工厂和扩展的媒体工厂,存储在原生媒体服务进程的全局地址空间中。电子设备可通过原生媒体服务进程,判断媒体数据地址所对应的媒体数据是否被原生的媒体工厂支持播放。其中,原生媒体服务进程的全局地址空间,是原生媒体服务进程所申请的地址空间、且该地址空间中的数据可被该原生媒体服务进程操作。
本实施例中,将扩展的媒体工厂添加到原生媒体服务进程的全局地址空间中,以实现对原生的媒体工厂所支持和所不支持媒体数据的播放,减少了 开发工作量,对操作系统原生逻辑介入比较少,可减少因修改操作系统原生逻辑带来新缺陷的情况。
在一个实施例中,步骤S402之前,该媒体数据播放方法还包括向原生媒体服务进程注入自定义代码以添加扩展的媒体工厂的步骤。参照图5,该向原生媒体服务进程注入自定义代码以添加扩展的媒体工厂的步骤具体包括如下步骤:
S502,向原生媒体服务进程注入自定义代码。
具体地,电子设备可通过自定义进程,向原生媒体服务进程注入自定义代码。在需要获取到管理权限以执行注入代码操作的操作系统,可以在获得相应的管理权限后执行步骤S502。
其中,自定义进程是非操作系统原生的进程。自定义代码是非操作系统原生的代码,用于扩展操作系统的媒体数据处理能力。在安卓操作系统中,可通过Ptrace()函数实现自定义代码的注入。初始进程是操作系统在启动完毕后启动的第一个用户级进程。在安卓操作系统中,初始进程为init进程。
在一个实施例中,自定义进程可在操作系统启动完毕后启动。在一个实施例中,自定义进程可跟随操作系统启动而启动。
在一个实施例中,当操作系统启动完毕并启动初始进程后,初始进程可根据启动配置文件中配置的自定义程序路径启动自定义进程。初始进程具体可在接收到启动配置文件中配置的操作系统启动完毕通知后,根据启动配置文件中配置的自定义程序路径启动自定义进程。
在安卓操作系统中,初始进程为init进程,启动配置文件为init.rc文件。在init.rc文件中,自定义进程可在启动配置文件中被配置为service;自定义进程被配置为disabled,表示不跟随操作系统启动而启动;自定义进程被配置为在接收到操作系统启动完毕通知后启动。
在一个实施例中,电子设备通过自定义进程获取原生媒体服务进程的内存分配函数的地址,并将原生媒体服务进程暂停,从而按照获取的地址调用原生媒体服务进程的内存分配函数分配内存空间,该内存空间属于原生媒体 服务进程的全局地址空间。电子设备通过自定义进程将自定义代码复制到分配的内存空间中,并修改原生媒体服务进程的执行位置到分配的内存空间中自定义代码的起始地址,进而恢复原生媒体服务进程。
S504,通过自定义代码,在原生媒体服务进程的全局地址空间中添加扩展的媒体工厂。
在一个实施例中,原生媒体服务进程在从暂停恢复后就会执行自定义代码。该自定义代码在执行时,先保存媒体服务进程的状态,然后加载指定的代码文件,执行该代码文件中的自定义逻辑,以在原生媒体服务进程的全局地址空间中添加扩展的媒体工厂,卸载代码文件,并恢复保存的媒体服务进程的状态。
S506,监测到原生媒体服务进程关闭,则待原生媒体服务进程重启后,返回步骤S502。
具体地,电子设备可通过自定义进程监听操作系统在原生媒体服务进程关闭时发出的进程关闭通知。响应于进程关闭通知,待原生媒体服务进程重启后,返回步骤S502。其中,原生媒体服务进程在关闭后,会由操作系统重启该原生媒体服务进程。自定义进程在接收到关闭通知后,等待操作系统将原生媒体服务进程重启后,返回步骤S502,继续通过自定义进程向原生媒体服务进程注入定义代码。
本实施例中,通过向原生媒体服务进程注入自定义代码就可以实现对操作系统媒体数据处理能力的扩展,不需要在操作系统源码基础上进行修改,在无法获取到操作系统源码的情况下也可以实现对操作系统媒体数据处理能力的扩展。而且,可自动发现原生媒体服务进程关闭的情况,并在原生媒体服务进程重启后重新注入自定义代码,保证了对操作系统媒体数据处理能力进行扩展的有效性。
如图6所示,在一个实施例中,步骤S206包括以下步骤:
S602,通过调用命名为标准媒体数据播放接口的自定义接口,调用易名的原生标准媒体数据播放接口。
S604,通过调用易名的原生标准媒体数据播放接口,检测原生媒体播放方式是否支持播放媒体数据地址所对应的媒体数据。
其中,自定义接口被命名为与标准媒体数据播放接口相同的名称,因此在调用标准媒体数据播放接口时会调用该自定义接口。易名的原生标准媒体数据播放接口,保留了标准媒体数据播放接口的内容,其名称换为与标准媒体数据播放接口原本的名称不同的名称。
进一步地,电子设备可通过自定义接口调用易名的标准媒体数据播放接口,从而调用各原生的媒体工厂的评分函数,得到对媒体数据地址所对应的媒体数据的支持能力评分。电子设备可根据该支持能力评分,判断原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据。
本实施例中,巧妙地利用了接口名称实现了对操作系统媒体数据处理能力的扩展,在原生的媒体工厂支持媒体数据时,处理逻辑发生的变化少,尽量减少对操作系统原生逻辑的介入,可减少因修改操作系统原生逻辑带来新缺陷的情况。
在一个实施例中,步骤S208包括:当检测到支持播放时,通过易名的原生标准媒体数据播放接口,为媒体数据匹配原生的媒体播放方式。步骤S210包括:当检测到不支持播放时,通过自定义接口,为媒体数据匹配扩展的媒体播放方式。
具体地,电子设备可在通过易名的原生标准媒体数据播放接口,检测到原生的媒体工厂支持播放媒体数据时,直接通过易名的原生标准媒体数据播放接口。电子设备在通过易名的原生标准媒体数据播放接口,检测到原生的媒体工厂不支持播放媒体数据时,再通过命名为标准媒体数据播放接口的自定义接口中定义的计算机处理逻辑,指定该自定义接口所定义的扩展的媒体播放方式。
本实施例中,通过易名的原生标准媒体数据播放接口,检测原生的媒体工厂是否支持媒体数据,在检测到支持时仍然通过易名的原生标准媒体数据播放接口,为媒体数据匹配原生的媒体播放方式。而在通过易名的原生标准 媒体数据播放接口判断出原生的媒体工厂不支持媒体数据时,才通过自定义接口,为媒体数据匹配扩展的媒体播放方式。尽量减少对操作系统原生逻辑的介入,可减少因修改操作系统原生逻辑带来新缺陷的情况。
在一个实施例中,检测原生的媒体播放方式是否支持播放媒体数据地址所对应的媒体数据包括:当满足以下至少一者时,判定原生的媒体播放方式不支持播放媒体数据地址所对应的媒体数据:
1),通过原生的媒体参数获取函数,获取到媒体数据地址所对应的媒体数据的通道数目为0。
具体地,在安卓操作系统中,可通过媒体播放框架StagefrightPlayer中的MediaExtractor函数(一种提取媒体信息的函数)获取媒体数据的通道数目。一般视频有两个通道,一个是音频通道,另一个是视频通道。如果MediaExtractor函数返回的媒体数据的通道数目为0,则说明电子设备不支持该媒体数据,也就是原生的媒体工厂不支持该媒体数据。
2),通过原生的媒体参数获取函数,获取媒体数据地址所对应的媒体数据的编码格式失败。
具体地,在安卓操作系统中,可通过MediaExtractor函数获取媒体数据的编码格式,具体可以是音频和/或视频的编码格式。如果MediaExtractor函数返回表示获取编码格式失败的信息,则说明电子设备不支持该媒体数据,也就是原生的媒体工厂不支持该媒体数据。
3),获取到媒体数据地址所对应的媒体数据的编码格式后,判定获取的编码格式不被原生解码器所支持。
具体地,在安卓操作系统中,可通过OMX接口(一种用于解码的接口)的函数来判断获取的编码格式是否被原生解码器所支持,若否,则判定获取的编码格式不被原生解码器所支持。终端具体可先判断条件1)和2)是否成立,在条件1)和2)不成立的情况下再判断条件3)是否成立。
进一步地,若上述条件1)、2)和3)均不成立,则可以判定媒体数据地址所对应的媒体数据被原生的媒体工厂所支持。
本实施例中,提供了多个可快速判断媒体数据是否被原生的媒体工厂所支持的判断条件,可以实现对媒体数据是否被原生的媒体工厂所支持的高效判断。
下面用一个具体应用场景来说明上述媒体数据播放方法的原理。本应用场景中以上述媒体数据播放方法应用于安卓操作系统来详细说明。参照图7,自定义进程向MediaServer进程注入自定义代码,并通过自定义代码在MediaServer进程的全局地址空间中添加扩展的媒体工厂。自定义进程若监听到操作系统在原生媒体服务进程关闭时发出的进程关闭通知,响应于进程关闭通知,待原生媒体服务进程重启后,继续向MediaServer进程注入自定义代码。
进一步地,参照图8,应用程序产生播放媒体数据的需求时,调用安卓操作系统的SDK所提供的MediaPlayer接口,通过该MediaPlayer接口向MediaServer进程中的MediaPlayerService传入媒体数据地址。MediaServer进程中的MediaPlayerService调用媒体工厂接口MediaPlayerFactory,由MediaPlayerFactory遍历媒体工厂集合分别对媒体数据地址所对应的媒体数据进行支持能力评分。在遍历至原生的媒体工厂时,若该原生的媒体工厂支持播放该媒体数据,则对应输出大于0且小于等于1的支持能力评分。若该原生的媒体工厂不支持播放该媒体数据,则输出大于等于0且小于1的支持能力评分。在遍历至扩展的媒体工厂MyPlayerFactory时,若判定原生的媒体工厂支持播放媒体数据,则输出值为0的支持能力评分;若判定原生的媒体工厂不支持播放媒体数据,则输出值为1的支持能力评分。MediaPlayerFactory最终选择最大的支持能力评分对应的媒体工厂创建播放器实例MediaplayerBase,由MediaServer进程通过该播放器实例解码媒体数据并通过SDK输出至应用程序,由应用程序输出。
图9为一个实施例中电子设备900的结构框图,电子设备900的内部结构可对应与如图2所示的结构,下述每个模块可全部或部分通过软件、硬件 或其组合来实现。。参照图9,该电子设备900包括:地址获取模块901、标准媒体数据播放接口调用模块902、媒体播放方式匹配模块903和播放模块904。
地址获取模块901,用于获取媒体数据地址。
标准媒体数据播放接口调用模块902,用于以媒体数据地址为调用参数,调用标准媒体数据播放接口。
媒体播放方式匹配模块903,用于通过调用标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放媒体数据地址所对应的媒体数据;当检测到支持播放时,为媒体数据匹配原生的媒体播放方式;当检测到不支持播放时,为媒体数据匹配扩展的媒体播放方式。
播放模块904,用于根据匹配的媒体播放方式播放媒体数据。
上述电子设备900,对于原生的媒体播放方式支持播放或者不支持播放媒体数据地址所对应的媒体数据的情况,都可以实现播放,实现了播放能力的扩展,提高了兼容性。而且在播放时优先采用原生的媒体播放方式,在原生的媒体播放方式不支持播放时,才采用扩展的媒体播放方式,可尽可能保证播放的稳定性。再者,统一通过调用标准媒体数据播放接口,就可以实现对原生的媒体播放方式支持播放以及不支持播放的媒体数据的播放,具有播放媒体数据需求的应用程序不需要做额外改进,提高了通用性。
在一个实施例中,原生的媒体播放方式采用原生的媒体工厂;扩展的媒体播放方式采用扩展的媒体工厂。
本实施例中,采用媒体工厂,利用操作中系统原生的播放逻辑,可以通过小的改动实现操作系统播放能力的扩展。
媒体播放方式匹配模块903还用于通过调用标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据。
本实施例中,通过调用扩展的媒体工厂,实现原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据的检测,对操作系统改动小。
在一个实施例中,所述媒体播放方式匹配模块903还用于通过调用所述标准媒体数据播放接口,遍历媒体工厂集合中的媒体工厂,对所述媒体数据进行支持能力评分;所述媒体工厂集合包括原生的媒体工厂和扩展的媒体工厂;根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
在一个实施例中,所述媒体播放方式匹配模块903还用于通过遍历至的扩展的媒体工厂,检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据;当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分;当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分。
在一个实施例中,所述媒体播放方式匹配模块903还用于当检测到支持播放时,将支持能力评分范围中的最小值,作为对应于扩展的媒体工厂的支持能力评分;当检测到不支持播放时,将支持能力评分范围中的最大值,作为对应于扩展的媒体工厂的支持能力评分。
在一个实施例中,所述媒体播放方式匹配模块903还用于通过遍历至的原生的媒体工厂,检测遍历至的原生的媒体工厂自身是否支持播放所述媒体数据地址所对应的媒体数据;当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分;当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于不将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分。
在一个实施例中,所述媒体播放方式匹配模块903还用于从遍历的各媒体工厂对应的支持能力评分中筛选出最大的支持能力评分;当最大的支持能力评分对应原生的媒体工厂时,确定所述原生的媒体播放方式支持播放所述媒体数据地址所对应的媒体数据;当最大的支持能力评分对应扩展的媒体工厂时,确定所述原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据。
在一个实施例中,媒体播放方式匹配模块903还用于通过调用标准媒体数据播放接口,向原生媒体服务进程传入媒体数据地址;通过原生媒体服务进程,调用在其全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放媒体数据地址所对应的媒体数据。
本实施例中,将扩展的媒体工厂添加到原生媒体服务进程的全局地址空间中,以实现对原生的媒体工厂所支持和所不支持媒体数据的播放,减少了开发工作量,对操作系统原生逻辑介入比较少,可减少因修改操作系统原生逻辑带来新缺陷的情况。
图10为另一个实施例中电子设备900的结构框图。参照图10,该电子设备900还包括:注入模块905,用于向原生媒体服务进程注入自定义代码;通过自定义代码,在原生媒体服务进程的全局地址空间中添加扩展的媒体工厂;监测到原生媒体服务进程关闭,则待原生媒体服务进程重启后,继续向原生媒体服务进程注入自定义代码。
本实施例中,通过向原生媒体服务进程注入自定义代码就可以实现对操作系统媒体数据处理能力的扩展,不需要在操作系统源码基础上进行修改,在无法获取到操作系统源码的情况下也可以实现对操作系统媒体数据处理能力的扩展。而且,可自动发现原生媒体服务进程关闭的情况,并在原生媒体服务进程重启后重新注入自定义代码,保证了对操作系统媒体数据处理能力进行扩展的有效性。
在一个实施例中,媒体播放方式匹配模块903还用于通过调用命名为标准媒体数据播放接口的自定义接口,调用易名的原生标准媒体数据播放接口;通过调用易名的原生标准媒体数据播放接口,检测原生媒体播放方式是否支持播放媒体数据地址所对应的媒体数据。
本实施例中,巧妙地利用了接口名称实现了对操作系统媒体数据处理能力的扩展,在原生的媒体工厂支持媒体数据时,处理逻辑发生的变化少,尽量减少对操作系统原生逻辑的介入,可减少因修改操作系统原生逻辑带来新缺陷的情况。
在一个实施例中,媒体播放方式匹配模块903还用于当检测到支持播放时,通过易名的原生标准媒体数据播放接口,为媒体数据匹配原生的媒体播放方式;当检测到不支持播放时,为媒体数据匹配扩展的媒体播放方式包括:当检测到不支持播放时,通过自定义接口,为媒体数据匹配扩展的媒体播放方式。
本实施例中,通过易名的原生标准媒体数据播放接口,检测原生的媒体工厂是否支持媒体数据,在检测到支持时仍然通过易名的原生标准媒体数据播放接口,为媒体数据匹配原生的媒体播放方式。而在通过易名的原生标准媒体数据播放接口判断出原生的媒体工厂不支持媒体数据时,才通过自定义接口,为媒体数据匹配扩展的媒体播放方式。尽量减少对操作系统原生逻辑的介入,可减少因修改操作系统原生逻辑带来新缺陷的情况。
在一个实施例中,媒体播放方式匹配模块903还用于当满足以下至少一者时,判定原生的媒体播放方式不支持播放媒体数据地址所对应的媒体数据;
1),通过原生的媒体参数获取函数,获取到媒体数据地址所对应的媒体数据的通道数目为0。
2),通过原生的媒体参数获取函数,获取媒体数据地址所对应的媒体数据的编码格式失败。
3),获取到媒体数据地址所对应的媒体数据的编码格式后,判定获取的编码格式不被原生解码器所支持。
本实施例中,提供了多个可快速判断媒体数据是否被原生的媒体工厂所支持的判断条件,可以实现对媒体数据是否被原生的媒体工厂所支持的高效判断。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,该计算机可读指令可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记 忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (36)

  1. 一种媒体数据播放方法,执行于电子设备,所述方法包括:
    获取媒体数据地址;
    以所述媒体数据地址为调用参数,调用标准媒体数据播放接口;
    通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式;
    当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式;及
    根据匹配的所述媒体播放方式播放所述媒体数据。
  2. 根据权利要求1所述的方法,其特征在于,所述原生的媒体播放方式采用原生的媒体工厂;所述扩展的媒体播放方式采用扩展的媒体工厂;
    所述通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据包括:
    通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据。
  3. 根据权利要求2所述的方法,其特征在于,所述通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据包括:
    通过调用所述标准媒体数据播放接口,遍历媒体工厂集合中的媒体工厂,对所述媒体数据进行支持能力评分;所述媒体工厂集合包括原生的媒体工厂和扩展的媒体工厂;及
    根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
  4. 根据权利要求3所述的方法,其特征在于,所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据之前,所述方法包括:
    通过遍历至的扩展的媒体工厂,检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分;或
    当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分。
  5. 根据权利要求4所述的方法,其特征在于,所述当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分包括:
    当检测到支持播放时,将支持能力评分范围中的最小值,作为对应于扩展的媒体工厂的支持能力评分;
    所述当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分,包括:
    当检测到不支持播放时,将支持能力评分范围中的最大值,作为对应于扩展的媒体工厂的支持能力评分。
  6. 根据权利要求3所述的方法,其特征在于,所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据之前,所述方法包括:
    通过遍历至的原生的媒体工厂,检测遍历至的原生的媒体工厂自身是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分;或
    当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于不将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分。
  7. 根据权利要求3所述的方法,其特征在于,所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据包括:
    从遍历的各媒体工厂对应的支持能力评分中筛选出最大的支持能力评分;
    当最大的支持能力评分对应原生的媒体工厂时,确定所述原生的媒体播放方式支持播放所述媒体数据地址所对应的媒体数据;及
    当最大的支持能力评分对应扩展的媒体工厂时,确定所述原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据。
  8. 根据权利要求2所述的方法,其特征在于,所述通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据包括:
    通过调用所述标准媒体数据播放接口,向原生媒体服务进程传入所述媒体数据地址;及
    调用所述原生媒体服务进程的全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据。
  9. 根据权利要求8所述的方法,其特征在于,所述调用所述原生媒体服务进程的全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据之前,所述方法包括:
    向原生媒体服务进程注入自定义代码;
    通过所述自定义代码,在所述原生媒体服务进程的全局地址空间中添加扩展的媒体工厂;及
    监测到所述原生媒体服务进程关闭,则待所述原生媒体服务进程重启后,返回所述向原生媒体服务进程注入自定义代码的步骤。
  10. 根据权利要求1所述的方法,其特征在于,所述通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据包括:
    通过调用命名为标准媒体数据播放接口的自定义接口,调用易名的原生标准媒体数据播放接口;及
    通过调用所述易名的原生标准媒体数据播放接口,检测原生媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
  11. 根据权利要求10所述的方法,其特征在于,所述当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式包括:
    当检测到支持播放时,通过所述易名的原生标准媒体数据播放接口,为所述媒体数据匹配原生的媒体播放方式;
    所述当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式包括:
    当检测到不支持播放时,通过所述自定义接口,为所述媒体数据匹配扩展的媒体播放方式。
  12. 根据权利要求1所述的方法,其特征在于,所述检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据包括:
    当满足以下至少一者时,判定原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据;
    通过原生的媒体参数获取函数,获取到所述媒体数据地址所对应的媒体数据的通道数目为0;
    通过原生的媒体参数获取函数,获取所述媒体数据地址所对应的媒体数据的编码格式失败;及
    获取到所述媒体数据地址所对应的媒体数据的编码格式后,判定获取的编码格式不被原生解码器所支持。
  13. 一种电子设备,包括存储器和处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:
    获取媒体数据地址;
    以所述媒体数据地址为调用参数,调用标准媒体数据播放接口;
    通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式;
    当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式;及
    根据匹配的所述媒体播放方式播放所述媒体数据。
  14. 根据权利要求13所述的电子设备,其特征在于,所述原生的媒体播放方式采用原生的媒体工厂;所述扩展的媒体播放方式采用扩展的媒体工厂;
    所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通 过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,还执行以下步骤:
    通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据。
  15. 根据权利要求14所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    通过调用所述标准媒体数据播放接口,遍历媒体工厂集合中的媒体工厂,对所述媒体数据进行支持能力评分;所述媒体工厂集合包括原生的媒体工厂和扩展的媒体工厂;及
    根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
  16. 根据权利要求15所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤之前,执行以下步骤:
    通过遍历至的扩展的媒体工厂,检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分;或
    当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分。
  17. 根据权利要求14所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分的步骤时,执行以下步骤:
    当检测到支持播放时,将支持能力评分范围中的最小值,作为对应于扩展 的媒体工厂的支持能力评分;
    使得所述处理器在执行所述当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分的步骤时,执行以下步骤:
    当检测到不支持播放时,将支持能力评分范围中的最大值,作为对应于扩展的媒体工厂的支持能力评分。
  18. 根据权利要求14所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤之前,执行以下步骤:
    通过遍历至的原生的媒体工厂,检测遍历至的原生的媒体工厂自身是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分;或
    当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于不将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分。
  19. 根据权利要求15所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    从遍历的各媒体工厂对应的支持能力评分中筛选出最大的支持能力评分;当最大的支持能力评分对应原生的媒体工厂时,确定所述原生的媒体播放方式支持播放所述媒体数据地址所对应的媒体数据;及
    当最大的支持能力评分对应扩展的媒体工厂时,确定所述原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据。
  20. 根据权利要求14所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒 体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    通过调用所述标准媒体数据播放接口,向原生媒体服务进程传入所述媒体数据地址;及
    调用所述原生媒体服务进程的全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据。
  21. 根据权利要求20所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述调用所述原生媒体服务进程的全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据的步骤之前,执行以下步骤:
    向原生媒体服务进程注入自定义代码;通过所述自定义代码,在所述原生媒体服务进程的全局地址空间中添加扩展的媒体工厂;及
    监测到所述原生媒体服务进程关闭,则待所述原生媒体服务进程重启后,返回所述向原生媒体服务进程注入自定义代码的步骤。
  22. 根据权利要求13所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    通过调用命名为标准媒体数据播放接口的自定义接口,调用易名的原生标准媒体数据播放接口;及
    通过调用所述易名的原生标准媒体数据播放接口,检测原生媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
  23. 根据权利要求22所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式的步骤时,执行以下步骤:
    当检测到支持播放时,通过所述易名的原生标准媒体数据播放接口,为所述媒体数据匹配原生的媒体播放方式;
    使得所述处理器在执行所述当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式的步骤时,执行以下步骤:
    当检测到不支持播放时,通过所述自定义接口,为所述媒体数据匹配扩展的媒体播放方式。
  24. 根据权利要求13所述的电子设备,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    当满足以下至少一者时,判定原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据;
    通过原生的媒体参数获取函数,获取到所述媒体数据地址所对应的媒体数据的通道数目为0;
    通过原生的媒体参数获取函数,获取所述媒体数据地址所对应的媒体数据的编码格式失败;及
    获取到所述媒体数据地址所对应的媒体数据的编码格式后,判定获取的编码格式不被原生解码器所支持。
  25. 一种非易失性的计算机可读存储介质,存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取媒体数据地址;
    以所述媒体数据地址为调用参数,调用标准媒体数据播放接口;
    通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式;
    当检测到不支持播放时,为所述媒体数据匹配扩展的媒体播放方式;及
    根据匹配的所述媒体播放方式播放所述媒体数据。
  26. 根据权利要求25所述的计算机可读存储介质,其特征在于,所述原生的媒体播放方式采用原生的媒体工厂;所述扩展的媒体播放方式采用扩展的媒体工厂;
    所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通 过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,还执行以下步骤:
    通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据。
  27. 根据权利要求26所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    通过调用所述标准媒体数据播放接口,遍历媒体工厂集合中的媒体工厂,对所述媒体数据进行支持能力评分;所述媒体工厂集合包括原生的媒体工厂和扩展的媒体工厂;及
    根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
  28. 根据权利要求27所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤之前,执行以下步骤:
    通过遍历至的扩展的媒体工厂,检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分;或
    当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分。
  29. 根据权利要求26所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述当检测到支持播放时,获得与扩展的媒体工厂对应、且用于将原生的媒体工厂分配予所述媒体数据的支持能力评分的步骤时,执行以下步骤:
    当检测到支持播放时,将支持能力评分范围中的最小值,作为对应于扩展 的媒体工厂的支持能力评分;
    使得所述处理器在执行所述当检测到不支持播放时,获得与扩展的媒体工厂对应、且用于将扩展的媒体工厂分配予所述媒体数据的支持能力评分的步骤时,执行以下步骤:
    当检测到不支持播放时,将支持能力评分范围中的最大值,作为对应于扩展的媒体工厂的支持能力评分。
  30. 根据权利要求26所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤之前,执行以下步骤:
    通过遍历至的原生的媒体工厂,检测遍历至的原生的媒体工厂自身是否支持播放所述媒体数据地址所对应的媒体数据;
    当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分;或
    当检测到支持播放时,获得与遍历至的原生的媒体工厂对应、且用于不将遍历至的原生的媒体工厂分配予所述媒体数据的支持能力评分。
  31. 根据权利要求27所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述根据遍历的各媒体工厂所对应的支持能力评分,确定所述原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    从遍历的各媒体工厂对应的支持能力评分中筛选出最大的支持能力评分;当最大的支持能力评分对应原生的媒体工厂时,确定所述原生的媒体播放方式支持播放所述媒体数据地址所对应的媒体数据;及
    当最大的支持能力评分对应扩展的媒体工厂时,确定所述原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据。
  32. 根据权利要求26所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通过调用所述标准媒体数据播放接口,调用扩展的媒体工厂,以检测原生的媒体工厂是否支持 播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    通过调用所述标准媒体数据播放接口,向原生媒体服务进程传入所述媒体数据地址;及
    调用所述原生媒体服务进程的全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据。
  33. 根据权利要求32所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述调用所述原生媒体服务进程的全局地址空间中所添加的扩展的媒体工厂,以检测原生的媒体工厂是否支持播放所述媒体数据地址所对应的媒体数据的步骤之前,执行以下步骤:
    向原生媒体服务进程注入自定义代码;通过所述自定义代码,在所述原生媒体服务进程的全局地址空间中添加扩展的媒体工厂;及
    监测到所述原生媒体服务进程关闭,则待所述原生媒体服务进程重启后,返回所述向原生媒体服务进程注入自定义代码的步骤。
  34. 根据权利要求25所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述通过调用所述标准媒体数据播放接口,触发检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    通过调用命名为标准媒体数据播放接口的自定义接口,调用易名的原生标准媒体数据播放接口;及
    通过调用所述易名的原生标准媒体数据播放接口,检测原生媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据。
  35. 根据权利要求34所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述当检测到支持播放时,为所述媒体数据匹配原生的媒体播放方式的步骤时,执行以下步骤:
    当检测到支持播放时,通过所述易名的原生标准媒体数据播放接口,为所述媒体数据匹配原生的媒体播放方式;
    使得所述处理器在执行所述当检测到不支持播放时,为所述媒体数据匹配 扩展的媒体播放方式的步骤时,执行以下步骤:
    当检测到不支持播放时,通过所述自定义接口,为所述媒体数据匹配扩展的媒体播放方式。
  36. 根据权利要求25所述的计算机可读存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,使得所述处理器在执行所述检测原生的媒体播放方式是否支持播放所述媒体数据地址所对应的媒体数据的步骤时,执行以下步骤:
    当满足以下至少一者时,判定原生的媒体播放方式不支持播放所述媒体数据地址所对应的媒体数据;
    通过原生的媒体参数获取函数,获取到所述媒体数据地址所对应的媒体数据的通道数目为0;
    通过原生的媒体参数获取函数,获取所述媒体数据地址所对应的媒体数据的编码格式失败;及
    获取到所述媒体数据地址所对应的媒体数据的编码格式后,判定获取的编码格式不被原生解码器所支持。
PCT/CN2017/115568 2017-01-04 2017-12-12 媒体数据播放方法、电子设备和计算机可读存储介质 WO2018126852A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710005498.4 2017-01-04
CN201710005498.4A CN106791546B (zh) 2017-01-04 2017-01-04 媒体数据播放方法和装置

Publications (1)

Publication Number Publication Date
WO2018126852A1 true WO2018126852A1 (zh) 2018-07-12

Family

ID=58950047

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/115568 WO2018126852A1 (zh) 2017-01-04 2017-12-12 媒体数据播放方法、电子设备和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN106791546B (zh)
WO (1) WO2018126852A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110858918A (zh) * 2018-08-22 2020-03-03 深圳Tcl数字技术有限公司 Mds数据获取方法、数字电视及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106791546B (zh) * 2017-01-04 2019-08-23 腾讯科技(深圳)有限公司 媒体数据播放方法和装置
US10735806B2 (en) * 2018-09-07 2020-08-04 Disney Enterprises, Inc. Configuration for detecting hardware-based or software-based decoding of video content
CN109640192B (zh) * 2018-12-26 2021-07-20 深圳创维-Rgb电子有限公司 视频播放器优化方法、装置、播放终端及存储介质
CN116560879B (zh) * 2023-07-10 2024-04-09 深圳市慧为智能科技股份有限公司 人脸识别服务的调用方法、装置、终端设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005327349A (ja) * 2004-05-12 2005-11-24 Funai Electric Co Ltd ディスク再生装置
CN1749953A (zh) * 2005-06-30 2006-03-22 无敌科技(西安)有限公司 格式支持能力可无限扩充式多媒体播放系统
CN101304433A (zh) * 2008-04-17 2008-11-12 北京大学 向播放器提供数据的方法、装置及多媒体播放系统
CN103366780A (zh) * 2012-03-31 2013-10-23 盛乐信息技术(上海)有限公司 多媒体播放器引擎系统及其使用方法和多媒体播放器
CN104104972A (zh) * 2013-04-10 2014-10-15 深圳市快播科技有限公司 多媒体播放方法、装置及系统
CN106791546A (zh) * 2017-01-04 2017-05-31 腾讯科技(深圳)有限公司 媒体数据播放方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716242A (zh) * 2004-06-28 2006-01-04 千乡万才科技(中国)有限公司 计算机多媒体文件播放方法及系统
CN105407407A (zh) * 2014-06-26 2016-03-16 广州市动景计算机科技有限公司 视频的播放方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005327349A (ja) * 2004-05-12 2005-11-24 Funai Electric Co Ltd ディスク再生装置
CN1749953A (zh) * 2005-06-30 2006-03-22 无敌科技(西安)有限公司 格式支持能力可无限扩充式多媒体播放系统
CN101304433A (zh) * 2008-04-17 2008-11-12 北京大学 向播放器提供数据的方法、装置及多媒体播放系统
CN103366780A (zh) * 2012-03-31 2013-10-23 盛乐信息技术(上海)有限公司 多媒体播放器引擎系统及其使用方法和多媒体播放器
CN104104972A (zh) * 2013-04-10 2014-10-15 深圳市快播科技有限公司 多媒体播放方法、装置及系统
CN106791546A (zh) * 2017-01-04 2017-05-31 腾讯科技(深圳)有限公司 媒体数据播放方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110858918A (zh) * 2018-08-22 2020-03-03 深圳Tcl数字技术有限公司 Mds数据获取方法、数字电视及存储介质

Also Published As

Publication number Publication date
CN106791546B (zh) 2019-08-23
CN106791546A (zh) 2017-05-31

Similar Documents

Publication Publication Date Title
WO2018126852A1 (zh) 媒体数据播放方法、电子设备和计算机可读存储介质
TWI703497B (zh) 應用程式的處理方法和裝置
US20240137393A1 (en) Methods for discovery of media capabilities of 5g edge
KR101034080B1 (ko) 균일한 비디오 디코딩 및 디스플레이
WO2017054462A1 (zh) 视频解码的方法、服务器和移动终端
CN107832099B (zh) 一种客户端版本兼容的方法、装置及存储介质
CN111954051B (zh) 传输视频音频数据的方法、系统、云端服务器和存储介质
JP7346606B2 (ja) 画面共有処理方法、装置、機器及び記憶媒体
US20150331882A1 (en) Redundant file deletion method, apparatus and storage medium
JP2018523193A (ja) サードパーティアプリケーションに対するデジタルアシスタント拡張性
WO2019047878A1 (zh) 语音操控终端的方法、终端、服务器和存储介质
WO2017193885A1 (zh) 一种应用启动方法及装置
WO2019071680A1 (zh) 一种插件加载的方法和装置
US11743512B2 (en) Methods for NBMP deployments through 5G FLUS control
WO2015035774A1 (zh) 一种基于用户空间文件系统的移动终端定制化方法及系统
WO2019071678A1 (zh) 一种直播的方法和装置
WO2019015491A1 (zh) 应用程序的分身方法、装置、设备和介质
CN112749022A (zh) 相机资源访问方法、操作系统、终端和虚拟相机
CN111338829B (zh) 远程过程调用服务的调用方法及装置
CN111694585A (zh) 替换系统分区文件的方法、系统、终端和存储介质
CN108255434B (zh) 标签管理方法、管理装置及计算机可读存储介质
US20170289204A1 (en) Video playing method and device
CN113542208A (zh) 用于媒体处理和流式传输的方法、装置和介质
CN111831834A (zh) 基于网络的媒体处理(nbmp)中处理媒体内容的方法和装置
KR101909260B1 (ko) 어플리케이션의 미디어 칩셋 연동 방법, 그리고 이를 구현한 사용자 단말

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17890155

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17890155

Country of ref document: EP

Kind code of ref document: A1