[go: up one dir, main page]

CN111447370A - Camera access method, access device, terminal device and readable storage medium - Google Patents

Camera access method, access device, terminal device and readable storage medium Download PDF

Info

Publication number
CN111447370A
CN111447370A CN202010423175.9A CN202010423175A CN111447370A CN 111447370 A CN111447370 A CN 111447370A CN 202010423175 A CN202010423175 A CN 202010423175A CN 111447370 A CN111447370 A CN 111447370A
Authority
CN
China
Prior art keywords
camera
image
photographing
instruction
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010423175.9A
Other languages
Chinese (zh)
Other versions
CN111447370B (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 CN202010423175.9A priority Critical patent/CN111447370B/en
Publication of CN111447370A publication Critical patent/CN111447370A/en
Application granted granted Critical
Publication of CN111447370B publication Critical patent/CN111447370B/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
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • 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
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The application provides a camera access method, an access device, terminal equipment and a readable storage medium. The camera access method comprises the following steps: if an instruction for starting a camera program is received, requesting a buffer pipeline BQ from a bottom layer frame, wherein the bottom layer frame is a program frame for accessing a camera, the BQ is used for caching an image acquired by a target camera, and the target camera is a camera to be accessed; displaying a preview picture based on the image acquired by the target camera cached by the BQ; and if a photographing instruction is received, acquiring the image obtained by photographing in the image cached in the BQ at the moment corresponding to the photographing instruction. The method and the device can reduce the blocking phenomenon of the terminal equipment caused by long-time use of the camera program for photographing to a certain extent.

Description

摄像头访问方法、访问装置、终端设备及可读存储介质Camera access method, access device, terminal device and readable storage medium

技术领域technical field

本申请属于摄像技术领域,尤其涉及一种摄像头访问方法、访问装置、终端设备及计算机可读存储介质。The present application belongs to the field of camera technology, and in particular, relates to a camera access method, an access device, a terminal device, and a computer-readable storage medium.

背景技术Background technique

目前,用户都希望长时间使用终端设备中的相机类程序进行拍照(比如对音乐厅的表演进行长时间的拍照),然而,在这种情况下,终端设备会出现较为严重的卡顿现象。At present, users all want to use the camera program in the terminal device to take pictures for a long time (for example, taking pictures of a performance in a concert hall for a long time). However, in this case, the terminal device may experience a serious freeze phenomenon.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请实施例提供了一种摄像头访问方法、访问装置、终端设备及计算机可读存储介质。可以在一定程度上减轻长时间使用相机类程序进行拍照所导致的终端设备卡顿现象。In view of this, embodiments of the present application provide a camera access method, an access device, a terminal device, and a computer-readable storage medium. To a certain extent, the terminal device stuck phenomenon caused by using a camera program for a long time to take pictures can be alleviated.

第一方面,本申请实施例提供了一种摄像头访问方法,包括:In a first aspect, an embodiment of the present application provides a camera access method, including:

若接收到开启相机类程序的指令时,向底层框架请求一个缓冲管道BQ,其中,所述底层框架为用于对摄像头进行访问的程序框架,所述BQ用于缓存目标摄像头采集的图像,所述目标摄像头为待访问的摄像头;If an instruction to open a camera program is received, a buffer pipeline BQ is requested from the underlying framework, where the underlying framework is a program framework used to access the camera, and the BQ is used to cache the images collected by the target camera. The target camera is the camera to be accessed;

基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示;Based on the image collected by the target camera in the BQ cache, display the preview screen;

若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。If a photographing instruction is received, based on the time corresponding to the photographing instruction, an image obtained by photographing is acquired in the image buffered by the BQ.

本申请第一方面提供了一种摄像头访问方法。首先,若接收到开启相机类程序的指令时,向底层框架请求一个缓存管道(Buffer Queue,BQ),该BQ用于存储目标摄像头采集的图像;然后,基于该BQ所存储的图像,进行预览画面显示,比如可直接将该BQ存储的图像作为预览画面进行显示,并在接收到拍照指令时,基于该拍照指令对应时刻处,所述BQ缓存的图像,获取拍照所得图像。由此可见,本申请所提供的方案中,拍照所得图像也是来源于上述BQ,因此,上述BQ一方面用于预览画面的显示,另一方面用于拍照。A first aspect of the present application provides a camera access method. First, if an instruction to open a camera program is received, a buffer queue (Buffer Queue, BQ) is requested from the underlying framework, and the BQ is used to store the image captured by the target camera; then, based on the image stored in the BQ, a preview is performed. For screen display, for example, the image stored by the BQ can be directly displayed as a preview screen, and when a photographing instruction is received, based on the image cached by the BQ at the time corresponding to the photographing instruction, the photographed image is obtained. It can be seen that, in the solution provided by this application, the images obtained by taking pictures are also derived from the above-mentioned BQ. Therefore, the above-mentioned BQ is used for displaying the preview screen on the one hand, and taking pictures on the other hand.

目前,传统的相机类程序在启动后,会向底层框架请求2个BQ,该两个BQ均用于接收摄像头采集的图像,但其中一个BQ用于预览画面显示,另一个BQ用于拍照。本申请所提供的摄像头访问方法在相机类程序启动之后,仅仅向底层框架请求了1个BQ,该BQ不但用于预览画面的显示,还用于拍照,因此,本申请所提供的技术方案相比于现有技术,能够在一定程度上减少相机类程序在拍照时的存储空间占据量,进而在一定程度上减轻长时间使用相机类程序进行拍照所导致的终端设备卡顿现象。At present, after the traditional camera program is started, it will request 2 BQs from the underlying framework, both of which are used to receive images collected by the camera, but one of the BQs is used for preview screen display and the other BQ is used for taking pictures. The camera access method provided by this application only requests one BQ from the underlying framework after the camera class program is started, and the BQ is not only used for displaying the preview screen, but also for taking pictures. Compared with the prior art, the storage space occupied by the camera-like program when taking pictures can be reduced to a certain extent, and to a certain extent, the stuck phenomenon of the terminal device caused by using the camera-like program to take pictures for a long time can be reduced to a certain extent.

第二方面,本申请实施例提供了一种摄像头访问装置,包括:In a second aspect, an embodiment of the present application provides a camera access device, including:

缓存管道请求模块,用于若接收到开启相机类程序的指令时,向底层框架请求一个缓冲管道BQ,其中,所述底层框架为用于对摄像头进行访问的程序框架,所述BQ用于缓存目标摄像头采集的图像,所述目标摄像头为待访问的摄像头;The cache pipeline request module is used to request a buffer pipeline BQ from the underlying framework if an instruction to open the camera class program is received, wherein the underlying framework is a program framework for accessing the camera, and the BQ is used for caching The image collected by the target camera, the target camera is the camera to be accessed;

预览显示模块,用于基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示;A preview display module, configured to display a preview screen based on the image collected by the target camera in the BQ cache;

拍照模块,用于若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。A photographing module, configured to acquire an image obtained by photographing in the image cached in the BQ at the time corresponding to the photographing instruction if a photographing instruction is received.

第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在上述存储器中并可在上述处理器上运行的计算机程序,上述处理器执行上述计算机程序时实现如上述第一方面所述方法的步骤。In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the above-mentioned first The steps of the method in one aspect.

第四方面,本申请实施例提供了一种计算机可读存储介质,上述计算机可读存储介质存储有计算机程序,上述计算机程序被处理器执行时实现如上述第一方面所述方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.

第五方面,本申请实施例提供了一种计算机程序产品,上述计算机程序产品包括计算机程序,上述计算机程序被一个或多个处理器执行时实现如上述第一方面所述方法的步骤。In a fifth aspect, an embodiment of the present application provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by one or more processors, the steps of the method described in the first aspect are implemented.

可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the second aspect to the fifth aspect, reference may be made to the relevant description of the first aspect, which will not be repeated here.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only for the present application. some examples.

图1是本申请提供的底层框架的结构示意图;Fig. 1 is the structural representation of the bottom frame provided by the application;

图2是本申请实施例一提供的一种摄像头访问方法的实现流程示意图;FIG. 2 is a schematic flowchart of the implementation of a camera access method provided in Embodiment 1 of the present application;

图3是用于摄像头访问的框架结构示意图;3 is a schematic diagram of a frame structure for camera access;

图4是本申请实施例二提供的一种摄像头访问装置的结构示意图;4 is a schematic structural diagram of a camera access device according to Embodiment 2 of the present application;

图5是本申请实施例三提供的一种终端设备的结构示意图。FIG. 5 is a schematic structural diagram of a terminal device according to Embodiment 3 of the present application.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without 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.

本申请实施例提供的摄像头访问方法适用于终端设备,示例性地,该终端设备包括但不限于:智能手机、平板电脑、笔记本、桌上型计算机以及服务器等。The camera access method provided by the embodiments of the present application is applicable to terminal devices, and the terminal devices include, but are not limited to, smart phones, tablet computers, notebooks, desktop computers, servers, and the like.

应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It is to be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described feature, integer, step, operation, element and/or component, but does not exclude one or more other features , whole, step, operation, element, component and/or the presence or addition of a collection thereof.

还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terminology used in the specification of the application herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural unless the context clearly dictates otherwise.

还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be further understood that, as used in this specification and the appended claims, the term "and/or" refers to and including 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 contextually interpreted as "when" or "once" or "in response to determining" or "in response to detecting" . Similarly, the phrases "if it is determined" or "if the [described condition or event] is detected" may be interpreted, depending on the context, to mean "once it is determined" or "in response to the determination" or "once the [described condition or event] is detected. ]" or "in response to detection of the [described condition or event]".

另外,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the present application, the terms "first", "second" and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

为便于本领域技术人员更容易理解本申请,下面以Android操作系统为例,描述用于对摄像头进行访问的底层框架。如图1所述,相机类程序通过底层框架101对摄像头进行访问,该底层框架101包括应用框架层102、相机服务层103以及硬件抽象层104。To make it easier for those skilled in the art to understand the present application, the following uses the Android operating system as an example to describe the underlying framework for accessing the camera. As shown in FIG. 1 , the camera class program accesses the camera through an underlying framework 101 , and the underlying framework 101 includes an application framework layer 102 , a camera service layer 103 and a hardware abstraction layer 104 .

如图1所示,应用框架层102提供了应用程序编程接口(Application ProgrammingInterface,API)函数(Android hardware camera2.0 CameraDevice以及Androidhardware camera2.0 CameraManager)以及黏合Binder接口(Android hardwarecamera2.0 ICameraDeviceUser以及Android hardware camera2.0 ICameraService),从而使得相机类程序可以通过调用上述API函数,进而通过调用上述Binder接口实现对摄像头的访问。As shown in FIG. 1 , the application framework layer 102 provides application programming interface (Application ProgrammingInterface, API) functions (Android hardware camera2.0 CameraDevice and Androidhardware camera2.0 CameraManager) and binding Binder interfaces (Android hardwarecamera2.0 ICameraDeviceUser and Android hardware camera2.0 ICameraService), so that the camera class program can access the camera by calling the above API function, and then by calling the above Binder interface.

其中,除了应用框架层102提供的Binder接口之外,相机服务层103中的ICameraDeviceCallbacks以及ICameraServiceListener也为Binder接口,其中,应用框架层102中的Android hardware camera2.0 ICameraDeviceUser是已打开的特定相机设备的接口,Android hardware camera2.0 ICameraService是相机服务的接口。相机服务层103的ICameraDeviceCallbacks和ICameraServiceListener分别是对应用框架102的Androidhardware camera2.0 CameraDevice和Android hardware camera 2.0 CameraManager的回调接口。Among them, in addition to the Binder interface provided by the application framework layer 102, the ICameraDeviceCallbacks and ICameraServiceListener in the camera service layer 103 are also Binder interfaces, and the Android hardware camera2.0 ICameraDeviceUser in the application framework layer 102 is the opened specific camera device. Interface, Android hardware camera2.0 ICameraService is the interface of the camera service. The ICameraDeviceCallbacks and ICameraServiceListener of the camera service layer 103 are callback interfaces to the Android hardware camera 2.0 CameraDevice and the Android hardware camera 2.0 CameraManager of the application framework 102 respectively.

除此之外,相机服务层103还提供了其他用于与抽象硬件层104(HardwareAbstraction Layer,HAL)进行互动的代码,通常位于Android操作系统文件frameworks/av/services/camera/libcameraservice/CameraService.cpp下,由于为现有技术,这里不再赘述。HAL104定义了由相机服务层103调用的接口函数,由于为现有技术,此处亦不再赘述。In addition, the camera service layer 103 also provides other codes for interacting with the abstract hardware layer 104 (HardwareAbstraction Layer, HAL), usually located in the Android operating system file frameworks/av/services/camera/libcameraservice/CameraService.cpp In the following, since it is the prior art, it will not be repeated here. The HAL 104 defines the interface functions to be called by the camera service layer 103 , since it is the prior art, it will not be repeated here.

附图1所示的底层框架仅仅是一种示意,本申请所述的底层框架并不仅仅局限于附图1所述的结构,其他能够实现对摄像头调用的底层框架也均在本申请保护范围之内。The underlying framework shown in FIG. 1 is only an illustration, and the underlying framework described in this application is not limited to the structure described in FIG. 1 , and other underlying frameworks that can call the camera are also within the scope of protection of this application. within.

下面通过具体实施例来对本申请所述的技术方案进行描述。The technical solutions described in this application will be described below through specific embodiments.

实施例一Example 1

下面对本申请实施例一提供的一种摄像头访问方法进行描述,该摄像头访问方法由相机类程序执行,请参阅附图2,该方法包括:The following describes a camera access method provided in Embodiment 1 of the present application. The camera access method is executed by a camera class program. Please refer to FIG. 2 , and the method includes:

在步骤S201中,若接收到开启相机类程序的指令时,向底层框架请求一个缓存管道BQ,其中,所述底层框架为用于对摄像头进行访问的程序框架,所述BQ用于缓存目标摄像头采集的图像,所述目标摄像头为待访问的摄像头;In step S201, if an instruction to open a camera class program is received, a cache pipeline BQ is requested from the underlying framework, wherein the underlying framework is a program framework for accessing the camera, and the BQ is used to cache the target camera The collected image, the target camera is the camera to be accessed;

在本申请实施例中,可以在用户启动相机APP时,或者在启动即时通讯应用中的“视频通话”功能时,或者还可以在启动网购平台中的“相机”功能时,认为接收到上述开启相机类程序的指令,本申请并不对接收上述开启相机类程序的指令场景进行限定。In the embodiment of the present application, when the user starts the camera APP, or when the "video call" function in the instant messaging application is started, or when the "camera" function in the online shopping platform is started, it may be considered that the above-mentioned activation is received. The instruction of the camera-like program, and the present application does not limit the scene of receiving the above-mentioned instruction to start the camera-like program.

当终端设备接收到上述开启相机类程序指令时,向底层框架请求一个缓存管道BQ,该缓存管道BQ用于缓存待访问的摄像头所采集的图像。该步骤S201所述的底层框架可以如图1所示。When the terminal device receives the above-mentioned instruction to enable the camera class program, it requests a cache pipeline BQ from the underlying framework, and the cache pipeline BQ is used to cache the images collected by the camera to be accessed. The underlying framework described in step S201 may be as shown in FIG. 1 .

在现有技术中,当终端设备接收到开启相机类程序的指令时,会向底层框架请求两个BQ,其中一个BQ用于预览画面显示,另一个用于获取拍照图像。与该现有技术不同,本申请仅仅会向底层框架请求一个BQ,该BQ同时用于预览画面显示以及获取拍照图像。In the prior art, when a terminal device receives an instruction to start a camera program, it will request two BQs from the underlying framework, one of which is used for preview screen display, and the other is used to obtain photographed images. Different from the prior art, the present application only requests a BQ from the underlying framework, and the BQ is simultaneously used for preview screen display and acquisition of photographed images.

在步骤S202中,基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示;In step S202, a preview screen display is performed based on the image collected by the target camera in the BQ cache;

在本申请实施例中,上述步骤S201请求得到的BQ用于预览画面的显示。在该步骤S202中,可以直接将所述BQ缓存的所述目标摄像头采集的图像作为预览画面显示;或者可以先对上述BQ缓存的上述目标摄像头采集的图像进行图像处理(比如添加滤镜、人脸美化和/或增添贴纸等处理),得到图像处理后图像,然后再将上述图像处理后图像作为预览画面进行显示。In this embodiment of the present application, the BQ requested in the above step S201 is used for displaying the preview screen. In this step S202, the image captured by the target camera in the BQ cache may be directly displayed as a preview screen; or the image captured by the target camera in the BQ cache may be first subjected to image processing (such as adding filters, human face beautification and/or adding stickers, etc.) to obtain an image after image processing, and then display the above-mentioned image after image processing as a preview screen.

在步骤S203中,若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像;In step S203, if a photographing instruction is received, based on the time corresponding to the photographing instruction, an image obtained by photographing is obtained in the image buffered by the BQ;

在本申请实施例中,拍照所得图像也来源于步骤S201所请求的BQ。相比于现有技术,减少了占据存储空间的BQ,进而能够在一定程度上减轻长时间进行拍照时终端设备的卡顿现象。In this embodiment of the present application, the image obtained by photographing also comes from the BQ requested in step S201. Compared with the prior art, the BQ occupying the storage space is reduced, so that the stuck phenomenon of the terminal device when taking pictures for a long time can be alleviated to a certain extent.

此外,在本申请实施例中,该步骤S203可以具体包括:将所述拍照指令对应时刻处的预览画面作为拍照所得图像。In addition, in this embodiment of the present application, the step S203 may specifically include: taking the preview image at the time corresponding to the photographing instruction as an image obtained by photographing.

也即是,当接收到拍照指令之后,直接将当前时刻的预览画面作为拍照所得图像,避免了在接收到拍照指令之后,相机类程序与底层框架的再次沟通,因此,一方面能够减小相机类程序的大小,另一方面能够在一定程度上提高拍照效率,避免了获取拍照所得图像的耗时过长,再一方面能够减少了终端设备的数据处理量,减小终端设备的功耗。That is, after receiving the photographing instruction, the preview image at the current moment is directly used as the image obtained by the photographing, which avoids the re-communication between the camera-like program and the underlying framework after receiving the photographing instruction. Therefore, on the one hand, the camera can be reduced. On the other hand, it can improve the efficiency of taking pictures to a certain extent, avoid taking too long to obtain the images obtained by taking pictures, and on the other hand, it can reduce the data processing amount of the terminal device and reduce the power consumption of the terminal device.

在现有技术中,当接收到拍照指令时,相机类程序会首先向底层框架发送该拍照指令,然后用于拍照的BQ会获取到摄像头采集的图像,将该图像作为拍照所得图像。在本申请实施例中,若直接将预览画面作为拍照所得图像,一方面由于避免了使用专用于拍照的BQ使得存储空间占据量减少,另一方面避免了拍照时相机类程序与底层框架的再次沟通,提高了拍照效率。In the prior art, when receiving a photographing instruction, the camera class program will first send the photographing instruction to the underlying framework, and then the BQ used for photographing will acquire the image collected by the camera, and use the image as the image obtained by photographing. In the embodiment of the present application, if the preview screen is directly used as the image obtained by taking pictures, on the one hand, the use of BQ dedicated for taking pictures is avoided, so that the storage space occupation is reduced, and on the other hand, the camera program and the underlying framework are avoided when taking pictures. Communication improves the efficiency of taking pictures.

此外,上述“拍照指令对应时刻”指的是:与用户发出拍照指令的时间点相距小于预设时长的时刻。比如,若用户是A时刻发出了拍照指令,所述预设时长为2ms,则距离A时刻小于2ms的任意时刻均可以是上述“拍照指令对应时刻”。In addition, the above-mentioned "time corresponding to the photographing instruction" refers to a time that is less than a preset time period from the time point when the user sends the photographing instruction. For example, if the user sends a photographing instruction at time A, and the preset duration is 2ms, any time less than 2ms away from time A may be the above-mentioned "time corresponding to the photographing instruction".

另外,在本申请实施例中,若拍照所得图像为预览画面,则该拍照所得图像的可交换图像文件格式(Exchangeable image file formot,exif)信息的确定方式为:对所述拍照所得图像对应的预览画面的图像参数信息解析得到。比如,若拍照所得图像为图像X,该图像X为预览画面Y,则可对该预览画面Y的图像参数信息(比如图像尺寸等信息)进行解析,得到图像X的exif信息,该exif信息可以被写入图像X的头文件中。In addition, in the embodiment of the present application, if the image obtained by taking a photo is a preview screen, the exchangeable image file format (Exchangeable image file format, exif) information of the image obtained by taking the photo is determined in the following way: The image parameter information of the preview screen is obtained through analysis. For example, if the image obtained by taking the photo is image X, and the image X is the preview screen Y, the image parameter information (such as image size and other information) of the preview screen Y can be analyzed to obtain the exif information of the image X, and the exif information can be is written to the header file of image X.

此外,在上述步骤S203之后,可以对该步骤S203获取的拍照所得图像进行图像处理,比如,尺寸修改、增加滤镜、人脸美化和/或增添贴纸等,得到拍照所得最终图像。In addition, after the above step S203, image processing can be performed on the photographed image obtained in step S203, such as size modification, adding filters, face beautification and/or adding stickers, etc., to obtain the final image obtained by photographing.

在本申请实施例中,上述相机类程序可具备录像功能,则该实施例一所提供的摄像头访问方法还可以包括:若接收到录像指令,直接将录像期间的各个预览画面进行整合,以生成视频文件。此外,上述相机类程序还可提供录像期间的拍照功能,则步骤S203可为具体包括:若在录像期间接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。In the embodiment of the present application, the above-mentioned camera program may have a video recording function, and the camera access method provided in the first embodiment may further include: if a video recording instruction is received, directly integrating each preview screen during the video recording to generate video file. In addition, the above-mentioned camera program can also provide the function of taking pictures during the video recording, and step S203 may specifically include: if a photographing instruction is received during the video recording, based on the time corresponding to the photographing instruction, obtain the image cached in the BQ. The resulting image was taken.

由此可见,本申请实施例一提供的摄像头访问方法,仅仅会向底层框架请求一个缓存管道(Buffer Queue,BQ),该BQ一方面用于预览画面的显示,另一方面用于拍照,相比于现有技术,减少了BQ的数量,进而减少了拍照时的存储空间占据量,从而在一定程度上减轻长时间使用相机类程序进行拍照所导致的终端设备卡顿现象。It can be seen that the camera access method provided by the first embodiment of the present application only requests a buffer queue (Buffer Queue, BQ) from the underlying framework. Compared with the prior art, the number of BQs is reduced, thereby reducing the amount of storage space occupied when taking pictures, thereby reducing the terminal device stuck phenomenon caused by using a camera program for a long time to take pictures to a certain extent.

为便于本领域技术人员更清楚的理解本申请所提供的技术方案,下面基于附图3来进一步描述用于摄像头访问的框架结构示意图。如图3所示,相机类程序通过调用底层框架来实现对摄像头的访问,其中,相机类程序包括参数配置模块、摄像头控制模块、视图显示控制模块、录像组件以及文件保存模块等。该参数配置模块主要是配置预览画面的显示帧率以及录像视频帧率等参数;该摄像头控制模块用于控制待打开摄像头的标识以及待关闭摄像头的标识等参数;该视图显示控制模块用于控制显示界面上显示控件以及隐藏空间等;该文件保存模块用于对录像得到的视频文件以及拍照所的的图像进行保存;该录像组件用于对各个经过特效处理的预览图像进行整合,以得到视频文件。In order to facilitate those skilled in the art to more clearly understand the technical solutions provided by the present application, the following further describes a schematic diagram of a frame structure for camera access based on FIG. 3 . As shown in Figure 3, the camera class program implements access to the camera by calling the underlying framework, wherein the camera class program includes a parameter configuration module, a camera control module, a view display control module, a video recording component, and a file saving module. The parameter configuration module mainly configures parameters such as the display frame rate of the preview screen and the frame rate of the video recording; the camera control module is used to control parameters such as the identification of the camera to be opened and the identification of the camera to be closed; the view display control module is used to control the Display controls and hidden spaces on the display interface; the file saving module is used to save the video files obtained by recording and the images taken by the camera; the video recording component is used to integrate each special effect processed preview image to obtain a video document.

此外,如图3所示,相机类程序通过一个BQ实现了预览画面的显示功能、录像功能以及拍照功能。然而,在现有技术中,拍照功能往往需要向底层框架调用另外一个BQ(如图3中灰色部分所示的BQ),然后对该BQ中存储的图像进行一系列图像处理之后(如图3中灰色部分所示的处理1’、处理2’以及处理N’所示,其中,处理1’可以为人像美化,处理2’可以为增加贴纸,处理N’可以为增添滤镜),得到拍照所得图像。In addition, as shown in FIG. 3 , the camera class program realizes the display function of the preview screen, the video recording function and the photographing function through a BQ. However, in the prior art, the camera function often needs to call another BQ to the underlying framework (the BQ shown in gray in Figure 3), and then perform a series of image processing on the image stored in the BQ (as shown in Figure 3). Processing 1', processing 2' and processing N' shown in the middle gray part, where processing 1' can be for portrait beautification, processing 2' can be adding stickers, and processing N' can be adding filters), get a photo resulting image.

