CN114422837B - 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
CN114422837B
CN114422837B CN202210085902.4A CN202210085902A CN114422837B CN 114422837 B CN114422837 B CN 114422837B CN 202210085902 A CN202210085902 A CN 202210085902A CN 114422837 B CN114422837 B CN 114422837B
Authority
CN
China
Prior art keywords
media data
application
sharing
control application
master control
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.)
Active
Application number
CN202210085902.4A
Other languages
Chinese (zh)
Other versions
CN114422837A (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

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 application by the sharing application by configuring the master application and the sharing application. After the master control application acquires the original media data, the original media data is encoded according to the recording parameters in the data acquisition request, and then the processed media data is sent to the sharing application, so that the multi-application sharing media data is realized. According to the scheme, through data transmission between the shared application and the main control application, data acquired by two or more applications in one terminal device by using cameras or microphones at the same time is realized.

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 by multiple applications.
Background
With rapid development of technology, recording of audio and video by using terminal devices such as smart phones and tablets has been realized, and people can record audio and video by using various recording applications and further process the audio and video by using the applications on the terminal devices.
In the prior art, 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 camera or the microphone of the terminal device needs to be called for use. When other applications want to use the camera or microphone at the same time, only the application with the highest priority or the application that finally calls the interface of the camera or microphone can use the camera or microphone.
In summary, in the existing method for using a camera or a microphone, only one application is supported for data collected by the camera or the microphone to use, and there is no scheme for two or more applications to use the data collected by the camera or the microphone simultaneously in one terminal device.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for sharing media data by multiple applications, which are used for solving the problem that the existing method for using a camera or a microphone only supports one application to use, and a scheme for simultaneously using the camera or the microphone by two or more applications in one terminal equipment does not exist at present.
In a first aspect, an embodiment of the present invention provides a method for sharing media data by multiple applications, applied to a terminal device, where multiple applications are installed in the terminal device, 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 media data recording operation of a user on any sharing application, wherein the sharing application sends a media data acquisition request to a main control application, and the media data acquisition request comprises a port identification and recording parameters;
the master control application calls an interface of media equipment of the terminal equipment to record media data according to the media data acquisition request, and acquires original media data;
and the master control application sends target media data required by the master control application to the sharing application according to the original media data, the port identification and the recording parameter in the media data acquisition request, and the target media data is obtained by encoding 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 or not;
if the master control application itself needs to use the original media data, the original media data is copied locally.
In a specific embodiment, the master control application sends the target media data needed by the master control application to the sharing application according to the port identifier and the recording parameter in the original media data, and the method includes:
the master control application encodes 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 the local port corresponding to the port identifier.
In one embodiment, the method further comprises:
the main control application compresses the target media data to obtain compressed target media data;
correspondingly, the master control application sends the target media data to the sharing application through the local port corresponding to the port identifier, and the method comprises the following steps:
and the main control application sends the target media data after compression processing to the sharing application through the local port corresponding to the port identifier.
In a specific embodiment, before the sharing 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 main control application obtains the parameter range of the media data supported by the terminal equipment according to the query information;
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;
the master application sends a parameter range of media data available to the master application to the sharing application.
In one specific embodiment, the sharing application sends a media data acquisition request to a master application, including: and when the recording parameters of the media data required by the sharing application are within the parameter range of the media data available by the master application, the sharing application sends the media data acquisition request to the master application.
In a specific embodiment, the obtaining, by the master control application, the parameter range of the media data that can be provided by the master control application according to the parameter range of the media data supported by the terminal device includes:
the master control application determines the parameter range of the media data supported by the terminal equipment or the subset of the parameter range of the media data supported by the terminal equipment as the parameter range of the media data which 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 by multiple applications, including:
the sending module is used for responding to the media data recording operation of a user on any sharing application, and the sharing application sends a media data acquisition request to a main control application, wherein the media data acquisition request comprises a port identification and recording parameters;
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 master control application to acquire the original media data;
the sending module is further configured to send, to the sharing application, target media data required by the sharing 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 aspects via execution of the executable instructions.
In a fourth aspect, an embodiment of the present invention provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the first aspects.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising a computer program for implementing the method of any one of the first aspects when the computer program is executed by a processor.
The method, the device, the equipment and the medium for sharing the media data by the multiple applications provided by the embodiment of the invention are characterized in that the sharing application sends a media data acquisition request to the master application by configuring the master application and the sharing application. After the master control application acquires the original media data, the original media data is encoded according to the recording parameters in the data acquisition request, and then the processed media data is sent to the sharing application, so that the multi-application sharing media data is realized. According to the scheme, through data transmission between the shared application and the main control application, data acquired by two or more applications in one terminal device by using cameras or microphones at the same time is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1a is a schematic diagram of a camera or microphone used in a conventional application provided by the present invention;
FIG. 1b is a schematic diagram of a method for sharing media data by multiple applications according to the present invention;
fig. 2 is a flowchart illustrating a method for sharing media data by multiple applications according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for sharing media data by multiple applications according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating a third embodiment of a method for sharing media data by multiple applications according to the present invention;
FIG. 5 is a schematic diagram of a method for sharing media data by multiple applications according to the present invention;
FIG. 6 is a schematic diagram illustrating an embodiment of a device for sharing media data by multiple applications according to the present invention;
fig. 7 is a schematic structural diagram of a terminal device according to the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which are made by a person skilled in the art based on the embodiments of the invention in light of the present disclosure, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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, the terminal devices such as smart phones and tablets can realize more and more functions, from call answering, internet surfing, photographing, video recording, video call and the like; more and more applications can use cameras or microphones on terminal devices, and users can select applications to record audio and video, photograph or communicate video 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 by calling an interface of the camera or the microphone of the terminal device. When other applications want to use the camera or microphone at the same time, only the application with the highest priority or the application that finally calls the interface of the camera or microphone can use the camera or microphone. Therefore, the existing method of using the camera or the microphone only supports one application to use the data collected by the camera or the microphone, and no scheme for simultaneously using the data collected by the camera or the microphone by two or more applications in one terminal device exists at present.
For example, fig. 1a is a schematic diagram of a camera or a microphone used by an existing application provided by the present invention, as shown in fig. 1a, when the camera or the microphone is used by an application a, an application programming interface (Application Programming Interface, abbreviated as API) of the camera or the microphone is called, if the camera or the microphone is also wanted to be used by an application B at this time, only an application with a higher priority or an application calling the API last can obtain the use permission of the camera or the microphone.
In order to solve the problems in the prior art, the inventor finds that in the process of researching a method for sharing media data by multiple applications, the data acquired by two or more applications by using cameras or microphones in one terminal device can be realized by sharing the media data among the multiple applications. Firstly, configuring a master control application and a sharing application, wherein the sharing application sends query information to the master control application, and sends a media data acquisition request to the master control application if the parameter range of media data which can be provided by the master control application and obtained through the query information meets the recording parameters of the media data required by the sharing application. After receiving the media data acquisition request, the master control application calls an interface of media equipment of the terminal equipment to record the media data, and the obtained original media data is encoded according to recording parameters in the media data acquisition request and is sent to the sharing application through a local port corresponding to a port identifier in the media data acquisition request. Based on the inventive concept, a scheme for 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, as shown in fig. 1b, where the application scenario may include: terminal device 11, master application 12, at least one sharing application (fig. 1b shows two sharing applications, sharing application 13, sharing application 14, respectively).
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 inter-application data transmission, and comprises but not limited to a smart phone, a tablet personal computer and a computer.
In the application scenario shown in fig. 1b, the terminal device 11 is an android system smart phone, and when a user wants to use a camera or a microphone while performing multiple applications, the shared application 13 is opened, and the shared application 13 sends query information to the master application 12, so that the master application 12 returns the parameter range of the media data available by the master application to the shared application 13. When the recording parameters of the media data required by the sharing application 13 are within the parameter range of the media data available to the master application, the sharing application 13 sends a media data acquisition request to the master application 12, and then the master 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.
Accordingly, after receiving the query information sent by the sharing application 13, the master control application 12 obtains the parameter range of the media data supported by the terminal device 11, and sends the parameter range of the media data available to the master control application to the sharing application 13. After receiving the media data acquisition request sent by the sharing application 13, the master control application 12 calls an interface of the media device of the terminal device 11 to record media data, acquires original media data, encodes 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 by the embodiment of the present invention, the embodiment of the present invention does not limit the actual form of the terminal device included in fig. 1b, and also does not limit the forms of the master control application and the sharing application, where the forms of the master control application and the sharing application in the smart phone or the tablet are application programs, the forms of the master control application and the sharing application in the computer are software, and in the specific application of the scheme, the master control application and the sharing application can be set according to the actual requirements.
The technical scheme of the invention is described in detail through specific embodiments. It should be noted that the following 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 invention is carried out, a master control application and a sharing application are required to be configured in the terminal equipment, the master control application is configured as an application for operating an interface of the media equipment, and the sharing application is configured as an application for carrying out media data sharing. The master 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, and the master control application acquires the media data and then sends the acquired media data to the shared application.
The media data includes audio data, video data, and audio-video data.
Fig. 2 is a flowchart of a first embodiment of a method for sharing media data by multiple applications, as shown in fig. 2, where the method for sharing media data by 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 the sharing application to realize the services of shooting video, recording audio or carrying out video call, the user clicks a button on a graphical user interface of the terminal device, and the sharing application needs to judge whether recording parameters of media data needed by the sharing application are within the parameter range of the media data available by the main control application. If the recording parameters of the needed media data are within the parameter range of the media data which can be provided by the master control application, the sharing application sends a media data acquisition request to the master control application. If the recording parameters of the needed media data are not in the parameter range of the media data which can be provided by the main control application, a prompt message is displayed on a graphical user interface of the terminal equipment, and the prompt message is used for prompting the user that the media data of the current camera or microphone do not meet the service requirement.
In this step, when the sharing application determines that the recording parameters of the required media data are within the parameter range of the media data available to the master application, the sharing application sends a media data acquisition request to the master application, where the media data acquisition request includes the port identifier and the recording parameters. The subsequent master control application can encode the original media data according to the recording parameters, and then the processed target media data is sent to the sharing application through the local port corresponding to the port identification.
The recording parameters in the media data acquisition request may be, for example, resolution, sampling rate, and values corresponding to the resolution and the sampling rate, and may also be, for example, frame rate, sampling depth, and values corresponding to the frame rate and the sampling depth. The embodiment of the invention does not specifically limit the recording parameters and the sizes of the recording parameters in the media data acquisition request, and can be selected according to actual conditions.
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, and acquires 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 media data acquisition request, and then invokes an interface of a media device of the terminal device to record the media data, so as to acquire original media data. The master control application determines whether the master control application needs to use the original media data or not, and if the master control application needs to use the original media data, the master control application copies the original media data locally.
For example, if the user wants to record the audio and video through the sharing application, the main control application may call the APIs corresponding to the camera and the microphone to acquire the media data of the audio and video.
For example, when the user uses the master control application to record audio and video and also wants to use the sharing application to perform video call, the master control application copies the original media data after obtaining the original media data, uses one master control application, processes one master control application and sends one master control application to the sharing application.
S203: the main control application sends the target media data needed by the main control application to the sharing application according to the original media data, the port identification and the recording parameter in the media data acquisition request, and the target media data is obtained by encoding the original media data.
In this step, after the master control application obtains the original media data, the media data is encoded according to the recording parameters in the media data obtaining request, so as to obtain the target media data. And then, according to the port identification in the media data acquisition request, a local port of the corresponding terminal equipment system is found, and then the target media data is sent to the sharing application through the local port.
According to the method for sharing media data by multiple applications, the media data acquisition request is sent to the master control application through the sharing application, and the master control application directly calls the interface of the media device after receiving the media data acquisition request to obtain the original media data. The master 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 sharing application through the local port, so that the data acquired by two or more applications in one terminal device by using cameras or microphones at the same time is realized.
Fig. 3 is a flow chart of a second embodiment of a method for sharing media data by multiple applications provided by the present invention, as shown in fig. 3, in this embodiment, the step S203 may be implemented by:
s301: and the main control application encodes the original media data according to the recording parameters to obtain target media data.
In this step, after the master control application obtains the original media data, the master control application encodes the original media data according to the recording parameters in the media data obtaining 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.
For example, the recording parameter is 1280ppi×720ppi, and the sampling rate is 44.1KHz, and then the master application encodes the original media data into target media data with a resolution of 1280ppi×720ppi and a sampling rate of 44KHz after obtaining the original media data.
Optionally, S302: and the main control application compresses the target media data to obtain the compressed target media data.
In this step, after the main control application obtains the target media data, the main control application may further selectively compress the target media data to obtain the compressed target media data. The compression processing of the target media data can reduce the storage space occupied by the target media data and accelerate the transmission speed.
It should be noted that, the case of selecting to compress the target media data may be: when a worker configures a main control application, a preset space threshold is set in the main control application, and after the main control application acquires target media data, if the main control application judges that the occupied storage space of the target media data exceeds the preset space threshold, the target media data is compressed. The case of selecting to compress the target media data may also be: after the target media data is obtained, the main control application directly compresses the target media data. The embodiment of the invention does not limit the condition of selecting to compress the target media data or limit the preset space threshold value, and can be selected and set according to the actual condition.
S303: the master control application sends the target media data to the sharing application through the local port corresponding to the port identification.
In this step, after the master control application obtains the target media data, the local port in the corresponding terminal device system is found through the port identifier in the media data obtaining request, and the target media data is sent to the sharing application through the local port.
Optionally, if the master control application compresses the target media data after obtaining the target media data, the target media data after the compression is sent to the sharing application through the local port.
According to the method for sharing media data by multiple applications, the primary media data is encoded by the master control application, and the target media data is obtained and then sent to the sharing application. The main control application can also select to compress the target media data, and the compressed target media data is generated to the sharing application. The method and the device realize that two or more applications in one terminal device use the data collected by the camera or the microphone at the same time, and simultaneously improve the data transmission efficiency.
Fig. 4 is a flow chart of a third embodiment of a method for sharing media data by multiple applications provided by the present invention, as shown in fig. 4, on the basis of the above embodiment, before the sharing application sends a media data acquisition request to a master 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.
Because before the sharing application sends the media data obtaining request to the master application, it needs to determine whether the recording parameters of the media data needed by the sharing application are within the parameter range of the media data available to the master application, the sharing application needs to obtain the parameter range of the media data available to the master application before sending the media data obtaining request to the master application.
In this step, the sharing application sends query information to the master application, where the query information is used to query a parameter range of media data that can be provided by the master application.
It should be noted that, the triggering event that the sharing application sends the query information to the master application may be: the user wants to use the sharing application to realize services such as shooting video, recording audio or making video call, and clicks a button on a graphical user interface of the terminal device. The trigger event that the sharing application sends the query information to the master application may also be: after the master application and the sharing application are configured, the sharing application is started for the first time. The embodiment of the invention does not limit the triggering event of sending the query information to the main control application by the sharing application, and can be selected according to actual conditions.
S402: and the main 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 sharing application sends the query information to the master control application, the master control application receives the query information, so that the parameter range of the media data supported by the terminal device can be directly obtained.
Exemplary parameter ranges of the media data supported by the terminal device include: resolution ranges from 630ppi 360ppi to 3840ppi 2160ppi, frame rate ranges from 10fps to 120fps, sampling depth ranges from 16Bit to 24Bit, and sampling rate ranges from 44.1KHz to 48KHz. The embodiment of the invention does not limit the parameters and the parameter range of the media data supported by the terminal equipment, and can be selected according to actual conditions.
S403: and 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.
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 in which the master application obtains the parameter ranges of the media data that the master application can provide may be: after the main control application obtains the parameter range of the media data supported by the terminal equipment, the number of sharing applications for sharing the media data at the moment is obtained, and the parameter range of the media data which can be provided by the main control application is determined according to the number of sharing applications. The method comprises the steps of setting a mapping relation between the number of sharing applications for sharing media data and the proportion in a master control application, finding out the corresponding proportion according to the number, and selecting the range of the proportion from the parameter ranges of the media data supported by terminal equipment as the parameter range of the media data which can be provided by the master control application. The number of sharing 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 available by the master control application; the number of sharing applications for sharing 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 available by the master control application.
The manner in which the master application obtains the parameter ranges of the media data that the master application can provide 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 sharing application according to the number of sharing applications in the terminal device. The main control application is provided with a mapping relation between the number and the proportion of the shared application, the corresponding proportion is found according to the number, and the range of the proportion is selected from the parameter ranges of the media data supported by the terminal equipment and is used as the parameter range of the media data which can be provided by the main control application. The number of the shared applications in the terminal equipment is 1, the corresponding proportion is 100%, and the parameter range of the media data supported by the terminal equipment is used as the parameter range of the media data which can be provided by the main control application; the number of 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 which can be provided by the master control application.
S404: the master application sends the 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 application, the master application may send the parameter range to the sharing application, so that the subsequent sharing application may determine whether to send the media data acquisition request to the master application according to the parameter range of the media data that can be provided by the master application.
According to the method for sharing media data by multiple applications, the sharing application sends the query request to the master control application, and then the master control application determines the parameter range of the media data which can be provided by the master control application and sends the parameter range to the sharing application, so that the sharing 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 which can be provided by the master control application, normal operation of terminal equipment is guaranteed, and the problems of large data quantity and halt of the terminal equipment are avoided.
The method for sharing media data by multiple applications provided by the embodiment of the present invention is illustrated by a specific example.
FIG. 5 is a schematic diagram of a method for sharing media data by multiple applications according to the present invention; as shown in fig. 5, the terminal device is a terminal device of an android system, and a master control application and a sharing application are configured in the terminal device, where 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 by the audio and video recording tool provided by the android to record the audio and video files into the original video data and the audio data, and when only the master control application performs the local video file recording service, the acquired audio and video data are converged into the media data processing module. At this time, only the recording parameters of the master control application are stored in the media behavior decision module, and the media data processing module performs operations such as watermark adding, watermark decoding and the like according to the parameters and then writing the watermark into the local video file.
At this time, the sharing application also expects to use the device camera and MIC to perform video call, and then queries the current available recording specification from the master control application through the device sharing interface, and when the current available recording specification meets the recording requirement of itself, sends a media data acquisition request to the master control application through the device operation interface. The device operation interface realization module in the main control application receives the media data acquisition request, and then sends the media data acquisition request to the media behavior decision module, and the media behavior decision module decides and then sends the media data acquisition request to the media data processing module. And the media data processing module copies and codes the acquired audio and video data according to the recording parameters in the media data acquisition request, and sends the coded audio and video data to the sharing application through the local port. After the sharing application obtains the data, the data can be sent to a designated server according to the service requirement.
According to the method for sharing media data by multiple applications, the media data acquisition request is sent to the master control application through the sharing application, the master control application copies the acquired audio and video data, one copy is processed according to the recording parameters of the master control application, the other copy 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 are sent to the sharing application, so that data acquired by two or more applications in one terminal device by using cameras or microphones at the same time is realized.
The following are examples of the apparatus of the present invention that may be used to perform the method embodiments of the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, please refer to the embodiments of the method of the present invention.
FIG. 6 is a schematic diagram illustrating an embodiment of a device for sharing media data by 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 sharing application, where the sharing 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 sharing application;
the processing module 62 is configured to invoke, by the master control application according to the media data acquisition request, an interface of a media device of the terminal device to record media data, and acquire original media data;
the sending module 61 is further configured to send, to the sharing application, target media data required by the sharing 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 or not;
if the master control application itself needs to use the original media data, the original media data is copied locally.
Further, the processing module 62 is further configured to encode the original media data according to the recording parameter by the master control application to obtain the target media data.
Further, the sending module 61 is specifically configured to send, by using the local port corresponding to the port identifier, the target media data to the sharing application.
Further, the processing module 62 is further configured to compress the target media data by the master control application, so as to obtain the compressed target media data.
Further, the sending module 61 is specifically further configured to send the compressed target media data to the sharing application through the local port corresponding to the port identifier by using the master control application.
Further, the sending module 61 is further configured to send query information to the master application by using the sharing application, where the query information is used to query a parameter range of media data that can be provided by the master application.
Further, the processing module 62 is further configured to obtain, according to the query information, a parameter range of media data supported by the terminal device by using the master control application.
Further, the processing module 62 is further configured to obtain, by the master application, a parameter range of media data that can be provided by the master application according to the parameter range of media data supported by the terminal device.
Further, the sending module 61 is further configured to send, by the master application, a parameter range of media data that can be provided by the master application to the sharing application.
Further, the sending module 61 is specifically configured to send, by the sharing application, the media data obtaining request to the master application when the recording parameter of the media data required by the sharing application is within a parameter range of the media data available to the master application.
Further, the processing module 62 is specifically configured to determine, by the master application, a parameter range of media data supported by the terminal device, or a subset of the parameter range of media data supported by the terminal device, as a parameter range of media data that can be provided by the master application.
The device for sharing media data by multiple applications provided in this embodiment is configured to execute the technical scheme in any of the foregoing method embodiments, and its implementation principle and technical effect are similar, and are not described herein again.
Fig. 7 is a schematic structural diagram of a terminal device according to 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 for storing executable instructions of the processor 71;
wherein the processor 71 is configured to perform the technical solution of any of the method embodiments described above via execution of 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 apparatus 70 may further include:
and a bus for connecting the devices.
The terminal device is configured to execute the technical scheme in any of the foregoing method embodiments, and its implementation principle and technical effects are similar, and are not described herein again.
The embodiment of the invention also provides a readable storage medium, on which a computer program is stored, which when executed by a processor implements the technical solution provided by any of the foregoing embodiments.
The embodiment of the invention also provides a computer program product, which comprises a computer program, wherein the computer program is used for realizing the technical scheme provided by any one of the method embodiments when being executed by a processor.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features can be replaced equivalently; such modifications and substitutions do not depart from the spirit of the invention.

Claims (8)

1. A method for sharing media data by multiple applications, characterized in that the method is applied to a terminal device, in which a plurality of applications are installed, wherein the plurality of applications include a master application configured to operate an interface of a media device and at least one sharing application configured to require media data sharing, the method comprising:
responding to media data recording operation of a user on any sharing application, wherein the sharing application sends a media data acquisition request to a main control application, and the media data acquisition request comprises a port identification and recording parameters;
the master control application calls an interface of media equipment of the terminal equipment to record media data according to the media data acquisition request, and acquires original media data;
the master control application sends target media data required by the master control application to the sharing application according to the original media data, the port identification and the recording parameter in the media data acquisition request, and the target media data is obtained by encoding the original media data;
the method further comprises the steps of:
the master control application determines whether the master control application needs to use the original media data or not;
if the master control application needs to use the original media data, the original media data is copied locally;
the master control application sends the target media data needed by the master control application to the sharing application according to the original media data, the port identification and the recording parameter in the media data acquisition request, and the target media data comprises:
the master control application encodes 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 the local port corresponding to the port identifier.
2. The method according to claim 1, wherein the method further comprises:
the main control application compresses the target media data to obtain compressed target media data;
correspondingly, the master control application sends the target media data to the sharing application through the local port corresponding to the port identifier, and the method comprises the following steps:
and the main control application sends the target media data after compression processing to the sharing application through the local port corresponding to the port identifier.
3. The method of claim 1, wherein before the sharing application sends the media data retrieval 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 main control application obtains the parameter range of the media data supported by the terminal equipment according to the query information;
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;
the master application sends a parameter range of media data available to the master application to the sharing application.
4. A method according to claim 3, wherein the sharing application sending a media data acquisition request to a master application comprises: and when the recording parameters of the media data required by the sharing application are within the parameter range of the media data available by the master application, the sharing application sends the media data acquisition request to the master application.
5. A method according to claim 3, wherein the master application obtaining the parameter range of the media data available to 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 equipment or the subset of the parameter range of the media data supported by the terminal equipment as the parameter range of the media data which can be provided by the master control application.
6. An apparatus for sharing media data by multiple applications, comprising:
the sending module is used for responding to the media data recording operation of a user on any sharing application, and the sharing application sends a media data acquisition request to a main control application, wherein the media data acquisition request comprises a port identification and recording parameters;
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 master control application to acquire original media data;
the sending module is further configured to send, to the sharing application, target media data required by the host 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;
the processing module is further used for determining whether the master control application needs to use the original media data or not; if the master control application needs to use the original media data, the original media data is copied locally;
the processing module is further used for encoding the original media data according to the recording parameters by the master control application to obtain the target media data;
the sending module is specifically configured to send, by the master control application through the local port corresponding to the port identifier, the target media data to the sharing application.
7. 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 one of claims 1 to 5 via execution of the executable instructions.
8. A readable storage medium having stored thereon a computer program, which when executed by a processor implements the method of any of claims 1 to 5.
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 CN114422837A (en) 2022-04-29
CN114422837B true 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 (13)

* 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
KR20120100358A (en) * 2011-03-04 2012-09-12 세크론 주식회사 Image processing method and apparatus
CN103716290A (en) * 2012-10-09 2014-04-09 上海博路信息技术有限公司 Method for sharing mobile phone shooting capability
CN104918112A (en) * 2014-03-13 2015-09-16 深圳Tcl新技术有限公司 Camera resource application method and device
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

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200832274A (en) * 2007-01-17 2008-08-01 Asustek Comp Inc Video processing method and system for a virtual camera
US20130325952A1 (en) * 2012-06-05 2013-12-05 Cellco Partnership D/B/A Verizon Wireless Sharing information
EP2926233A4 (en) * 2012-11-29 2016-07-13 Edsense L L C System and method for displaying multiple applications
US9262304B2 (en) * 2013-09-05 2016-02-16 Google Inc. Methods and systems for testing interactions between mobile applications
WO2015171549A2 (en) * 2014-05-05 2015-11-12 Citrix Systems, Inc. Facilitating communication between mobile applications

Patent Citations (13)

* 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
KR20120100358A (en) * 2011-03-04 2012-09-12 세크론 주식회사 Image processing method and apparatus
CN103716290A (en) * 2012-10-09 2014-04-09 上海博路信息技术有限公司 Method for sharing mobile phone shooting capability
CN104918112A (en) * 2014-03-13 2015-09-16 深圳Tcl新技术有限公司 Camera resource application method and device
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多播技术及其应用;谢天舜, 朱祥华;电信工程技术与标准化(第03期);全文 *

Also Published As

Publication number Publication date
CN114422837A (en) 2022-04-29

Similar Documents

Publication Publication Date Title
CN103475572B (en) Method, device and system for sending multiple pictures in instant messaging application
CN109101335B (en) Extending functionality of a host device
CN109257646A (en) Method for processing video frequency, device, electronic equipment and computer-readable medium
CN109348167B (en) Wireless auxiliary stream data transmission method and system based on video conference system
CN106453572B (en) Method and system based on Cloud Server synchronous images
CN110955541B (en) Data processing method, device, chip, electronic equipment and readable storage medium
CN115525453B (en) Multi-screen collaborative interrupt processing method and electronic equipment
US20180014063A1 (en) Method and Apparatus for Accessing a Terminal Device Camera to a Target Device
CN113727035A (en) Image processing method, system, electronic device and storage medium
CN112055072A (en) Cloud audio input method and device, cloud system, electronic equipment and storage medium
WO2021088671A1 (en) Method for calling terminal capability, device, and computer storage medium
CN110166564B (en) Information communication method, terminal and storage medium
CN114422837B (en) Method, device, equipment and medium for sharing media data by multiple applications
CN113282548A (en) File saving method and device, electronic equipment and storage medium
CN114974324A (en) Method for recording call audio by earphone, earphone and storage medium
CN116052701A (en) Audio processing method and electronic equipment
CN114691067A (en) Screen projection method and electronic equipment
CN113642010B (en) Method for acquiring data of extended storage device and mobile terminal
CN114566173A (en) Audio mixing method, device, equipment and storage medium
CN114816789A (en) File processing method based on cloud application, electronic device and storage medium
KR100713148B1 (en) Mobile Terminal Equipment and Multimedia Resources Sharing Technology among Mobile Terminal Equipments and Stationary Terminal Equipments
CN112948046A (en) Screen capturing method, device, equipment and storage medium
JP2006524973A (en) System for controlling camera resources in portable devices
CN111142737A (en) Setting method of mobile terminal, mobile terminal and computer storage medium
CN114884925B (en) Method, device and system for transmitting composite photo data and electronic equipment

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