WO2021249353A1 - 显示设备、摄像头检测方法及摄像头异常处理方法 - Google Patents

显示设备、摄像头检测方法及摄像头异常处理方法 Download PDF

Info

Publication number
WO2021249353A1
WO2021249353A1 PCT/CN2021/098709 CN2021098709W WO2021249353A1 WO 2021249353 A1 WO2021249353 A1 WO 2021249353A1 CN 2021098709 W CN2021098709 W CN 2021098709W WO 2021249353 A1 WO2021249353 A1 WO 2021249353A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
display
application
image
controller
Prior art date
Application number
PCT/CN2021/098709
Other languages
English (en)
French (fr)
Inventor
王宏斌
陈浩
李保成
司洪龙
吴汉勇
孔祥键
刘晋
Original Assignee
海信视像科技股份有限公司
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
Priority claimed from CN202010514148.2A external-priority patent/CN111683279B/zh
Priority claimed from CN202010722308.2A external-priority patent/CN111866498B/zh
Priority claimed from CN202010752500.6A external-priority patent/CN111918056B/zh
Application filed by 海信视像科技股份有限公司 filed Critical 海信视像科技股份有限公司
Publication of WO2021249353A1 publication Critical patent/WO2021249353A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/422Input-only peripherals, i.e. input devices connected to specially adapted client devices, e.g. global positioning system [GPS]
    • H04N21/4223Cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk

Definitions

  • This application relates to the technical field of display devices, and specifically to a display device, a camera detection method, and a camera abnormality processing method.
  • Display devices have become an indispensable device in life. Many display devices are equipped with cameras. Some applications such as mirrors and video calls require cameras to collect images. Then the status of the camera is very important for the display device.
  • Some embodiments of the present application provide a display device, which includes:
  • a display for displaying images and a user interface, and a selector used in the user interface to indicate that an item is selected in the user interface;
  • the controllers respectively connected to the display and the camera, the controllers are configured as:
  • controlling the display In response to receiving a control signal input by the user for instructing to start the shooting function of the camera application, controlling the display to display the first image collected by the camera;
  • the display is controlled to refresh the first image into a second image, where the second image is an image collected after the camera is reconnected.
  • Some embodiments of the present application provide a method for processing camera abnormalities, the method including:
  • controlling the display In response to receiving a control signal input by the user for instructing to start the shooting function of the camera application, controlling the display to display the first image collected by the camera;
  • the display is controlled to refresh the first image into a second image, where the second image is an image collected after the camera is reconnected.
  • a camera disconnection message is sent to the camera application using the camera.
  • the message that the camera is disconnected may be a camera unplug function registered by the controller when the camera is started.
  • Some embodiments of the present application also provide a display device, including:
  • the camera is configured to collect image data
  • a display configured to present a preview screen displaying image data
  • a controller connected to the camera and the display, and a designated application for calling the camera is configured in the controller, and the controller is configured to:
  • the image data collected by the camera is re-acquired, so that the designated application can call the camera normally.
  • the controller detects whether the camera is successfully connected when the device node that executes the if the camera does not exist, and is further configured to:
  • reacquiring the image data collected by the camera is further configured to:
  • the image data collected by the camera is reacquired, and the reacquired image data is displayed on the display, so that the designated application can call the camera normally.
  • the controller is further configured to:
  • the image data collected by the camera is cyclically acquired according to the preset reading times
  • the delay is the first time period
  • the designated application calls the camera normally.
  • the controller is further configured to:
  • the abnormal information of the camera is sent to a designated application, and the abnormal information of the camera is displayed on the display.
  • the controller calling the camera while executing the specified application is further configured to:
  • the step of detecting whether the camera is successfully connected is executed.
  • the controller is further configured to:
  • the newly acquired image data is sent to the display, and the display displays a new preview screen, and the new preview screen refers to a screen presented when the newly acquired image data is displayed.
  • Some embodiments of the present application also provide a display device, including:
  • a prompt message is displayed on the display, and the prompt message includes the reason for the abnormal state and the operation method for releasing the abnormal state.
  • Some embodiments of the present application also provide a camera detection method, including:
  • a prompt message is displayed on the display, and the prompt message includes the reason for the abnormal state and the operation method for releasing the abnormal state.
  • the method specifically includes:
  • a prompt message is displayed on the display, and the prompt information includes that the camera is not currently inserted or the physical switch of the camera is turned off.
  • Fig. 1 is a schematic diagram of an operation scenario between a display device and a control device according to some embodiments of the present application;
  • FIG. 2 is a block diagram of the hardware configuration of a display device 200 according to some embodiments of the present application.
  • FIG. 3 is a block diagram of the hardware configuration of the control device 100 according to some embodiments of the present application.
  • FIG. 4 is a schematic diagram of software configuration in a display device 200 according to some embodiments of the present application.
  • FIG. 5 is a schematic diagram showing the display of an icon control interface of an application program in a display device 200 according to some embodiments of the present application;
  • 6A-6F are schematic diagrams of prompt information on a display device interface according to some embodiments of the present application.
  • FIG. 7 is a schematic diagram of a system framework of a display device 200 according to some embodiments of the present application.
  • FIG. 8 is a schematic flowchart of an image restoration method according to some embodiments of the present application.
  • FIG. 9 is a schematic diagram of an interaction flow between a camera application and a hardware abstraction layer according to some embodiments of the present application.
  • FIG. 10 is a schematic diagram of an interaction flow between a camera application and a hardware abstraction layer according to other embodiments of the present application.
  • FIG. 11 is a flowchart of a method for processing a camera abnormality according to some embodiments of the present application.
  • FIG. 12 is another flowchart of a method for processing camera abnormalities according to some embodiments of the present application.
  • FIG. 13 is another flowchart of a method for processing camera abnormalities according to some embodiments of the present application.
  • FIG. 14 exemplarily shows a flowchart of a method for displaying a new preview screen according to some embodiments.
  • FIG. 1 is a schematic diagram of an operation scenario between a display device and a control device according to some embodiments of the present application.
  • a user can operate the display device 200 through a mobile terminal 300 and the control device 100.
  • the control device 100 may be a remote controller, and the communication between the remote controller and the display device includes infrared protocol communication, Bluetooth protocol communication, and wireless or other wired methods to control the display device 200.
  • the user can control the display device 200 by inputting user instructions through keys on the remote control, voice input, control panel input, etc.
  • mobile terminals, tablet computers, computers, notebook computers, and other smart devices may also be used to control the display device 200.
  • the mobile terminal 300 can install a software application with the display device 200, realize connection communication through a network communication protocol, and realize the purpose of one-to-one control operation and data communication. It is also possible to transmit the audio and video content displayed on the mobile terminal 300 to the display device 200 to achieve a synchronous display function.
  • the display device 200 also performs data communication with the server 400 through multiple communication methods.
  • the display device 200 may be allowed to communicate through a local area network (LAN), a wireless local area network (WLAN), and other networks.
  • the server 400 may provide various contents and interactions to the display device 200.
  • the display device 200 may be a liquid crystal display, an OLED display, or a projection display device.
  • the display device 200 may additionally provide a smart network TV function with a computer support function.
  • Fig. 2 exemplarily shows a configuration block diagram of the control device 100 according to an exemplary embodiment.
  • the control device 100 includes a controller 110, a communication interface 130, a user input/output interface 140, a memory, and a power supply.
  • the control device 100 can receive an input operation instruction from a user, and convert the operation instruction into an instruction that can be recognized and responded to by the display device 200, so as to act as an intermediary between the user and the display device 200.
  • the communication interface 130 is used to communicate with the outside, and includes at least one of a WIFI chip, a Bluetooth module, an NFC or an alternative module.
  • the user input/output interface 140 includes at least one of a microphone, a touch panel, a sensor, a button, or an alternative module.
  • FIG. 3 shows a block diagram of the hardware configuration of the display device 200 according to an exemplary embodiment.
  • the display device 200 includes a tuner and demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280.
  • the controller includes a central processing unit, a video processor, an audio processor, a graphics processor, RAM, ROM, and the first interface to the nth interface for input/output.
  • the display 260 may be at least one of a liquid crystal display, an OLED display, a touch display, and a projection display, and may also be a projection device and a projection screen.
  • the tuner demodulator 210 receives broadcast television signals through a wired or wireless receiving manner, and demodulates audio and video signals, such as EPG data signals, from multiple wireless or wired broadcast television signals.
  • the detector 230 is used to collect signals from the external environment or interact with the outside.
  • the controller 250 and the tuner and demodulator 210 may be located in different separate devices, that is, the tuner and demodulator 210 may also be in an external device of the main device where the controller 250 is located, such as an external set-top box.
  • the controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in the memory.
  • the controller 250 controls the overall operation of the display device 200.
  • the user may input a user command on a graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input command through the graphical user interface (GUI).
  • GUI graphical user interface
  • the user may input a user command by inputting a specific sound or gesture, and the user input interface recognizes the sound or gesture through the sensor to receive the user input command.
  • the "user interface” is a medium interface for interaction and information exchange between an application or operating system and a user, and it realizes the conversion between the internal form of information and the form acceptable to the user.
  • the commonly used form of the user interface is the Graphic User Interface (GUI), which refers to the user interface related to the operation of the computer that is displayed in a graphical manner. It can be an icon, window, control and other interface elements displayed on the display screen of an electronic device.
  • the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc. At least one of the visual interface elements.
  • FIG. 4 is a schematic diagram of the software configuration in the display device 200 according to some embodiments of the present application.
  • the system is divided into four layers, from top to bottom, respectively, the application (Applications) layer (referred to as “application layer”) , Application Framework layer (referred to as “framework layer”), Android runtime (Android runtime) and system library layer (referred to as “system runtime layer”), and kernel layer.
  • the kernel layer contains at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power supply Drive etc.
  • FIG. 5 is a schematic diagram of the icon control interface display of an application program in the display device 200 according to some embodiments of the present application.
  • the application layer includes at least one application program that can display a corresponding icon control on the display, such as: Live TV application icon control, video-on-demand application icon control, media center application icon control, application center icon control, game application icon control, etc.
  • Live TV applications can provide live TV through different sources.
  • Video-on-demand applications can provide videos from different storage sources. Unlike live TV applications, VOD provides video display from certain storage sources.
  • Media center applications can provide various multimedia content playback applications.
  • Application center can provide storage of various applications.
  • a display device with a camera needs to detect the state of the camera when opening an application that uses the camera.
  • Figure 6A- Figure 6F which specifically include:
  • the camera may be a built-in camera
  • USB universal serial bus
  • the universal serial bus (USB) port of the camera is used to detect whether a USB device is inserted. If the USB device is not inserted, a dialog box will pop up to inform the user that the built-in camera is not inserted or the physical switch of the camera is turned off. When the switch is turned off, the camera will be powered off directly, so the USB port will detect that no device is plugged in, just like unplugging the camera.
  • a prompt message is displayed on the display, and the prompt information includes that the camera is not currently inserted or the physical switch of the camera is turned off.
  • the display pops up a dialog box to prompt the user that the camera is not currently inserted or the physical switch of the camera is turned off, as shown in FIG. 6A.
  • the camera If it is detected that the universal serial bus port of the camera has been inserted into the camera, check whether the camera can be started normally. If the camera can be started normally, the camera will work according to the user's input instructions; if the camera cannot be started normally, a prompt message will be displayed on the monitor, the prompt message includes the camera abnormality, turn off the physical switch of the camera or plug and unplug the camera before restarting Open.
  • the camera motor control service is not started and the motor control service is started normally, but the communication with the camera is abnormal.
  • a prompt message is displayed on the display.
  • the prompt message includes that the motor control service has not been started, exit the application again and open it again, and restart the motor control service of the camera.
  • the display pops up a dialog box to prompt the user that the motor control service is not started, exit the application again and open it again, as shown in Figure 6B. Restart the motor control service of the camera in the background.
  • a prompt message is displayed on the display, and the prompt message includes the abnormality of the camera. Turn off the physical switch of the camera or plug and unplug the camera before turning it on again.
  • the display pops up a dialog box to prompt the user that the camera is abnormal, turn off the physical switch of the camera or plug and unplug the camera and then turn it on again, as shown in FIG. 6C.
  • the camera provider (Camera Provider) service is abnormal, the current camera is occupied, and the camera provider service and the camera communication are abnormal.
  • the prompt information includes the abnormality of the camera service, exit the current application and reopen it.
  • the abnormality of the camera provider service means that the camera provider service is not activated.
  • a dialog box pops up on the display to prompt the user that the service of the camera is abnormal, and the current application is reopened after exiting, as shown in FIG. 6D.
  • a prompt message is displayed on the display, and the prompt message includes the current camera is occupied, allowing the user to choose whether to stop occupying the camera.
  • the display pops up a dialog box to prompt the user that the current camera is occupied by a certain application, and allows the user to choose whether to stop the certain application from occupying the camera, as shown in FIG. 6E.
  • a prompt message is displayed on the display.
  • the prompt message includes the abnormality of the camera. Exit the current application and turn off the physical switch of the camera or re-open the camera after plugging and unplugging the camera.
  • the display pops up a dialog box to prompt the user that the camera is abnormal, exit the current application and turn off the camera's physical switch or plug and unplug the camera again, as shown in Figure 6F Shown.
  • the user when the user uses the camera, it is detected whether the camera state is normal. If the camera state is abnormal, the user will be prompted to the cause of the abnormal state of the camera and the operation method to remove the abnormal state, so that the user can quickly use the prompt operation method. Turn on the camera to improve user experience.
  • Step S501 Receive through the user interface a control instruction for starting the camera input by the user by operating the control device; in response to the control instruction for starting the camera input by the user, step S502 is executed.
  • Step S502 Detect whether the USB port of the camera is inserted into the camera
  • the detection is triggered at the framework layer at this time.
  • the camera can be a built-in camera, or it can be plugged into the camera through a USB interface.
  • the USB device can be a camera. If the USB device is not inserted, a dialog box will pop up to inform the user that the built-in camera is not inserted or the physical switch of the camera is turned off. Among them, when the physical switch is turned off, the camera will be powered off directly, so the USB port will detect that no device is inserted, just like unplugging the camera.
  • step S503 Display prompt information on the display, where the prompt information includes that the camera is not currently inserted or the physical switch of the camera is turned off.
  • the display pops up a dialog box to prompt the user that the camera is not currently inserted or the physical switch of the camera is turned off, as shown in FIG. 6A.
  • step S504 Detects whether the camera can be started normally. If it is detected that the camera is normally started, step S505 is executed. Step S505: Determine whether the camera is a pan-tilt camera. If the camera is not a pan-tilt camera, end the detection. If the camera is a pan-tilt camera, step S506 is executed. Step S506: Detect whether the motor control service and the camera can communicate normally. When it is detected that the motor control service and the camera cannot communicate normally, there are two situations: the camera motor control service does not start and the motor control service starts normally, but the communication with the camera is abnormal.
  • step S507 Display a prompt message on the display, the prompt message including that the motor control service is not started, exit the application again and open it again, and restart the motor control service of the camera.
  • the display pops up a dialog box to prompt the user that the motor control service is not started, exit the application again and reopen it, as shown in FIG. 6B. Restart the motor control service of the camera in the background.
  • Step S508 Display prompt information on the display.
  • the prompt information includes the abnormality of the camera.
  • the physical switch of the camera is turned off or the camera is reopened after plugging and unplugging the camera.
  • the display pops up a dialog box to prompt the user that the camera is abnormal, turn off the physical switch of the camera or plug and unplug the camera and then turn it on again, as shown in FIG. 6C.
  • step S509 If it is detected that the camera cannot be started normally, it can be divided into the following situations: the camera provider (CameraProvider) service is abnormal, the current camera is occupied, and the communication between the camera provider service and the camera is abnormal. If an abnormality in the service of the camera provider is detected, step S509 is executed. In some embodiments, the abnormality of the camera provider service means that the camera provider service is not activated. Step S509: Restart the camera provider service, and display prompt information on the display. The prompt information includes the abnormality of the camera service, and the current application is reopened after exiting the current application.
  • a dialog box pops up on the display to prompt the user that the service of the camera is abnormal, and the current application is reopened after exiting, as shown in FIG. 6D. If it is detected that the camera is occupied, step S510 is executed.
  • Step S510 Display prompt information on the display, the prompt information including the current camera being occupied, and let the user choose whether to stop occupying the camera.
  • the display pops up a dialog box to prompt the user that the current camera is occupied by a certain application, and allows the user to choose whether to stop the certain application from occupying the camera, as shown in FIG. 6E.
  • step S511 is executed. Step S511: Displaying prompt information on the display, the prompt information including the camera abnormality, exit the current application and turn off the camera physical switch or plug and unplug the camera and then turn it on again.
  • the display pops up a dialog box to prompt the user that the camera is abnormal, exit the current application and turn off the camera's physical switch or plug and unplug the camera again, as shown in Figure 6F Shown.
  • FIG. 7 is a schematic diagram of a system framework of a display device 200 according to some embodiments of the present application.
  • the display device 200 can be divided into a camera end and a TV end, where the camera end may include the above-mentioned embodiments
  • the image collector includes a camera.
  • the camera may use a UVC device, such as a UVC camera.
  • UVC USB Video Class
  • USB Video Class is a protocol standard defined for USB video capture devices, and the video captured by the UVC camera needs to meet the protocol standard.
  • the TV terminal includes a controller 250, and its software framework specifically includes a Camera HAL layer (Hardware Abstraction Layer), a camera service layer, and a camera application layer.
  • the camera application layer can include applications that use the camera;
  • the camera service layer is a standardized middle layer that provides interface calls and services for the applications of the camera application layer;
  • the Camera HAL layer is a standard API defined in the camera service layer An implementation layer.
  • the camera and the controller 250 may be connected through a USB interface, such as a USB2.0 interface, and realize the image data transmission from the camera end to the TV end through the UVC protocol.
  • the USB interface is used as a connector between the camera and the controller 250, and the image data collected by the camera is sent to the controller 250 through the USB cable.
  • the controller 250 determines whether the USB status of the camera is connected or disconnected according to the voltage amplitude of the differential signal of the USB cable.
  • the connected status refers to the status when the camera is plugged into the USB interface.
  • the on state refers to the state when the camera is unplugged from the USB interface.
  • the controller 250 can also determine whether the USB state of the camera is the connected state or the disconnected state according to whether the voltage value of the power pin of the USB interface meets the voltage range during USB operation.
  • the display device 200 is equipped with a camera, which is preset to be inserted into the USB interface of the display device 200, so that the user can use the camera-related applications on the display device 200 normally.
  • the controller 250 may determine that the camera is in the disconnected state, and the controller 250 will feed back the message that the camera is in the disconnected state. After the camera application is reached, the camera application cannot be used normally.
  • the responding application when it is determined that the camera is in an abnormal state, the responding application is exited, and the display 275 of the display device 200 will display a prompt message for exiting the camera application; in other embodiments ,
  • the camera application preset when the camera is judged to be in an abnormal state, the image will continue to be output, and the display 275 of the display device 200 will always display the image before the camera is disconnected, that is, the image is stuck, causing the image output of the camera-related application to be interrupted .
  • the user can only restart the camera application so that the controller 250 re-detects whether the camera is in the connected state.
  • the controller 250 determines that the camera is in the disconnected state is usually caused by interference. After the interference is eliminated or weakened, the controller 250 can determine that the camera is in the connected state, and the process of interference elimination or weakening may be very short, such as 0-2 seconds. , That is, the controller 250 will detect that the camera is disconnected and connected instantaneously. After the user restarts the camera application, the camera application can be used normally.
  • FIG. 8 is a schematic flowchart of an image restoration method according to some embodiments of the present application. As shown in FIG. 8, the method includes the following steps:
  • Step S110 In response to receiving a control signal input by the user for instructing to start the shooting function of the camera application, control the display to display the first image collected by the camera.
  • the camera application when the user starts the camera application, the camera application displays a shooting interface, and the control signal used to instruct to start the shooting function of the camera application is the start signal of the camera application.
  • the camera application when the user starts the camera application, the camera application will display the shooting controls. When the user selects and triggers the shooting control through the selector through touch, voice and other control methods, the camera application will display the shooting interface. After the user inputs a control signal for instructing to start the shooting function of the camera application, the controller needs to control the display of the display device to display the shooting interface of the camera application.
  • the main thread of the Camera HAL layer starts the camera after receiving the control signal used to instruct the camera application to start the shooting function, and then checks the USB status of the camera. After determining that the camera is connected, it controls the camera Capture the image, send the image collected by the camera to the camera application, so that the display will present the shooting interface corresponding to the image collected by the camera.
  • the image collected by the camera can be called the first image, and the first image can be a video with a certain frame rate flow.
  • Camera HAL main thread can store the first image in the image queue buffer of the camera application, so that the camera application refreshes the first image of the shooting interface in real time after reading the image queue buffer, so that the user can see the real-time refresh on the shooting interface The first image.
  • the controller when the camera is started, registers two callback functions: callback function 1: used to detect that the camera is unplugged; callback function 2: used to detect that the camera is plugged in.
  • callback function 1 used to detect that the camera is unplugged
  • callback function 2 used to detect that the camera is plugged in.
  • the camera HAL main thread determines that the camera is connected, it sends callback function 1 to the camera application.
  • the camera application knows that the camera is connected normally according to the callback function 1, it reads the image queue buffer and outputs the first image on the shooting interface.
  • the controller may also use a notification message to achieve similar effects.
  • Step S120 Detect the USB state of the camera.
  • the Camera HAL main thread starts the USB status listening thread, and detects the USB status of the camera through the thread.
  • the USB status listening thread can generate callback function 1 according to the controller to determine that the USB status of the camera is disconnected, and generate callback function 2 according to the controller to determine that the status of the camera is connected.
  • Step S130 If the USB status is disconnected, it is determined whether the camera is reconnected within the delay time. When the USB status is disconnected, the controller no longer sends the first image to the image queue buffer of the camera application, the camera application cannot continue to refresh the first image, and the first image seen by the user is no longer refreshed.
  • the USB state listening thread continues to listen to the USB state of the camera, and determines whether the camera is switched to the connected state within the delay time, for example, USB state detection
  • the listening thread can determine that the camera is switched to the connected state according to the detected insertion message of the UVC device, where the insertion message of the UVC device can generate a notification message of callback function 1 for the controller.
  • the Camera HAL main thread can also start the Camera HAL message processing thread after starting the USB status listening thread. After the USB status listening thread is started, the USB status of the camera is continuously detected, and the UVC device is detected. Insert the message, send the notification message of the camera connection to the Camera HAL message processing thread to notify the USB connection.
  • the notification information of the camera connection may include a connecting state.
  • the delay time can be set according to user experience, such as 1-5 seconds. In some embodiments, the delay time is set to 2 seconds, and it is determined whether the camera is switched to the connected state within 2 seconds. If the camera is switched to the connected state, it can be considered that the camera has been reconnected since the last time it was disconnected.
  • Step S140 If the camera is reconnected within the delay time, control the display to refresh the first image into a second image, where the second image is an image collected after the camera is reconnected.
  • the USB status listening thread listens to the insertion message of the UVC device within the delay time, it indicates that the camera is reconnected, and the USB status listening thread informs the Camera HAL main thread of the insertion message of the UVC device, so that The Camera HAL main thread controls the camera to collect images.
  • the image collected by the camera can be called the second image.
  • the Camera HAL main thread can fill the second image into the image queue buffer corresponding to the first image, that is, the image of the camera application. Queue buffer, the camera application can read the second image from the image queue buffer, and refresh the first image of the shooting interface to the second image, so that the user can see the first image refreshed to the second image on the display.
  • the shooting interface of the camera application displays the first frame of the last frame.
  • the image queue buffer area of the camera application is filled with the second image, and the shooting interface of the camera application is refreshed from the first image to the second image.
  • the maximum time for the first image to refresh to the second image is the above-mentioned delay time.
  • the delay time is set to a relatively short period of time, such as 2 seconds
  • the shooting interface has not been updated for 2 seconds, which is similar to the user experience that the shooting interface is not updated in time due to network stalls.
  • the camera application does not receive callback function 1, from the perspective of the camera application, only the image in the image queue buffer is delayed in updating, the camera application will not exit, and the user does not need to restart the camera application, which can improve the user experience.
  • Step S150 If the camera is not reconnected within the delay time, control the camera application to exit or prompt on the display to exit the camera application.
  • the USB status listening thread if the USB status listening thread does not hear the insertion message of the UVC device within the delay time, it indicates that the camera is not reconnected within the delay time and the camera cannot work normally. At this time, a notification is required The camera application camera is abnormal.
  • the USB status listening thread sends callback function 2 to the camera application, so that the camera application performs corresponding processing, such as automatically exiting the shooting interface, or automatically exiting the application, or prompting the user to close the application, or prompting the user to restart the application.
  • the Camera HAL message processing process of the Camera HAL layer does not receive the camera connection notification message sent by the USB status listening thread within the delay time, and the Camera HAL message processing process sends callback function 2 to the camera. Application, stop the USB status listening thread, and restart the Camera HAL layer.
  • FIG 9 is a schematic diagram of the interaction process between a camera application and a hardware abstraction layer according to some embodiments of the present application.
  • the actions of the camera application include starting the application and closing the application, and the Camera HAL layer responds to the actions of the camera application, where , Camera HAL layer includes a Camera HAL main thread and USB status listening thread.
  • the action in response to the camera application is to start the application.
  • the actions of the Camera HAL main thread include starting the camera, opening the video stream, and filling in data.
  • the process of starting the camera includes turning on the camera so that the camera can collect images. At this time, the camera can be marked as video0 at the logical level, and the callback function 1 and callback function 2 are registered.
  • configuration parameters such as frame rate, resolution and other parameters Configure the camera for shooting, set the image queue buffer of the camera application; start the video stream including start the acquisition of the image data stream, the image data stream includes the data corresponding to the first image, where the first image is the image taken by the camera; fill data This includes sending the first image to the image queue buffer so that the camera application can read the image queue buffer and refresh the shooting interface in real time.
  • the Camera HAL main thread starts the USB status listening thread after the camera, and the USB status listening thread monitors the USB status of the camera. If it detects that the camera is disconnected, it turns off the camera, and then judges the delay Whether the USB status is switched to connected within the time, if the USB status is switched to connected, it indicates that a new camera is connected to the USB interface. It should be noted that the new camera may still be the original camera at the physical level. At the logical level, according to the device sorting rules, it is always numbered starting from the sequence number 0. If 0 is not occupied, the new camera is placed The serial number 0 is video0; if it is already occupied, the newly connected camera is placed on serial number 1, which is video1.
  • the USB status listening thread detects that the USB status is switched to connected within the delay time, it indicates that a new camera, namely video1, is detected, and then start and configure the camera.
  • starting the camera includes opening video1
  • configuring the camera includes configuring video1 according to historical configuration parameters.
  • the historical configuration parameters include the configuration parameters of video0.
  • the Camera HAL main thread can fill in data and capture the second image taken by video1.
  • the image queue buffer sent to the camera application enables the camera application to obtain the second image and refresh the first image to the second image, so that the user can see the refresh of the shooting interface.
  • the USB status listening thread If within the delay time, the USB status listening thread does not detect that the USB status is switched to connected, that is, there is no new camera inserted, it will send callback function 2 to the camera application to notify the camera application that the camera is disconnected.
  • the actions of the Camera HAL main thread include closing the video stream and closing the camera. Among them, closing the video stream includes releasing the image queue buffer of the camera application, and closing the camera includes controlling the camera to stop collecting images.
  • an error process can also be set in the Camera HAL layer. During the process of starting the camera or closing the camera, when the Camera HAL layer cannot be executed according to the above steps due to the disconnection of the camera, the error process can be executed.
  • the error process can be configured to restart the camera application, so that the controller 250 re-detects whether the camera is in the connected state.
  • FIG. 10 is a schematic diagram of the interaction flow between the camera application and the hardware abstraction layer according to other embodiments of the present application.
  • Camera HAL message processing process among which, the Camera HAL main thread can be referred to as the main thread.
  • the interaction process between the camera application and the Camera HAL layer is as follows: the camera application sends a command to turn on the camera to the Camera HAL layer, where the command to turn on the camera is based on the command input by the user for instructing to start the shooting function of the camera application. Control signal generation.
  • the main thread of Camera HAL starts and configures the camera according to the command to open the camera, so that the camera can collect images according to the configuration parameters, and register callback function 1 and callback function 2. At this time, the camera can be recorded as video0 at the logical level, and the image collected by the camera Called the first image.
  • the configuration parameters may include shooting parameters set by the user, such as parameters such as frame rate and resolution, and may also include parameters such as the address of the image buffer.
  • the Camera HAL main thread fills the image queue buffer after the camera is configured. For example, the first image collected by the camera can be stored in the image queue buffer by turning on the video stream.
  • start the USB status listening thread The camera application reads the first image in the image queue buffer of the image data, and refreshes the shooting interface in real time according to the first image.
  • the USB listening thread listens to the USB status of the camera. If it hears that the USB is disconnected, the camera is disconnected, and a notification message of the camera disconnection is sent to the Camera HAL message processing thread to notify the USB disconnection that the camera is disconnected.
  • the notification information opened can be that video0 is disconnected.
  • the Camera HAL message processing thread After the Camera HAL message processing thread receives the notification message that the camera is disconnected, it starts a timer to start the timing, and stops the camera work, so that the camera no longer collects image data, which will cause the image queue buffer to be unable to continue to obtain the first image.
  • the maximum time of the timer is the delay time in the above embodiment, such as 2 seconds.
  • the USB listening thread continues to listen to the USB status of the camera after listening to the USB disconnection. If the USB connection is detected, the camera is reconnected, and the notification message of the camera connection is sent to the Camera HAL message processing thread to notify the USB Connected, the notification message of the camera connection can be that video0 is in the connecting state.
  • the camera HAL message processing thread stops the timing if it receives a notification message of the camera connection within the timing time, starts and configures the camera to restore the camera to work, and then fills the second image to the image queue buffer of the camera application. Among them, at the physical level, the camera is instantly disconnected and then connected again. It is always the original camera. At the logical level, according to the device sorting rules, it always starts from the serial number 0 and goes up.
  • the newly connected camera needs to be reconfigured after startup to make it work according to the original camera's working mode.
  • the newly connected camera can be configured according to the historical configuration parameters of the last camera connection.
  • the historical configuration parameters can include the shooting parameters set by the user, and can also include parameters such as the address of the image buffer.
  • the image data collected by video1 is called the second image. After the Camera HAL message processing thread configures video1, the second image can be filled into the image queue buffer.
  • the camera application can read the image queue buffer and refresh the shooting interface to the second image. If the delay expires, the Camera HAL message processing thread has not received the notification message of the camera connection, that is, the USB is not connected, it will report an error and restart the Camera HAL layer, stop the USB status listening thread, and notify the system error, such as a callback function 2Send to the camera application to notify the camera application that the camera is disconnected.
  • the camera application generates an instruction to turn off the camera after receiving the notification of the system error, and sends the instruction to turn off the camera to the Camera HAL main thread.
  • the camera application can also generate the shutdown camera according to the instruction to exit the shooting interface or exit the application received by the user Instructions.
  • the Camera HAL layer After the Camera HAL layer receives the instruction to close the camera, it closes the video stream and then closes the camera.
  • the action in response to the camera application is closing the application, and the actions of the Camera HAL layer include closing the video stream and closing the camera. Among them, closing the video stream includes releasing the image queue of the camera application
  • Some embodiments of the application monitor the USB status of the camera by setting a USB status listening thread. When it is detected that the camera is disconnected, it is determined whether the camera is reinserted within the delay time, and if the camera is reinserted within the delay time , The image collected by the re-inserted camera is filled into the image queue buffer of the camera application, so that the image of the camera application can be refreshed to the image collected by the re-inserted camera, which solves the problem of the camera application when the camera is disconnected and connected instantaneously When the user is required to restart the camera application, the user experience is improved; in addition, the USB status listening thread in some embodiments of this application is set at the Camera HAL layer, which is closer to the bottom layer at the software level, and the subsequent modification is more flexible and easy to modify. Control is conducive to the system upgrade of display equipment.
  • FIG. 11 is a data flow diagram of a camera abnormality processing method according to some embodiments of the present application.
  • the controller of the display device provided in some embodiments of the present application is configured to execute the camera abnormal processing method. As shown in FIG. 11, the controller is configured to perform the following steps:
  • the user if the user needs to use the display device to make a video call, the user first starts the designated application, and the designated application calls the camera to realize the startup of the camera. After the camera is turned on, the image data can be collected in real time, and the controller can obtain the image data in real time and send it to the monitor for display in the preview screen on the monitor.
  • the controller will not be able to receive the image data collected by the camera, and the camera exception handling mechanism needs to be activated. Therefore, in order to ensure that an abnormality occurs in the camera, the camera abnormality processing mechanism can be activated in time to restore the use of the camera, and the controller needs to be able to determine in real time whether the image data collected by the camera is acquired. If the controller can obtain the image data collected by the camera, it means that the connection between the camera and the display device is normal. If the image data collected by the camera cannot be obtained, it means that the connection between the camera and the display device is abnormal. In this case, the camera exception handling mechanism needs to be activated in time .
  • the controller cannot receive the image data collected by the camera at a certain moment, it means that the connection between the camera and the display device may be abnormal, causing the data path between the camera and the display device to be disconnected instantaneously.
  • the camera abnormality processing mechanism that is, to detect whether the device node of the camera exists.
  • the device node of the camera is used to identify the connection between the camera and the display device. If the device node of the camera exists, the camera and the display device are connected; if the device node of the camera does not exist, the camera and the display device are disconnected.
  • the controller determines that the device node of the camera does not exist, the camera and the display device are disconnected at this time.
  • the camera is processed to detect whether the camera is successfully connected, that is, Whether the camera and the display device are successfully connected.
  • the controller detects whether the camera is connected successfully, and is further configured to:
  • Step 31 If the device node of the camera does not exist, close the image data output stream of the camera.
  • Step 32 Check whether the camera is successfully connected within the preset time period.
  • the process of processing the camera includes closing the image data output stream of the camera, sending delayed error reporting information to the specified application, and looping to check whether the camera is connected successfully. Turning off the image data output stream of the camera means that the camera stops sending the collected image data to the controller, and the controller no longer obtains the image data collected by the camera at this time. Sending delayed error report information to the specified application is used to notify the specified application that the current camera is abnormal. At the same time, the information will be displayed on the display, mainly in the interface of the display presenting the specified application.
  • Circulating detection of whether the camera is successfully connected is used for the controller to cyclically detect whether the camera and the display device are successfully reconnected within a preset time period, that is, try to re-establish the connection between the camera and the display device.
  • the device node of the camera does not exist, the connection between the camera and the display device needs to be re-established.
  • the image data output stream of the camera corresponding to the current moment is closed first, and then within a preset time period, it is detected whether the camera and the display device are successfully reconnected according to a certain detection frequency.
  • the preset duration may be set to 15 seconds, and the detection frequency may be set to be detected once per second.
  • the controller cyclically detects whether the camera and the display device are reconnected successfully according to a detection frequency of once per second. If the reconnection is successful, the controller can reacquire the image data collected by the camera; if the function is not connected, the camera is abnormal.
  • the controller After the controller detects that the camera and the display device are successfully reconnected, at this time, the data flow path of the camera and the display device is connected, and the controller can retrieve the image data collected by the camera to ensure that the specified application can resume the process of calling the camera. Normal use by the user.
  • the controller when the controller detects that the device node of the camera does not exist, it needs to close the image data output stream of the camera, and then re-detect the connection between the camera and the display device. Therefore, if the controller detects that the camera is successfully connected during execution, it will re-acquire the image data collected by the camera and be further configured as:
  • Step 41 If it is detected that the camera is successfully connected, turn on the image data output stream of the camera.
  • Step 42 Re-acquire the image data collected by the camera, and display the re-acquired image data on the display, so that the specified application can call the camera normally.
  • the controller detects whether the connection between the camera and the display device is successful according to the first processing rule, if it detects that the connection between the camera and the display device is successful, the camera can normally output image data to the controller. At this time, the controller needs to turn on the camera again. Image data output stream.
  • the controller can reacquire the image data collected by the camera and send the reacquired image data to the monitor, and the monitor displays the reacquired image data to ensure that the specified application can be restored
  • the process of calling the camera ensures the normal use of the user.
  • the controller detects that the camera is not successfully connected, the connection between the camera and the display device cannot be restored at this time. In order to remind the user to perform subsequent operations, the controller needs to generate camera abnormal information at this time; and send the camera abnormal information to the designated Application, and display the abnormal information of the camera on the display.
  • the camera abnormality information can be set as content that prompts that the camera has been unplugged, and the content is sent to the designated application to be displayed on the interface when the designated application is presented on the display. After viewing the content, the user can know that the camera has been disconnected from the display device at this time, and can perform subsequent operations, for example, to restore the physical connection between the camera and the display device.
  • step S2 that is, after the controller executes the step of detecting whether the device node of the camera exists if the image data collected by the camera cannot be obtained, if the controller detects that the device node of the camera exists, At this time, the controller needs to execute another processing rule to restore the connection between the camera and the display device.
  • FIG. 12 exemplarily shows another flowchart of a method for processing camera abnormality according to some embodiments.
  • the controller when processing an abnormality of the camera, the controller is further configured to:
  • the image data collected by the camera is acquired cyclically according to the preset reading times.
  • the controller executes another processing rule.
  • the processing rule includes cyclically acquiring image data collected by the camera according to a preset number of readings, and detecting whether the camera is connected success.
  • the controller when the controller cannot obtain the image data collected by the camera and can detect the existence of the device node of the camera, the controller cyclically obtains the image data collected by the camera according to the preset reading times.
  • the preset number of readings may be set to 1000, and the controller loops 1000 times to try to reacquire the image data collected by the camera.
  • the controller fails to reacquire the image data collected by the camera within the preset reading times, that is, it fails 1000 times, it means that the connection between the camera and the display device is abnormal at this time. If the controller can reacquire the image data collected by the camera one time within the preset reading times, it means that the image data output stream of the camera is back to normal. At this time, the controller can reacquire the image data collected by the camera and will re-acquire the image data. The acquired image data is sent to the monitor, and the reacquired image data is displayed on the monitor to ensure that the specified application can resume the process of calling the camera and ensure the normal use of the user.
  • the controller may perform a step of detecting whether the camera and the display device are successfully reconnected. At this time, the controller needs to wait for the first time period after attempting to reacquire the image data collected by the camera for a preset number of reading times, and then check whether the camera is successfully connected after the first time period has elapsed.
  • the first duration may be set to 10 seconds.
  • the controller waits for 10 seconds after acquiring image data through 1000 cycles, that is, after 10 seconds, it can start the process of detecting whether the camera is connected successfully.
  • the controller detects that the camera and the display device are successfully reconnected after the first period of time, the camera can normally output image data to the controller. At this time, the controller can reacquire the image data collected by the camera, and will re-acquire the image data collected by the camera. The image data is sent to the monitor, and the reacquired image data is displayed on the monitor to ensure that the specified application can resume the process of calling the camera and ensure the normal use of the user.
  • the controller detects that the camera is not successfully connected, the connection between the camera and the display device cannot be restored at this time. In order to remind the user to perform subsequent operations, the controller needs to generate camera abnormal information at this time; and send the camera abnormal information to the designated Application, and display the abnormal information of the camera on the display.
  • the camera abnormality information can be set as content that prompts that the camera has been unplugged, and the content is sent to the designated application to be displayed on the interface when the designated application is presented on the display. After viewing the content, the user can know that the camera has been disconnected from the display device at this time, and can perform subsequent operations, for example, to restore the physical connection between the camera and the display device.
  • the display device executes the camera abnormality processing method, it is executed when the controller cannot receive the image data collected by the camera, that is, the display device implements detection and processing on the display device side.
  • the display device can also monitor the camera in real time on the camera side, so as to determine whether the camera is abnormal in a timely manner.
  • FIG. 13 exemplarily shows another flow chart of a method for processing camera abnormality according to some embodiments.
  • the controller is executing the specified application to call the camera and is further configured to perform the following steps:
  • the designated application calls the camera and turns on the camera.
  • the controller turns on the thread monitoring function, specifically for the controller to turn on the socket thread monitoring to monitor the connection status of the camera and the display device in real time.
  • the controller detects that the camera is not disconnected from the display device, at this time, the controller can obtain the image data collected by the camera, and send the obtained image data to the monitor, and the monitor displays the obtained image Data to ensure that the specified application can resume the process of calling the camera and ensure the normal use of the user.
  • step S3 If the controller detects that the camera is disconnected from the display device, it means that the camera cannot output image data to the controller. Therefore, the controller executes the related steps of detecting whether the camera is successfully connected as described in step S3. For the specific content, please refer to the foregoing introduction to step S3, which will not be repeated here.
  • the controller When the controller detects that the camera is disconnected from the display device and detects whether the camera is successfully connected, the controller needs to stop the preview of the image data, and restart the preview after the camera is successfully connected.
  • FIG. 14 exemplarily shows a flowchart of a method for displaying a new preview screen according to some embodiments.
  • the controller is further configured to perform the following steps:
  • the new preview screen refers to a screen presented when the newly acquired image data is displayed.
  • the controller uses the thread monitoring function to monitor the connection between the camera and the display device in real time. When it detects that the connection between the camera and the display device is disconnected, the controller cannot obtain the image data collected by the camera. At this time, the controller stops sending image data to the display. To cancel the display of the preview screen currently displayed in the monitor.
  • step S3 After the controller executes the processing rules described in step S3 to perform abnormal processing on the camera, if the camera and the display device are successfully reconnected, the image data collected by the camera can be re-acquired after the second time period.
  • the second duration may be set to 1 second. Since the controller detects whether the camera and the display device are successfully connected once every second, after detecting that the camera and the display device are successfully connected, the image data collected by the camera can be re-acquired after 1 second.
  • the controller can reacquire the image data collected by the camera, and send the acquired image data to the monitor, and the monitor displays the acquired image data to get a new preview screen to ensure that the specified application can resume the process of calling the camera and ensure that the user is normal use.
  • the display device provided by the embodiment of the present application determines whether the controller has obtained the image data collected by the camera when the designated application configured in the controller calls the camera; if it cannot be obtained, it detects the camera’s Whether the device node exists; if the device node of the camera does not exist, check whether the camera is successfully connected, and when the camera is successfully connected, re-acquire the image data collected by the camera, so that the specified application can call the camera normally. It can be seen that the display device provided by this application ensures the stability of the camera by monitoring the camera device node, and can deal with the abnormal phenomenon of the camera in time to ensure the continuous output of the image data stream and avoid the display interface showing a stuck state. In turn, it is ensured that users can use the camera normally, and the user experience is good.
  • a camera abnormality processing method provided by some embodiments of the present application is executed by the controller in the display device provided in the foregoing embodiments, and the method includes:
  • the image data collected by the camera is re-acquired, so that the designated application can call the camera normally.
  • detecting whether the camera is successfully connected includes: if the device node of the camera does not exist, closing the image data output stream of the camera; Within the set time period, it is detected whether the camera is successfully connected.
  • the method further includes: when the designated application calls the camera, enabling the thread monitoring function to monitor whether the camera is disconnected; if it is detected that the camera is not disconnected, executing the Specify the step for the application to call the camera; if it is detected that the camera is disconnected, execute the step of detecting whether the camera is successfully connected.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Studio Devices (AREA)