显然,附图3所示的相机类程序在进行摄像头访问时,仅仅只需要一个BQ即可同时实现拍照、录像以及预览,因此,相比现有技术会占据更少的存储空间,因此,能够在一定程度上解决长时间采用相机类程序拍照出现卡顿的情况。此外,如图3所示,拍照所得图像其实为预览图像,因此,避免了传统的相机类程序需再和底层框架进行通信的过程,能够在一定程度上解决拍照延迟的问题,从而更快地获得拍照所得图像,并且减少了终端设备的数据处理量,减少了终端设备的拍照功耗。Obviously, when the camera program shown in FIG. 3 accesses the camera, only one BQ is needed to simultaneously realize photographing, video recording and previewing. Therefore, compared with the prior art, it will occupy less storage space. Therefore, it can To a certain extent, it solves the situation of freezing when taking pictures with camera-like programs for a long time. In addition, as shown in Figure 3, the image obtained by taking a photo is actually a preview image. Therefore, it avoids the process of traditional camera-like programs needing to communicate with the underlying framework, and can solve the problem of delay in taking photos to a certain extent. The images obtained by taking pictures are obtained, the data processing amount of the terminal device is reduced, and the power consumption of taking pictures of the terminal device is reduced.

实施例二Embodiment 2

如图4所示,为本申请实施例二提供的一种摄像头访问装置的结构示意图,为了便于说明,仅示出与本申请实施例相关的部分,该摄像头访问装置400包括:As shown in FIG. 4, it is a schematic structural diagram of a camera access device provided in Embodiment 2 of the present application. For convenience of description, only the parts related to the embodiment of the present application are shown. The camera access device 400 includes:

