CN114422837A - Method, device, equipment and medium for sharing media data by multiple applications - Google Patents

Method, device, equipment and medium for sharing media data by multiple applications Download PDF

Info

Publication number
CN114422837A
CN114422837A CN202210085902.4A CN202210085902A CN114422837A CN 114422837 A CN114422837 A CN 114422837A CN 202210085902 A CN202210085902 A CN 202210085902A CN 114422837 A CN114422837 A CN 114422837A
Authority
CN
China
Prior art keywords
media data
application
master control
control application
sharing
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202210085902.4A
Other languages
Chinese (zh)
Other versions
CN114422837B (en
Inventor
李智
彭京
郑长松
汪远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Public Security Research Center
Chengdu TD Tech Ltd
Original Assignee
Sichuan Public Security Research Center
Chengdu TD Tech Ltd
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 Sichuan Public Security Research Center, Chengdu TD Tech Ltd filed Critical Sichuan Public Security Research Center
Priority to CN202210085902.4A priority Critical patent/CN114422837B/en
Publication of CN114422837A publication Critical patent/CN114422837A/en
Application granted granted Critical
Publication of CN114422837B publication Critical patent/CN114422837B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4126The peripheral being portable, e.g. PDAs or mobile phones
    • 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/41Structure of client; Structure of client peripherals
    • H04N21/422Input-only peripherals, i.e. input devices connected to specially adapted client devices, e.g. global positioning system [GPS]
    • H04N21/42203Input-only peripherals, i.e. input devices connected to specially adapted client devices, e.g. global positioning system [GPS] sound input device, e.g. microphone
    • 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/41Structure of client; Structure of client peripherals
    • H04N21/422Input-only peripherals, i.e. input devices connected to specially adapted client devices, e.g. global positioning system [GPS]
    • H04N21/4223Cameras
    • 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • 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/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method, a device, equipment and a medium for sharing media data by multiple applications. In the method, a media data acquisition request is sent to a master control application by the sharing application through configuring the master control application and the sharing application. After the master control application acquires the original media data, the original media data are coded according to the recording parameters in the data acquisition request, and then the processed media data are sent to the sharing application, so that the media data are shared by multiple applications. According to the scheme, data transmission between the shared application and the master control application is realized, and data collected by a camera or a microphone is used by two or more applications in one terminal device at the same time.

Description

Method, device, equipment and medium for sharing media data by multiple applications
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a device, and a medium for sharing media data among multiple applications.
Background
With the rapid development of science and technology, the use of terminal devices such as smart phones and tablets for recording audio and video is realized, people can record audio and video by using various recording applications, and the applications can be used on the terminal devices for further processing the audio and video.
In the prior art, for a terminal device having a camera and a microphone, the camera and the microphone are exclusive resources, and when an application wants to use the camera or the microphone, the application needs to use the camera or the microphone through an interface of the terminal device. When other applications want to use the camera or the microphone at the same time, only the application with the highest priority or the application calling the interface of the camera or the microphone last can use the camera or the microphone.
In summary, the existing method using a camera or a microphone only supports one application for data collected by the camera or the microphone, and there is no scheme for two or more applications to use the data collected by the camera or the microphone in one terminal device at present.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a device, and a medium for sharing media data by multiple applications, which are used to solve the problem that the existing method for using a camera or a microphone only supports one application, and at present, there is no scheme for using two or more applications in one terminal device simultaneously with the camera or the microphone.
In a first aspect, an embodiment of the present invention provides a method for sharing media data by multiple applications, where the method is applied to a terminal device, and the terminal device has multiple applications installed therein, where the multiple applications include a master application configured to operate an interface of the media device and at least one sharing application configured to need to share media data, and the method includes:
responding to a media data recording operation of a user on any shared application, and sending a media data acquisition request to a master control application by the shared application, wherein the media data acquisition request comprises a port identifier and a recording parameter;
the master control application calls an interface of the media equipment of the terminal equipment to record the media data according to the media data acquisition request to acquire original media data;
and the master control application sends the required target media data to the sharing application according to the original media data, the port identification and the recording parameter in the media data acquisition request, wherein the target media data is obtained by coding the original media data.
In one embodiment, the method further comprises:
the master control application determines whether the master control application needs to use the original media data;
and if the master control application needs to use the original media data, copying the original media data locally.
In a specific embodiment, the sending, by the master application, the target media data required by the master application to the shared application according to the original media data, the port identifier and the recording parameter in the media data acquisition request includes:
the master control application carries out coding processing on the original media data according to the recording parameters to obtain the target media data;
and the master control application sends the target media data to the sharing application through a local port corresponding to the port identification.
In one embodiment, the method further comprises:
the master control application compresses the target media data to obtain compressed target media data;
correspondingly, the sending, by the master application, the target media data to the shared application through the local port corresponding to the port identifier includes:
and the master control application sends the compressed target media data to the shared application through a local port corresponding to the port identification.
In a specific embodiment, before the shared application sends the media data acquisition request to the master application, the method further includes:
the sharing application sends query information to the master control application, wherein the query information is used for querying a parameter range of media data which can be provided by the master control application;
the master control application acquires the parameter range of the media data supported by the terminal equipment according to the query information;
the master control application acquires the parameter range of the media data which can be provided by the master control application according to the parameter range of the media data supported by the terminal equipment;
the master application sends parameter ranges of media data that can be provided by the master application to the sharing application.
In a specific embodiment, the sending, by the sharing application, a media data acquisition request to the master application includes: and when the recording parameter of the media data required by the sharing application is in the parameter range of the media data provided by the master control application, the sharing application sends the media data acquisition request to the master control application.
In a specific embodiment, the acquiring, by the master control application, a parameter range of media data that can be provided by the master control application according to a parameter range of media data supported by the terminal device includes:
the master control application determines the parameter range of the media data supported by the terminal device, or a subset of the parameter range of the media data supported by the terminal device, as the parameter range of the media data that can be provided by the master control application.
In a second aspect, an embodiment of the present invention provides an apparatus for sharing media data among multiple applications, including:
the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for responding to a media data recording operation of a user on any shared application, and the shared application sends a media data acquisition request to a master control application, wherein the media data acquisition request comprises a port identifier and a recording parameter;
the processing module is used for calling an interface of the media equipment of the terminal equipment to record the media data according to the media data acquisition request by the main control application so as to acquire original media data;
the sending module is further configured to send, by the master application, target media data required by the master application to the shared application according to the original media data, the port identifier and the recording parameter in the media data acquisition request, where the target media data is obtained by encoding the original media data.
In a third aspect, an embodiment of the present invention provides a terminal device, including:
a processor, a memory, a communication interface, and a display;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of the first aspect via execution of the executable instructions.
In a fourth aspect, the present invention provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method of any one of the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program is used to implement the method of any one of the first aspect.
According to the method, the device, the equipment and the medium for sharing the media data by multiple applications, the main control application and the sharing application are configured, and the sharing application sends the media data acquisition request to the main control application. After the master control application acquires the original media data, the original media data are coded according to the recording parameters in the data acquisition request, and then the processed media data are sent to the sharing application, so that the media data are shared by multiple applications. According to the scheme, data transmission between the shared application and the master control application is realized, and data collected by a camera or a microphone is used by two or more applications in one terminal device at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1a is a schematic diagram of a camera or a microphone used in a conventional application provided by the present invention;
FIG. 1b is a schematic view of a scene of a method for sharing media data by multiple applications according to the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for sharing media data among multiple applications according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for sharing media data among multiple applications according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of a method for sharing media data among multiple applications according to the present invention;
FIG. 5 is a block diagram illustrating a method for sharing media data among multiple applications according to the present invention;
FIG. 6 is a schematic structural diagram of an embodiment of an apparatus for sharing media data among multiple applications according to the present invention;
fig. 7 is a schematic structural diagram of a terminal device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments based on the embodiments in the present invention, which can be made by those skilled in the art in light of the present disclosure, are within the scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
With the development of science and technology, more and more functions can be realized by terminal equipment such as smart phones, tablets and the like, from call receiving and making, internet surfing to photographing, video recording, video call and the like; more and more cameras or microphones can be used, and users can select applications to record audio and video, take pictures or carry out video calls and the like according to own requirements.
For a terminal device with a camera and a microphone, the camera and the microphone are exclusive resources, and when an application wants to use the camera or the microphone, the application needs to use the camera or the microphone through an interface of the terminal device. When other applications want to use the camera or the microphone at the same time, only the application with the highest priority or the application calling the interface of the camera or the microphone last can use the camera or the microphone. Therefore, the existing method using a camera or a microphone only supports one application for using data collected by the camera or the microphone, and there is no scheme for simultaneously using data collected by the camera or the microphone for two or more applications in one terminal device.
For example, fig. 1a is a schematic diagram of using a camera or a microphone by an existing Application according to the present invention, as shown in fig. 1a, when an Application a uses the camera or the microphone, an Application Programming Interface (API) of the camera or the microphone is called, and if an Application B also wants to use the camera or the microphone at this time, only an Application with a higher priority or calling the API at last can acquire the usage right of the camera or the microphone.
In view of the problems in the prior art, the inventor finds that, in the process of researching a method for sharing media data by multiple applications, data acquired by two or more applications simultaneously using a camera or a microphone in one terminal device can be realized in a media data sharing manner among the multiple applications. The method comprises the steps that a main control application and a sharing application are configured, the sharing application sends query information to the main control application, the parameter range of media data which can be provided by the main control application is obtained through the query information, and if the recording parameters of the media data required by the sharing application are met, a media data acquisition request is further sent to the main control application. After receiving the media data acquisition request, the master control application calls an interface of the media equipment of the terminal equipment to record the media data, encodes the obtained original media data according to the recording parameters in the media data acquisition request, and sends the encoded original media data to the shared application through a local port corresponding to the port identifier in the media data acquisition request. Based on the inventive concept, the scheme of sharing media data by multiple applications in the invention is designed.
Fig. 1b is a schematic view of a scenario of a method for sharing media data by multiple applications according to the present invention, and as shown in fig. 1b, the scenario of the application may include: a terminal device 11, a master application 12, and at least one shared application (fig. 1b shows two shared applications, namely a shared application 13 and a shared application 14).
The terminal equipment adopted by the scheme is equipment which is provided with a camera and/or a microphone, can run corresponding applications and can perform data processing and data transmission between the applications, and the terminal equipment comprises but is not limited to a smart phone, a tablet personal computer and a computer.
For example, in the application scenario shown in fig. 1b, the terminal device 11 is a smartphone of an android system, and when a user wants to perform multiple applications and use a camera or a microphone at the same time, the shared application 13 is opened, the shared application 13 sends query information to the master control application 12, and then the master control application 12 returns a parameter range of media data that can be provided by the master control application to the shared application 13. When the recording parameter of the media data required by the sharing application 13 is within the parameter range of the media data that can be provided by the main control application, the sharing application 13 sends a media data acquisition request to the main control application 12, and then the main control application 12 sends the target media data to the sharing application 13 according to the media data acquisition request, and the sharing application 13 receives the target media data.
Correspondingly, after receiving the query information sent by the sharing application 13, the main control application 12 obtains the parameter range of the media data supported by the terminal device 11, and after obtaining the parameter range of the media data that can be provided by the main control application, sends the parameter range of the media data to the sharing application 13. After receiving the media data acquisition request sent by the sharing application 13, the main control application 12 calls an interface of the media device of the terminal device 11 to record media data, acquires original media data, codes the original data according to recording parameters in the media data acquisition request, and finally sends the original data to the sharing application 13.
It should be noted that fig. 1b is only a schematic diagram of an application scenario provided in the embodiment of the present invention, and the embodiment of the present invention does not limit the actual form of the terminal device included in fig. 1b, nor limit the forms of the master control application and the shared application, where the master control application and the shared application are in the form of an application program in a smart phone or a tablet, and are in the form of software in a computer, and in the specific application of the scheme, the setting may be performed according to actual requirements.
The technical solution of the present invention will be described in detail below with reference to specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Before the method for sharing media data by multiple applications provided by the present invention is performed, a master application and a sharing application need to be configured in a terminal device, the master application is configured as an application for operating an interface of a media device, and the sharing application is configured as an application that needs to share media data. The main control application can directly operate the media device through the interface of the media device to obtain the media data. The shared application needs to send a media data acquisition request to the shared application when acquiring the media data, and the media data is acquired by the master control application and then sent to the shared application.
It should be noted that the media data includes audio data, video data, and audio-video data.
Fig. 2 is a flowchart illustrating a first embodiment of a method for sharing media data among multiple applications, as shown in fig. 2, the method for sharing media data among multiple applications specifically includes the following steps:
s201: and responding to the media data recording operation of the user on any sharing application, and sending a media data acquisition request to the master control application by the sharing application.
When a user wants to use a sharing application to realize services such as video shooting, audio recording or video call, the user clicks a button on a graphical user interface of a terminal device, and the sharing application needs to judge whether recording parameters of media data required by the sharing application are within a parameter range of the media data provided by a main control application. And if the required recording parameters of the media data are in the range of the parameters of the media data available by the master control application, the sharing application sends a media data acquisition request to the master control application. And if the required recording parameters of the media data are not in the parameter range of the media data provided by the master control application, displaying prompt information on a graphical user interface of the terminal equipment for prompting a user that the media data of the current camera or microphone do not meet the service requirements.
In this step, when the sharing application determines that the recording parameter of the required media data is within the parameter range of the media data that can be provided by the master control application, the sharing application sends a media data acquisition request to the master control application, where the media data acquisition request includes the port identifier and the recording parameter. The subsequent main control application can perform coding processing on the original media data according to the recording parameters, and then send the processed target media data to the shared application through the local port corresponding to the port identifier.
For example, the recording parameter in the media data acquisition request may be a resolution, a sampling rate, and a value corresponding to the resolution and the sampling rate, and may also be a frame rate, a sampling depth, and a value corresponding to the frame rate and the sampling depth. The embodiment of the invention does not specifically limit the recording parameters and the size of the recording parameters in the media data acquisition request, and can select the recording parameters according to the actual situation.
S202: and the master control application calls an interface of the media equipment of the terminal equipment to record the media data according to the media data acquisition request so as to acquire the original media data.
In this step, after the sharing application sends a media data acquisition request to the master control application, the master control application receives the request, and then calls an interface of the media device of the terminal device to record media data, so as to acquire original media data. And the master control application determines whether the master control application needs to use the original media data, and if the master control application needs to use the original media data, the master control application copies the original media data locally.
Illustratively, if a user wants to record audio and video through the shared application, the master control application calls APIs corresponding to the camera and the microphone to obtain media data of the audio and video.
Illustratively, a user uses a master control application to record audio and video, and wants to use a shared application to perform video call, the master control application copies original media data after acquiring the original media data, uses one master control application, processes one master control application and sends the master control application to the shared application.
S203: and the master control application sends the required target media data to the shared application according to the original media data, the port identification and the recording parameter in the media data acquisition request, wherein the target media data is obtained by encoding the original media data.
In this step, after the master control application acquires the original media data, the media data is encoded according to the recording parameters in the media data acquisition request, so as to obtain the target media data. And then finding a corresponding local port of the terminal equipment system according to the port identification in the media data acquisition request, and sending the target media data to the shared application through the local port.
In the method for sharing media data by multiple applications provided by this embodiment, a media data acquisition request is sent to a master control application by a sharing application, and the master control application directly calls an interface of a media device after receiving the media data acquisition request, so as to obtain original media data. The main control application encodes the original media data according to the recording parameters in the media data acquisition request and then sends the original media data to the shared application through the local port, so that the data acquired by two or more applications in one terminal device simultaneously using a camera or a microphone is realized.
Fig. 3 is a flowchart illustrating a second embodiment of a method for sharing media data by multiple applications, as shown in fig. 3, in this embodiment, the step S203 may be implemented by the following steps:
s301: and the main control application carries out coding processing on the original media data according to the recording parameters to obtain target media data.
In this step, after the master control application acquires the original media data, the original media data is encoded according to the recording parameters in the media data acquisition request, so that the original media data meets the requirements of the recording parameters, and the encoded original media data is used as target media data.
Illustratively, the recording parameter is 1280ppi by 720ppi resolution and 44.1KHz sampling rate, and then the main control application encodes the original media data into target media data with 1280ppi by 720ppi resolution and 44KHz sampling rate.
Optionally, S302: and the master control application compresses the target media data to obtain the compressed target media data.
In this step, after the master control application obtains the target media data, it may also select to perform compression processing on the target media data, so as to obtain the compressed target media data. The target media data is compressed, so that the storage space occupied by the target media data is reduced, and the transmission speed is increased.
It should be noted that, the case of selecting to perform compression processing on the target media data may be: when the working personnel configure the master control application, the preset space threshold value is set in the master control application, and after the master control application acquires the target media data, if the storage space occupied by the target media data exceeds the preset space threshold value, the target media data is compressed. The case of selecting the compression processing on the target media data may also be: and after the main control application acquires the target media data, directly compressing the target media data. The embodiment of the invention does not limit the condition of selecting to compress the target media data, does not limit the preset space threshold, and can select and set according to the actual condition.
S303: and the master control application sends the target media data to the shared application through the local port corresponding to the port identification.
In this step, after the master control application acquires the target media data, the local port in the corresponding terminal device system is found through the port identifier in the media data acquisition request, and the target media data is sent to the shared application through the local port.
Optionally, if the master control application performs compression processing on the target media data after acquiring the target media data, the compressed target media data is sent to the shared application through the local port.
In the method for sharing media data by multiple applications provided by this embodiment, the primary media data is encoded by the master control application, and the target media data is obtained and then transmitted to the sharing application. The master control application can also select to compress the target media data, and the compressed target media data is transmitted to the sharing application. The data collected by the camera or the microphone can be used by two or more applications in one terminal device, and the data transmission efficiency is improved.
Fig. 4 is a flowchart illustrating a third embodiment of a method for sharing media data by multiple applications, as shown in fig. 4, on the basis of the foregoing embodiment, before a sharing application sends a media data acquisition request to a master control application, the method for sharing media data by multiple applications further includes the following steps:
s401: the sharing application sends query information to the master application.
Since it is necessary to determine whether the recording parameter of the media data required by the sharing application is within the parameter range of the media data that can be provided by the master control application before the sharing application sends the media data acquisition request to the master control application, the sharing application also needs to acquire the parameter range of the media data that can be provided by the master control application before sending the media data acquisition request to the master control application.
In this step, the sharing application sends query information to the master control application, where the query information is used to query a parameter range of media data that can be provided by the master control application.
It should be noted that the trigger event for the shared application to send the query information to the master application may be: the user wants to use the sharing application to realize services such as video shooting, audio recording or video call, and clicks a button on a graphical user interface of the terminal device. The trigger event for the shared application to send the query information to the master application may also be: after the master control application and the shared application are configured, the shared application is started for the first time. The embodiment of the invention does not limit the trigger event of sending the query information to the master control application by the shared application, and can select the trigger event according to the actual situation.
S402: and the master control application acquires the parameter range of the media data supported by the terminal equipment according to the query information.
In this step, after the shared application sends the query information to the master control application, the master control application receives the query information, and then the parameter range of the media data supported by the terminal device can be directly obtained.
Illustratively, the parameter ranges of the media data supported by the terminal device include: the resolution ranges from 630ppi 360ppi to 3840ppi 2160ppi, the frame rate ranges from 10fps to 120fps, the sampling depth ranges from 16Bit to 24Bit, and the sampling rate ranges from 44.1KHz to 48 KHz. The embodiment of the invention does not limit the parameters and parameter ranges of the media data supported by the terminal equipment and can select the parameters according to the actual situation.
S403: the master control application obtains the parameter range of the media data which can be provided by the master control application according to the parameter range of the media data supported by the terminal equipment.
In this step, after the master control application obtains the parameter range of the media data supported by the terminal device, or a subset of the parameter range of the media data supported by the terminal device, is determined as the parameter range of the media data that can be provided by the master control application.
For example, the manner for the master application to obtain the parameter range of the media data that can be provided by the master application may be as follows: after the master control application obtains the parameter range of the media data supported by the terminal equipment, the number of the shared applications for sharing the media data at the moment is obtained, and the parameter range of the media data provided by the master control application is determined according to the number of the shared applications. The method comprises the steps of setting a mapping relation between the number and the proportion of shared applications for sharing media data in a master control application, finding out the corresponding proportion according to the number, and selecting the range of the proportion from the parameter range of the media data supported by the terminal equipment as the parameter range of the media data provided by the master control application. Exemplarily, the number of shared applications for sharing media data is 0, the corresponding proportion is 100%, and the parameter range of the media data supported by the terminal device is used as the parameter range of the media data provided by the master control application; the number of sharing applications for sharing the media data is 3, the corresponding proportion is 50%, and the first 50% of the parameter range of the media data supported by the terminal device is used as the parameter range of the media data provided by the master control application.
For example, the manner for the master application to obtain the parameter range of the media data that can be provided by the master application may also be: the master control application provides the same parameter range of the media data which can be provided by the master control application for each shared application according to the number of the shared applications in the terminal equipment. The main control application is provided with a mapping relation between the number and the proportion of the shared applications, the corresponding proportion is found according to the number, and the range of the proportion is selected from the parameter range of the media data supported by the terminal equipment and is used as the parameter range of the media data provided by the main control application. Exemplarily, the number of shared applications in the terminal device is 1, the corresponding proportion is 100%, and the parameter range of the media data supported by the terminal device is used as the parameter range of the media data provided by the master control application; the number of the shared applications in the terminal device is 5, the corresponding proportion is 50%, and the first 50% of the parameter range of the media data supported by the terminal device is used as the parameter range of the media data provided by the master control application.
S404: the master application sends parameter ranges of the media data that the master application can provide to the sharing application.
In this step, after determining the parameter range of the media data that can be provided by the master control application, the master control application may send the parameter range of the media data to the sharing application, so that the subsequent sharing application may determine whether to send a media data acquisition request to the master control application according to the parameter range of the media data that can be provided by the master control application.
In the method for sharing media data by multiple applications provided by this embodiment, the shared application sends the query request to the master control application, and the master control application determines the parameter range of the media data that can be provided by the master control application and sends the parameter range to the shared application, so that the shared application can determine whether to send the media data acquisition request to the master control application according to the parameter range of the media data that can be provided by the master control application, thereby ensuring normal operation of the terminal device and avoiding the problems of large data volume and crash of the terminal device.
The following describes an example of a method for sharing media data by multiple applications according to an embodiment of the present invention.
FIG. 5 is a block diagram illustrating a method for sharing media data among multiple applications according to the present invention; as shown in fig. 5, the terminal device is a terminal device of an android system, a master control application and a sharing application are configured in the terminal device, the master control application is used for recording audio and video files, and the sharing application is used for video call.
When the master control application records the audio and video files, the API interfaces of the camera and the microphone can be directly called through an audio and video recording tool provided by an android to record original video data and audio data, and when only the master control application carries out local video file recording service, the obtained audio and video data are converged to the media data processing module. At the moment, only the recording parameters of the main control application are stored in the media behavior decision module, and the media data processing module performs operations such as adding and decoding of watermarks according to the parameters and then writes the watermarks into a local video file.
At this time, the sharing application also expects to use the device camera and the MIC for a video call, and then queries the current available recording specification from the master control application through the device sharing interface, and when the sharing application meets the recording requirement of the sharing application, sends a media data acquisition request to the master control application through the device operating interface. And after the media behavior decision module makes a decision, the media behavior decision module transmits the decision to the media data processing module. And the media data processing module copies and encodes the acquired audio and video data according to the recording parameters in the media data acquisition request, and transmits the encoded audio and video data to the shared application through the local port. After the shared application acquires the data, the data can be sent to a designated server according to the service requirement.
In the method for sharing media data by multiple applications provided by this embodiment, a media data acquisition request is sent to a master control application through a sharing application, and then the master control application copies the acquired audio and video data, one copy of the audio and video data is processed according to its own recording parameters, one copy of the audio and video data is processed according to the recording parameters in the media data acquisition request, and then the audio and video data processed according to the recording parameters in the media data acquisition request is sent to the sharing application, so that two or more applications in one terminal device use data acquired by a camera or a microphone at the same time.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
FIG. 6 is a schematic structural diagram of an embodiment of an apparatus for sharing media data among multiple applications according to the present invention; as shown in fig. 6, the apparatus 60 includes:
a sending module 61, configured to respond to a media data recording operation of a user on any shared application, where the shared application sends a media data acquisition request to a master control application, where the media data acquisition request includes a port identifier and a recording parameter of the shared application;
a processing module 62, configured to invoke an interface of a media device of the terminal device to record media data according to the media data acquisition request by the master control application, so as to acquire original media data;
the sending module 61 is further configured to send, by the master application, target media data required by the master application to the shared application according to the original media data, the port identifier and the recording parameter in the media data acquisition request, where the target media data is obtained by encoding the original media data.
Further, the processing module 62 is further configured to:
the master control application determines whether the master control application needs to use the original media data;
and if the master control application needs to use the original media data, copying the original media data locally.
Further, the processing module 62 is further configured to perform encoding processing on the original media data by the master control application according to the recording parameter, so as to obtain the target media data.
Further, the sending module 61 is specifically configured to send the target media data to the shared application through a local port corresponding to the port identifier by the master application.
Further, the processing module 62 is further configured to perform compression processing on the target media data by the master control application to obtain compressed target media data.
Further, the sending module 61 is specifically configured to send, by the master application, the compressed target media data to the shared application through a local port corresponding to the port identifier.
Further, the sending module 61 is further configured to send, by the sharing application, query information to the master control application, where the query information is used to query a parameter range of media data that can be provided by the master control application.
Further, the processing module 62 is further configured to, by the master control application, obtain a parameter range of the media data supported by the terminal device according to the query information.
Further, the processing module 62 is further configured to obtain, by the master application, a parameter range of the media data that can be provided by the master application according to the parameter range of the media data supported by the terminal device.
Further, the sending module 61 is further configured to send, by the master application, the parameter range of the media data that can be provided by the master application to the sharing application.
Further, the sending module 61 is specifically configured to, when the recording parameter of the media data required by the shared application is within a parameter range of the media data that can be provided by the master control application, send, by the shared application, the media data acquisition request to the master control application.
Further, the processing module 62 is specifically configured to determine, by the master application, a parameter range of the media data supported by the terminal device, or a subset of the parameter range of the media data supported by the terminal device, as a parameter range of the media data that can be provided by the master application.
The apparatus for sharing media data by multiple applications provided in this embodiment is configured to execute the technical solution in any one of the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a terminal device provided in the present invention. As shown in fig. 7, the terminal device 70 includes:
a processor 71, a memory 72, and a communication interface 73 and a display 74;
the memory 72 is used for storing executable instructions of the processor 71;
wherein the processor 71 is configured to perform the technical solution of any of the preceding method embodiments via executing the executable instructions.
Alternatively, the memory 72 may be separate or integrated with the processor 71.
Optionally, when the memory 72 is a device independent from the processor 71, the terminal device 70 may further include:
and the bus is used for connecting the devices.
The terminal device is configured to execute the technical solution in any of the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
The embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the technical solutions provided in any of the foregoing embodiments.
An embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program is used to implement the technical solution provided by any of the foregoing method embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (11)

1. A method for sharing media data by multiple applications is applied to a terminal device, wherein the terminal device has multiple applications installed therein, and the multiple applications include a master application configured to operate an interface of the media device and at least one sharing application configured to require media data sharing, and the method includes:
responding to a media data recording operation of a user on any shared application, and sending a media data acquisition request to a master control application by the shared application, wherein the media data acquisition request comprises a port identifier and a recording parameter;
the master control application calls an interface of the media equipment of the terminal equipment to record the media data according to the media data acquisition request to acquire original media data;
and the master control application sends the required target media data to the sharing application according to the original media data, the port identification and the recording parameter in the media data acquisition request, wherein the target media data is obtained by coding the original media data.
2. The method of claim 1, further comprising:
the master control application determines whether the master control application needs to use the original media data;
and if the master control application needs to use the original media data, copying the original media data locally.
3. The method according to claim 1 or 2, wherein the sending, by the master application, the target media data required by the master application to the shared application according to the original media data, the port identifier and the recording parameter in the media data acquisition request comprises:
the master control application carries out coding processing on the original media data according to the recording parameters to obtain the target media data;
and the master control application sends the target media data to the sharing application through a local port corresponding to the port identification.
4. The method of claim 3, further comprising:
the master control application compresses the target media data to obtain compressed target media data;
correspondingly, the sending, by the master application, the target media data to the shared application through the local port corresponding to the port identifier includes:
and the master control application sends the compressed target media data to the shared application through a local port corresponding to the port identification.
5. The method of claim 1 or 2, wherein before the shared application sends the media data acquisition request to the master application, the method further comprises:
the sharing application sends query information to the master control application, wherein the query information is used for querying a parameter range of media data which can be provided by the master control application;
the master control application acquires the parameter range of the media data supported by the terminal equipment according to the query information;
the master control application acquires the parameter range of the media data which can be provided by the master control application according to the parameter range of the media data supported by the terminal equipment;
the master application sends parameter ranges of media data that can be provided by the master application to the sharing application.
6. The method of claim 5, wherein the shared application sends a media data acquisition request to a master application, comprising: and when the recording parameter of the media data required by the sharing application is in the parameter range of the media data provided by the master control application, the sharing application sends the media data acquisition request to the master control application.
7. The method of claim 5, wherein the acquiring, by the master application, the parameter range of the media data that can be provided by the master application according to the parameter range of the media data supported by the terminal device comprises:
the master control application determines the parameter range of the media data supported by the terminal device, or a subset of the parameter range of the media data supported by the terminal device, as the parameter range of the media data that can be provided by the master control application.
8. An apparatus for sharing media data among multiple applications, comprising:
the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for responding to a media data recording operation of a user on any shared application, and the shared application sends a media data acquisition request to a master control application, wherein the media data acquisition request comprises a port identifier and a recording parameter;
the processing module is used for calling an interface of media equipment of the terminal equipment to record the media data according to the media data acquisition request by the main control application so as to acquire original media data;
the sending module is further configured to send, by the master application, target media data required by the master application to the shared application according to the original media data, the port identifier and the recording parameter in the media data acquisition request, where the target media data is obtained by encoding the original media data.
9. A terminal device, comprising:
a processor, a memory, a communication interface, and a display;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1 to 7 via execution of the executable instructions.
10. A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
11. A computer program product, comprising a computer program which, when executed by a processor, is adapted to carry out the method of any one of claims 1 to 7.
CN202210085902.4A 2022-01-25 2022-01-25 Method, device, equipment and medium for sharing media data by multiple applications Active CN114422837B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210085902.4A CN114422837B (en) 2022-01-25 2022-01-25 Method, device, equipment and medium for sharing media data by multiple applications

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210085902.4A CN114422837B (en) 2022-01-25 2022-01-25 Method, device, equipment and medium for sharing media data by multiple applications

Publications (2)

Publication Number Publication Date
CN114422837A true CN114422837A (en) 2022-04-29
CN114422837B CN114422837B (en) 2023-08-18

Family

ID=81276786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210085902.4A Active CN114422837B (en) 2022-01-25 2022-01-25 Method, device, equipment and medium for sharing media data by multiple applications

Country Status (1)

Country Link
CN (1) CN114422837B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5392400A (en) * 1992-07-02 1995-02-21 International Business Machines Corporation Collaborative computing system using pseudo server process to allow input from different server processes individually and sequence number map for maintaining received data sequence
US20080170133A1 (en) * 2007-01-17 2008-07-17 Asustek Computer Inc. Video processing method and system for a virtual camera
KR20120100358A (en) * 2011-03-04 2012-09-12 세크론 주식회사 Image processing method and apparatus
US20130325952A1 (en) * 2012-06-05 2013-12-05 Cellco Partnership D/B/A Verizon Wireless Sharing information
CN103716290A (en) * 2012-10-09 2014-04-09 上海博路信息技术有限公司 Method for sharing mobile phone shooting capability
US20150050633A1 (en) * 2012-11-29 2015-02-19 Edsense, L.L.C. System and method for displaying multiple applications
US20150067656A1 (en) * 2013-09-05 2015-03-05 Google Inc. Methods and Systems for Testing Interactions Between Mobile Applications
CN104918112A (en) * 2014-03-13 2015-09-16 深圳Tcl新技术有限公司 Camera resource application method and device
US20150319144A1 (en) * 2014-05-05 2015-11-05 Citrix Systems, Inc. Facilitating Communication Between Mobile Applications
KR20160071835A (en) * 2014-12-12 2016-06-22 엘지전자 주식회사 Display apparatus and the control method thereof
CN106484547A (en) * 2016-10-10 2017-03-08 广东欧珀移动通信有限公司 A kind of management method, device and terminal for opening application more
CN107659768A (en) * 2017-08-08 2018-02-02 珠海全志科技股份有限公司 A kind of system and method based on the more Application share cameras of Android
CN110704201A (en) * 2018-07-10 2020-01-17 深圳市优必选科技有限公司 Multimedia data sharing method and terminal equipment
CN110753187A (en) * 2019-10-31 2020-02-04 芋头科技(杭州)有限公司 Camera control method and device
CN112114906A (en) * 2020-09-30 2020-12-22 上海商米科技集团股份有限公司 Multi-camera application mode method based on android platform
CN113347477A (en) * 2021-04-09 2021-09-03 北京润信恒达科技有限公司 Method, device and system for sharing camera by multiple applications
CN113556479A (en) * 2020-09-02 2021-10-26 华为技术有限公司 Method for sharing camera by multiple applications and electronic equipment
CN113890932A (en) * 2020-07-02 2022-01-04 华为技术有限公司 Audio control method and system and electronic equipment

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5392400A (en) * 1992-07-02 1995-02-21 International Business Machines Corporation Collaborative computing system using pseudo server process to allow input from different server processes individually and sequence number map for maintaining received data sequence
US20080170133A1 (en) * 2007-01-17 2008-07-17 Asustek Computer Inc. Video processing method and system for a virtual camera
KR20120100358A (en) * 2011-03-04 2012-09-12 세크론 주식회사 Image processing method and apparatus
US20130325952A1 (en) * 2012-06-05 2013-12-05 Cellco Partnership D/B/A Verizon Wireless Sharing information
CN103716290A (en) * 2012-10-09 2014-04-09 上海博路信息技术有限公司 Method for sharing mobile phone shooting capability
US20150050633A1 (en) * 2012-11-29 2015-02-19 Edsense, L.L.C. System and method for displaying multiple applications
US20150067656A1 (en) * 2013-09-05 2015-03-05 Google Inc. Methods and Systems for Testing Interactions Between Mobile Applications
CN104918112A (en) * 2014-03-13 2015-09-16 深圳Tcl新技术有限公司 Camera resource application method and device
US20150319144A1 (en) * 2014-05-05 2015-11-05 Citrix Systems, Inc. Facilitating Communication Between Mobile Applications
KR20160071835A (en) * 2014-12-12 2016-06-22 엘지전자 주식회사 Display apparatus and the control method thereof
CN106484547A (en) * 2016-10-10 2017-03-08 广东欧珀移动通信有限公司 A kind of management method, device and terminal for opening application more
CN107659768A (en) * 2017-08-08 2018-02-02 珠海全志科技股份有限公司 A kind of system and method based on the more Application share cameras of Android
CN110704201A (en) * 2018-07-10 2020-01-17 深圳市优必选科技有限公司 Multimedia data sharing method and terminal equipment
CN110753187A (en) * 2019-10-31 2020-02-04 芋头科技(杭州)有限公司 Camera control method and device
CN113890932A (en) * 2020-07-02 2022-01-04 华为技术有限公司 Audio control method and system and electronic equipment
CN113556479A (en) * 2020-09-02 2021-10-26 华为技术有限公司 Method for sharing camera by multiple applications and electronic equipment
CN112114906A (en) * 2020-09-30 2020-12-22 上海商米科技集团股份有限公司 Multi-camera application mode method based on android platform
CN113347477A (en) * 2021-04-09 2021-09-03 北京润信恒达科技有限公司 Method, device and system for sharing camera by multiple applications

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢天舜 , 朱祥华: "IP多播技术及其应用", 电信工程技术与标准化, no. 03 *

Also Published As

Publication number Publication date
CN114422837B (en) 2023-08-18

Similar Documents

Publication Publication Date Title
JP7369281B2 (en) Device capacity scheduling method and electronic devices
WO2022143077A1 (en) Photographing method, system, and electronic device
JP6396021B2 (en) Camera image data compression method and terminal supporting the same
CN110955541B (en) Data processing method, device, chip, electronic equipment and readable storage medium
EP4099690A1 (en) Enhanced video call method and system, and electronic device
US20180014063A1 (en) Method and Apparatus for Accessing a Terminal Device Camera to a Target Device
CN110413383B (en) Event processing method, device, terminal and storage medium
CN115525453B (en) Multi-screen collaborative interrupt processing method and electronic equipment
EP3399713B1 (en) Device, system, and method to perform real-time communication
CN111953980B (en) Video processing method and device
CN114422837B (en) Method, device, equipment and medium for sharing media data by multiple applications
CN101771849A (en) Network capturing apparatus and displaying method
WO2022143087A1 (en) Screen projection method and electronic device
CN112948046A (en) Screen capturing method, device, equipment and storage medium
CN113691815A (en) Video data processing method, device and computer readable storage medium
CN114095660A (en) Image display method, image display device, storage medium and electronic equipment
CN113691526A (en) Pushing method, device, system, equipment and medium based on WebRTC
CN113141480A (en) Screen recording method, device, equipment and storage medium
CN117135299B (en) Video recording method and electronic equipment
CN116743761B (en) Cooperative working method and electronic equipment
CN117406654B (en) Sound effect processing method and electronic equipment
CN114500819B (en) Shooting method, shooting device and computer readable storage medium
CN116028383B (en) Cache management method and electronic equipment
CN116962640B (en) Monitoring plug flow method and device based on screen terminal and screen terminal
CN114339112B (en) Video call method, electronic equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant