CN109068059B - Method for calling camera, mobile terminal and storage medium - Google Patents

Method for calling camera, mobile terminal and storage medium Download PDF

Info

Publication number
CN109068059B
CN109068059B CN201810980731.5A CN201810980731A CN109068059B CN 109068059 B CN109068059 B CN 109068059B CN 201810980731 A CN201810980731 A CN 201810980731A CN 109068059 B CN109068059 B CN 109068059B
Authority
CN
China
Prior art keywords
camera
information
mobile terminal
calling
request
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
CN201810980731.5A
Other languages
Chinese (zh)
Other versions
CN109068059A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810980731.5A priority Critical patent/CN109068059B/en
Publication of CN109068059A publication Critical patent/CN109068059A/en
Application granted granted Critical
Publication of CN109068059B publication Critical patent/CN109068059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging

Abstract

The application is applicable to the technical field of communication, and provides a method for calling a camera, a mobile terminal and a computer readable storage medium, wherein the method comprises the following steps: monitoring whether an application program sends a calling request for calling a camera or not in the mobile terminal, if so, generating first information based on the calling request, wherein the data frame format of the first information is a data frame format supported by the camera of the mobile terminal, and sending the first information to the camera to indicate the camera to return a corresponding preview image according to the first information.

Description

Method for calling camera, mobile terminal and storage medium
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a method for invoking a camera, a mobile terminal, and a computer-readable storage medium.
Background
Android 5.0 starts to design a new Application Programming Interface (API) for photographing, and the newly added API not only greatly improves the photographing function of the Android system, but also supports the output of photos in RAW format, and even allows the Application to adjust the photographing parameters of the camera, such as a focusing mode, an exposure mode, a shutter, and the like.
However, as the API of the camera is upgraded, the architecture of the camera is also updated, so that the problem that the application installed on the mobile terminal is incompatible when calling the API of the camera to preview or take a picture occurs.
Disclosure of Invention
In view of this, embodiments of the present application provide a method for calling a camera, a terminal device, and a computer-readable storage medium, so as to solve the problem that an application program is not compatible when calling the camera to preview or take a picture.
A first aspect of an embodiment of the present application provides a method for invoking a camera, including:
monitoring whether an application program in the mobile terminal sends a calling request for calling a camera or not;
if an application program in the mobile terminal sends a calling request for calling a camera, generating first information based on the calling request, wherein the data frame format of the first information is a data frame format supported by the camera of the mobile terminal;
and sending the first information to the camera to instruct the camera to return a corresponding preview image according to the first information.
A second aspect of an embodiment of the present application provides a mobile terminal, including:
the calling request monitoring unit is used for monitoring whether an application program in the mobile terminal sends a calling request for calling the camera;
the mobile terminal comprises a first information generating unit, a second information generating unit and a processing unit, wherein the first information generating unit is used for generating first information based on a calling request of calling a camera if an application program in the mobile terminal is monitored to send out the calling request of calling the camera, and the data frame format of the first information is a data frame format supported by the camera of the mobile terminal;
and the first information sending unit is used for sending the first information to the camera so as to instruct the camera to return a corresponding preview image according to the first information.
A third aspect of an embodiment of the present application provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect of the embodiment of the present application when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product comprising a computer program that, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
The embodiment of the application provides a method for calling a camera, which includes monitoring whether an application program in a mobile terminal sends a call request for calling the camera or not by using a middleware, if the application program in the mobile terminal sends the call request for calling the camera, generating first information based on the call request, sending the first information to the camera, so as to indicate the camera to return a corresponding preview image according to the first information, and because the middleware provided by the embodiment of the application can monitor that the application program in the mobile terminal sends the call request for calling the camera, converting the call request for the application program into the first information supported by the camera of the mobile terminal, and indicating the camera to return the corresponding preview image according to the first information by the first information, therefore, even if the camera system is upgraded, the upgraded interface may not recognize the call request sent by some application programs, however, the call request which cannot be recognized by the camera system can be converted into the first information which can be recognized by the camera through the middleware, so that the camera system can return corresponding preview images according to the first information, and the problem that the application programs are incompatible when calling the camera to preview images or take pictures after the system of the camera is upgraded is solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic implementation flow diagram of a method for invoking a camera according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an implementation flow of another method for invoking a camera according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an implementation flow of another method for invoking a camera according to an embodiment of the present disclosure;
fig. 4 is a schematic block diagram of a mobile terminal according to an embodiment of the present application;
fig. 5 is a schematic block diagram of another mobile terminal provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic implementation flow diagram of a method for invoking a camera according to an embodiment of the present application, where as shown in the figure, the method may include the following steps:
step S101, monitoring whether an application program in the mobile terminal sends a calling request for calling a camera.
In the embodiment of the present application, a plurality of application programs having a right to call a camera may be installed in a mobile terminal such as a mobile phone, for example, some application programs having a code scanning function and some application programs having a beauty and photo taking function, the application programs may all need to call a camera in the mobile terminal in actual use, the camera of the mobile terminal includes a hardware module and a software system, and after the software system of the camera is upgraded, some APIs may also be changed accordingly, so that after the software system of the camera is upgraded, some application programs may not call the camera, or the application programs may need to upgrade themselves to call the camera so as to call the camera. However, some application publishers may not modify their own software systems in time, and therefore, there is a need to provide middleware by which even non-upgraded applications can invoke upgraded cameras. In order to implement the above functions, the middleware needs to monitor whether an application program in the mobile terminal sends a call request for calling the camera.
Step S102, if it is monitored that an application program in the mobile terminal sends a call request for calling a camera, first information is generated based on the call request, and the data frame format of the first information is the data frame format supported by the camera of the mobile terminal.
In the embodiment of the application, if it is monitored that an application program in the mobile terminal sends a call request for calling a camera, the call request may be intercepted or not intercepted, for example, it is determined whether a data frame format of the call request is consistent with a data frame format supported by the camera of the mobile terminal, if so, no interception is needed, and also no middleware is needed to convert the call request into first information supported by the camera of the mobile terminal, if not, interception may be performed, and first information is generated based on the call request, and of course, a data format of the generated first information is the data frame format supported by the camera of the mobile terminal.
Step S103, sending the first information to the camera to instruct the camera to return a corresponding preview image according to the first information.
In this embodiment of the application, after the middleware converts the call request into the first information that can be supported by the camera, the first information can be sent to the camera instead of the call request, the camera can return a corresponding preview image according to the first information after receiving the first information that can be identified, the camera can return the preview image to the middleware, the middleware returns the preview image to the application program that calls the camera, and the application program side can perform related operations such as code scanning recognition and beauty treatment after receiving the preview image. In practical applications, the camera may also directly return the preview image to the application program currently running in the foreground, so that the preview image is indirectly sent to the application program calling the camera without using middleware as a relay.
The middleware provided by the embodiment of the application can monitor that an application program sends a calling request for calling a camera in the mobile terminal, the calling request of the application program is converted into first information supported by the camera of the mobile terminal, and the camera is indicated by the first information to return corresponding preview images according to the first information, so that even if a camera system is upgraded, the calling request sent by some application programs cannot be identified by an interface possibly after the upgrading, however, the calling request which cannot be identified by the camera system can be converted into the first information which can be identified by the camera through the middleware, so that the camera system can return corresponding preview images according to the first information, and the problem that the application program is incompatible when the camera is called to preview images or take pictures after the system of the camera is upgraded is solved.
Fig. 2 is a schematic implementation flow diagram of another method for invoking a camera according to an embodiment of the present disclosure, where as shown in the figure, the method may include the following steps:
step S201, monitoring whether an application program in the mobile terminal sends a call request for calling a camera.
The content of step S201 is consistent with that of step S101, and the description of step S101 may be specifically referred to, which is not repeated herein.
Step S202, if it is monitored that an application program in the mobile terminal sends a calling request for calling a camera, a configuration file of the application program sending the calling request is obtained, and whether the application program is compatible with the camera of the mobile terminal is determined based on the configuration file.
Step S203, if the application program is not compatible with the camera of the mobile terminal, generating first information based on the calling request.
In the embodiment of the present application, the embodiment shown in fig. 1 describes that whether to convert the call request into the first information may be determined by comparing a data frame format of the call request with a data frame format supported by the camera, and in the embodiment of the present application, it may be determined whether the application is compatible with the camera of the mobile terminal by obtaining a configuration file of the application that issues the call request, and if so, the call request does not need to be converted into the first information. If not, first information needs to be generated based on the calling request.
Certainly, in practical application, the configuration file of the application program having the authority to call the camera may also be periodically scanned, an application program list that needs to convert the call request into the first information is generated, and the update may be performed at preset intervals. Therefore, if it is monitored that an application program in the mobile terminal sends a call request for calling a camera, it is only necessary to determine whether the application program sending the call request is in the application program list, and if the application program sending the call request is in the application program list, the call request is generated into first information, and if the application program sending the call request is not in the application program list, the call request does not need to be processed, and the camera can recognize the call request.
As another embodiment of the present application, the generating the first information based on the invocation request includes:
and acquiring preset shooting parameters from the calling request of the application program or a configuration file based on the calling request, and generating first information according to the preset shooting parameters, wherein the first information is used for indicating the camera to modify hardware parameters of the camera according to the preset shooting parameters, and returning a preview image matched with the preset shooting parameters.
In the embodiment of the present application, since different applications may need to set different shooting parameters based on their respective functional requirements, for example, shooting parameters of code scanning software and shooting parameters of beauty software may be different, and these shooting parameters are usually stored in a configuration file, and some applications may also encode corresponding shooting parameters into a call request. The middleware may obtain a preset shooting parameter from the call request of the application program or from the configuration file, and generate the first information according to the preset shooting parameter, and of course, a data frame format of the first information including the preset shooting parameter also needs to conform to a data frame format supported by the camera.
Step S204, the first information is sent to the camera to indicate the camera to return a corresponding preview image according to the first information.
In the embodiment of the application, after first information containing preset shooting parameters is obtained, the first information containing the preset shooting parameters can be sent to the camera, the camera can modify hardware parameters of the camera according to the preset shooting parameters after receiving the first information, and preview images are collected through the camera after the hardware parameters are modified, namely the returned preview images are images matched with the preset shooting parameters.
In practical application, after the camera receives the first information, the camera may also obtain the preset shooting parameters from the configuration file of the corresponding application program according to the first information. And then, modifying the hardware parameters of the camera according to the preset shooting parameters, and acquiring a preview image through the camera after the hardware parameters are modified.
Fig. 3 is a schematic implementation flow diagram of another method for invoking a camera according to an embodiment of the present disclosure, where as shown in the figure, the method may include the following steps:
step S301, monitoring whether an application program in the mobile terminal sends a calling request for calling a camera.
Step S302, if it is monitored that an application program in the mobile terminal sends a call request for calling a camera, preset shooting parameters are obtained from the call request of the application program or a configuration file based on the call request.
Step S301 and step S302 can refer to the related descriptions in the embodiments shown in fig. 1 and fig. 2, and are not described herein again.
Step S303, generating a first information queue according to the preset shooting parameters, and sequentially sending the first information in the first information queue to the camera at preset time intervals, so as to instruct the camera to return a preview image matched with the preset shooting parameters according to each received first information.
In this embodiment, in order to simplify communication between the middleware and the application program, a first information queue may be generated according to the preset shooting parameter, that is, a plurality of first information are generated, the plurality of first information are sequentially sent to the camera at a preset time interval, and the camera returns a preview image every time it receives one first information. In this way, an uninterrupted preview image is obtained through the middleware once the application begins to call the camera. In this way, the user can see a real-time preview image on the application side. The first information transmitted at this time includes preset shooting parameters, which can also be understood as shooting parameters initialized by the application program.
Of course, in the actual use of the application program, there may be a function of modifying the shooting parameters based on the user's requirements, and the application program may send a request for modifying the shooting parameters; the beauty photography software may also want to obtain not only preview images but also photographs, so the application may also issue a photograph request for photography; of course, if the first message in the first message queue is sent to the camera without interruption, the preview image is returned without interruption, and the application may also have a request to stop the preview. The following description is made by way of the above examples.
Step S304, if a modification request of the shooting parameters is monitored, a first information queue is regenerated based on the shooting parameters to be modified corresponding to the modification request, first information in the first information queue is sequentially sent to the camera at preset time intervals so as to instruct the camera to modify hardware parameters of the camera according to the shooting parameters to be modified, and a preview image matched with the modified shooting parameters is returned according to each piece of first information.
In the embodiment of the present application, a user may modify some shooting parameters in an interface of an application, for example, adjust a focal length, turn on a blurring function, and the like. If the middleware monitors the modification request of the shooting parameters, the middleware indicates that a user possibly wants to modify the initialized shooting parameters into the shooting parameters required by the user, the shooting parameters are recorded as the shooting parameters to be modified, the middleware regenerates the first information queue according to the shooting parameters to be modified, and the original first information queue (containing the initialized shooting parameters) is emptied. And continuously and sequentially sending the first information in the first information queue generated based on the shooting parameters to be modified to the camera at preset time intervals so as to instruct the camera to modify the hardware parameters of the camera according to the shooting parameters to be modified, and returning a preview image matched with the modified shooting parameters according to each piece of first information.
It should be noted that, each time a modification request of the shooting parameters is monitored, the first information queue needs to be regenerated according to the shooting parameters expected to be modified, and the original first information queue needs to be deleted, two storage spaces can be allocated, the first storage space stores a first information queue and sends the first information in the first storage space to the camera, if the modification request of the shooting parameters is monitored, the first information queue is regenerated in the second storage space according to the shooting parameters to be modified, after the first information with the first preset quantity is generated in the second storage space, the first information queue of the second storage space is covered on the first information queue of the first storage space, and after the quantity of the first information in the information queue of the first storage space is smaller than the second preset quantity, the first information continues to be generated in the first storage space.
Step S305, if it is monitored that the application program calling the camera sends out a photographing request for photographing, second information is generated based on the photographing request and sent to the camera, the data frame format of the second information is the data frame format supported by the camera of the mobile terminal, the second information comprises format parameters of an image requested to be returned by the camera, and the priority of the second information is higher than that of the first information.
In this embodiment of the application, if it is monitored that the application calling the camera sends a photographing request for photographing, the middleware may generate second information, where the second information is obtained by adding a format parameter of an image requested to be returned by the camera to the first information, that is, by adding a piece of data to the first request, where the piece of data includes the format parameter of the image requested to be returned by the camera, and usually defaults to an image format, and after monitoring that the application calling the camera sends a photographing request for photographing, the middleware generates second information, where the second information is obtained by adding the format parameter of the image to the first information. The camera, upon receiving the second information, may return an image in a particular format. Of course, the second information has a higher priority than the first information, i.e. once the second information is generated, it is sent to the camera in preference to the next first information to be sent.
Step S306, if an exit instruction of the application program of the camera or an instruction of stopping the preview is monitored, terminating the sending of the first information.
In this embodiment of the application, if the middleware monitors an exit instruction of an application program calling the camera or an instruction of stopping preview, it indicates that the user no longer needs to use the camera. The second information corresponding to the photographing request is the sending of the single information and the returning of the single photo, while the first information corresponding to the calling request is sent uninterruptedly and returned uninterruptedly, so that if the user does not need to use the camera any more, the sending of the first information needs to be terminated, and the preview image can not be returned any more.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 is a schematic block diagram of a mobile terminal according to an embodiment of the present application, and only a portion related to the embodiment of the present application is shown for convenience of description.
The mobile terminal 4 may be a software unit, a hardware unit or a combination of software and hardware unit built in a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, etc., or may be integrated into a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, etc., as an independent pendant. The mobile terminal is integrated with the middleware in the method embodiment.
The mobile terminal 4 includes:
a call request monitoring unit 41, configured to monitor whether an application program in the mobile terminal sends a call request for calling a camera;
a first information generating unit 42, configured to generate first information based on a call request sent by an application program in the mobile terminal if it is monitored that the application program in the mobile terminal sends the call request for calling a camera, where a data frame format of the first information is a data frame format supported by the camera of the mobile terminal;
a first information sending unit 43, configured to send the first information to the camera, so as to instruct the camera to return a corresponding preview image according to the first information.
Optionally, the first information generating unit 42 includes:
the camera management system comprises a configuration file acquisition module, a camera management module and a camera management module, wherein the configuration file acquisition module is used for acquiring a configuration file of an application program which sends a calling request if the application program sends the calling request for calling the camera in the mobile terminal is monitored, and determining whether the application program is compatible with the camera of the mobile terminal or not based on the configuration file;
and the first information generation module is used for generating first information based on the calling request if the application program is not compatible with the camera of the mobile terminal.
Optionally, the first information generating unit 42 is further configured to:
and acquiring preset shooting parameters from the calling request of the application program or a configuration file based on the calling request, and generating first information according to the preset shooting parameters, wherein the first information is used for indicating the camera to modify hardware parameters of the camera according to the preset shooting parameters, and returning a preview image matched with the preset shooting parameters.
Optionally, the first information generating unit 42 is further configured to:
generating a first information queue according to the preset shooting parameters;
correspondingly, the first information sending unit 43 is further configured to:
and sequentially sending the first information in the first information queue to the camera at preset time intervals so as to instruct the camera to return a preview image matched with preset shooting parameters according to each received first information.
Optionally, the mobile terminal 4 further includes:
a shooting parameter modifying unit 44, configured to, if a modification request of the shooting parameter is monitored, regenerate a first information queue based on the shooting parameter to be modified corresponding to the modification request, and sequentially send first information in the first information queue to the camera at a preset time interval, so as to instruct the camera to modify a hardware parameter of the camera according to the shooting parameter to be modified, and return a preview image matched with the modified shooting parameter according to each first information.
Optionally, the mobile terminal 4 further includes:
a second information sending unit 45, configured to generate second information based on a photographing request and send the second information to the camera if it is monitored that an application program calling the camera sends the photographing request for photographing, where a data frame format of the second information is a data frame format supported by the camera of the mobile terminal, the second information includes a format parameter requesting an image returned by the camera, and a priority of the second information is greater than that of the first information.
Optionally, the mobile terminal 4 further includes:
a first information stopping unit 46, configured to terminate sending of the first information if an exit instruction of the application program calling the camera or an instruction of stopping the preview is monitored.
It will be apparent to those skilled in the art that, for convenience and simplicity of description, the foregoing functional units and modules are merely illustrated in terms of division, and in practical applications, the foregoing functional allocation may be performed by different functional units and modules as needed, that is, the internal structure of the mobile terminal is divided into different functional units or modules to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the mobile terminal may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Fig. 5 is a schematic block diagram of a mobile terminal according to another embodiment of the present application. As shown in fig. 5, the mobile terminal 5 of this embodiment includes: one or more processors 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processors 50. The processor 50, when executing the computer program 52, implements the steps in the above-described embodiments of the method for invoking a camera, such as the steps S101 to S103 shown in fig. 1. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the modules/units in the above-described mobile terminal embodiments, such as the functions of the modules 41 to 43 shown in fig. 4.
Illustratively, the computer program 52 may be partitioned into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 52 in the mobile terminal 5. For example, the computer program 52 may be divided into a call request monitoring unit, a first information generating unit, and a first information transmitting unit.
The calling request monitoring unit is used for monitoring whether an application program in the mobile terminal sends a calling request for calling the camera;
the first information generating unit is used for generating first information based on a calling request if it is monitored that an application program in the mobile terminal sends the calling request for calling the camera, and the data frame format of the first information is a data frame format supported by the camera of the mobile terminal;
the first information sending unit is configured to send the first information to the camera to instruct the camera to return a corresponding preview image according to the first information.
Other units or modules can be referred to the description of the embodiment shown in fig. 4, and are not described again here.
The mobile terminal includes, but is not limited to, a processor 50, a memory 51. Those skilled in the art will appreciate that fig. 5 is only one example of a mobile terminal 5 and is not intended to limit the mobile terminal 5 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the mobile terminal may also include input devices, output devices, network access devices, buses, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the mobile terminal 5, such as a hard disk or a memory of the mobile terminal 5. The memory 51 may also be an external storage device of the mobile terminal 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the mobile terminal 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the mobile terminal 5. The memory 51 is used for storing the computer program and other programs and data required by the mobile terminal. The memory 51 may also be used to temporarily store data that has been output or is to be output.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed mobile terminal and method may be implemented in other ways. For example, the above-described embodiments of the mobile terminal are merely illustrative, and for example, the division of the modules or units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for calling a camera, applied to a scene in which an application on a mobile terminal is incompatible with the camera, the method comprising:
monitoring whether an application program in the mobile terminal sends a calling request for calling a camera or not;
if an application program in the mobile terminal sends a calling request for calling a camera, generating first information based on the calling request, wherein the data frame format of the first information is a data frame format supported by the camera of the mobile terminal;
and sending the first information to the camera to instruct the camera to return a corresponding preview image according to the first information.
2. The method for invoking a camera according to claim 1, wherein if it is monitored that an application program in the mobile terminal sends an invocation request for invoking a camera, generating the first information based on the invocation request comprises:
if the situation that an application program in the mobile terminal sends a calling request for calling a camera is monitored, acquiring a configuration file of the application program sending the calling request, and determining whether the application program is compatible with the camera of the mobile terminal or not based on the configuration file;
and if the application program is not compatible with the camera of the mobile terminal, generating first information based on the calling request.
3. The method of invoking a camera according to claim 1, wherein said generating first information based on the invocation request comprises:
and acquiring preset shooting parameters from the calling request of the application program or a configuration file based on the calling request, and generating first information according to the preset shooting parameters, wherein the first information is used for indicating the camera to modify hardware parameters of the camera according to the preset shooting parameters, and returning a preview image matched with the preset shooting parameters.
4. The method for invoking a camera according to claim 3, wherein the generating of the first information according to the preset shooting parameter comprises:
generating a first information queue according to the preset shooting parameters;
correspondingly, the sending the first information to the camera to instruct the camera to return a corresponding preview image according to the first information includes:
and sequentially sending the first information in the first information queue to the camera at preset time intervals so as to instruct the camera to return a preview image matched with preset shooting parameters according to each received first information.
5. The method of invoking a camera of claim 4, further comprising:
if the modification request of the shooting parameters is monitored, regenerating a first information queue based on the shooting parameters to be modified corresponding to the modification request, sequentially sending first information in the first information queue to the camera at preset time intervals to indicate the camera to modify the hardware parameters of the camera according to the shooting parameters to be modified, and returning a preview image matched with the modified shooting parameters according to each piece of first information.
6. The method of invoking a camera according to any one of claims 1 to 5, further comprising:
if monitoring that an application program calling the camera sends a photographing request for photographing, generating second information based on the photographing request, and sending the second information to the camera, wherein the data frame format of the second information is a data frame format supported by the camera of the mobile terminal, the second information comprises format parameters of an image requested to be returned by the camera, and the priority of the second information is greater than that of the first information.
7. The method of invoking a camera according to any one of claims 1 to 5, further comprising:
and if an exit instruction of the application program of the camera is called or an instruction of stopping the preview is monitored, the sending of the first information is terminated.
8. A mobile terminal, wherein a scene in which an application applied to the mobile terminal is incompatible with a camera, comprises:
the calling request monitoring unit is used for monitoring whether an application program in the mobile terminal sends a calling request for calling the camera;
the mobile terminal comprises a first information generating unit, a second information generating unit and a processing unit, wherein the first information generating unit is used for generating first information based on a calling request of calling a camera if an application program in the mobile terminal is monitored to send out the calling request of calling the camera, and the data frame format of the first information is a data frame format supported by the camera of the mobile terminal;
and the first information sending unit is used for sending the first information to the camera so as to instruct the camera to return a corresponding preview image according to the first information.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by one or more processors, implements the steps of the method according to any one of claims 1 to 7.
CN201810980731.5A 2018-08-27 2018-08-27 Method for calling camera, mobile terminal and storage medium Active CN109068059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810980731.5A CN109068059B (en) 2018-08-27 2018-08-27 Method for calling camera, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810980731.5A CN109068059B (en) 2018-08-27 2018-08-27 Method for calling camera, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109068059A CN109068059A (en) 2018-12-21
CN109068059B true CN109068059B (en) 2020-09-11

Family

ID=64757095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810980731.5A Active CN109068059B (en) 2018-08-27 2018-08-27 Method for calling camera, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109068059B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413423A (en) * 2019-07-23 2019-11-05 腾讯科技(深圳)有限公司 Data processing method, relevant apparatus, equipment and storage medium
CN111259441B (en) * 2020-01-14 2023-02-28 Oppo广东移动通信有限公司 Device control method, device, storage medium and electronic device
CN111314646B (en) * 2020-02-27 2021-04-23 Oppo(重庆)智能科技有限公司 Image acquisition method, image acquisition device, terminal device and readable storage medium
CN112199127A (en) * 2020-10-10 2021-01-08 Oppo(重庆)智能科技有限公司 Image data processing method and device, mobile terminal and storage medium
CN113596328B (en) * 2021-07-23 2023-02-24 北京字节跳动网络技术有限公司 Camera calling method and device and electronic equipment
CN113791969A (en) * 2021-08-12 2021-12-14 惠州Tcl云创科技有限公司 Debugging method of Android platform camera module, storage medium and terminal equipment
CN116528063B (en) * 2023-07-04 2023-11-03 荣耀终端有限公司 Shooting method, readable storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101375249A (en) * 2003-11-10 2009-02-25 微软公司 A color management system that supports legacy and advanced color management applications
CN103336833A (en) * 2013-07-11 2013-10-02 成都西可科技有限公司 Method for integrally viewing RAW images in intelligent mobile phone OS
CN103593370A (en) * 2012-08-16 2014-02-19 腾讯科技(深圳)有限公司 Browsers and method for implementing expanded applications in browsers
CN104703115A (en) * 2013-12-09 2015-06-10 佳能株式会社 Communication apparatus and control method thereof
CN106060459A (en) * 2016-05-30 2016-10-26 安徽四创电子股份有限公司 Protocol conversion system and method for camera

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7203692B2 (en) * 2001-07-16 2007-04-10 Sony Corporation Transcoding between content data and description data
CN104980660B (en) * 2015-07-10 2019-01-04 成都品果科技有限公司 A kind of mute method taken pictures of Android platform
CN105959530A (en) * 2016-04-26 2016-09-21 乐视控股(北京)有限公司 Method and system for invoking a camera function according to an individualized property of an application
CN106372250A (en) * 2016-09-23 2017-02-01 郑州云海信息技术有限公司 Parameter passing method and device capable of starting local application through URL protocol
CN107205120B (en) * 2017-06-30 2019-04-09 维沃移动通信有限公司 A kind of processing method and mobile terminal of image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101375249A (en) * 2003-11-10 2009-02-25 微软公司 A color management system that supports legacy and advanced color management applications
CN103593370A (en) * 2012-08-16 2014-02-19 腾讯科技(深圳)有限公司 Browsers and method for implementing expanded applications in browsers
CN103336833A (en) * 2013-07-11 2013-10-02 成都西可科技有限公司 Method for integrally viewing RAW images in intelligent mobile phone OS
CN104703115A (en) * 2013-12-09 2015-06-10 佳能株式会社 Communication apparatus and control method thereof
CN106060459A (en) * 2016-05-30 2016-10-26 安徽四创电子股份有限公司 Protocol conversion system and method for camera