缓存管道请求模块401,用于若接收到开启相机类程序的指令时,向底层框架请求一个缓冲管道BQ,其中,所述底层框架为用于对摄像头进行访问的程序框架,所述BQ用于缓存目标摄像头采集的图像,所述目标摄像头为待访问的摄像头;The cache pipeline request module 401 is configured to request a buffer pipeline BQ from the underlying framework if an instruction to open a camera class program is received, wherein the underlying framework is a program framework for accessing the camera, and the BQ is used for Cache the images collected by the target camera, where the target camera is the camera to be accessed;

预览显示模块402,用于基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示;A preview display module 402, configured to display a preview screen based on the image collected by the target camera in the BQ cache;

拍照模块403,用于若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。The photographing module 403 is configured to, if a photographing instruction is received, acquire an image obtained by photographing in the image cached in the BQ at the time corresponding to the photographing instruction.

可选地,上述相机类程序具备录像功能;Optionally, the above-mentioned camera program has a video recording function;

相应地,上述摄像头访问装置400还包括:Correspondingly, the above-mentioned camera access device 400 further includes:

预览整合模块,用于若接收到录像指令,则将录像期间的各个预览画面进行整合,以生成视频文件。The preview integration module is used for integrating various preview images during the recording period to generate a video file if a recording instruction is received.

