Method and device for controlling camera of terminal equipment and terminal equipment
By acquiring the camera's control commands and status, and determining the preconditions for executing camera functions, the problem of high complexity in camera control in existing technologies is solved, enabling more efficient camera control and development.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2026-03-10
AI Technical Summary
When adding new functions to camera controls, existing technologies require the redevelopment of the camera control process, resulting in high complexity and low development efficiency in camera control.
By acquiring the camera's control commands and current state, the camera state associated with the control commands is determined as a prerequisite, and functions are executed based on the camera state, thus avoiding complex control process coupling.
It reduces the complexity of camera control, improves the efficiency of camera control and function development, and reduces development costs.
Smart Images

Figure CN121644966A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, and terminal device for controlling a camera in a terminal device. Background Technology
[0002] The camera's shooting controls can include various functions. For example, clicking the shooting control will allow the camera to take an image, while pressing and holding the control will allow the camera to record video.
[0003] Currently, when adding new functions to the shooting control, in order to avoid affecting the previous shooting functions, it is necessary to redevelop the camera control process related to the new shooting function and couple the new camera control process into the previously developed camera control process, resulting in high complexity of camera control. Summary of the Invention
[0004] This disclosure provides a method, apparatus, and terminal device for controlling a camera in a terminal device, which addresses technical problems in the prior art.
[0005] In a first aspect, embodiments of this disclosure provide a method for controlling a camera in a terminal device, the method comprising:
[0006] The system acquires control commands for the camera of the terminal device and the current camera state of the camera, wherein the camera state is associated with the camera's shooting lifecycle.
[0007] Determine a first camera state associated with the control command, wherein the first camera state is a prerequisite for executing the control command;
[0008] Based on the current camera state and the first camera state, execute the functions of the camera associated with the control command.
[0009] In a second aspect, embodiments of this disclosure provide a camera control device for a terminal device, the camera control device for the terminal device including an acquisition module, a determination module, and a processing module, wherein:
[0010] The acquisition module is used to acquire the control commands of the camera of the terminal device and the current camera state of the camera, wherein the camera state is a state associated with the shooting life cycle of the camera;
[0011] The determining module is used to determine a first camera state associated with the control command, wherein the first camera state is a prerequisite for executing the control command.
[0012] The processing module is used to execute the functions of the camera associated with the control command based on the current camera state and the first camera state.
[0013] Thirdly, embodiments of this disclosure provide a terminal device including: a processor and a memory;
[0014] The memory stores computer-executed instructions;
[0015] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the camera control method of the terminal device as described in the first aspect above and various possible aspects of the first aspect.
[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the camera control method of the terminal device described in the first aspect and various possible aspects of the first aspect.
[0017] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the camera control method of the terminal device as described in the first aspect above and various possible aspects of the first aspect.
[0018] This disclosure provides a camera control method, apparatus, and terminal device for a terminal device. The terminal device can acquire camera control commands and the current camera state, wherein the camera state can be a state associated with the camera's shooting lifecycle. The terminal device can determine a first camera state associated with the control command, wherein the first camera state can be a prerequisite for executing the control command. The terminal device can execute the camera function associated with the control command based on the current camera state and the first camera state. In the above method, since the terminal device can execute the camera function based on the current camera state and the first camera state associated with the control command, it is not necessary to process the camera control command through a complex camera control flow. Therefore, the complexity of camera control can be reduced, and the efficiency of camera control can be improved. Furthermore, during camera function development, it is not necessary to couple complex camera control flows, thus improving the development efficiency of camera functions and reducing the development cost of camera functions. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram illustrating a camera control method for a terminal device provided in an embodiment of this disclosure;
[0022] Figure 3 This is a schematic diagram illustrating a process for acquiring camera control commands according to an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram illustrating the lifecycle of a recorded video as provided in an embodiment of this disclosure;
[0024] Figure 5 A schematic diagram illustrating a transformation relationship provided in an embodiment of this disclosure;
[0025] Figure 6 This is a schematic diagram of a method for processing control commands provided in an embodiment of the present disclosure;
[0026] Figure 7 This is a schematic diagram illustrating a process for processing control commands, provided in an embodiment of the present disclosure.
[0027] Figure 8 A schematic diagram illustrating another process for processing control commands provided in an embodiment of this disclosure;
[0028] Figure 9 A schematic diagram of the structure of a camera control device for a terminal device provided in an embodiment of this disclosure;
[0029] Figure 10 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this disclosure. Detailed Implementation
[0030] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0031] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0032] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0033] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0034] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0035] For ease of understanding, the concepts involved in the embodiments of this disclosure will be explained below.
[0036] Terminal devices are devices with wireless transceiver capabilities. They can be deployed on land, including indoors or outdoors, handheld, wearable, or vehicle-mounted. Examples include mobile phones, tablet computers, computers with wireless transceiver capabilities, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, vehicle-mounted terminal devices, wireless terminals in self-driving vehicles, wireless terminal devices in remote medical care, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, wireless terminal devices in smart homes, and wearable terminal devices, among others. The terminal equipment involved in the embodiments of this disclosure may also be referred to as a terminal, user equipment (UE), access terminal equipment, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal equipment, mobile device, UE terminal equipment, wireless communication equipment, UE agent, or UE device, etc. The terminal equipment may also be fixed or mobile.
[0037] In related technologies, camera shooting controls can include multiple functions. For example, clicking the shooting control allows the camera to record video, and long-pressing the shooting control also allows the camera to record video. Currently, when adding new functions to the shooting control, to avoid affecting existing shooting functions, it is necessary to redevelop the camera control flow related to the new shooting function and couple it to the previously developed camera control flow. For example, if clicking the shooting control allows the camera to record video, and if it is necessary to develop a function where the user long-presses the shooting control to record video, then the camera control flow for long-pressing the shooting control to record video needs to be redeveloped and coupled to the camera control flow for clicking the shooting control to record video. Since only one shooting scenario can use camera resources (video stream, audio stream) at a time, the current camera control flow needs to determine whether other camera control flows have released camera resources. Only after other camera control flows have released camera resources can the current camera control flow execute. This results in low efficiency in developing camera functions, and the terminal device needs to execute camera control commands through multiple camera control flows, leading to high complexity and low efficiency in processing control commands.
[0038] To address the technical problems in related technologies, this disclosure provides a camera control method for a terminal device. The terminal device can acquire camera control commands and the current camera state, and obtain the transition relationships between multiple camera states. The terminal device can determine a second camera state after the execution of the control command, and based on the transition relationships, determine the previous camera state of the second camera state, and designate the previous camera state as a first camera state. The terminal device can then execute camera functions associated with the control command based on the current camera state and the first camera state. Thus, since the terminal device can execute camera functions associated with the control command based on the camera state, the complexity of camera control can be reduced, and the efficiency of camera control can be improved. Furthermore, during camera function development, there is no need to couple complex camera control processes, thereby improving the development efficiency of camera functions and reducing the development cost.
[0039] Below, in conjunction with Figure 1 The application scenarios of the embodiments of this disclosure will be described.
[0040] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. Please refer to [link / reference]. Figure 1 This includes a terminal device. The terminal device's display page is a shooting page. The shooting page may include recording controls. When the user clicks the recording control, the terminal device can obtain the current camera state, which can be a state where the camera recording scene has been triggered and the image has been rendered onto the screen. Since this camera state allows recording, the terminal device can execute the recording operation and begin recording video. In this way, the terminal device can execute control commands based on the camera state, eliminating the need for complex camera control processes, thereby reducing the complexity of camera control and improving the processing efficiency of control commands.
[0041] It should be noted that, Figure 1 This is an example of an application scenario for the embodiments of this disclosure, and is not intended to limit the application scenarios of the embodiments of this disclosure.
[0042] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0043] Figure 2 This is a schematic diagram of a camera control method for a terminal device provided in an embodiment of the present disclosure.
[0044] Please see Figure 2 The method process includes:
[0045] S201. Obtain the camera control commands and current camera status of the terminal device.
[0046] The execution entity of this disclosure can be a terminal device or a camera control device of the terminal device. The camera control device of the terminal device can be implemented in software, or it can be implemented using a combination of software and hardware; this disclosure does not limit this approach.
[0047] The camera control commands may include camera start commands, shooting commands, video recording start commands, video recording stop commands, camera turn-off commands, and commands to return to the preview page, etc., and this disclosure does not limit these commands.
[0048] Optionally, the terminal device can obtain camera control commands based on the following two feasible implementation methods:
[0049] One feasible implementation method:
[0050] In response to a touch operation on the camera, the device obtains control instructions to display the camera's shooting page. For example, the terminal device's display page may include a camera application. When the user taps the camera application, the terminal device can generate and obtain control instructions, which can be used to display the camera's shooting page. That is, after the terminal device executes the control instructions, it can display the camera's shooting page.
[0051] Below, in conjunction with Figure 3 The process of acquiring camera control commands is explained.
[0052] Figure 3 This is a schematic diagram illustrating a process for acquiring camera control commands according to an embodiment of this disclosure. Please refer to... Figure 3 This includes a terminal device. The terminal device's display page may include a camera application. When the user clicks on the camera application, the terminal device can determine that the control command is to display the camera's shooting page.
[0053] Another feasible implementation method:
[0054] The display shows the camera's shooting page, which may include shooting controls. In response to touch input to these controls, the device receives control commands from the camera to take a picture. For example, the terminal device's display can show the camera's shooting page. When the user clicks the shooting controls on the camera's shooting page, the terminal device can generate and receive control commands. These commands can be used to record video; that is, after the terminal device executes the control command, it can begin recording video. This improves the flexibility of the terminal device in receiving control commands.
[0055] The touch operation of the shooting control may include at least one of the following:
[0056] Click the camera control once;
[0057] Segmented click multiple shooting control;
[0058] Long press the camera control.
[0059] One of the actions, clicking the shutter control once, can be used for video recording. For example, if a user clicks the shutter control once, the camera can start recording video.
[0060] The segmented shooting control can be used to start recording segmented video. For example, a user can click the shooting control once to record 15 seconds of video, and click it again to record another 15 seconds, resulting in a 30-second video.
[0061] The long-press action of the shooting control can be used for video recording. For example, if a user long-presses the shooting control, the camera can start recording video.
[0062] The camera state refers to the state associated with the camera's shooting lifecycle. For example, the shooting lifecycle can include the lifecycle of capturing images and the lifecycle of recording video. The lifecycle of capturing images and the lifecycle of recording video are similar, and the lifecycle of recording video can include the process of stopping recording.
[0063] Below, in conjunction with Figure 4 It provides a detailed explanation of the lifecycle of the camera's recorded video.
[0064] Figure 4 This is a schematic diagram illustrating the lifecycle of a recorded video according to an embodiment of this disclosure. Please refer to [link / reference]. Figure 4 This includes: entering the camera recording scene, initializing the camera, opening the camera, starting the camera preview (screen rendering), starting camera recording, stopping camera recording, closing the camera, and exiting the camera recording scene. Among these, initializing the camera, opening the camera, and starting the camera preview are processes that are executed automatically after entering the camera recording scene, while starting camera recording, stopping camera recording, and closing the camera are processes that are triggered by user actions.
[0065] The camera's camera status may include at least one of the following:
[0066] The camera is not initialized.
[0067] Camera initialization state;
[0068] The camera is on.
[0069] Camera preview status;
[0070] Camera recording status;
[0071] The camera has stopped recording.
[0072] The camera uninitialized state can be either a state where the camera shooting scene has not been triggered, or a state where the user has exited the camera shooting scene. For example, if the user has not triggered the camera recording scene, the terminal device can determine that the camera state is uninitialized; if the user has exited the camera shooting scene, the terminal device can determine that the camera state is uninitialized.
[0073] The camera initialization state can be the state when a user triggers a camera recording scene but the camera is not turned on. For example, if a user triggers a camera recording scene, and the camera is not yet turned on, the terminal device can determine that the camera state is the camera initialization state.
[0074] The "camera on" status indicates that the user has triggered a camera shooting scene and the camera is already turned on. For example, if the user triggers a camera recording scene and the camera is successfully turned on, the terminal device can determine that the camera status is "camera on".
[0075] The camera preview state refers to the state where the user triggers a camera shooting scene and the image has been rendered onto the screen. For example, if the user triggers a camera recording scene, and the camera begins to collect the user's audio and video data and renders the collected image onto the screen, the terminal device can determine that the camera state is the camera preview state.
[0076] The camera recording status can be the state when a user triggers a camera recording scene and the camera starts recording. For example, if a user triggers a camera recording scene and clicks the record control, the camera starts recording video, and the terminal device can determine that the camera status is camera recording status.
[0077] The "camera stopped recording" state can be defined as the state where the camera stops recording after a user triggers a recording session. For example, if a user triggers a recording session and then clicks the "stop recording" control, the camera stops recording video, and the terminal device can determine that the camera is in the "camera stopped recording" state.
[0078] Optionally, the terminal device can determine the current camera state based on the camera's current lifecycle. For example, if the camera has already rendered an image for display, the terminal device can determine that the current camera state is camera preview; if the camera is currently recording video, the terminal device can determine that the current camera state is camera recording; and if the camera has stopped recording video, the terminal device can determine that the current camera state is camera stopped recording.
[0079] Optionally, the terminal device may also obtain the current camera status based on any feasible implementation method, and this disclosure does not limit this.
[0080] S202, Determine the first camera state associated with the control command.
[0081] The first camera state can serve as a prerequisite for executing a control command. For example, if the control command is a record command, the camera needs to be in camera preview mode (video recording can only begin after the image is rendered and displayed on the screen), and the terminal device can determine that the first camera state associated with the record command is the camera preview mode. Conversely, if the control command is a stop recording command, the camera needs to be in camera recording mode (recording can only stop after the camera has started recording), and the terminal device can determine that the first camera state associated with the stop recording command is the camera recording mode.
[0082] The terminal device can determine the state of the first camera according to the following feasible implementation method: obtain the conversion relationship, and determine the state of the first camera based on the control command and the conversion relationship.
[0083] Transition relationships can be used to indicate the relationships between multiple camera states. For example, a transition relationship can include the logical order between multiple camera states. For instance, the camera recording state precedes the camera stop recording state, and the camera preview state precedes the camera recording state.
[0084] The terminal device can acquire multiple camera states of the camera according to any feasible implementation method (e.g., the terminal device can pre-set multiple camera states), and this disclosure does not limit this.
[0085] Below, in conjunction with Figure 5 The transformation relationship is explained.
[0086] Figure 5 This is a schematic diagram illustrating a transformation relationship provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 5 This includes: conversion relationships. These conversion relationships can include camera initialization state, camera on state, camera preview state, camera recording state, camera stopped recording state, and camera uninitialized state.
[0087] Please see Figure 5 The camera can enter the camera initialization state from the uninitialized state, the camera can enter the camera on state from the camera initialization state, the camera on state can enter the camera preview state from the camera preview state, the camera recording state can enter the camera stopped recording state from the camera stopped recording state, and the camera uninitialized state from the camera stopped recording state.
[0088] Please see Figure 5 The camera can transition from a stopped recording state to a camera preview state, and from the camera initialization state, camera on state, and camera preview state to a camera uninitialized state. This allows the terminal device to accurately determine the logical order between multiple camera states based on these transitions, thereby improving the accuracy of determining the first camera state.
[0089] Specifically, the terminal device determines the first camera state based on control commands and conversion relationships. Specifically, it can determine the second camera state after the control command is executed, determine the previous camera state of the second camera state based on the conversion relationship, and set the previous camera state as the first camera state.
[0090] The second camera state can be the camera state after the control command is executed. For example, if the control command is to display the recording page, then after the control command is executed, the terminal device can display the camera's recording page, that is, the second camera state after the control command is executed can be the camera preview state; if the control command is to record, then after the control command is executed, the terminal device can start recording video, that is, the second camera state after the control command is executed can be the camera recording state; if the control command is to stop recording, then after the control command is executed, the terminal device can stop recording video, that is, the second camera state after the control command is executed can be the camera stopped recording state.
[0091] Specifically, the terminal device can determine the second camera state based on a preset correspondence between control commands and the second camera state. For example, the preset correspondence may include each control command and the corresponding second camera state. In this way, the terminal device can determine the second camera state after the camera control command is executed based on the camera control command and the preset correspondence.
[0092] It should be noted that the terminal device can determine the state of the second camera after the control command is executed according to any feasible implementation method, and the embodiments disclosed herein do not limit this.
[0093] The previous camera state can be the previous camera state of the second camera state. For example, if the second camera state is recording, then the previous camera state can be the camera preview state; if the second camera state is stopped recording, then the previous camera state can be the camera recording state; if the second camera state is previewing, then the previous camera state can be either stopped recording or camera on. For example, ... Figure 5As shown, if the second camera state is the camera uninitialized state, then the previous camera state can be the camera initialization state, the camera open state, or the camera preview state.
[0094] Specifically, the terminal device can determine the previous camera state of the second camera state as the first camera state associated with the control command. For example, the control command can be a recording command, and the second camera state after the execution of this recording command is the camera recording state. The previous camera state of this recording state is the camera preview state. Therefore, the terminal device can determine the first camera state associated with the recording command as the camera preview state. Similarly, the control command can be a stop recording command, and the second camera state after the execution of this stop recording command is the camera stop recording state. The previous camera state of this stop recording state is the camera recording state. Therefore, the terminal device can determine the first camera state associated with the stop recording command as the camera recording state.
[0095] S203. Based on the current camera state and the first camera state, execute the camera functions associated with the control commands.
[0096] If the current camera state is the same as the first camera state, it means that the current camera state is the previous camera state after the second camera state following the execution of the control command. Therefore, the current camera state is a prerequisite for the control command, and the terminal device can execute the camera function associated with the control command. For example, if the control command is a recording command, and the current camera state is the camera preview state, the terminal device can execute the recording command and start video recording.
[0097] This disclosure provides a camera control method for a terminal device. The terminal device can acquire camera control commands and the current camera state, and obtain a conversion relationship. The terminal device can determine a second camera state after the execution of the control command, and based on the conversion relationship, determine the previous camera state of the second camera state, and designate the previous camera state as the first camera state. If the current camera state and the first camera state are the same, the terminal device can execute the camera function associated with the control command. In this way, since the terminal device can execute the camera function associated with the control command based on the camera state, it does not need to go through a complex camera control process, thus reducing the complexity of camera control and improving its efficiency. Furthermore, during camera function development, there is no need to couple complex camera control processes, thus improving the development efficiency and reducing the development cost of camera functions. Moreover, the terminal device can accurately determine the first camera state based on the conversion relationship, thereby improving the accuracy of camera control.
[0098] Based on any of the above embodiments, the following, in conjunction with Figure 6The method for executing camera functions associated with control commands in the above communication method will be described in detail.
[0099] Figure 6 This is a schematic diagram illustrating a method for performing camera functions according to an embodiment of this disclosure. Please refer to [link / reference]. Figure 6 The method process includes:
[0100] S601. Determine whether the current camera state is the same as the first camera state.
[0101] Optionally, the terminal device can determine whether the current camera state is the same as the first camera state according to any feasible implementation method, and this embodiment of the present disclosure does not limit this. For example, if the current camera state is a camera recording state and the first camera state is a camera recording state, then the terminal device can determine that the current camera state is the same as the first camera state; if the current camera state is a camera recording state and the first camera state is a camera uninitialized state, then the terminal device can determine that the current camera state is different from the first camera state.
[0102] S602. If the current camera state is the same as the first camera state, then execute the camera function associated with the control command.
[0103] If the current camera state is the same as the first camera state, it means that the current camera state is the previous camera state after the control command is executed. Therefore, after the terminal device executes the camera function associated with the control command, the current camera state can enter the camera state after the control command is executed, and the terminal device can execute the control command. For example, if the control command is a recording command, the camera state after the recording command is executed is the camera recording state, and the previous camera state is the camera preview state. If the current camera state is the camera preview state, it means that after the terminal device executes the recording command, the current camera state can enter the camera recording state, and the terminal device can execute the recording command and perform camera recording.
[0104] S603. If the current camera state is different from the first camera state, determine whether the current camera state can be automatically converted to the first camera state, and based on the determination result, execute the camera function associated with the control command.
[0105] Optionally, the terminal device can determine whether the current camera state can be automatically converted to the first camera state based on the conversion relationship, the current camera state, and the first camera state.
[0106] The camera's camera state can include automatically transitioning states. For example, the camera initialization state can automatically transition to the camera on state, and the camera on state can automatically transition to the camera preview state. For instance, after the user clicks the camera control, the camera's current state is the camera initialization state, requiring no further user intervention. After camera initialization is complete, the current camera state can transition to the camera on state. Once the camera is on, it can automatically render the image and display it on the screen, requiring no further user intervention. The current camera state can then transition from the camera on state to the camera preview state.
[0107] The camera state can include states that cannot be automatically switched. For example, the camera cannot automatically switch between recording state and stopped recording state. When the camera is currently in preview state, if the user clicks the record control, the current camera state can switch from preview state to recording state. If the user clicks the stop recording control, the current camera state can switch from recording state to stopped recording state. That is, the camera preview state, recording state, and stopped recording state cannot be automatically switched.
[0108] For example, if the current camera state is camera initialization state and the first camera state is camera preview state, the terminal device can determine that the current camera state can be automatically converted to the first camera state based on the conversion relationship. If the current camera state is camera initialization state and the first camera state is camera recording state, the terminal device can determine that the current camera state cannot be automatically converted to the first camera state based on the conversion relationship.
[0109] The terminal device executes the camera function associated with the control command based on the judgment result. Specifically, if the current camera state can be automatically converted to the first camera state, the device waits for the current camera state to be converted to the first camera state before executing the camera function associated with the control command.
[0110] If the current camera state can automatically transition to the first camera state, it means that the current camera state can automatically transition to the first camera state after a certain period of time. Therefore, the terminal device can wait for a period of time until the current camera state becomes the first camera state before executing the camera function associated with the control command. For example, if the control command is a recording command, the current camera state is the camera initialization state, and the first camera state associated with the recording command is the camera preview state, the terminal device may determine that the current camera state is different from the first camera state. However, since the camera initialization state can automatically transition to the camera preview state, the terminal device can wait for the camera initialization state to transition to the camera preview state before executing the recording command and recording video.
[0111] Optionally, if the current camera state cannot automatically transition to the first camera state, the terminal device will not execute the camera function associated with the control command. For example, if the determination result indicates that the current camera state cannot automatically transition to the first camera state, it means that the current camera state will not automatically transition to the first camera state even after a certain period of time (user operation may be required to transition to the first camera state). Therefore, the terminal device can cancel the control command and not execute the camera function associated with the control command. For example, if the control command is a recording command, the current camera state is the camera recording state, and the first camera state associated with the recording command is the camera preview state, and the terminal device determines that the current camera state is different from the first camera state, and the camera recording state cannot automatically transition to the camera preview state, then the terminal device may choose not to execute the recording function associated with the recording command and cancel the recording command.
[0112] Below, in conjunction with Figures 7-8 This section explains the process by which terminal devices process control commands.
[0113] Figure 7 This is a schematic diagram illustrating a process for processing control commands according to an embodiment of this disclosure. Please refer to [link / reference]. Figure 7 This includes a terminal device. The terminal device's current display page is a shooting page, which includes recording controls, and the camera's current camera state is the camera preview state. If the terminal device receives a recording command, it can determine that the first camera state associated with the recording command is the camera preview state. Since both the current camera state and the first camera state are in the camera preview state, the terminal device can execute the recording command and begin recording video. This improves the efficiency of camera control and reduces its complexity.
[0114] Figure 8 This is a schematic diagram illustrating another process for processing control commands according to an embodiment of this disclosure. Please refer to... Figure 8 This includes a terminal device. The terminal device's current display page is a shooting page, which includes recording controls. The camera's current camera state is the camera preview state. If the terminal device receives a stop recording command, it can determine that the first camera state associated with the stop recording command is the camera recording state. Since the current camera state is the camera preview state and the first camera state is the camera recording state, the current camera state is different from the first camera state, and the current camera state cannot automatically switch back to the first camera state. Therefore, the terminal device cannot execute the stop recording command and cancels it. This improves the efficiency and accuracy of camera control while reducing its complexity.
[0115] This disclosure provides a method for processing control commands. A terminal device can determine whether the current camera state is the same as a first camera state. If the current camera state is the same as the first camera state, the terminal device can execute the camera function associated with the control command. If the current camera state is different from the first camera state, the terminal device can determine whether the current camera state can automatically switch to the first camera state. If the current camera state can automatically switch to the first camera state, the terminal device waits for the current camera state to switch to the first camera state before executing the camera function associated with the control command. In this way, the terminal device can control the camera based on the camera state, and when the current camera state can automatically switch to the first camera state, the terminal device can wait for the current camera state to switch to the first camera state before executing the camera function associated with the control command, thereby improving the flexibility of camera control.
[0116] Figure 9 This is a schematic diagram of the structure of a camera control device for a terminal device provided in an embodiment of this disclosure. Please refer to... Figure 9 The camera control device 900 of the terminal device includes an acquisition module 901, a determination module 902, and a processing module 903, wherein:
[0117] The acquisition module 901 is used to acquire the control commands of the camera of the terminal device and the current camera state of the camera, wherein the camera state is a state associated with the shooting life cycle of the camera.
[0118] The determining module 902 is used to determine a first camera state associated with the control command, wherein the first camera state is a prerequisite for executing the control command.
[0119] The processing module 903 is used to execute the functions of the camera associated with the control command based on the current camera state and the first camera state.
[0120] According to one or more embodiments of this disclosure, the acquisition module 901 is specifically used for:
[0121] In response to a touch operation on the camera, a control command is obtained to display the camera's shooting page.
[0122] According to one or more embodiments of this disclosure, the acquisition module 901 is specifically used for:
[0123] The camera displays a shooting page, which includes shooting controls.
[0124] In response to a touch operation on the shooting control, a control command is obtained for the camera to take a picture.
[0125] According to one or more embodiments of this disclosure, the camera state includes at least one of the following:
[0126] The camera is not initialized.
[0127] Camera initialization state;
[0128] The camera is on.
[0129] Camera preview status;
[0130] Camera recording status;
[0131] The camera has stopped recording.
[0132] According to one or more embodiments of this disclosure, the determining module 902 is specifically used for:
[0133] Obtain the transformation relationship, which is used to indicate the relationship between multiple camera states of the camera;
[0134] The state of the first camera is determined based on the control command and the conversion relationship.
[0135] According to one or more embodiments of this disclosure, the determining module 902 is specifically used for:
[0136] Determine the state of the second camera after the control command is executed;
[0137] Based on the transformation relationship, the previous camera state of the second camera state is determined, and the previous camera state is determined as the first camera state.
[0138] According to one or more embodiments of this disclosure, the processing module 903 is specifically used for:
[0139] If the current camera state is the same as the first camera state, then the function of the camera associated with the control command is executed;
[0140] If the current camera state is different from the first camera state, it is determined whether the current camera state can be automatically converted to the first camera state. If the current camera state can be automatically converted to the first camera state, the camera function associated with the control command is executed while waiting for the current camera state to be converted to the first camera state.
[0141] According to one or more embodiments of this disclosure, the processing module 903 is further configured to:
[0142] If the current camera state cannot be automatically converted to the first camera state, then the camera function associated with the control command will not be executed.
[0143] The camera control device of the terminal device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.
[0144] Figure 10 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 10 The diagram illustrates a structural schematic suitable for implementing the terminal device 1000 of the embodiments of the present disclosure. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 10 The terminal device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0145] like Figure 10 As shown, the terminal device 1000 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the terminal device 1000. The processing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0146] Typically, the following devices can be connected to the I / O interface 1005: input devices 1006 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1008 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows terminal device 1000 to exchange data via wireless or wired communication with other devices. Although Figure 10 A terminal device 1000 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0147] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1009, or installed from storage device 1008, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of embodiments of this disclosure.
[0148] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0149] The aforementioned computer-readable medium may be included in the aforementioned terminal device; or it may exist independently and not assembled into the terminal device.
[0150] The aforementioned computer-readable medium carries one or more programs, which, when executed by the terminal device, cause the terminal device to perform the method shown in the above embodiments.
[0151] This disclosure provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements various methods that may be involved in the above embodiments.
[0152] This disclosure provides a computer program product, including a computer program that, when executed by a processor, implements various methods that may be involved in the above embodiments.
[0153] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0154] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0155] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0156] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0157] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0158] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0159] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0160] It is understood that the data involved in this technical solution (including but not limited to the data itself, its acquisition, or its use) shall comply with the requirements of relevant laws, regulations, and provisions. Data may include information, parameters, and messages, such as flow control instructions.
[0161] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0162] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Multitasking and parallel processing may be advantageous in certain environments. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments. Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely exemplary forms of implementing the claims.
Claims
1. A control method of a camera of a terminal device, characterized by, The method comprises: obtaining a control instruction of a camera of a terminal device and a current camera state of the camera, the camera state of the camera being a state associated with a shooting life cycle of the camera; determining a first camera state associated with the control instruction, the first camera state being a precondition for executing the control instruction; based on the current camera state and the first camera state, executing a function of the camera associated with the control instruction.
2. The method of claim 1, wherein, The obtaining of the control instruction of the camera of the terminal device comprises: in response to a touch operation on the camera, obtaining a control instruction of displaying a shooting page of the camera.
3. The method of claim 1, wherein, The obtaining of the control instruction of the camera of the terminal device comprises: displaying a shooting page of the camera, the shooting page of the camera comprising a shooting control; in response to a touch operation on the shooting control, obtaining a control instruction for the camera to shoot.
4. The method according to any one of claims 1 to 3, characterized in that, The camera state of the camera comprises at least one of: a camera non-initialization state; a camera initialization state; a camera opening state; a camera preview state; a camera recording state; a camera stop recording state.
5. The method according to any one of claims 1 to 3, characterized in that, The determination of the first camera state associated with the control instruction comprises: obtaining a conversion relationship, the conversion relationship being used to indicate a mutual conversion relationship between a plurality of camera states of the camera; based on the control instruction and the conversion relationship, determining the first camera state.
6. The method of claim 5, wherein, The determination of the first camera state based on the control instruction and the conversion relationship comprises: determining a second camera state after the execution of the control instruction; based on the conversion relationship, determining a previous camera state of the second camera state, and determining the previous camera state as the first camera state.
7. The method according to any one of claims 1 to 3, characterized in that, The execution of the function of the camera associated with the control instruction based on the current camera state and the first camera state comprises: if the current camera state is the same as the first camera state, executing the function of the camera associated with the control instruction; if the current camera state is different from the first camera state, determining whether the current camera state can be automatically converted into the first camera state, and if the current camera state can be automatically converted into the first camera state, waiting for the current camera state to be converted into the first camera state, and then executing the function of the camera associated with the control instruction.
8. The method of claim 7, wherein, The method further comprises: if the current camera state cannot be automatically converted into the first camera state, not executing the function of the camera associated with the control instruction.
9. An apparatus for controlling a camera of a terminal device, characterized by The method comprises an obtaining module, a determining module and a processing module, wherein: the obtaining module is configured to obtain a control instruction of a camera of a terminal device and a current camera state of the camera, the camera state of the camera being a state associated with a shooting life cycle of the camera; the determining module is configured to determine a first camera state associated with the control instruction, the first camera state being a precondition for executing the control instruction; the processing module is configured to execute a function of the camera associated with the control instruction based on the current camera state and the first camera state.
10. A terminal device, comprising: The method comprises: a processor and a memory; the memory stores computer-executed instructions; the processor executes the computer-executed instructions stored in the memory, so that the processor executes the control method of the camera of the terminal device according to any one of claims 1-8.
11. A computer readable storage medium, characterized in that, the computer-readable storage medium stores computer-executed instructions, and when the processor executes the computer-executed instructions, the control method of the camera of the terminal device according to any one of claims 1-8 is implemented.
12. A computer program product, characterised in that, a computer program, which, when executed by a processor, implements the control method of the camera of the terminal device according to any one of claims 1-8.