Abstract

本申请一些实施例公开了一种显示设备、摄像头检测方法及摄像头异常处理方法,其中,显示设备包括:显示器,控制器,该控制器被配置为:响应于用户输入的启动摄像头的控制指令,检测所述摄像头的状态;如果所述摄像头的状态异常,在显示器上显示提示信息,所述提示信息包括出现异常状态的原因和解除所述异常状态的操作方法;如果所述摄像头的状态正常,在显示器上显示所述摄像头采集的第一图像。

Description

显示设备、摄像头检测方法及摄像头异常处理方法
本申请要求于2020年7月30日提交的、申请号为202010752500.6、申请名称为“一种摄像头状态检测方法及显示设备”;于2020年7月24日提交的、申请号为202010722308.2、申请名称为“一种摄像头异常处理方法及显示设备”;于2020年6月8日提交的、申请号为202010514148.2、申请名称为“显示设备及图像恢复方法”的专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及显示设备技术领域,具体而言,涉及一种显示设备、摄像头检测方法及摄像头异常处理方法。
背景技术
显示设备成为生活中不可缺少的设备,很多显示设备都设置有摄像头,部分应用如照镜子、视频通话等需要摄像头采集图像,那么摄像头的状态对于显示设备十分重要。
发明内容
本申请一些实施例提供了一种显示设备,该显示设备包括:
显示器,用于显示图像和用户界面,及在所述用户界面中用以指示在用户界面中项目被选择的选择器;
分别与所述显示器及摄像头连接的控制器,所述控制器被配置为:
响应于接收到用户输入的用于指示启动摄像头应用的拍摄功能的控制信号,控制所述显示器中显示所述摄像头采集的第一图像;
检测所述摄像头的USB状态;
根据所述USB状态为断开连接,判断在延时时间内所述摄像头是否重新连接;
如果在所述延时时间内所述摄像头重新连接,控制所述显示器将所述第一图像刷新为第二图像,其中,所述第二图像为所述摄像头重新连接后采集的图像。
本申请一些实施例提供了一种摄像头异常处理方法,该方法包括:
响应于接收到用户输入的用于指示启动摄像头应用的拍摄功能的控制信号,控制显示器显示所述摄像头采集的第一图像;
检测所述摄像头的USB状态;
根据所述USB状态为断开连接,判断在延时时间内所述摄像头是否重新连接;
如果在所述延时时间内所述摄像头重新连接,控制所述显示器将所述第一图像刷新为第二图像,其中,所述第二图像为所述摄像头重新连接后采集的图像。
在一些实施例中,如果在所述延时时间内所述摄像头没有重新连接,向使用所述摄像头的摄像头应用发送摄像头断开的消息。
在一些实施例中,摄像头断开的消息可为控制器在摄像头启动时注册的摄像头拔出函数。
本申请一些实施例还提供一种显示设备,包括:
摄像头,被配置为采集图像数据;
显示器,被配置为呈现显示有图像数据的预览画面;
与所述摄像头和显示器连接的控制器,所述控制器内配置有用于调用摄像头的指定应用,所述控制器被配置为:
在所述指定应用调用摄像头时,判断是否获取到所述摄像头采集的图像数据;
若无法获取到所述摄像头采集的图像数据,则检测所述摄像头的设备节点是否存在;
如果所述摄像头的设备节点不存在,则检测所述摄像头是否连接成功;
若检测到所述摄像头连接成功,重新获取所述摄像头采集的图像数据,实现所述指定应用正常调用摄像头。
在一些实施例中,所述控制器在执行所述如果摄像头的设备节点不存在,则检测所述摄像头是否连接成功,被进一步配置为:
如果所述摄像头的设备节点不存在,则关闭所述摄像头的图像数据输出流;
在预设时长内,检测所述摄像头是否连接成功。
在一些实施例中,所述控制器在执行若检测到所述摄像头连接成功,重新获取所述摄像头采集的图像数据,被进一步配置为:
如果检测到所述摄像头连接成功,打开所述摄像头的图像数据输出流;
重新获取所述摄像头采集的图像数据,将重新获取的图像数据显示在显示器中,实现所述指定应用正常调用摄像头。
在一些实施例中,所述控制器被进一步配置为:
如果所述摄像头的设备节点存在,则按照预设读取次数,循环获取所述摄像头采集的图像数据;
如果在所述预设读取次数内均未获取到摄像头采集的图像数据,则延时第一时长;
在经过所述第一时长后,检测所述摄像头是否连接成功;
如果检测到所述摄像头连接成功,则由所述指定应用正常调用摄像头。
在一些实施例中,所述控制器被进一步配置为:
如果检测到所述摄像头未连接成功,生成摄像头异常信息;
将所述摄像头异常信息发送至指定应用,以及,将所述摄像头异常信息显示在所述显示器中。
在一些实施例中,所述控制器在执行所述指定应用调用摄像头,被进一步配置为:
在所述指定应用调用摄像头时,开启线程监听功能,监测所述摄像头是否断开连接;
如果监测到所述摄像头未断开连接,则执行所述指定应用调用摄像头的步骤;
如果监测到所述摄像头断开连接,则执行检测所述摄像头是否连接成功的步骤。
在一些实施例中,所述控制器被进一步配置为:
如果监测到所述摄像头断开连接,则停止发送所述摄像头采集的图像数据至显示器,所述显示器取消显示预览画面;
在所述摄像头连接成功时,延时第二时长,重新获取所述摄像头采集的图像数据;
将重新获取的图像数据发送至所述显示器,所述显示器显示新预览画面,所述新 预览画面是指显示重新获取的图像数据时呈现的画面。
本申请一些实施例还提供一种显示设备,包括:
显示器;摄像头;用户接口;
控制器,用于执行:
响应于用户输入的启动摄像头的控制指令,检测所述摄像头的状态;
如果所述摄像头的状态异常,则在显示器上显示提示信息,所述提示信息包括出现异常状态的原因和解除所述异常状态的操作方法。
本申请一些实施例还提供一种摄像头检测方法,包括:
响应于用户输入的启动摄像头的控制指令,检测所述摄像头的状态;
如果所述摄像头的状态异常,则在显示器上显示提示信息,所述提示信息包括出现异常状态的原因和解除所述异常状态的操作方法。
在一些实施例中,所述方法具体包括:
响应于用户输入的启动摄像头的控制指令,检测所述摄像头的状态;
如果检测到摄像头的通用串行总线端口未插入摄像头,则在显示器上显示提示信息,所述提示信息包括当前未插入摄像头或者摄像头物理开关被关闭。
附图说明
图1为根据本申请一些实施例的显示设备与控制装置之间操作场景的示意图;
图2为根据本申请一些实施例的显示设备200的硬件配置框图;
图3为根据本申请一些实施例的控制设备100的硬件配置框图;
图4为根据本申请一些实施例的显示设备200中软件配置示意图;
图5为根据本申请一些实施例的显示设备200中应用程序的图标控件界面显示示意图;
图6A-图6F为根据本申请一些实施例的显示设备界面提示信息示意图;
图7为根据本申请一些实施例的显示设备200的系统框架示意图;
图8为根据本申请一些实施例的图像恢复方法的流程示意图;
图9为根据本申请一些实施例的摄像头应用和硬件抽象层的交互流程示意图;
图10为根据本申请另一些实施例的摄像头应用和硬件抽象层的交互流程示意图;
图11为根据本申请一些实施例的摄像头异常处理方法的流程图;
图12为根据本申请一些实施例的摄像头异常处理方法的另一种流程图;
图13为根据本申请一些实施例的摄像头异常处理方法的又一种流程图;
图14中示例性示出了根据一些实施例的显示新预览画面的方法流程图。
具体实施方式
为使本申请的目的、实施方式和优点更加清楚,下面将结合本申请示例性实施例中的附图,对本申请示例性实施方式进行清楚、完整地描述,显然,所描述的示例性实施例仅是本申请一部分实施例,而不是全部的实施例。
基于本申请描述的示例性实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请所附权利要求保护的范围。此外,虽然本申请中公开内容按照示范性一个或几个实例来介绍,但应理解,可以就这些公开内容的各个方面 也可以单独构成一个完整实施方式。需要说明的是,本申请中对于术语的简要说明,仅是为了方便理解接下来描述的实施方式,而不是意图限定本申请的实施方式。除非另有说明,这些术语应当按照其普通和通常的含义理解。
图1为根据本申请一些实施例的显示设备与控制装置之间操作场景的示意图,如图1所示,用户可通过移动终端300和控制装置100操作显示设备200。控制装置100可以是遥控器,遥控器和显示设备的通信包括红外协议通信、蓝牙协议通信,无线或其他有线方式来控制显示设备200。用户可以通过遥控器上按键,语音输入、控制面板输入等输入用户指令,来控制显示设备200。在一些实施例中,也可以使用移动终端、平板电脑、计算机、笔记本电脑、和其他智能设备以控制显示设备200。
在一些实施例中,移动终端300可与显示设备200安装软件应用,通过网络通信协议实现连接通信,实现一对一控制操作的和数据通信的目的。也可以将移动终端300上显示音视频内容传输到显示设备200上,实现同步显示功能显示设备200还与服务器400通过多种通信方式进行数据通信。可允许显示设备200通过局域网(LAN)、无线局域网(WLAN)和其他网络进行通信连接。服务器400可以向显示设备200提供各种内容和互动。显示设备200,可以液晶显示器、OLED显示器、投影显示设备。显示设备200除了提供广播接收电视功能之外,还可以附加提供计算机支持功能的智能网络电视功能。
图2示例性示出了根据示例性实施例中控制装置100的配置框图。如图2所示,控制装置100包括控制器110、通信接口130、用户输入/输出接口140、存储器、供电电源。控制装置100可接收用户的输入操作指令,且将操作指令转换为显示设备200可识别和响应的指令,起用用户与显示设备200之间交互中介作用。通信接口130用于和外部通信,包含WIFI芯片,蓝牙模块,NFC或可替代模块中的至少一种。用户输入/输出接口140包含麦克风,触摸板,传感器,按键或可替代模块中的至少一种。
图3示出了根据示例性实施例中显示设备200的硬件配置框图。如图3所示显示设备200包括调谐解调器210、通信器220、检测器230、外部装置接口240、控制器250、显示器260、音频输出接口270、存储器、供电电源、用户接口280中的至少一种。控制器包括中央处理器,视频处理器,音频处理器,图形处理器,RAM,ROM,用于输入/输出的第一接口至第n接口。显示器260可为液晶显示器、OLED显示器、触控显示器以及投影显示器中的至少一种,还可以为一种投影装置和投影屏幕。调谐解调器210通过有线或无线接收方式接收广播电视信号,以及从多个无线或有线广播电视信号中解调出音视频信号,如以及EPG数据信号。检测器230用于采集外部环境或与外部交互的信号。控制器250和调谐解调器210可以位于不同的分体设备中,即调谐解调器210也可在控制器250所在的主体设备的外置设备中,如外置机顶盒等。
在一些实施例中,控制器250,通过存储在存储器上中各种软件控制程序,来控制显示设备的工作和响应用户的操作。控制器250控制显示设备200的整体操作。用户可在显示器260上显示的图形用户界面(GUI)输入用户命令,则用户输入接口通过图形用户界面(GUI)接收用户输入命令。或者,用户可通过输入特定的声音或手势进行输入用户命令,则用户输入接口通过传感器识别出声音或手势,来接收用户输入命令。
在一些实施例中,“用户界面”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面常用的表现形式是图形用户界面(Graphic User Interface,GUI),是指采用图形方式显示的与计算 机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个图标、窗口、控件等界面元素,其中控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素中的至少一种。
图4为根据本申请一些实施例的显示设备200中软件配置示意图,如图4所示,将系统分为四层,从上至下分别为应用程序(Applications)层(简称“应用层”),应用程序框架(Application Framework)层(简称“框架层”),安卓运行时(Android runtime)和系统库层(简称“系统运行库层”),以及内核层。内核层至少包含以下驱动中的至少一种:音频驱动、显示驱动、蓝牙驱动、摄像头驱动、WIFI驱动、USB驱动、HDMI驱动、传感器驱动(如指纹传感器,温度传感器,压力传感器等)、以及电源驱动等。
图5为根据本申请一些实施例的显示设备200中应用程序的图标控件界面显示示意图,如图5中所示,应用程序层包含至少一个应用程序可以在显示器中显示对应的图标控件,如:直播电视应用程序图标控件、视频点播应用程序图标控件、媒体中心应用程序图标控件、应用程序中心图标控件、游戏应用图标控件等。直播电视应用程序,可以通过不同的信号源提供直播电视。视频点播应用程序,可以提供来自不同存储源的视频。不同于直播电视应用程序,视频点播提供来自某些存储源的视频显示。媒体中心应用程序,可以提供各种多媒体内容播放的应用程序。应用程序中心,可以提供储存各种应用程序。
<摄像头检测>
带有摄像头的显示装置,在打开采用摄像头的应用时,需要检测摄像头的状态,参考图6A-图6F,具体包括:
通过用户接口接收用户通过操作控制设备而输入的启动摄像头的控制指令;响应于用户输入的启动摄像头的控制指令,检测摄像头的USB端口是否插入摄像头;在一些实施例中,摄像头可以为内置摄像头,也可以通过USB接口插入摄像头。以USB摄像头为例,通过摄像头端的通用串行总线(USB)端口检测是否插入USB设备,若未插入USB设备,则弹出对话框告知用户当前未插入内置摄像头或者摄像头物理开关被关闭,其中,物理开关关闭时会直接给摄像头断电,所以和拔出摄像头一样,USB端口会检测到没有设备插入。
如果检测到摄像头的通用串行总线端口未插入摄像头,在显示器上显示提示信息,所述提示信息包括当前未插入摄像头或者摄像头物理开关被关闭。在一些实施例中,当检测到摄像头的通用串行总线端口未插入摄像头,显示器弹出对话框以提示用户当前未插入摄像头或者摄像头物理开关被关闭,如图6A所示。
如果检测到摄像头的通用串行总线端口已插入摄像头,检测摄像头是否能正常启动。若摄像头可以正常启动,则根据用户的输入指令,摄像头工作;若摄像头不可以正常启动,则在显示器上显示提示信息,所述提示信息包括摄像头异常,关闭摄像头物理开关或插拔摄像头后再重新打开。
在一些实施例中,如果检测到摄像头正常启动,判断摄像头是否是云台摄像头。如果摄像头不是云台摄像头,结束检测。如果摄像头是云台摄像头,检测马达控制服务与摄像头是否能够正常通信。其中,当检测马达控制服务与摄像头不能正常通信,分为两种情况:摄像头马达控制服务未启动和马达控制服务正常启动,但是与摄像头通信发生异常。
如果检测到马达控制服务未启动,在显示器上显示提示信息,所述提示信息包括马达控制服务未启动,重新退出应用程序再打开,重新启动所述摄像头的马达控制服务。在一些实施例中,当检测到马达控制服务未启动时,显示器弹出对话框以提示用户马达控制服 务未启动,重新退出应用程序再打开,如图6B所示。后台重新启动所述摄像头的马达控制服务。
如果检测到马达控制服务与摄像头发生通信异常,在显示器上显示提示信息,所述提示信息包括摄像头异常,关闭摄像头物理开关或插拔摄像头后再重新打开。在一些实施例中,当检测到马达控制服务与摄像头发生通信异常时,显示器弹出对话框以提示用户摄像头异常,关闭摄像头物理开关或插拔摄像头后再重新打开,如图6C所示。
<摄像头异常情况>
在一些实施例中,如果检测到摄像头不能正常启动,分以下几种情况:摄像头提供者(Camera Provider)服务异常、当前摄像头被占用,以及,摄像头提供者服务与摄像头通信发生异常。
如果检测到摄像头提供者服务异常,重新启动摄像头提供者服务,在显示器上显示提示信息,所述提示信息包括摄像头服务异常,退出当前应用程序后重新打开。在一些实施例中,摄像头提供者服务异常是指摄像头提供者服务未激活。在一些实施例中,当检测到摄像头提供者服务异常,显示器弹出对话框以提示用户摄像头服务异常,退出当前应用程序后重新打开,如图6D所示。
如果检测到摄像头被占用,在显示器上显示提示信息,所述提示信息包括当前摄像头被占用,让用户选择是否停止占用摄像头。在一些实施例中,检测到摄像头被占用,显示器弹出对话框以提示用户当前摄像头被某应用程序占用,让用户选择是否停止某应用程序占用摄像头,如图6E所示。
如果检测到摄像头提供者服务与摄像头发生通信异常,在显示器上显示提示信息,所述提示信息包括摄像头异常,退出当前应用并关闭摄像头物理开关或插拔摄像头后再重新打开。在一些实施例中,当检测到摄像头提供者服务与摄像头通信发生异常时,显示器弹出对话框以提示用户摄像头异常,退出当前应用并关闭摄像头物理开关或插拔摄像头后再重新打开,如图6F所示。
下将详细介绍如何检测摄像头异常,这里不再展开说明。
上述实施例中,当用户使用摄像头时会检测摄像头状态是否正常,如果摄像头状态异常,则提示用户出现摄像头异常状态的原因和解除所述异常状态的操作方法,以使用户通过提示的操作方法快速打开摄像头,提升用户体验。
<检测摄像头的连接状态>
在一些显示装置中,若打开采用摄像头的应用,首先需要检测摄像头的连接状态,在摄像头连接状态正常情况下,才能保证该应用的正常运行,具体检测步骤包括:
步骤S501:通过用户接口接收用户通过操作控制设备而输入的启动摄像头的控制指令;响应于用户输入的启动摄像头的控制指令,执行步骤S502。
步骤S502:检测摄像头的USB端口是否插入摄像头;
在一些实施例中,当应用程序通过Camera API的open方法去打开摄像头时,此时在framework层会触发检测。其中,摄像头可以为内置摄像头,也可以通过USB接口插入摄像头。首先通过摄像头端的通用串行总线(USB)端口检测是否插入USB设备,其中,USB设备可以是摄像头,若未插入USB设备,则弹出对话框告知用户当前未插入内置摄像头或者摄像头物理开关被关闭,其中,物理开关关闭时会直接给摄像头断电,所以和拔出摄像头一样,USB端口会检测到没有设备插入。
如果检测到摄像头的通用串行总线端口未插入摄像头,执行步骤S503。步骤S503:在显示器上显示提示信息,所述提示信息包括当前未插入摄像头或者摄像头物理开关被关闭。在一些实施例中,当检测到摄像头的通用串行总线端口未插入摄像头,显示器弹出对话框以提示用户当前未插入摄像头或者摄像头物理开关被关闭,如图6A所示。
如果检测到摄像头的通用串行总线端口已插入摄像头,执行步骤S504。步骤S504:检测摄像头是否能正常启动。如果检测到摄像头正常启动,执行步骤S505。步骤S505:判断摄像头是否是云台摄像头。如果摄像头不是云台摄像头,结束检测。如果摄像头是云台摄像头,执行步骤S506。步骤S506:检测马达控制服务与摄像头是否能够正常通信。当检测马达控制服务与摄像头不能正常通信,分为两种情况:摄像头马达控制服务未启动和马达控制服务正常启动,但是与摄像头通信发生异常。
如果检测到马达控制服务未启动,执行步骤S507。步骤S507:在显示器上显示提示信息,所述提示信息包括马达控制服务未启动,重新退出应用程序再打开,重新启动所述摄像头的马达控制服务。在一些实施例中,当检测到马达控制服务未启动时,显示器弹出对话框以提示用户马达控制服务未启动,重新退出应用程序再打开,如图6B所示。后台重新启动所述摄像头的马达控制服务。
如果检测到马达控制服务与摄像头发生通信异常,执行步骤S508。步骤S508:在显示器上显示提示信息,所述提示信息包括摄像头异常,关闭摄像头物理开关或插拔摄像头后再重新打开。在一些实施例中,当检测到马达控制服务与摄像头发生通信异常时,显示器弹出对话框以提示用户摄像头异常,关闭摄像头物理开关或插拔摄像头后再重新打开,如图6C所示。
如果检测到摄像头不能正常启动,可分以下几种情况:摄像头提供者(CameraProvider)服务异常、当前摄像头被占用,以及,摄像头提供者服务与摄像头通信发生异常。如果检测到摄像头提供者服务异常,执行步骤S509。一些实施例中,摄像头提供者服务异常是指摄像头提供者服务未激活。步骤S509:重新启动摄像头提供者服务,在显示器上显示提示信息,所述提示信息包括摄像头服务异常,退出当前应用程序后重新打开。在一些实施例中,当检测到摄像头提供者服务异常,显示器弹出对话框以提示用户摄像头服务异常,退出当前应用程序后重新打开,如图6D所示。如果检测到摄像头被占用,执行步骤S510。
步骤S510:在显示器上显示提示信息,所述提示信息包括当前摄像头被占用,让用户选择是否停止占用摄像头。在一些实施例中,检测到摄像头被占用,显示器弹出对话框以提示用户当前摄像头被某应用程序占用,让用户选择是否停止某应用程序占用摄像头,如图6E所示。如果检测到摄像头提供者服务与摄像头发生通信异常,执行步骤S511。步骤S511:在显示器上显示提示信息,所述提示信息包括摄像头异常,退出当前应用并关闭摄像头物理开关或插拔摄像头后再重新打开。
在一些实施例中,当检测到摄像头提供者服务与摄像头通信发生异常时,显示器弹出对话框以提示用户摄像头异常,退出当前应用并关闭摄像头物理开关或插拔摄像头后再重新打开,如图6F所示。
<摄像头异常检测和处理>
图7为根据本申请一些实施例的显示设备200的系统框架示意图,如图7所示,以电视为例,显示设备200可分为摄像头端和电视端,其中,摄像头端可包括上述实施例中的图像采集器,图像采集器包括摄像头。在一些实施例中,摄像头可采用UVC设备,如UVC 摄像头。其中,UVC(USB Video Class)是一种为USB视频捕获设备定义的协议标准,UVC摄像头所捕获的视频需要满足该协议标准。
在一些实施例中,电视端包括控制器250,其软件框架具体包括Camera HAL层(Hardware Abstraction Layer,硬件抽象层)、摄像头服务层和摄像头应用层。其中,摄像头应用层可包括使用摄像头的应用程序;摄像头服务层是为摄像头应用层的应用程序提供接口调用和服务的一个标准化的中间层;Camera HAL层是对摄像头服务层中定义的标准API的一个实现层。摄像头和控制器250可通过USB接口,如USB2.0接口连接,通过UVC协议实现摄像头端到电视端的图像数据传递。USB接口作为摄像头和控制器250之间的连接器,通过USB连接线将摄像头采集的图像数据发送到控制器250。
在一些实施例中,控制器250根据USB连接线的差分信号的电压幅值来判断摄像头的USB状态是连接状态还是断开状态,其中,连接状态是指摄像头插入到USB接口时的状态,断开状态是指摄像头从USB接口中拔出时的状态。在一些实施例中,控制器250还可根据USB接口的电源引脚的电压值是否符合USB工作时的电压范围,来判断摄像头的USB状态是连接状态还是断开状态。
在一些实施例中,显示设备200配备摄像头,其预设为插入到显示设备200的USB接口中,使用户能够在显示设备200上正常使用摄像头相关应用。然而,在显示设备200工作时,由于USB连接线的差分信号有时会受到干扰而产生波动,导致控制器250可能会判定摄像头为断开状态,控制器250将摄像头为断开状态这一消息反馈到摄像头应用后,将导致摄像头应用不能正常使用。例如,在一些实施例中,根据摄像头应用的预先设置,当判断摄像头处于不正常状态,则退出响应的应用,显示设备200的显示器275会显示摄像头应用退出的提示信息;在另一些实施例中,根据摄像头应用预先设置,当判断摄像头处于不正常状态,也持续输出图像,而显示设备200的显示器275会一直显示摄像头断开前的图像,即图像卡住,导致摄像头相关应用的图像输出中断。
此时,用户只能重启摄像头应用以使控制器250重新检测摄像头是否处于连接状态。控制器250判定摄像头为断开状态通常是受到了干扰导致的,在干扰消除或减弱后,控制器250能够判定摄像头为连接状态,而干扰消除或减弱的过程可能很短暂,如0-2秒,即控制器250会检测到摄像头瞬间断开又瞬间连上,在用户重启摄像头应用后,就能够正常使用摄像头应用了。
为提高用户体验,本申请一些实施例提供了一种图像恢复方法,该图像恢复方法通过预先在Camera HAL层设置一个USB状态侦听线程,来解决摄像头应用由于摄像头瞬间断开而导致的闪退或图像输出中断的问题。图8为根据本申请一些实施例的图像恢复方法的流程示意图,如图8所示,该方法包括以下步骤:
步骤S110:响应于接收到用户输入的用于指示启动摄像头应用的拍摄功能的控制信号,控制显示器显示摄像头采集的第一图像。
在一些实施例中,用户启动摄像头应用,则摄像头应用会展示拍摄界面,则用于指示启动摄像头应用的拍摄功能的控制信号即为摄像头应用的启动信号。在一些实施例中,用户启动摄像头应用,则摄像头应用会展示拍摄控件,当用户通过触控、语音等控制方式,通过选择器选中并触发拍摄控件后,摄像头应用会展示拍摄界面。当用户输入用于指示启动摄像头应用的拍摄功能的控制信号后,控制器需要控制显示设备的显示器显示摄像头应用的拍摄界面。Camera HAL层的主线程,以下简称Camera HAL主线程,在接收到用于 指示启动摄像头应用的拍摄功能的控制信号后,启动摄像头,对摄像头进行USB状态检测,判定摄像头为连接状态后,控制摄像头采集图像,将摄像头采集的图像发送到摄像头应用,使显示器呈现与摄像头采集的图像对应的拍摄界面,此时,摄像头采集的图像可称为第一图像,第一图像可为一定帧率的视频流。Camera HAL主线程可将第一图像存储在摄像头应用的图像队列缓冲区,使摄像头应用读取图像队列缓冲区后对拍摄界面的第一图像进行实时刷新,从而用户能够在拍摄界面看到实时刷新的第一图像。
在一些实施例中,摄像头启动时,控制器注册两个回调函数:回调函数1:用于检测摄像头拔出;回调函数2:用于检测摄像头插上。Camera HAL主线程在判定摄像头为连接状态后,将回调函数1发送给摄像头应用,摄像头应用根据回调函数1得知摄像头连接正常后,读取图像队列缓冲区,在拍摄界面输出第一图像。在一些实施例中,控制器除采用回调函数的方案外,还可以采用通知消息的方式实现类似的效果。
步骤S120:检测摄像头的USB状态。
在一些实施例中,摄像头启动后,Camera HAL主线程启动USB状态侦听线程,通过该线程检测摄像头的USB状态。USB状态侦听线程可根据控制器生成回调函数1,判定摄像头的USB状态为断开连接,根据控制器生成回调函数2,判定摄像头的状态为连接状态。
步骤S130:若USB状态为断开连接,判断在延时时间内摄像头是否重新连接。当USB状态为断开连接时,控制器不再向摄像头应用的图像队列缓冲区发送第一图像,摄像头应用无法继续刷新第一图像,用户看到的第一图像不再刷新。
在一些实施例中,从判定摄像头的USB状态为断开连接起,USB状态侦听线程继续对摄像头的USB状态进行侦听,判断延时时间内摄像头是否切换为连接状态,例如,USB状态侦听线程可根据检测到UVC设备的插入消息,判定摄像头切换为连接状态,其中,该UVC设备的插入消息,可为控制器生成回调函数1的通知消息。
在一些实施例中,Camera HAL主线程还可在启动USB状态侦听线程后,启动Camera HAL消息处理线程,USB状态侦听线程在启动后持续对摄像头的USB状态进行检测,根据检测到UVC设备的插入消息,发送摄像头连接的通知消息到Camera HAL消息处理线程,以通知USB连接。其中,摄像头连接的通知信息可包括connecting(连接)状态。延时时间可根据用户体验设置,例如1-5秒。在一些实施例中,设置延时时间为2秒,判断2秒内摄像头是否切换为连接状态。如果摄像头切换为连接状态,可认为摄像头自上次断开连接之后重新连接。
步骤S140:如果在延时时间内所述摄像头重新连接,控制显示器将第一图像刷新为第二图像,其中,第二图像为摄像头重新连接后采集的图像。
在一些实施例中,在延时时间内如果USB状态侦听线程侦听到UVC设备的插入消息,则表明摄像头重新连接,USB状态侦听线程将UVC设备的插入消息通知Camera HAL主线程,使Camera HAL主线程控制摄像头采集图像,此时,摄像头采集的图像可称为第二图像,Camera HAL主线程可将第二图像填充到在第一图像对应的图像队列缓冲区,即摄像头应用的图像队列缓冲区,摄像头应用可从图像队列缓冲区读取第二图像,将拍摄界面的第一图像刷新为第二图像,从而用户能够在显示器看到第一图像刷新为第二图像。
在一些实施例中,当摄像头断开连接时,摄像头应用的图像队列缓存区的第一图像不能填充新的图像数据,使得在摄像头重新连接前,摄像头应用的拍摄界面展示的是最后一帧第一图像。在摄像头重新连接后,摄像头应用的图像队列缓存区填充了第二图像,摄像 头应用的拍摄界面将从第一图像刷新为第二图像。具体的,如果摄像头能够在延时时间内重新连接,则第一图像刷新至第二图像的最长时间为上述延时时间,由于延时时间设置的时长较短,如2秒,则从用户角度来看,拍摄界面有2秒没有更新,这与网络卡顿导致的拍摄界面没有及时更新的用户体验相近。由于摄像头应用没有收到回调函数1,因此,从摄像头应用角度来看,只是图像队列缓冲区的图像延迟了更新,摄像头应用不会退出,用户也不必重启摄像头应用,可以提升了用户体验。
步骤S150:如果在延时时间内摄像头没有重新连接,控制摄像头应用退出或在显示器上提示退出摄像头应用。
在一些实施例中,如果在延时时间内,USB状态侦听线程没有侦听到UVC设备的插入消息,则表明摄像头没有在延时时间内重新连接,摄像头无法正常工作,此时,需要通知摄像头应用摄像头异常。USB状态侦听线程将回调函数2发送至摄像头应用,使摄像头应用进行相应处理,例如自动退出拍摄界面,或自动退出应用,或提示用户关闭应用,或提示用户重启应用。
在一些实施例中,Camera HAL层的Camera HAL消息处理进程,在延时时间内没有接收到USB状态侦听线程发送的摄像头连接的通知消息,则Camera HAL消息处理进程将回调函数2发送至摄像头应用,并停止USB状态侦听线程,重启Camera HAL层。
图9为根据本申请一些实施例的摄像头应用和硬件抽象层的交互流程示意图,如图9所示,摄像头应用的动作包括启动应用和关闭应用,Camera HAL层对摄像头应用的动作进行响应,其中,Camera HAL层包括一个Camera HAL主线程和USB状态侦听线程。响应于摄像头应用的动作为启动应用,Camera HAL主线程的动作包括启动摄像头、开启视频流和填充数据。其中,启动摄像头的过程包括打开摄像头,使摄像头能够采集图像,此时,摄像头在逻辑层面上可标记为video0,注册回调函数1和回调函数2,按照配置参数,如帧率、分辨率等参数对摄像头进行拍摄配置,设置摄像头应用的图像队列缓冲区;开启视频流包括启动图像数据流的获取,图像数据流包括第一图像对应的数据,其中,第一图像为摄像头拍摄的图像;填充数据包括将第一图像发送到图像队列缓冲区,使摄像头应用可读取图像队列缓冲区,实时刷新拍摄界面。
在一些实施例中,Camera HAL主线程在摄像头后启动USB状态侦听线程,USB状态侦听线程对摄像头的USB状态进行监测,如果监测到摄像头断开,则关掉摄像头,然后判断在延时时间内USB状态是否切换为连接,如果USB状态切换为连接,则表明有新的摄像头连接至USB接口中。需要说明的是,该新的摄像头,在物理层面上可能还是原摄像头,在逻辑层面上,根据设备排序规则为总是从序号0开始往上标号,如果0没有被占用,则新的摄像头放在序号0上,即为video0;如果已经占用,则新连接的摄像头放在序号1上,即为video1。
以新的摄像头标记为video1为例进行说明,如果在延时时间内,USB状态侦听线程监测到USB状态切换为连接,则表明检测到新的摄像头,即video1,则执行启动并配置摄像头。其中,启动摄像头包括打开video1,配置摄像头包括按照历史配置参数对video1进行配置,历史配置参数包括video0的配置参数,video1配置完成后,Camera HAL主线程可进行填充数据,将video1拍摄的第二图像发送至摄像头应用的图像队列缓冲区,使摄像头应用能够获取第二图像,将第一图像刷新为第二图像,从而用户能够看到拍摄界面的刷新。如果在延时时间内,USB状态侦听线程没有监测到USB状态切换为连接,即没有新的摄 像头插入,则将回调函数2发送至摄像头应用,从而通知摄像头应用摄像头断开。响应于摄像头应用的动作为关闭应用,Camera HAL主线程的动作包括关闭视频流和关闭摄像头。其中,关闭视频流包括释放摄像头应用的图像队列缓冲区,关闭摄像头包括控制摄像头停止采集图像。
在一些实施例中,还可在Camera HAL层设置一个错误流程,在启动摄像头或关闭摄像头等过程中,由于摄像头断开连接而导致Camera HAL层无法按上述步骤执行时,可以执行该错误流程,该错误流程可被配置为重启摄像头应用,以使控制器250重新检测摄像头是否处于连接状态。
图10为根据本申请另一些实施例的摄像头应用和硬件抽象层的交互流程示意图,如图10所示,Camera HAL层除了设置有Camera HAL主线程、USB状态侦听线程外,还可设置有Camera HAL消息处理进程,其中,Camera HAL主线程可简称为主线程。
在一些实施例中,摄像头应用与Camera HAL层的交互流程如下:摄像头应用将打开摄像头的命令发送给Camera HAL层,其中,打开摄像头的命令根据用户输入的用于指示启动摄像头应用的拍摄功能的控制信号生成。Camera HAL主线程根据打开摄像头的命令启动并配置摄像头,使摄像头能够按照配置参数采集图像,并注册回调函数1和回调函数2,此时,摄像头在逻辑层面上可记为video0,摄像头采集的图像称为第一图像。其中,配置参数可包括用户设置的拍摄参数,如帧率、分辨率等参数,还可包括图像缓冲区的地址等参数。Camera HAL主线程在配置完摄像头后填充图像队列缓冲区,例如,可通过开启视频流,将摄像头采集的第一图像存储至图像队列缓冲区。同时,启动USB状态侦听线程。摄像头应用读取图像数据图像队列缓冲区中的第一图像,根据第一图像实时刷新拍摄界面。USB侦听线程对摄像头的USB状态进行侦听,如果侦听到USB断开,即摄像头断开连接,发送摄像头断开的通知消息到Camera HAL消息处理线程,以通知USB断开,该摄像头断开的通知信息可为video0为disconnecting(失联)状态。Camera HAL消息处理线程接收到摄像头断开的通知消息后,启动一个计时器以开启计时,并停止摄像头工作,使摄像头不再采集图像数据,进而会导致图像队列缓冲区无法继续获取第一图像,其中,计时器的最大计时时间为上述实施方式中的延时时间,如2秒。
USB侦听线程在侦听到USB断开后继续对摄像头的USB状态进行侦听,如果侦听到USB连接,即摄像头重新连接,发送摄像头连接的通知消息到Camera HAL消息处理线程,以通知USB连接,该摄像头连接的通知信息可为video0为connecting(连接)状态。Camera HAL消息处理线程在计时时间内,如果接收到摄像头连接的通知消息则停止计时,启动并配置摄像头,使摄像头恢复工作,进而填充第二图像到摄像头应用的图像队列缓冲区。其中,在物理层面上,摄像头瞬间断开后又瞬间连接,始终是原来的摄像头,而在逻辑层面上,根据设备排序规则为总是从序号0开始往上标号,如果0没有被占用,则新的摄像头设置在0上,即标记为video0,如果序号0已经被占用,则新连接的摄像头设置在1上,即标记为video1。无论新连接的摄像头标记为video0还是video1,由于在逻辑层面上原来连接的摄像头已经被停止工作,因此,新连接的摄像头在启动后需要对其重新配置,使其按照原摄像头的工作方式进行工作,为摄像头应用采集图像。以新连接的摄像头标记为video1为例,可按照上次摄像头连接时的历史配置参数进行配置,历史配置参数可包括用户设置的拍摄参数,还可包括图像缓冲区的地址等参数。video1采集的图像数据称为第二图像,Camera HAL消息处理线程将video1配置好后,第二图像可填充至图像队列缓冲区。
摄像头应用可读取图像队列缓冲区,将拍摄界面刷新为第二图像。如果延时间到,Camera HAL消息处理线程还未接收到摄像头连接的通知消息,即USB未连接,则报错并重启Camera HAL层,停止USB状态侦听线程,并将系统错误的通知,如回调函数2发送到摄像头应用,从而通知摄像头应用摄像头断开。摄像头应用收到系统错误的通知后生成关闭摄像头的指令,将关闭摄像头的指令发送给Camera HAL主线程,另外,摄像头应用也可根据接收到用户输入的退出拍摄界面或退出应用的指令生成关闭摄像头的指令。Camera HAL层接收到关闭摄像头的指令后,关闭视频流然后关闭摄像头。响应于摄像头应用的动作为关闭应用,Camera HAL层的动作包括关闭视频流和关闭摄像头。其中,关闭视频流包括释放摄像头应用的图像队列
本申请一些实施例通过设置了一个USB状态侦听线程对摄像头的USB状态进行监测,当监测到摄像头断开后,判断在延时时间内摄像头是否重新插入,如果在延时时间内摄像头重新插入,则将重新插入的摄像头采集的图像填充至摄像头应用的图像队列缓冲区,使摄像头应用的图像能够刷新为重新插入的摄像头采集的图像,解决了摄像头应用在摄像头瞬见断开又瞬间连上时需要用户重启摄像头应用的问题,提升了用户体验;另外,本申请一些实施例的USB状态侦听线程设置在Camera HAL层,在软件层级上更靠近底层,后续修改的灵活性大,修改容易控制,有利于显示设备的系统升级。
下面介绍另一种摄像头异常检测和处理方案,图11为根据本申请一些实施例的摄像头异常处理方法的数据流图。在指定应用调用摄像头异常时,本申请一些实施例提供的显示设备,其控制器被配置为执行摄像头异常处理方法,图11,控制器被配置为执行以下步骤:
S1、在指定应用调用摄像头时,判断是否获取到摄像头采集的图像数据。
在一些实施例中,若用户需要利用显示设备进行视频通话时,用户先启动指定应用,由指定应用调用摄像头,实现摄像头的启动。摄像头开启后,可实时采集图像数据,控制器实时获取图像数据并发送至显示器,显示在显示器中的预览画面中。
如果摄像头出现异常,控制器将无法接收到摄像头采集的图像数据,需要启动摄像头异常处理机制。因此,为保证在摄像头出现异常,能够及时启动摄像头异常处理机制以恢复摄像头的使用,需要控制器能够实时判断是否获取到摄像头采集的图像数据。如果控制器能够获取到摄像头采集的图像数据,说明摄像头与显示设备的连接正常,如果不能获取到摄像头采集的图像数据,说明摄像头与显示设备的连接异常,此时,需要及时启动摄像头异常处理机制。
S2、若无法获取到摄像头采集的图像数据,则检测摄像头的设备节点是否存在。
如果控制器在某一瞬时无法接收到摄像头采集的图像数据,说明摄像头与显示设备的连接可能出现异常,导致摄像头与显示设备的数据通路瞬时断开。此时,为准确确定摄像头与显示设备的连接是否出现异常,需启动摄像头异常处理机制,即检测摄像头的设备节点是否存在。摄像头的设备节点用于标识摄像头与显示设备的连接,如果摄像头的设备节点存在,说明摄像头与显示设备处于连接状态;如果摄像头的设备节点不存在,说明摄像头与显示设备处于断开状态。
S3、如果摄像头的设备节点不存在,则检测摄像头是否连接成功。
如果控制器判断出摄像头的设备节点不存在,此时摄像头与显示设备处于断开状态,为建立摄像头与显示设备的连接,在一些实施例中,对摄像头进行处理,检测摄像头是否连接成功,即摄像头与显示设备是否连接成功。在一些实施例中,控制器在执行如果摄像 头的设备节点不存在,则检测摄像头是否连接成功,被进一步配置为:
步骤31、如果摄像头的设备节点不存在,则关闭摄像头的图像数据输出流。
步骤32、在预设时长内,检测摄像头是否连接成功。
对摄像头进行处理的过程包括关闭摄像头的图像数据输出流,发送延时错误上报信息给指定应用,以及,循环检测摄像头是否连接成功。关闭摄像头的图像数据输出流即摄像头停止向控制器发送其采集的图像数据,控制器此时不再获取摄像头采集的图像数据。发送延时错误上报信息给指定应用用于通知指定应用当前摄像头出现异常,同时,该信息会显示在显示器中,主要显示在显示器呈现指定应用的界面中。循环检测摄像头是否连接成功用于在预设时长内,由控制器循环检测摄像头与显示设备是否重新连接成功,即尝试重新建立摄像头与显示设备的连接。在摄像头的设备节点不存在时,需重新建立摄像头与显示设备的连接。在一些实施例中,先关闭当前时刻对应的摄像头的图像数据输出流,而后在预设时长内,按照一定检测频率检测摄像头与显示设备是否重新连接成功。在一些实施例中,预设时长可设为15秒,检测频率可设为每秒检测一次。在15秒内,控制器按照每秒一次的检测频率,循环检测摄像头与显示设备是否重新连接成功。如果重新连接成功,说明控制器可重新获取摄像头采集的图像数据;如果未连接功能,说明摄像头出现异常。
S4、若检测到摄像头连接成功,重新获取摄像头采集的图像数据,实现指定应用正常调用摄像头。
在控制器检测到摄像头与显示设备重新连接成功后,此时,摄像头与显示设备的数据流通路连通,控制器可重新获取摄像头采集的图像数据,以保证指定应用能够恢复调用摄像头的进程,保证用户的正常使用。
在一些实施例中,由于控制器在检测到摄像头的设备节点不存在时,需关闭摄像头的图像数据输出流,再进行摄像头与显示设备的连接重新检测。因此,控制器在执行若检测到摄像头连接成功,重新获取摄像头采集的图像数据,被进一步配置为:
步骤41、如果检测到摄像头连接成功,打开摄像头的图像数据输出流。
步骤42、重新获取摄像头采集的图像数据,将重新获取的图像数据显示在显示器中,实现指定应用正常调用摄像头。
控制器在依据第一处理规则检测摄像头与显示设备的连接是否成功时,如果检测到摄像头与显示设备连接成功,说明摄像头可正常向控制器输出图像数据,此时,控制器需再次打开摄像头的图像数据输出流。
摄像头的图像数据输出流被再次打开后,控制器可重新获取摄像头采集的图像数据,并将重新获取到的图像数据发送至显示器,由显示器显示重新获取到的图像数据,以保证指定应用能够恢复调用摄像头的进程,保证用户的正常使用。
但是,如果控制器检测到摄像头未连接成功,此时摄像头与显示设备的连接无法恢复,为提醒用户进行后序操作,控制器在此时需生成摄像头异常信息;并将摄像头异常信息发送至指定应用,以及,将摄像头异常信息显示在显示器中。
在一些实施例中,摄像头异常信息可设为提示摄像头已拔出的内容,并将该内容发送至指定应用,以显示在显示器呈现指定应用时的界面中。用户在查看到该内容后,即可获知此时摄像头已与显示设备断开连接,可进行后续操作,例如,重新恢复摄像头与显示设备的物理连接。
在一些实施例中,在步骤S2之后,即控制器在执行若无法获取到摄像头采集的图像 数据,则检测摄像头的设备节点是否存在的步骤的之后,如果控制器检测到摄像头的设备节点存在,则此时控制器需执行另一处理规则,以恢复摄像头与显示设备的连接。
图12中示例性示出了根据一些实施例的摄像头异常处理方法的另一种流程图。具体地,参见图12,在对摄像头出现异常进行处理时,控制器被进一步配置为:
S51、如果摄像头的设备节点存在,则按照预设读取次数,循环获取摄像头采集的图像数据。
S52、如果在预设读取次数内均未获取到摄像头采集的图像数据,则延时第一时长。
S53、在经过第一时长后,检测摄像头是否连接成功。
S54、如果检测到摄像头连接成功,则由指定应用正常调用摄像头。
如果摄像头的设备节点存在,则说明当前摄像头与显示设备的数据流通路是连通状态,只是摄像头在输出图像数据时出现异常。此时,在摄像头无法正常输出图像数据时,控制器执行另一处理规则,在一些实施例中,该处理规则包括按照预设读取次数循环获取摄像头采集的图像数据,以及,检测摄像头是否连接成功。
为此,在控制器无法获取到摄像头采集的图像数据且能够检测到摄像头的设备节点存在时,控制器按照预设读取次数循环获取摄像头采集的图像数据。在一些实施例中,预设读取次数可设为1000次,控制器循环1000次尝试重新获取摄像头采集的图像数据。
如果控制器在预设读取次数内均未重新获取到摄像头采集的图像数据,即失败1000次,说明此时摄像头与显示设备的连接出现异常。如果控制器在预设读取次数内的某次能够重新获取到摄像头采集的图像数据,说明摄像头的图像数据输出流恢复正常,此时,控制器可重新获取摄像头采集的图像数据,并将重新获取到的图像数据发送至显示器,由显示器显示重新获取到的图像数据,以保证指定应用能够恢复调用摄像头的进程,保证用户的正常使用。
在控制器在预设读取次数内均未重新获取到摄像头采集的图像数据时,控制器可执行检测摄像头与显示设备是否重新连接成功的步骤。此时,控制器需在尝试预设读取次数均未重新获取到摄像头采集的图像数据之后,等待第一时长,在经过第一时长后,再检测摄像头是否连接成功。
在一些实施例中,第一时长可设为10秒。控制器在经过1000次循环获取图像数据之后,等待10秒,即在经过10秒后,即可启动检测摄像头是否连接成功的过程。
如果经过第一时长后,控制器检测到摄像头与显示设备重新连接成功,说明摄像头可正常向控制器输出图像数据,此时,控制器可重新获取摄像头采集的图像数据,并将重新获取到的图像数据发送至显示器,由显示器显示重新获取到的图像数据,以保证指定应用能够恢复调用摄像头的进程,保证用户的正常使用。
但是,如果控制器检测到摄像头未连接成功,此时摄像头与显示设备的连接无法恢复,为提醒用户进行后序操作,控制器在此时需生成摄像头异常信息;并将摄像头异常信息发送至指定应用,以及,将摄像头异常信息显示在显示器中。
在一些实施例中,摄像头异常信息可设为提示摄像头已拔出的内容,并将该内容发送至指定应用,以显示在显示器呈现指定应用时的界面中。用户在查看到该内容后,即可获知此时摄像头已与显示设备断开连接,可进行后续操作,例如,重新恢复摄像头与显示设备的物理连接。
前述各实施例提供的显示设备在执行摄像头异常处理方法时,是在控制器无法接收到 摄像头采集的图像数据时执行,即在显示设备侧由显示设备实现检测及处理。而在其他实施例中,显示设备还可在摄像头侧对摄像头进行实时监控,以更及时地确定摄像头是否出现异常。
图13中示例性示出了根据一些实施例的摄像头异常处理方法的又一种流程图。在摄像头侧判定摄像头出现异常时,参见图13,控制器在执行指定应用调用摄像头,被进一步配置为执行下述步骤:
S61、在指定应用调用摄像头时,开启线程监听功能,监测摄像头是否断开连接。
S62、如果监测到摄像头未断开连接,则执行指定应用调用摄像头的步骤。
S63、如果监测到摄像头断开连接,则执行检测摄像头是否连接成功的步骤。
在用户需要利用显示设备进行视频通话时,指定应用调用摄像头,将摄像头开启。此时,控制器开启线程监听功能,具体为控制器开启socket线程监听,以实时监测摄像头与显示设备的连接状态。
如果通过线程监听功能,控制器监测到摄像头与显示设备未断开连接,此时,控制器可获取摄像头采集的图像数据,并将获取到的图像数据发送至显示器,由显示器显示获取到的图像数据,以保证指定应用能够恢复调用摄像头的进程,保证用户的正常使用。
而如果控制器监测到摄像头与显示设备断开连接,此时,说明摄像头无法输出图像数据至控制器,因此,控制器执行步骤S3所述的检测摄像头是否连接成功的相关步骤。具体内容可参照前述对步骤S3的介绍,此处不再赘述。
在控制器监测到摄像头与显示设备断开连接,并检测摄像头是否连接成功的过程中,控制器需先停止图像数据的预览,并在摄像头连接成功后,再重新开启预览。
图14中示例性示出了根据一些实施例的显示新预览画面的方法流程图。参见图14,在线程监听功能先监听到摄像头断开与显示设备的连接后,又监听到摄像头与显示设备连接成功的过程中,控制器被进一步配置为执行下述步骤:
S71、如果监测到摄像头断开连接,则停止发送摄像头采集的图像数据至显示器,显示器取消显示预览画面。
S72、在摄像头连接成功时,延时第二时长,重新获取摄像头采集的图像数据。
S73、将重新获取的图像数据发送至显示器,显示器显示新预览画面,新预览画面是指显示重新获取的图像数据时呈现的画面。
控制器利用线程监听功能实时监听摄像头与显示设备的连接,在监测到摄像头与显示设备的连接断开时,控制器无法获取到摄像头采集的图像数据,此时,控制器停止向显示器发送图像数据,使得显示器中当前显示的预览画面取消显示。
在控制器执行步骤S3所述的处理规则对摄像头进行异常处理后,如果摄像头与显示设备重新连接成功,则可在第二时长后,重新获取摄像头采集的图像数据。
在一些实施例中,第二时长可设为1秒。由于控制器每秒检测一次摄像头与显示设备是否连接成功,因此,在检测到摄像头与显示设备连接成功后,可在1秒后重新获取摄像头采集的图像数据。
控制器可重新获取摄像头采集的图像数据,并将获取到的图像数据发送至显示器,由显示器显示获取到的图像数据得到新预览画面,以保证指定应用能够恢复调用摄像头的进程,保证用户的正常使用。
由以上技术方案可知,本申请实施例提供的一种显示设备,在控制器内配置的指定应 用调用摄像头时,判断控制器是否获取到摄像头采集的图像数据;若无法获取到,则检测摄像头的设备节点是否存在;如果摄像头的设备节点不存在,则检测摄像头是否连接成功,并在检测到摄像头连接成功时,重新获取摄像头采集的图像数据,实现指定应用正常调用摄像头。可见,本申请提供的显示设备,通过监听摄像头设备节点的方式来保证摄像头的稳定性,可对摄像头出现异常现象时进行及时处理,保证图像数据流输出的连续,避免显示界面呈现卡住状态,进而保证用户能够正常使用摄像头,用户体验好。
本申请一些实施例提供的一种摄像头异常处理方法,由前述实施例提供的显示设备中的控制器执行,该方法包括:
在所述指定应用调用摄像头时,判断是否获取到所述摄像头采集的图像数据;
若无法获取到所述摄像头采集的图像数据,则检测所述摄像头的设备节点是否存在;
如果所述摄像头的设备节点不存在,则检测所述摄像头是否连接成功;
若检测到所述摄像头连接成功,重新获取所述摄像头采集的图像数据,实现所述指定应用正常调用摄像头。
在一些实施例中,所述如果摄像头的设备节点不存在,则检测所述摄像头是否连接成功,包括:如果所述摄像头的设备节点不存在,则关闭所述摄像头的图像数据输出流;在预设时长内,检测所述摄像头是否连接成功。
在一些实施例中,所述方法还包括:在所述指定应用调用摄像头时,开启线程监听功能,监测所述摄像头是否断开连接;如果监测到所述摄像头未断开连接,则执行所述指定应用调用摄像头的步骤;如果监测到所述摄像头断开连接,则执行检测所述摄像头是否连接成功的步骤。
为了方便解释,已经结合具体的实施方式进行了上述说明。但是,上述在一些实施例中讨论不是意图穷尽或者将实施方式限定到上述公开的具体形式。根据上述的教导,可以得到多种修改和变形。上述实施方式的选择和描述是为了更好的解释原理以及实际的应用,从而使得本领域技术人员更好的使用实施方式以及适于具体使用考虑的各种不同的变形的实施方式。