可选地,上述相机类程序具备录像期间拍照功能;Optionally, the above-mentioned camera program has the function of taking pictures during video recording;

相应地,上述拍照模块403,包括:Correspondingly, the above-mentioned photographing module 403 includes:

录像拍照单元,用于若在录像期间接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。The recording and photographing unit is configured to acquire an image obtained by photographing in the image buffered in the BQ at the time corresponding to the photographing instruction if a photographing instruction is received during the recording period.

可选地,上述摄像头访问装置400还包括:Optionally, the above-mentioned camera access device 400 further includes:

拍照最终模块,用于对所述拍照所得图像进行图像处理,得到拍照所得最终图像。The final photographing module is used for performing image processing on the image obtained by photographing to obtain the final image obtained by photographing.

可选地,上述预览显示模块402包括:Optionally, the above-mentioned preview display module 402 includes:

图像处理单元,用于对所述BQ缓存的所述目标摄像头采集的图像进行图像处理,得到图像处理后图像,将所述图像处理后图像作为预览画面进行显示。The image processing unit is configured to perform image processing on the image collected by the target camera in the BQ cache to obtain an image after image processing, and display the image after image processing as a preview screen.

可选地,上述拍照模块403具体用于:Optionally, the above-mentioned photographing module 403 is specifically used for:

将所述拍照指令对应时刻处的预览画面作为拍照所得图像。The preview image at the moment corresponding to the photographing instruction is used as the image obtained by photographing.

可选地,上述拍照所得图像的可交换图像文件格式exif信息确定方式为:对所述拍照所得图像对应的预览画面的图像参数信息解析得到。Optionally, the method of determining the exchangeable image file format exif information of the above-mentioned image obtained by taking a photo is obtained by analyzing the image parameter information of the preview screen corresponding to the image obtained by taking the photo.

需要说明的是,上述装置之间的信息交互、执行过程等内容,由于与本申请方法实施例一基于同一构思,其具体功能及带来的技术效果,具体可参见相应方法实施例部分,此处不再赘述。It should be noted that the information exchange, execution process and other contents between the above-mentioned devices are based on the same concept as the method embodiment 1 of the present application. For specific functions and technical effects, please refer to the corresponding method embodiment section. It is not repeated here.

实施例三Embodiment 3

图5是本申请实施例三提供的终端设备的结构示意图。如图5所示,该实施例的终端设备500包括:处理器501、存储器502以及存储在上述存储器502中并可在上述处理器501上运行的计算机程序503。上述处理器501执行上述计算机程序503时实现上述方法实施例一中的步骤。或者,上述处理器601执行上述计算机程序503时实现上述装置实施例二中各模块的功能。FIG. 5 is a schematic structural diagram of a terminal device provided in Embodiment 3 of the present application. As shown in FIG. 5 , the terminal device 500 in this embodiment includes: a processor 501 , a memory 502 , and a computer program 503 stored in the above-mentioned memory 502 and executable on the above-mentioned processor 501 . When the processor 501 executes the computer program 503, the steps in the first method embodiment are implemented. Alternatively, when the above-mentioned processor 601 executes the above-mentioned computer program 503, the functions of each module in the second embodiment of the above-mentioned apparatus are implemented.