Also Published As

Publication number Publication date
CN109068059A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109068059B (en) Method for calling camera, mobile terminal and storage medium
CN110086967B (en) Image processing method, image processor, photographing device and electronic equipment
CN109462726B (en) Camera control method and device
CN110753187B (en) Camera control method and device
EP3723359A1 (en) Image processing apparatus, method for image processing, and electronic device
CN113727035B (en) Image processing method, system, electronic device and storage medium
CN111447370B (en) Camera access method, camera access device, terminal equipment and readable storage medium
CN114125284B (en) Image processing method, electronic device and storage medium
CN109672884B (en) Image hardware coding processing method and device
CN110958399B (en) High dynamic range image HDR realization method and related product
CN112399087B (en) Image processing method, image processing apparatus, image capturing apparatus, electronic device, and storage medium
CN111225153B (en) Image data processing method, image data processing device and mobile terminal
US20180288155A1 (en) Method and apparatus for managing a shared storage system
CN111314606B (en) Photographing method and device, electronic equipment and storage medium
CN113992854A (en) Image preview method and device, electronic equipment and computer readable storage medium
CN111182223B (en) Image processing method, image processing device, storage medium and electronic equipment
CN111259441B (en) Device control method, device, storage medium and electronic device
CN112087569B (en) Camera and camera starting method and device
CN116962870A (en) Vehicle-mounted shooting data management method and device, electronic equipment and readable storage medium
JP6347636B2 (en) Image processing system, data management method, and program
CN110602359B (en) Image processing method, image processor, photographing device and electronic equipment
CN116028383B (en) Cache management method and electronic equipment
US20190278638A1 (en) Image data management apparatus and method therefor
CN111193869B (en) Image data processing method, image data processing device and mobile terminal
CN112672046B (en) Method and device for storing continuous shooting images, electronic equipment and storage medium

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