Claims (16)

  1. 一种显示设备,包括:
    显示器,
    控制器,被配置为:
    响应于用户输入的启动摄像头的控制指令,检测所述摄像头的状态;
    如果所述摄像头的状态异常,在显示器上显示提示信息,所述提示信息包括出现异常状态的原因和解除所述异常状态的操作方法;
    如果所述摄像头的状态正常,在显示器上显示所述摄像头采集的第一图像。
  2. 根据权利要求1所述的显示设备,所述控制器被配置为:
    检测所述摄像头的通用串行总线状态;
    根据所述通用串行总线状态为断开连接,判断为摄像头异常状态。
  3. 根据权利要求2所述的显示设备,所述控制器被配置为:
    根据所述通用串行总线状态为断开连接,判断在延时时间内所述摄像头是否重新连接;
    如果在所述延时时间内所述摄像头重新连接,控制所述显示器将所述第一图像刷新为第二图像,其中,所述第二图像为所述摄像头重新连接后采集的图像。
  4. 根据权利要求3所述的显示设备,所述控制器还被配置为:
    如果在所述延时时间内所述摄像头没有重新连接,控制所述摄像头应用退出或在所述显示器上提示退出所述摄像头应用。
  5. 根据权利要求3所述的显示设备,所述控制器被配置为:
    判断在延时时间内是否检测到通用串行总线视频类设备的插入消息;
    如果在预设时间内检测到所述通用串行总线视频类设备的插入消息,则确定所述摄像头重新连接;
    如果在预设时间内没有检测到所述通用串行总线视频类设备的插入消息,则确定所述摄像头没有重新连接。
  6. 根据权利要求3所述的显示设备,所述控制器被配置为:
    将所述第二图像填充到所述第一图像对应的图像队列缓冲区内;
    从所述图像队列缓冲区内读取并输出所述第二图像到显示器。
  7. 根据权利要求1所述的显示装置,所述控制器被配置为:
    若无法获取到所述摄像头采集的图像数据,则检测所述摄像头的设备节点是否存在;
    如果所述摄像头的设备节点不存在,检测所述摄像头是否连接成功;
    若检测到所述摄像头连接成功,重新获取所述摄像头采集的图像数据。
  8. 根据权利要求7所述的显示设备,所述控制器被配置为:
    如果所述摄像头的设备节点不存在,则关闭所述摄像头的图像数据输出流;
    在预设时长内,检测所述摄像头是否连接成功。
  9. 根据权利要求8所述的显示设备,所述控制器被配置为:
    如果所述摄像头的设备节点存在,则按照预设读取次数,循环获取所述摄像头采集的图像数据;
    如果在所述预设读取次数内均未获取到摄像头采集的图像数据,则延时第一时长后,再检测所述摄像头是否连接成功。
  10. 根据权利要求1所述的显示设备,所述控制器被配置为:
    在指定应用调用摄像头时,开启线程监听功能,监测所述摄像头是否断开连接;
    如果监测到所述摄像头未断开连接,则执行所述指定应用调用摄像头的步骤;
    如果监测到所述摄像头断开连接,则执行检测所述摄像头是否连接成功的步骤。
  11. 一种摄像头检测方法,包括:
    响应于用户输入的启动摄像头的控制指令,检测所述摄像头的状态;
    如果所述摄像头的状态异常,则在显示器上显示提示信息,所述提示信息包括出现异常状态的原因和解除所述异常状态的操作方法。
  12. 根据权利要求11所述的方法,包括:
    响应于用户输入的启动摄像头的控制指令,检测所述摄像头的状态;
    如果检测到摄像头的通用串行总线端口未插入摄像头,则在显示器上显示提示信息,所述提示信息包括当前未插入摄像头或者摄像头物理开关被关闭。
  13. 根据权利要求11所述的方法,包括:
    如果检测到摄像头的通用串行总线端口已插入摄像头,所述摄像头正常打开,所述摄像头是云台摄像头,且所述摄像头的马达控制服务未启动,则在显示器上显示提示信息,重新启动所述摄像头的马达控制服务,所述提示信息包括马达控制服务未启动,重新退出应用程序再打开。
  14. 一种摄像头异常处理方法,包括:
    在所述指定应用调用摄像头时,判断是否获取到所述摄像头采集的图像数据;
    若无法获取到所述摄像头采集的图像数据,则检测所述摄像头的设备节点是否存在;
    如果所述摄像头的设备节点不存在,则检测所述摄像头是否连接成功;
    若检测到所述摄像头连接成功,重新获取所述摄像头采集的图像数据,实现所述指定应用正常调用摄像头。
  15. 根据权利要求14所述的方法,所述如果摄像头的设备节点不存在,则按照第一处理规则检测所述摄像头是否连接成功,包括:
    如果所述摄像头的设备节点不存在,则关闭所述摄像头的图像数据输出流;
    在预设时长内,检测所述摄像头是否连接成功。
  16. 根据权利要求14所述的方法,还包括:
    在所述指定应用调用摄像头时,开启线程监听功能,监测所述摄像头是否断开连接;
    如果监测到所述摄像头未断开连接,则执行所述指定应用调用摄像头的步骤;
    如果监测到所述摄像头断开连接,则执行检测所述摄像头是否连接成功的步骤。