示例性的,上述计算机程序503可以被分割成一个或多个模块,上述一个或者多个模块被存储在上述存储器502中,并由上述处理器501执行,以完成本申请。上述一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述上述计算机程序503在上述终端设备500中的执行过程。例如,上述计算机程序503可以包括缓存管道请求模块、预览显示模块以及拍照模块,各模块具体功能如下:Exemplarily, the above-mentioned computer program 503 may be divided into one or more modules, and the above-mentioned one or more modules are stored in the above-mentioned memory 502 and executed by the above-mentioned processor 501 to complete the present application. The above-mentioned one or more modules may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the above-mentioned computer program 503 in the above-mentioned terminal device 500 . For example, the above computer program 503 may include a cache pipeline request module, a preview display module, and a camera module, and the specific functions of each module are as follows:

若接收到开启相机类程序的指令时,向底层框架请求一个缓冲管道BQ,其中,所述底层框架为用于对摄像头进行访问的程序框架,所述BQ用于缓存目标摄像头采集的图像,所述目标摄像头为待访问的摄像头;If an instruction to open a camera program is received, a buffer pipeline BQ is requested from the underlying framework, where the underlying framework is a program framework used to access the camera, and the BQ is used to cache the images collected by the target camera. The target camera is the camera to be accessed;

基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示;Based on the image collected by the target camera in the BQ cache, display the preview screen;

若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。If a photographing instruction is received, based on the time corresponding to the photographing instruction, an image obtained by photographing is acquired in the image buffered by the BQ.

上述终端设备可包括,但不仅限于,处理器501、存储器502。本领域技术人员可以理解,图5仅仅是终端设备500的示例,并不构成对终端设备500的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如上述终端设备还可以包括输入输出设备、网络接入设备、总线等。The above-mentioned terminal device may include, but is not limited to, the processor 501 and the memory 502 . Those skilled in the art can understand that FIG. 5 is only an example of the terminal device 500, and does not constitute a limitation on the terminal device 500. It may include more or less components than the one shown, or combine some components, or different components For example, the above-mentioned terminal device may also include input and output devices, network access devices, buses, and the like.

所称处理器501可以是中央处理单元(Central Processing Unit,CPU),还可以是其它通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 501 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

上述存储器502可以是上述终端设备500的内部存储单元,例如终端设备500的硬盘或内存。上述存储器502也可以是上述终端设备500的外部存储设备,例如上述终端设备500上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(SecureDigital,SD)卡,闪存卡(Flash Card)等。进一步地,上述存储器502还可以既包括上述终端设备500的内部存储单元也包括外部存储设备。上述存储器502用于存储上述计算机程序以及上述终端设备所需的其它程序和数据。上述存储器502还可以用于暂时地存储已经输出或者将要输出的数据。The above-mentioned memory 502 may be an internal storage unit of the above-mentioned terminal device 500 , such as a hard disk or a memory of the terminal device 500 . The above-mentioned memory 502 may also be an external storage device of the above-mentioned terminal device 500, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (Secure Digital, SD) card, a flash memory card equipped on the above-mentioned terminal device 500 (Flash Card) etc. Further, the above-mentioned memory 502 may also include both an internal storage unit of the above-mentioned terminal device 500 and an external storage device. The above-mentioned memory 502 is used to store the above-mentioned computer program and other programs and data required by the above-mentioned terminal device. The above-mentioned memory 502 may also be used to temporarily store data that has been output or will be output.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将上述装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述装置中模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. The internal structure of the above device is divided into different functional modules to complete all or part of the functions described above. Each functional module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may be implemented in the form of hardware. , can also be implemented in the form of software functional units. In addition, the specific names of the functional modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working process of the modules in the foregoing apparatus, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的模块及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

上述集成的模块如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述各个方法实施例中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,上述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,上述计算机程序包括计算机程序代码,上述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。上述计算机可读介质可以包括:能够携带上述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,上述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If the above-mentioned integrated modules are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the above-mentioned method embodiments, and can also be completed by instructing relevant hardware through a computer program, and the above-mentioned computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code may be in the form of source code, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random Access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the above-mentioned computer-readable media may be appropriately increased or decreased in accordance with the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable media does not Including electrical carrier signals and telecommunication signals.

