WO2013107176A1 - 一种多媒体应用的并发管理方法和装置 - Google Patents

一种多媒体应用的并发管理方法和装置 Download PDF

Info

Publication number
WO2013107176A1
WO2013107176A1 PCT/CN2012/080174 CN2012080174W WO2013107176A1 WO 2013107176 A1 WO2013107176 A1 WO 2013107176A1 CN 2012080174 W CN2012080174 W CN 2012080174W WO 2013107176 A1 WO2013107176 A1 WO 2013107176A1
Authority
WO
WIPO (PCT)
Prior art keywords
multimedia
concurrency
application
concurrent
java
Prior art date
Application number
PCT/CN2012/080174
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 WO2013107176A1 publication Critical patent/WO2013107176A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt

Definitions

  • the present invention relates to multimedia technologies, and in particular, to a method and apparatus for concurrent management of multimedia applications. Background technique
  • multimedia applications are becoming more and more extensive, especially the emergence of smart terminals, which meets the needs of people who want to enjoy entertainment functions such as audio and video and games anytime and anywhere.
  • an alarm clock is played during the music playing process, and the sound is output due to the sound of the music and the alarm bell, so it should be taken.
  • the strategy controls the output of these two sounds, which can pause the music playing when the alarm goes off, or lower the sound of the music when the alarm sounds, to highlight the sound of the alarm. Otherwise, the output sound may be compared. Cluttered, reducing the user experience.
  • both methods are used, but only one fixed form can be used on one terminal: either pause the playing of the music when the alarm sounds, or reduce the sound of the music when the alarm sounds; Users can't choose a concurrency method according to their own preferences, and the user experience is not good.
  • the mechanism used is called the broadcast mechanism, that is, when a multimedia application is started, such as starting a video, the application, here a camera application, sends a broadcast, carrying the specified data in the broadcast. While the other multimedia application receives the broadcast, it determines, according to the received data in the broadcast, what operation it performs, such as suspending itself or lowering its own playing volume. But one of the more serious drawbacks of this mechanism is that All multimedia applications must agree on the meaning of the broadcasted data in advance so that the corresponding operation can be performed when a specified data is received.
  • android is an open platform that allows users to install software of their own interest. For example, in addition to using the audio player that comes with the android terminal, you can also install a music player provided by a third-party company. It is obviously impossible to pre-agreed the meaning of the specified data with various multimedia applications provided by different companies. Therefore, android support is not good for the concurrency control between the application that comes with the terminal and the multimedia application provided by the third party and the third-party application provided by two different companies. For example, testing on several brands of android smart terminals found that when shooting, third-party music player software is still allowed to play music, which is obviously very unreasonable. Summary of the invention
  • the main purpose of the present invention is to provide a concurrent management method and apparatus for a multimedia application, which can provide a user-configurable multimedia application concurrent management function in a more flexible manner, and implement the installed third-party multimedia application and the terminal. Concurrent management between multimedia applications with third-party multimedia applications.
  • the invention provides a method for concurrent management of multimedia applications, the method comprising:
  • the Java framework layer stores parameters of the concurrency strategy set in the Java application layer
  • the j av a framework layer When there is a multimedia application launch request, the j av a framework layer generates and saves a multimedia object for completing the actual multimedia function, and when determining that the multimedia application is currently concurrent, whether the query stores the concurrency policy parameter corresponding to the multimedia object, When there is a corresponding concurrency policy parameter, other multimedia objects except the multimedia object are managed according to the concurrency policy parameter; the Java framework layer starts an application of the newly saved multimedia object.
  • the method further includes: the Java framework layer is stored before the parameter of the concurrency policy set by the Java application layer, and the concurrency policy is set in the Java application layer through the concurrent policy setting interface, and the Java application layer is configured according to the concurrency policy set in the interface.
  • Send concurrency policy parameters in the background Give the Java 4 truss layer.
  • the Java framework layer generates and saves the multimedia object as: the JNI module of the Java framework layer receives the request for creating the multimedia object sent by the Java application layer, and generates the relevant multimedia interface by calling the relevant interface of the local implementation layer. a multimedia object, and saving the multimedia object into a data structure of the Java framework layer.
  • the managing the multimedia objects other than the multimedia object according to the concurrent policy parameter includes: suspending, according to the concurrent policy parameter, an application of the multimedia object other than the multimedia object, or reducing The sound of other multimedia objects other than the multimedia object.
  • the method further includes: after receiving the command to stop the multimedia application, the Java framework layer stops the application of the corresponding multimedia object, and queries whether to store according to the type of the multimedia object and the media type played by the multimedia object. There is a corresponding concurrency policy parameter. When there is a corresponding concurrency policy parameter, the management of other multimedia objects according to the concurrency policy parameter is cancelled, and the stopped multimedia object is deleted from the data structure.
  • the invention provides a concurrency management device for a multimedia application, where the device is located at a Java framework layer, and includes: a JNI module and a multimedia concurrency management module;
  • the JNI module is configured to generate and save a multimedia object for completing the actual multimedia function when the multimedia application initiates the request, and send the first query concurrent policy request to the multimedia concurrent management module; and start the new according to the notification of the multimedia concurrent management module The application of the saved multimedia object;
  • the multimedia concurrency management module is configured to store parameters of the concurrency policy set in the Java application layer; after receiving the first query concurrency policy request of the JNI module, when determining that the current multimedia application is concurrent, the query whether to store the newly saved multimedia object
  • the corresponding concurrency policy parameter when there is a corresponding concurrency policy parameter, manages other multimedia objects except the multimedia object according to the concurrency policy parameter; and notifies the JNI module to start an application of the newly saved multimedia object.
  • the JNI module is configured to receive a request for creating a multimedia object sent by a Java application layer, generate a multimedia object for completing an actual multimedia function by calling a related interface of the local implementation layer, and save the multimedia object to the multimedia. Concurrent management module within the data structure.
  • the JNI module is further configured to: after receiving the command to stop the multimedia application, stop the application of the corresponding multimedia object, and send the type of the multimedia object and the multimedia object to be played to the multimedia concurrent management module.
  • the second query of the media type concurrency policy request is further configured to: after receiving the command to stop the multimedia application, stop the application of the corresponding multimedia object, and send the type of the multimedia object and the multimedia object to be played to the multimedia concurrent management module.
  • the multimedia concurrency management module is further configured to: after receiving the second query concurrency policy request, query whether a corresponding concurrency policy is stored according to the type of the multimedia object that has been stopped and the media type played by the multimedia object.
  • the parameter when there is a corresponding concurrent policy parameter, cancels management of other multimedia objects according to the concurrent policy parameter, and deletes the stopped multimedia object from the data structure.
  • the device is implemented on the android platform.
  • the invention provides a concurrency management method and device for a multimedia application, and a Java framework layer (Java Framework) stores parameters of a concurrency strategy set in a Java application layer; when there is a multimedia application startup request, the Java framework layer generates and saves the The multimedia object that completes the actual multimedia function, when determining that the current multimedia application is concurrent, query whether the concurrent policy parameter corresponding to the multimedia object is stored, and when there is a corresponding concurrent policy parameter, according to the concurrent policy parameter to other multimedia
  • the object is managed; the j ava framework layer starts the newly saved multimedia object; thus, the user-configurable multimedia application concurrent management function can be provided in a more flexible manner, and the installed third-party multimedia application and the multimedia application provided by the terminal are implemented.
  • FIG. 1 is a schematic flowchart of a method for concurrently managing a multimedia application according to the present invention
  • FIG. 2 is a schematic structural diagram of a concurrent management device for implementing a multimedia application according to the present invention
  • FIG. 3 is a schematic structural diagram of a multimedia application of an android platform in the prior art
  • FIG. 4 is a schematic structural diagram of a multimedia application of an android platform implemented by the present invention. detailed description
  • the Java framework layer stores parameters of the concurrency strategy set in the Java application layer; when there is a multimedia application startup request, the Java framework layer generates and saves the multimedia object for completing the actual multimedia function, and determines that the current
  • the query queries whether the concurrent policy parameter corresponding to the multimedia object is stored, and when there is a corresponding concurrent policy parameter, the other multimedia objects are managed according to the concurrent policy parameter; the Java framework layer starts the newly saved multimedia object.
  • the present invention implements a concurrency management method for a multimedia application. As shown in FIG. 1, the method includes the following steps:
  • Step 101 The Java framework layer stores parameters of the concurrency policy set in the Java application layer.
  • the method further includes: setting a concurrency policy in the Java application layer (Java Application) through a concurrent policy setting interface, such as: whether to allow playback when an alarm clock Music, whether to allow multiple different music players to play music at the same time, whether to turn off all sounds when shooting, etc.
  • a concurrency policy in the Java application layer Java Application
  • a concurrent policy setting interface such as: whether to allow playback when an alarm clock Music, whether to allow multiple different music players to play music at the same time, whether to turn off all sounds when shooting, etc.
  • the terminal manufacturer can set various flexible and various setting items
  • the Java application layer according to the concurrency strategy set in the interface
  • the background sends concurrency policy parameters to the Java framework layer.
  • Step 102 When there is a multimedia application startup request, the Java framework layer generates and saves a multimedia object for completing an actual multimedia function; Specifically, the user initiates a multimedia application launch request to the Java application layer, such as music play, camera, etc.; the Java application layer passes the localization method to the JNI module of the Java framework layer, such as Android. Media. Media Player (android.media.MediaPlayer) Requesting to create a multimedia object, in this embodiment, a music player object; the JNI module receives the request, generates a multimedia object for completing an actual multimedia function by calling a related interface of a local implementation layer ( Native Libs), and saves The multimedia object is within a data structure of a Java framework layer;
  • the related interface of the local implementation layer may be a media player preparation (MediaPlayer::prepare) interface, a media player startup (MediaPlayer:: start) interface, a media player pause (MediaPlayer: :pause) interface, and a media player. Stop (MediaPlayer:: stop) interface, etc.
  • the data structure of the Java framework layer can be used but is not limited to: a multimedia object list, a list or an array of the Java framework layer.
  • Step 103 After the Java framework layer determines that the multimedia application is concurrently, the query queries whether the concurrent policy parameter corresponding to the multimedia object is stored. When there is a corresponding concurrent policy parameter, the other multimedia objects are managed according to the concurrent policy parameter.
  • the Java framework layer determines that the multimedia application is currently concurrent, generally: the Java framework layer detects whether an application of at least one multimedia object is currently activated, and if so, determines that the multimedia application is currently concurrent, otherwise determining that the multimedia application is not currently Concurrently, step 104 is directly executed.
  • the managing the other multimedia objects according to the concurrent policy parameters includes: suspending applications of other multimedia objects according to the concurrent policy parameters, or reducing sounds of other multimedia objects, and the like.
  • Step 104 The Java framework layer starts an application of the newly saved multimedia object.
  • the above method further includes: after the Java framework layer receives the command to stop the multimedia application, Stopping the application of the corresponding multimedia object, and querying whether the corresponding concurrent policy parameter is stored according to the type of the multimedia object and the media type played by the multimedia object, and canceling the concurrent policy according to the corresponding concurrent policy parameter
  • the parameter manages other multimedia objects, restores the application of other multimedia objects, and removes the stopped multimedia objects from the data structure.
  • the present invention further provides a multimedia management concurrent management device, the device is located in the Java framework layer, as shown in FIG. 2, the device includes: a JNI module 21, a multimedia concurrent management module (Multimedia Concurrent Manager) 22; among them,
  • the JNI module 21 is configured to generate and save a multimedia object for completing the actual multimedia function when the multimedia application initiates the request, and send the first query concurrent policy request to the multimedia concurrent management module 22; according to the notification of the multimedia concurrent management module 22 , launching an application of the newly saved multimedia object;
  • the multimedia concurrency management module 22 is configured to store parameters of the concurrency policy set in the Java application layer; after receiving the first query concurrency policy request of the JNI module 21, when determining that the current multimedia application is concurrent, whether the query stores the newly saved a concurrency policy parameter corresponding to the multimedia object, when there is a corresponding concurrency policy parameter, managing other multimedia objects according to the concurrency policy parameter; notifying the JNI module 21 to start an application of the newly saved multimedia object;
  • the JNI module 21 is specifically configured to: after receiving a request for creating a multimedia object sent by the Java application layer, generate a multimedia object for completing an actual multimedia function by calling an relevant interface of the local implementation layer, and save the multimedia object to the Java framework.
  • the JNI module 21 is specifically configured to: after receiving a request for creating a multimedia object sent by the Java application layer, generate a multimedia object for completing an actual multimedia function by calling an relevant interface of the local implementation layer, and save the multimedia object to the Java framework.
  • the JNI module 21 is further configured to: after receiving the command to stop the multimedia application, stop the application of the corresponding multimedia object, and send the type of the multimedia object and the media type of the multimedia object to the multimedia concurrent management module 22
  • the second query concurrent policy request; the multimedia concurrent management module 22 is further configured to: after receiving the second query concurrent policy request, check according to the type of the multimedia object that has been stopped and the media type played by the multimedia object Query whether there is a corresponding concurrency policy parameter, when there is a corresponding concurrency policy parameter, cancel management of other multimedia objects according to the concurrency policy parameter, resume application of other multimedia objects, and remove the stopped multimedia object from the data structure Deleted.
  • the system platform for implementing the above device is generally an android platform.
  • the multimedia application in the android platform is divided into the following levels: Java Application Layer (Java Application), Java Framework Layer (Java Framework)
  • Java Framework Java Framework
  • the local implementation layer (Live Libs) and the driver layer (Driver) implement multimedia applications through mutual division and cooperation at various levels. among them,
  • the Java application layer is responsible for constructing various UI interfaces for interacting with the user, determining the form of the interface and supporting user operations, and completing the specified functions by calling an interface provided by the Java framework layer; the Java application layer only needs to interact with the Java framework layer.
  • the Java framework layer provides support for the Java application layer, such as: Android. Hardware. Camera
  • Java framework layer provides API to Used by Java application layer developers, including how to use controls, manage resources, and manage application lifecycles to support application interaction modules.
  • the local implementation layer is a function library written by C/C++, which provides basic functions such as standard C library, processing of audio, processing of images, etc., and these basic functions are implemented by specific multimedia objects, the multimedia objects. Including: camera service corresponding to Camera (Camera Service), group video production software (PV Author) in packet video frame used by media recorder (mediarecorder), media player (mediaplayer) The corresponding Media Player Service (Media Player Service), the Media Player Service depends on the Packet Video Framework framework, the Video Player (PV Player), the Midi Player (Player), the Verbis Player (Verbis Player), etc.
  • the local implementation layer also includes multimedia objects of Camera Hardware; finally these basic functions are provided to the upper application through the Java framework layer.
  • the driver layer provides different drivers according to the underlying chip or hardware, and completes interaction with hardware, such as V4L2 capture (Capture) code provided by Camera Hardware and hardware code provided by ⁇ Packet Video Framework. ( Hardware Codec ⁇
  • a multimedia concurrency management module (Multimedia Concurrent Manager) is added to the Java framework layer in FIG. 3, and the multimedia concurrency management module stores parameters of a concurrency policy set in a Java application layer; a Java framework layer After receiving the request for creating the multimedia object, the JNI module generates a multimedia object for completing the actual multimedia function by calling the relevant interface of the local implementation layer, and saves the multimedia object into the data structure of the multimedia concurrent management module; the multimedia concurrent After receiving the first query of the JNI module, the management module queries whether the corresponding concurrency policy parameter is stored according to the type of the newly saved multimedia object and the media type played by the multimedia object. When there is a corresponding concurrency policy parameter, The other multimedia objects of the local implementation layer are managed according to the concurrency policy parameters; the JNI module starts the application of the newly saved multimedia object.
  • Multimedia Concurrent Manager Multimedia Concurrent Manager

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种多媒体应用的并发管理方法,在Java框架层中增加多媒体并发管理模块,存储在Java应用层设置的并发策略的参数;在有多媒体应用启动请求时,Java框架层生成并保存多媒体对象,在确定当前为多媒体应用并发时,查询是否存储有对应的并发策略参数,在有对应的并发策略参数时,根据所述并发策略参数对其他的多媒体对象进行管理;Java框架层启动新保存的多媒体对象;本发明同时还公开了一种多媒体应用的并发管理装置,通过本发明的方案,能够更加灵活的提供用户可配置的多媒体应用并发管理功能,实现第三方多媒体应用和终端自带的多媒体应用之间,以及第三方多媒体应用之间的并发管理。

Description

一种多媒体应用的并发管理方法和装置 技术领域
本发明涉及多媒体技术, 尤其涉及一种多媒体应用的并发管理方法和 装置。 背景技术
随着多媒体技术的发展, 多媒体应用越来越广泛, 尤其是智能终端的 出现, 更是满足了人们希望随时随地享受影音、 游戏等娱乐功能的需求。 但多媒体应用多了以后, 就需要考虑各种多媒体应用之间的一些并发操作, 比如, 在音乐播放的过程中来闹钟, 由于音乐的声音和闹钟响铃都会进行 声音输出, 所以应该采取一定的策略对这二种声音的输出进行控制, 可以 在闹钟响起的时候暂停音乐的播放, 或者在闹钟响起的时候降低音乐播放 的声音, 以突出闹钟的声音, 否则的话, 输出的声音就有可能比较杂乱, 降低用户体验。 在目前的智能终端中, 这两种方式都有使用, 但一个终端 上只能采用某一种固定的形式: 要么闹钟响起的时候暂停音乐的播放, 要 么闹钟响起的时候降低音乐播放的声音; 用户无法根据自己的喜好来选择 一种并发方式, 用户体验性不好。
与传统的功能手机( featurePhone )和其他智能终端平台相比, android 在多媒体应用并发的实现上有了很大的进步, 实现多媒体应用的并发相对 比较容易。 其所采用的机制被称为广播机制, 即当一个多媒体应用启动的 时候, 比如开始摄像, 那么这个应用程序, 在这里就是摄像应用程序, 会 发送一个广播, 在该广播中携带指定的数据, 而其它多媒体应用在收到所 述广播时, 根据接收到的所述广播中的数据确定自身进行何种操作, 如暂 停自身或降低自身的播放音量等。 但这种机制有一个比较严重的缺点就是, 所有多媒体应用必须对广播的数据的含义提前约定好, 这样才能在收到某 个指定的数据时执行相应的操作。 但 android是一个开放的平台, 允许用户 随意安装自己感兴趣的软件, 比如, 除了使用 android终端上自带的音频播 放器外, 还可以安装第三方公司提供的音乐播放器。 和不同公司提供的各 种多媒体应用提前约定指定数据的含义, 这显然是不可能的。 因此, 对于 终端自带的应用和第三方提供的多媒体应用之间以及二个不同公司提供的 第三方应用之间的并发控制, android的支持性并不好。 例如, 在若干个品 牌的 android智能终端上测试发现, 当进行摄像的时候, 仍然允许第三方音 乐播放软件播放音乐, 这显然是非常不合理的。 发明内容
有鉴于此, 本发明的主要目的在于提供一种多媒体应用的并发管理方 法和装置, 能够以更加灵活的方式, 提供用户可配置的多媒体应用并发管 理功能, 实现安装的第三方多媒体应用和终端自带的多媒体应用之间, 以 及第三方多媒体应用之间的并发管理。
为达到上述目的, 本发明的技术方案是这样实现的:
本发明提供的一种多媒体应用的并发管理方法, 该方法包括:
Java框架层存储在 Java应用层设置的并发策略的参数;
在有多媒体应用启动请求时, java框架层生成并保存用于完成实际多 媒体功能的多媒体对象, 在确定当前为多媒体应用并发时, 查询是否存储 有所述多媒体对象对应的并发策略参数, 在有对应的并发策略参数时, 根 据所述并发策略参数对除所述多媒体对象外的其他多媒体对象进行管理; Java框架层启动新保存的多媒体对象的应用。
上述方案中, 该方法还包括: 所述 Java框架层存储在 Java应用层设置 的并发策略的参数之前, 在 Java应用层通过并发策略设置界面设置并发策 略, Java应用层根据在界面设置的并发策略, 在后台将并发策略参数发送 给 Java 4ϋ架层。
上述方案中, 所述 Java框架层生成并保存多媒体对象为: Java框架层 的 JNI模块接收 Java应用层发送的创建多媒体对象的请求, 通过调用本地 实现层的相关接口生成用于完成实际多媒体功能的多媒体对象, 并保存所 述多媒体对象到 Java框架层的数据结构内。
上述方案中, 所述根据所述并发策略参数对除所述多媒体对象外的其 他多媒体对象进行管理, 包括: 根据所述并发策略参数暂停除所述多媒体 对象外的其他多媒体对象的应用、 或降低除所述多媒体对象外的其它多媒 体对象的声音。
上述方案中, 该方法还包括: Java框架层收到请求停止多媒体应用的 命令后, 停止对应的多媒体对象的应用, 根据所述多媒体对象的类型及所 述多媒体对象播放的媒体类型, 查询是否存储有对应的并发策略参数, 在 有对应的并发策略参数时, 取消根据所述并发策略参数对其他多媒体对象 的管理, 并将已经停止的多媒体对象从数据结构中删除。
本发明提供的一种多媒体应用的并发管理装置, 该装置位于 Java框架 层, 包括: JNI模块、 多媒体并发管理模块; 其中,
JNI模块, 配置为在有多媒体应用启动请求时, 生成并保存用于完成实 际多媒体功能的多媒体对象, 并向多媒体并发管理模块发送第一查询并发 策略请求; 根据多媒体并发管理模块的通知, 启动新保存的多媒体对象的 应用;
多媒体并发管理模块, 配置为存储在 Java应用层设置的并发策略的参 数; 收到 JNI模块的第一查询并发策略请求后, 在确定当前为多媒体应用 并发时, 查询是否存储有新保存的多媒体对象对应的并发策略参数, 在有 对应的并发策略参数时, 根据所述并发策略参数对除所述多媒体对象外的 其他多媒体对象进行管理; 通知 JNI模块启动新保存的多媒体对象的应用。 上述方案中, 所述 JNI模块, 配置为接收 Java应用层发送的创建多媒 体对象的请求, 通过调用本地实现层的相关接口生成用于完成实际多媒体 功能的多媒体对象, 并保存所述多媒体对象到多媒体并发管理模块的数据 结构内。
上述方案中, 所述 JNI模块, 还配置为收到请求停止多媒体应用的命 令后, 停止对应的多媒体对象的应用, 向多媒体并发管理模块发送携带所 述多媒体对象的类型及所述多媒体对象播放的媒体类型的第二查询并发策 略请求。
上述方案中, 所述多媒体并发管理模块, 还配置为收到第二查询并发 策略请求后, 根据已经停止的多媒体对象的类型及所述多媒体对象播放的 媒体类型, 查询是否存储有对应的并发策略参数, 在有对应的并发策略参 数时, 取消根据所述并发策略参数对其他多媒体对象的管理, 并将已经停 止的多媒体对象从数据结构中删除。
上述方案中, 该装置实现在 android平台上。
本发明提供了一种多媒体应用的并发管理方法和装置, Java框架层 ( Java Framework )存储在 Java应用层设置的并发策略的参数; 在有多媒 体应用启动请求时, Java框架层生成并保存用于完成实际多媒体功能的多 媒体对象, 在确定当前为多媒体应用并发时, 查询是否存储有所述多媒体 对象对应的并发策略参数, 在有对应的并发策略参数时, 根据所述并发策 略参数对其他的多媒体对象进行管理; java框架层启动新保存的多媒体对 象; 如此, 能够以更加灵活的方式, 提供用户可配置的多媒体应用并发管 理功能, 实现安装的第三方多媒体应用和终端自带的多媒体应用之间, 以 及第三方多媒体应用之间的并发管理, 将带来更好、 更加人性化的多媒体 应用感受, 大大提高用户体验, 另外, 本发明的方案只是对 Java框架层进 行了扩展, 对 Java应用层的开发没有任何影响, 和在传统的系统平台运行 的软件完全兼容。 附图说明
图 1为本发明实现多媒体应用的并发管理方法的流程示意图; 图 2为本发明实现多媒体应用的并发管理装置的结构示意图; 图 3为现有技术中 android平台多媒体应用的架构示意图;
图 4为本发明实现的 android平台多媒体应用的架构示意图。 具体实施方式
本发明的基本思想是: Java框架层存储在 Java应用层设置的并发策略 的参数; 在有多媒体应用启动请求时, Java框架层生成用于完成实际多媒 体功能的并保存多媒体对象, 在确定当前为多媒体应用并发时, 查询是否 存储有所述多媒体对象对应的并发策略参数, 在有对应的并发策略参数时, 根据所述并发策略参数对其他多媒体对象进行管理; Java框架层启动新保 存的多媒体对象的应用。
下面通过附图及具体实施例对本发明做进一步的详细说明。
本发明实现一种多媒体应用的并发管理方法, 如图 1 所示, 该方法包 括以下几个步驟:
步驟 101 : Java框架层存储在 Java应用层设置的并发策略的参数; 在本步驟之前, 进一步包括: 在 Java应用层(Java Application )通过 并发策略设置界面设置并发策略, 如: 闹钟时是否允许播放音乐、 是否允 许多个不同的音乐播放器同时播放音乐、 摄像时是否关闭所有声音等等, 这里, 终端厂商可以设置各种灵活多样的设置项; Java应用层根据在界面 设置的并发策略, 在后台将并发策略参数发送给 Java框架层。
步驟 102: 在有多媒体应用启动请求时, Java框架层生成并保存用于完 成实际多媒体功能的多媒体对象; 具体的, 用户向 Java应用层发起多媒体应用启动请求, 如音乐播放、 摄像等; Java应用层通过本地化方法向 Java框架层的 JNI模块如安卓.媒体. 媒体播放器( android.media.MediaPlayer ) , 请求创建多媒体对象, 本实施例 中为音乐播放器对象; 所述 JNI模块接收所述请求, 通过调用本地实现层 ( Native Libs )的相关接口生成用于完成实际多媒体功能的多媒体对象, 并 保存所述多媒体对象到 Java框架层的数据结构内;
所述本地 实现层的相 关接 口 可以是媒体播放器准备 ( MediaPlayer::prepare )接口、 媒体播放器启动 ( MediaPlayer:: start )接口、 媒体播放器暂停 ( MediaPlayer: :pause ) 接口、 和媒体播放器停止 ( MediaPlayer:: stop )接口等;
所述 Java框架层的数据结构可以使用但不局限于: Java框架层的多媒 体对象链表、 列表或数组等。
步驟 103: Java框架层确定当前为多媒体应用并发后, 查询是否存储有 所述多媒体对象对应的并发策略参数, 在有对应的并发策略参数时, 根据 所述并发策略参数对其他多媒体对象进行管理;
所述 Java框架层确定当前为多媒体应用并发, 一般是: Java框架层检 测当前是否有至少一个多媒体对象的应用已经被启动, 如果有, 则确定当 前为多媒体应用并发, 否则确定当前不为多媒体应用并发, 直接执行步驟 104。
所述根据所述并发策略参数对其他多媒体对象进行管理, 包括: 根据 所述并发策略参数暂停其他多媒体对象的应用, 或者降低其它多媒体对象 的声音, 等等。
本步驟还包括, 在没有对应的并发策略参数时, 直接执行步驟 104。 步驟 104: Java框架层启动新保存的多媒体对象的应用;
上述方法进一步包括: Java框架层收到请求停止多媒体应用的命令后, 停止对应的多媒体对象的应用, 根据所述多媒体对象的类型及所述多媒体 对象播放的媒体类型, 查询是否存储有对应的并发策略参数, 在有对应的 并发策略参数时, 取消根据所述并发策略参数对其他多媒体对象的管理, 恢复其他多媒体对象的应用, 并将已经停止的多媒体对象从数据结构中删 除。
为了实现上述方法, 本发明还提供一种多媒体应用的并发管理装置, 该装置位于 Java框架层, 如图 2所示, 该装置包括: JNI模块 21、 多媒体 并发管理模块 ( Multimedia Concurrent Manager ) 22; 其中,
JNI模块 21 , 配置为在有多媒体应用启动请求时, 生成并保存用于完 成实际多媒体功能的多媒体对象, 并向多媒体并发管理模块 22发送第一查 询并发策略请求; 根据多媒体并发管理模块 22的通知, 启动新保存的多媒 体对象的应用;
多媒体并发管理模块 22, 配置为存储在 Java应用层设置的并发策略的 参数; 收到 JNI模块 21的第一查询并发策略请求后, 在确定当前为多媒体 应用并发时, 查询是否存储有新保存的多媒体对象对应的并发策略参数, 在有对应的并发策略参数时, 根据所述并发策略参数对其他多媒体对象进 行管理; 通知 JNI模块 21启动新保存的多媒体对象的应用;
所述 JNI模块 21 , 具体配置为接收 Java应用层发送的创建多媒体对象 的请求后, 通过调用本地实现层的相关接口生成用于完成实际多媒体功能 的多媒体对象, 并保存所述多媒体对象到 Java框架层的数据结构内;
所述 JNI模块 21 , 还配置为收到请求停止多媒体应用的命令后, 停止 对应的多媒体对象的应用, 向多媒体并发管理模块 22发送携带所述多媒体 对象的类型及所述多媒体对象播放的媒体类型的第二查询并发策略请求; 所述多媒体并发管理模块 22,还配置为收到第二查询并发策略请求后, 根据已经停止的多媒体对象的类型及所述多媒体对象播放的媒体类型, 查 询是否存储有对应的并发策略参数, 在有对应的并发策略参数时, 取消根 据所述并发策略参数对其他多媒体对象的管理, 恢复其他多媒体对象的应 用, 并将已经停止的多媒体对象从数据结构中删除。
实现上述装置的系统平台一般是 android平台, 现有技术中的 android 平台中多媒体应用, 如图 3所示, 划分为以下几个层次: Java应用层(Java Application ), Java框架层 ( Java Framework ), 本地实现层 ( Native Libs ) 和驱动层(Driver ), 通过各个层次的相互分工与协作实现多媒体应用。 其 中,
所述 Java应用层负责构建与用户交互的各种 UI界面,确定界面的形式 及支持的用户操作,通过调用 Java框架层提供的接口完成指定的功能; Java 应用层只需要与 Java框架层打交道, 调用 Java框架层的应用程序编程接口 ( API, Application Programming Interface ) 即可, 不用关心底层硬件细节; Java应用层的模块包括: 照相机( Camera ), 媒体记录 ( Media Recorder ), 媒体播放器(Media Player )、 参数设置(Param Set )模块等。
所述的 Java框架层对 Java应用层提供支持, 如: 安卓.硬件.照相机
( android.hardware.Camera ) 、 安 卓 . 媒 体 . 媒 体 " i己 录 ( android.media.MediaRecorder ) 、 安 卓 . 媒 体 . 媒 体 播 放 器 ( android.media.MediaPlayer )等 JNI模块。 Java框架层提供了 API给 Java 应用层开发人员使用, 包括如何使用控件、 管理资源以及应用生命周期的 管理等, 对应用交互模块起到支撑作用。
所述的本地实现层是由 C/C++所编写的函数库, 提供了标准 C库、 对音 频的处理、 对图像的处理等基本功能, 这些基本功能由具体的多媒体对象 实现, 所述多媒体对象包括: 照相机(Camera )对应的照相机服务(Camera Service ), 媒体记录器( mediarecorder )使用的分组视频 4匡架(Packet Video Framework )中的分组视频制作软件 ( PV Author )、媒体播放器( mediaplayer ) 对应的媒体播放器服务 (MediaPlayer Service ), 媒体播放器服务依赖的 Packet Video Framework框架中的分组视频播放器( PV Player ), Midi播放 器(Player )、 威比斯播放器( Verbis Player )等, 此外, 在本地实现层还包 括照相机硬件 ( Camera Hardware )的多媒体对象; 最终通过 Java框架层给 上层应用提供这些基本功能。
所述的驱动层根据底层芯片或硬件的不同, 提供不同的驱动, 完成与 硬件的交互功能, 如对照相机硬件 ( Camera Hardware )提供的 V4L2采集 ( Capture )代码和^ Packet Video Framework提供的硬件代码 ( Hardware Codec λ
本发明中, 如图 4所示, 在图 3中的 Java框架层增加多媒体并发管理 模块(Multimedia Concurrent Manager ), 所述多媒体并发管理模块存储在 Java应用层设置的并发策略的参数; Java框架层的 JNI模块接收创建多媒 体对象的请求后, 通过调用本地实现层的相关接口生成用于完成实际多媒 体功能的多媒体对象, 并保存所述多媒体对象到多媒体并发管理模块的数 据结构内; 所述多媒体并发管理模块收到 JNI模块的第一查询并发策略请 求后, 根据新保存的多媒体对象的类型及多媒体对象播放的媒体类型, 查 询是否存储有对应的并发策略参数, 在有对应的并发策略参数时, 根据所 述并发策略参数对本地实现层的其他多媒体对象进行管理; JNI模块启动新 保存的多媒体对象的应用。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。

Claims

1、 一种多媒体应用的并发管理方法, 其中, 该方法包括: Java框架层存储在 Java应用层设置的并发策略的参数;
在有多媒体应用启动请求时, java框架层生成并保存用于完成实际多 媒体功能的多媒体对象, 在确定当前为多媒体应用并发时, 查询是否存储 有所述多媒体对象对应的并发策略参数, 在有对应的并发策略参数时, 根 据所述并发策略参数对除所述多媒体对象外的其他多媒体对象进行管理;
Java框架层启动新保存的多媒体对象的应用。
2、 根据权利要求 1所述的并发管理方法, 其中, 该方法还包括: 所述 Java框架层存储在 Java应用层设置的并发策略的参数之前,在 Java应用层 通过并发策略设置界面设置并发策略, Java应用层根据在界面设置的并发 策略, 在后台将并发策略参数发送给 Java框架层。
3、根据权利要求 1所述的并发管理方法, 其中, 所述 Java框架层生成 并保存多媒体对象为: Java框架层的 JNI模块接收 Java应用层发送的创建 多媒体对象的请求, 通过调用本地实现层的相关接口生成用于完成实际多 媒体功能的多媒体对象, 并保存所述多媒体对象到 Java框架层的数据结构 内。
4、 根据权利要求 1所述的并发管理方法, 其中, 所述根据所述并发策 略参数对除所述多媒体对象外的其他多媒体对象进行管理, 包括: 根据所 述并发策略参数暂停除所述多媒体对象外的其他多媒体对象的应用、 或降 低除所述多媒体对象外的其它多媒体对象的声音。
5、 根据权利要求 1所述的并发管理方法, 其中, 该方法还包括: Java 框架层收到请求停止多媒体应用的命令后, 停止对应的多媒体对象的应用, 根据所述多媒体对象的类型及所述多媒体对象播放的媒体类型 , 查询是否 存储有对应的并发策略参数, 在有对应的并发策略参数时, 取消根据所述 并发策略参数对其他多媒体对象的管理, 并将已经停止的多媒体对象从数 据结构中删除。
6、 一种多媒体应用的并发管理装置, 其中, 该装置位于 Java框架层, 包括: JNI模块、 多媒体并发管理模块; 其中,
JNI模块, 配置为在有多媒体应用启动请求时, 生成并保存用于完成实 际多媒体功能的多媒体对象, 并向多媒体并发管理模块发送第一查询并发 策略请求; 根据多媒体并发管理模块的通知, 启动新保存的多媒体对象的 应用;
多媒体并发管理模块, 配置为存储在 Java应用层设置的并发策略的参 数; 收到 JNI模块的第一查询并发策略请求后, 在确定当前为多媒体应用 并发时, 查询是否存储有新保存的多媒体对象对应的并发策略参数, 在有 对应的并发策略参数时, 根据所述并发策略参数对除所述多媒体对象外的 其他多媒体对象进行管理; 通知 JNI模块启动新保存的多媒体对象的应用。
7、 根据权利要求 6所述的并发管理装置, 其中, 所述 JNI模块, 配置 为接收 Java应用层发送的创建多媒体对象的请求, 通过调用本地实现层的 相关接口生成用于完成实际多媒体功能的多媒体对象, 并保存所述多媒体 对象到多媒体并发管理模块的数据结构内。
8、 根据权利要求 6所述的并发管理装置, 其中, 所述 JNI模块, 还配 置为收到请求停止多媒体应用的命令后, 停止对应的多媒体对象的应用, 向多媒体并发管理模块发送携带所述多媒体对象的类型及所述多媒体对象 播放的媒体类型的第二查询并发策略请求。
9、 根据权利要求 8所述的并发管理装置, 其中, 所述多媒体并发管理 模块, 还配置为收到第二查询并发策略请求后, 根据已经停止的多媒体对 象的类型及所述多媒体对象播放的媒体类型, 查询是否存储有对应的并发 策略参数, 在有对应的并发策略参数时, 取消根据所述并发策略参数对其 他多媒体对象的管理, 并将已经停止的多媒体对象从数据结构中删除。
10、 根据权利要求 6至 9任一项所述的并发管理装置, 其中, 该装置 实现在 android平台上。
PCT/CN2012/080174 2012-01-17 2012-08-15 一种多媒体应用的并发管理方法和装置 WO2013107176A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210015617.1 2012-01-17
CN201210015617.1A CN102609302B (zh) 2012-01-17 2012-01-17 一种多媒体应用的并发管理方法和装置

Publications (1)

Publication Number Publication Date
WO2013107176A1 true WO2013107176A1 (zh) 2013-07-25

Family

ID=46526696

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/080174 WO2013107176A1 (zh) 2012-01-17 2012-08-15 一种多媒体应用的并发管理方法和装置

Country Status (2)

Country Link
CN (1) CN102609302B (zh)
WO (1) WO2013107176A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609302B (zh) * 2012-01-17 2014-06-11 中兴通讯股份有限公司 一种多媒体应用的并发管理方法和装置
CN103593212A (zh) * 2013-11-01 2014-02-19 小米科技有限责任公司 一种应用安装的方法、装置和设备
CN103841326B (zh) * 2014-02-26 2017-05-17 宇龙计算机通信科技(深圳)有限公司 拍摄录像的方法及装置
CN103929536A (zh) * 2014-03-31 2014-07-16 广东明创软件科技有限公司 提高图片处理回显速度的方法及其移动终端
CN104980642B (zh) * 2014-04-08 2019-01-22 腾讯科技(北京)有限公司 视频拍摄方法及装置
CN104967770B (zh) * 2014-05-14 2018-07-10 腾讯科技(北京)有限公司 视频拍摄方法及装置
CN107968960A (zh) * 2016-10-20 2018-04-27 中兴通讯股份有限公司 一种后台音视频播放控制方法和装置
CN109672884B (zh) * 2017-10-13 2022-05-10 斑马智行网络(香港)有限公司 图像硬件编码处理方法和装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101383865A (zh) * 2008-10-22 2009-03-11 中兴通讯股份有限公司 手机电视播放中对可视电话并发处理的方法及装置
CN102300178A (zh) * 2010-06-25 2011-12-28 浪潮乐金数字移动通信有限公司 一种移动终端及其对收看视频时来电和短信的处理方法
CN102609302A (zh) * 2012-01-17 2012-07-25 中兴通讯股份有限公司 一种多媒体应用的并发管理方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101600011B (zh) * 2008-06-03 2013-06-05 中兴通讯股份有限公司 移动终端多媒体的并发播放方法和装置
CN101345961A (zh) * 2008-08-04 2009-01-14 中兴通讯股份有限公司 一种移动终端上多媒体引擎并发控制的实现方法
CN101431805A (zh) * 2008-12-04 2009-05-13 中兴通讯股份有限公司 一种电话与手机电视并发的处理方法和系统
CN101431831A (zh) * 2008-12-04 2009-05-13 中兴通讯股份有限公司 可视电话与手机电视并发的处理方法和并发处理的手机

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101383865A (zh) * 2008-10-22 2009-03-11 中兴通讯股份有限公司 手机电视播放中对可视电话并发处理的方法及装置
CN102300178A (zh) * 2010-06-25 2011-12-28 浪潮乐金数字移动通信有限公司 一种移动终端及其对收看视频时来电和短信的处理方法
CN102609302A (zh) * 2012-01-17 2012-07-25 中兴通讯股份有限公司 一种多媒体应用的并发管理方法和装置

Also Published As

Publication number Publication date
CN102609302A (zh) 2012-07-25
CN102609302B (zh) 2014-06-11

Similar Documents

Publication Publication Date Title
WO2013107176A1 (zh) 一种多媒体应用的并发管理方法和装置
US11954306B2 (en) System for universal remote media control in a multi-user, multi-platform, multi-device environment
WO2017177873A1 (zh) 一种音频同步录放系统及方法、存储介质
KR100595704B1 (ko) 휴대단말기에서의 리소스 관리 방법
US20090241149A1 (en) Content reproduction system, remote control device, and computer program
US20120209413A1 (en) Background Audio on Mobile Devices
US9191417B2 (en) Cross-process media handling in a voice-over-internet protocol (VOIP) application platform
CN105786473A (zh) 多任务界面的任务管理方法、装置及终端设备
CN103840963B (zh) 一种服务器数据更新方法,及装置
CN108111520B (zh) 媒体播放资源处理方法、装置及终端
WO2019127114A1 (zh) 一种虚拟机的音频播放方法及其装置、移动终端
CN104199633B (zh) 多媒体播放设备、播放器自动识别装置及方法
WO2011147218A1 (zh) 一种实现应用管理的方法及非智能移动终端
CN101140527A (zh) 一种音频驱动程序声音管理方法
EP2950310A1 (en) Method and system for continuously playing media resources in device
CN109697088A (zh) 应用界面加载方法、移动终端及计算机可读存储介质
US20240086231A1 (en) Task migration system and method
WO2020135655A1 (zh) 音频处理方法、装置、终端和存储介质
CN109672745A (zh) 用于FreeRTOS的音频在线播放控制方法和装置
TW201025133A (en) Method for installing application program and computer system
WO2011157035A1 (zh) 一种开机过程中实现增值业务的终端及方法
CN106454550B (zh) 内容接收装置
US20090169169A1 (en) Video content recording apparatus and video content transfer method
WO2015184902A1 (zh) 一种智能分屏的并发处理方法及相应的智能终端
WO2015109844A1 (zh) 便携式宽带无线装置

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: 12866218

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: 12866218

Country of ref document: EP

Kind code of ref document: A1