PCT/CN2021/098709 2020-06-08 2021-06-07 显示设备、摄像头检测方法及摄像头异常处理方法 WO2021249353A1 (zh)

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
CN202010514148.2 2020-06-08
CN202010514148.2A CN111683279B (zh) 2020-06-08 2020-06-08 显示设备及图像恢复方法
CN202010722308.2 2020-07-24
CN202010722308.2A CN111866498B (zh) 2020-07-24 2020-07-24 一种摄像头异常处理方法及显示设备
CN202010752500.6 2020-07-30
CN202010752500.6A CN111918056B (zh) 2020-07-30 2020-07-30 一种摄像头状态检测方法及显示设备

Publications (1)

Publication Number Publication Date
WO2021249353A1 true WO2021249353A1 (zh) 2021-12-16

Family

ID=78845300

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/098709 WO2021249353A1 (zh) 2020-06-08 2021-06-07 显示设备、摄像头检测方法及摄像头异常处理方法

Country Status (1)

Country Link
WO (1) WO2021249353A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114025157A (zh) * 2022-01-05 2022-02-08 广州朗国电子科技股份有限公司 一体机摄像头的识别方法、系统以及一体机
CN114726950A (zh) * 2022-02-28 2022-07-08 荣耀终端有限公司 一种摄像头模组的开启方法和装置
CN115878531A (zh) * 2022-12-09 2023-03-31 珠海视熙科技有限公司 MiPi接口控制方法、电子设备、摄像头模组、存储介质和视频系统
CN115883822A (zh) * 2023-02-07 2023-03-31 深圳市永兴元科技股份有限公司 在线考试系统摄像头调试方法、装置及存储介质
CN117579811A (zh) * 2023-11-14 2024-02-20 镁佳(武汉)科技有限公司 一种车辆摄像头故障检测与恢复方法、系统及装置

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100188550A1 (en) * 2009-01-27 2010-07-29 Seiko Epson Corporation Image display system, image input apparatus and controlling method
CN107147902A (zh) * 2017-05-27 2017-09-08 华勤通讯技术有限公司 摄像设备的检测方法及摄像设备
CN107911728A (zh) * 2017-11-20 2018-04-13 青岛海信电器股份有限公司 一种智能电视图像处理方法及智能电视
CN109194919A (zh) * 2018-09-19 2019-01-11 图普科技(广州)有限公司 一种摄像头数据流分配系统、方法及其计算机存储介质
CN111104288A (zh) * 2019-12-20 2020-05-05 维沃移动通信有限公司 一种信息处理方法及电子设备
CN111683279A (zh) * 2020-06-08 2020-09-18 海信视像科技股份有限公司 显示设备及图像恢复方法
CN111866498A (zh) * 2020-07-24 2020-10-30 海信视像科技股份有限公司 一种摄像头异常处理方法及显示设备
CN111918056A (zh) * 2020-07-30 2020-11-10 海信视像科技股份有限公司 一种摄像头状态检测方法及显示设备

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100188550A1 (en) * 2009-01-27 2010-07-29 Seiko Epson Corporation Image display system, image input apparatus and controlling method
CN107147902A (zh) * 2017-05-27 2017-09-08 华勤通讯技术有限公司 摄像设备的检测方法及摄像设备
CN107911728A (zh) * 2017-11-20 2018-04-13 青岛海信电器股份有限公司 一种智能电视图像处理方法及智能电视
CN109194919A (zh) * 2018-09-19 2019-01-11 图普科技(广州)有限公司 一种摄像头数据流分配系统、方法及其计算机存储介质
CN111104288A (zh) * 2019-12-20 2020-05-05 维沃移动通信有限公司 一种信息处理方法及电子设备
CN111683279A (zh) * 2020-06-08 2020-09-18 海信视像科技股份有限公司 显示设备及图像恢复方法
CN111866498A (zh) * 2020-07-24 2020-10-30 海信视像科技股份有限公司 一种摄像头异常处理方法及显示设备
CN111918056A (zh) * 2020-07-30 2020-11-10 海信视像科技股份有限公司 一种摄像头状态检测方法及显示设备

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114025157A (zh) * 2022-01-05 2022-02-08 广州朗国电子科技股份有限公司 一体机摄像头的识别方法、系统以及一体机
CN114025157B (zh) * 2022-01-05 2022-07-05 广州朗国电子科技股份有限公司 一体机摄像头的识别方法、系统以及一体机
CN114726950A (zh) * 2022-02-28 2022-07-08 荣耀终端有限公司 一种摄像头模组的开启方法和装置
CN115878531A (zh) * 2022-12-09 2023-03-31 珠海视熙科技有限公司 MiPi接口控制方法、电子设备、摄像头模组、存储介质和视频系统
CN115878531B (zh) * 2022-12-09 2024-03-15 珠海视熙科技有限公司 MiPi接口控制方法、电子设备、摄像头模组、存储介质和视频系统
CN115883822A (zh) * 2023-02-07 2023-03-31 深圳市永兴元科技股份有限公司 在线考试系统摄像头调试方法、装置及存储介质
CN115883822B (zh) * 2023-02-07 2023-05-30 深圳市永兴元科技股份有限公司 在线考试系统摄像头调试方法、装置及存储介质
CN117579811A (zh) * 2023-11-14 2024-02-20 镁佳(武汉)科技有限公司 一种车辆摄像头故障检测与恢复方法、系统及装置
CN117579811B (zh) * 2023-11-14 2024-05-28 镁佳(武汉)科技有限公司 一种车辆摄像头故障检测与恢复方法、系统及装置