以上上述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that the above-mentioned embodiments can still be used for The recorded technical solutions are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in the present application. within the scope of protection of the application.

Claims (10)

1.一种摄像头访问方法,其特征在于,包括:1. a camera access method, is characterized in that, comprises: 若接收到开启相机类程序的指令时,向底层框架请求一个缓冲管道BQ,其中,所述底层框架为用于对摄像头进行访问的程序框架,所述BQ用于缓存目标摄像头采集的图像,所述目标摄像头为待访问的摄像头;If an instruction to open a camera program is received, a buffer pipeline BQ is requested from the underlying framework, where the underlying framework is a program framework used to access the camera, and the BQ is used to cache the images collected by the target camera. The target camera is the camera to be accessed; 基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示;Based on the image collected by the target camera in the BQ cache, display the preview screen; 若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。If a photographing instruction is received, based on the time corresponding to the photographing instruction, an image obtained by photographing is acquired in the image buffered by the BQ. 2.如权利要求1所述的摄像头访问方法,其特征在于,所述相机类程序具备录像功能;2. The camera access method according to claim 1, wherein the camera class program has a video recording function; 相应地,所述摄像头访问方法还包括:Correspondingly, the camera access method further includes: 若接收到录像指令,则将录像期间的各个预览画面进行整合,以生成视频文件。If a recording instruction is received, the preview images during the recording are integrated to generate a video file. 3.如权利要求2所述的摄像头访问方法,其特征在于,所述相机类程序具备录像期间拍照功能;3. camera access method as claimed in claim 2, is characterized in that, described camera class program possesses photographing function during video recording; 相应地,所述若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像,包括:Correspondingly, if a photographing instruction is received, based on the time corresponding to the photographing instruction, in the image cached by the BQ, the image obtained by photographing is acquired, including: 若在录像期间接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。If a photographing instruction is received during the video recording, based on the time corresponding to the photographing instruction, an image obtained by photographing is obtained from the image buffered by the BQ. 4.如权利要求1所述的摄像头访问方法,其特征在于,在所述基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像的步骤之后,还包括:4. camera access method as claimed in claim 1, it is characterised in that, at the corresponding moment based on the photographing instruction, in the image buffered by the BQ, after the step of acquiring the image obtained by photographing, also comprising: 对所述拍照所得图像进行图像处理,得到拍照所得最终图像。Perform image processing on the image obtained by taking the photo to obtain the final image obtained by taking the photo. 5.如权利要求1所述的摄像头访问方法,其特征在于,所述基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示,包括:5. The camera access method according to claim 1, wherein the image collected by the target camera based on the BQ cache is displayed on a preview screen, comprising: 对所述BQ缓存的所述目标摄像头采集的图像进行图像处理,得到图像处理后图像;Perform image processing on the image collected by the target camera in the BQ cache to obtain an image after image processing; 将所述图像处理后图像作为预览画面进行显示。The image after image processing is displayed as a preview screen. 6.如权利要求1至5中任一项所述的摄像头访问方法,其特征在于,所述基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像,包括:6. The camera access method according to any one of claims 1 to 5, wherein, at the corresponding moment based on the photographing instruction, at the image buffered by the BQ, acquiring an image obtained by photographing, comprising: 将所述拍照指令对应时刻处的预览画面作为拍照所得图像。The preview image at the moment corresponding to the photographing instruction is used as the image obtained by photographing. 7.如权利要求6所述的摄像头访问方法,其特征在于,所述拍照所得图像的可交换图像文件格式exif信息确定方式为:对所述拍照所得图像对应的预览画面的图像参数信息解析得到。7. camera access method as claimed in claim 6, is characterized in that, the exchangeable image file format exif information determination mode of described photograph obtained image is: to the image parameter information of the corresponding preview screen of described photographed obtained image to obtain . 8.一种摄像头访问装置,其特征在于,包括:8. A camera access device, comprising: 缓存管道请求模块,用于若接收到开启相机类程序的指令时,向底层框架请求一个缓冲管道BQ,其中,所述底层框架为用于对摄像头进行访问的程序框架,所述BQ用于缓存目标摄像头采集的图像,所述目标摄像头为待访问的摄像头;The cache pipeline request module is used to request a buffer pipeline BQ from the underlying framework if an instruction to open the camera class program is received, wherein the underlying framework is a program framework for accessing the camera, and the BQ is used for caching The image collected by the target camera, the target camera is the camera to be accessed; 预览显示模块,用于基于所述BQ缓存的所述目标摄像头采集的图像,进行预览画面显示;A preview display module, configured to display a preview screen based on the image collected by the target camera in the BQ cache; 拍照模块,用于若接收到拍照指令,基于所述拍照指令对应时刻处,在所述BQ缓存的图像,获取拍照所得图像。A photographing module, configured to acquire an image obtained by photographing in the image cached in the BQ at the time corresponding to the photographing instruction if a photographing instruction is received. 9.一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述摄像头访问方法的步骤。9. A terminal device, comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that, when the processor executes the computer program, the implementation as claimed in the claims Steps of the camera access method described in any one of 1 to 7. 10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述摄像头访问方法的步骤。10. A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the camera access according to any one of claims 1 to 7 is implemented steps of the method.
CN202010423175.9A 2020-05-19 2020-05-19 Camera access method, access device, terminal device and readable storage medium Active CN111447370B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010423175.9A CN111447370B (en) 2020-05-19 2020-05-19 Camera access method, access device, terminal device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010423175.9A CN111447370B (en) 2020-05-19 2020-05-19 Camera access method, access device, terminal device and readable storage medium

Publications (2)

Publication Number Publication Date
CN111447370A true CN111447370A (en) 2020-07-24
CN111447370B CN111447370B (en) 2021-07-27

Family

ID=71653763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010423175.9A Active CN111447370B (en) 2020-05-19 2020-05-19 Camera access method, access device, terminal device and readable storage medium

Country Status (1)

Country Link
CN (1) CN111447370B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112312023A (en) * 2020-10-30 2021-02-02 北京小米移动软件有限公司 A camera cache queue allocation method, device, electronic device and storage medium
CN114584738A (en) * 2022-05-06 2022-06-03 深圳市飞图视讯有限公司 Camera sharing method and device, terminal equipment and storage medium
WO2023056795A1 (en) * 2021-10-09 2023-04-13 华为技术有限公司 Quick photographing method, electronic device, and computer readable storage medium
CN117149294A (en) * 2023-02-27 2023-12-01 荣耀终端有限公司 Camera application configuration method, equipment and storage media
WO2024040990A1 (en) * 2022-08-24 2024-02-29 荣耀终端有限公司 Photographing method and electronic device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140049611A1 (en) * 2012-08-16 2014-02-20 Lg Electronics Inc. Mobile terminal and controlling method thereof
US20140307116A1 (en) * 2013-04-12 2014-10-16 Nvidia Corporation Method and system for managing video recording and/or picture taking in a restricted environment
CN104580888A (en) * 2014-12-17 2015-04-29 广东欧珀移动通信有限公司 An image processing method and terminal
US9838641B1 (en) * 2015-12-30 2017-12-05 Google Llc Low power framework for processing, compressing, and transmitting images at a mobile image capture device
CN107527317A (en) * 2017-07-18 2017-12-29 西安电子科技大学 Data transmission system based on image procossing
US10178310B1 (en) * 2015-08-20 2019-01-08 Ambarella, Inc. Data unit feed synchronization to multiple pipelines
CN109672884A (en) * 2017-10-13 2019-04-23 阿里巴巴集团控股有限公司 Graphics hardware code processing method and device
CN110881104A (en) * 2019-10-17 2020-03-13 宇龙计算机通信科技(深圳)有限公司 Photographing method, photographing device, storage medium and terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140049611A1 (en) * 2012-08-16 2014-02-20 Lg Electronics Inc. Mobile terminal and controlling method thereof
US20140307116A1 (en) * 2013-04-12 2014-10-16 Nvidia Corporation Method and system for managing video recording and/or picture taking in a restricted environment
CN104580888A (en) * 2014-12-17 2015-04-29 广东欧珀移动通信有限公司 An image processing method and terminal
US10178310B1 (en) * 2015-08-20 2019-01-08 Ambarella, Inc. Data unit feed synchronization to multiple pipelines
US9838641B1 (en) * 2015-12-30 2017-12-05 Google Llc Low power framework for processing, compressing, and transmitting images at a mobile image capture device
CN107527317A (en) * 2017-07-18 2017-12-29 西安电子科技大学 Data transmission system based on image procossing
CN109672884A (en) * 2017-10-13 2019-04-23 阿里巴巴集团控股有限公司 Graphics hardware code processing method and device
CN110881104A (en) * 2019-10-17 2020-03-13 宇龙计算机通信科技(深圳)有限公司 Photographing method, photographing device, storage medium and terminal

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112312023A (en) * 2020-10-30 2021-02-02 北京小米移动软件有限公司 A camera cache queue allocation method, device, electronic device and storage medium
CN112312023B (en) * 2020-10-30 2022-04-08 北京小米移动软件有限公司 A camera cache queue allocation method, device, electronic device and storage medium
WO2023056795A1 (en) * 2021-10-09 2023-04-13 华为技术有限公司 Quick photographing method, electronic device, and computer readable storage medium
CN115967851A (en) * 2021-10-09 2023-04-14 华为技术有限公司 Quick photographing method, electronic device and computer readable storage medium
CN115967851B (en) * 2021-10-09 2025-09-12 华为技术有限公司 Fast photographing method, electronic device and computer-readable storage medium
CN114584738A (en) * 2022-05-06 2022-06-03 深圳市飞图视讯有限公司 Camera sharing method and device, terminal equipment and storage medium
WO2024040990A1 (en) * 2022-08-24 2024-02-29 荣耀终端有限公司 Photographing method and electronic device
CN117149294A (en) * 2023-02-27 2023-12-01 荣耀终端有限公司 Camera application configuration method, equipment and storage media

Also Published As

Publication number Publication date
CN111447370B (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN111447370A (en) Camera access method, access device, terminal device and readable storage medium
CN113727035B (en) Image processing method, system, electronic device and storage medium
US8982223B2 (en) Image sending apparatus, image recording apparatus and image recording method using identification information relating reduced image data with original image data
US9124548B2 (en) Method for uploading media file, electronic device using the same, and non-transitory storage medium
KR20170097414A (en) Electronic device and operating method thereof
CN109068059B (en) Method for calling camera, mobile terminal and storage medium
CN110475065A (en) Method, apparatus, electronic equipment and the storage medium of image procossing
CN107302666A (en) Photographic method, mobile terminal and computer-readable recording medium
CN106453572B (en) Method and system based on Cloud Server synchronous images
EP3926988A1 (en) Third-party access of end-user device assets
CN111314646A (en) Image acquisition method, image acquisition device, terminal device and readable storage medium
CN110958399A (en) High dynamic range image HDR realization method and related products
CN110049247A (en) Image optimization method and device, electronic equipment and readable storage medium
CN115689963A (en) Image processing method and electronic equipment
CN111447439B (en) Image coding method, image coding device and mobile terminal
US20110211087A1 (en) Method and apparatus providing for control of a content capturing device with a requesting device to thereby capture a desired content segment
CN111314606A (en) Photographing method and device, electronic equipment and storage medium
US20250191119A1 (en) Image obtaining method and electronic device
CN117692759A (en) Method, terminal, storage medium and chip for generating preview image
WO2019227620A1 (en) Image compression display method and device, computer device and storage medium
CN111294500A (en) Image shooting method, terminal device and medium
KR20150045820A (en) Apparatus and Method For Managing Image Files by Using Thumbnail Images
WO2022067491A1 (en) Image processing method, cloud end server, image processing apparatus, and storage medium
WO2022061723A1 (en) Image processing method, device, terminal, and storage medium
CN116028383B (en) Cache management method and electronic equipment

Legal Events

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