Similar Documents

Publication Publication Date Title
WO2021249353A1 (zh) 显示设备、摄像头检测方法及摄像头异常处理方法
US8185756B2 (en) System and method for transmitting a power control signal to an external device based on the presence of linkage information
US8692892B2 (en) Communication apparatus and control method used for transmitting video data to an external apparatus
JP4337056B2 (ja) 通信装置、通信状態検出方法及び通信状態検出プログラム
CN111683279B (zh) 显示设备及图像恢复方法
US11086635B2 (en) Electronic device, method for controlling electronic device, and program
CN114302132A (zh) 显示设备和工作模式设置方法
EP3852484B1 (en) Electronic device and operating method thereof for operating a bluetooth-wifi combo module
CN113064645B (zh) 一种开机界面控制方法及显示设备
CN113766305A (zh) 显示设备及镜像投屏音频输出控制方法
WO2024098974A1 (zh) 一种显示设备及外接设备的控制方法
CN111866498B (zh) 一种摄像头异常处理方法及显示设备
US20130155333A1 (en) Electronic device, control method, program, and recording medium for remotely operating electronic device
CN113050914B (zh) 一种处理方法及输出设备
US20230164430A1 (en) Camera Control Method and System, and Electronic Device
JP5603675B2 (ja) 表示装置、表示装置の制御方法、及び、プログラム
KR101633647B1 (ko) 디스플레이 장치 및 그 디스플레이 방법
WO2016169106A1 (zh) 通话管理方法、装置及多系统终端
JP2002207472A (ja) 画像表示装置
WO2014103376A1 (ja) 通信装置および通信システム
WO2022142496A1 (zh) 显示设备、外接设备、外接设备工作模式的切换方法及远场语音控制方法
JP2013247539A (ja) 表示装置、表示方法、及び表示装置の制御プログラム
JP2014146920A (ja) 通信装置、制御方法及びプログラム
CN110611785B (zh) 信息处理装置、存储介质以及信息处理方法
JP2011061564A (ja) リモコン装置、av機器及びこれらからなる遠隔制御システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21821065

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21821065

Country of ref document: EP

Kind code of ref document: A1