CN103268238A - Method for achieving drive of universal serial bus (USB) camera on basis of ReWorks operation system - Google Patents
Method for achieving drive of universal serial bus (USB) camera on basis of ReWorks operation system Download PDFInfo
- Publication number
- CN103268238A CN103268238A CN201310177352XA CN201310177352A CN103268238A CN 103268238 A CN103268238 A CN 103268238A CN 201310177352X A CN201310177352X A CN 201310177352XA CN 201310177352 A CN201310177352 A CN 201310177352A CN 103268238 A CN103268238 A CN 103268238A
- Authority
- CN
- China
- Prior art keywords
- usb
- usb camera
- operating system
- camera
- reworks
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
The invention discloses a method for achieving drive of a universal serial bus (USB) camera on the basis of a ReWorks operation system and belongs to the camera drive achieving technology. In the ReWorks operation system, the method for achieving the drive and video acquisition of the USB camera includes the following steps: (1) detection of the USB camera: the ReWorks operation system recognizes the USB camera through the type of the USB camera; (2) initialization of the USB camera: a UVC open source program under a Linux operation system is transplanted into the ReWorks operation system, and the initialization is performed on the USB camera through the UVC open source program; and (3) data acquisition of the USB camera. Compared with the prior art, the method for achieving the drive of the USB camera on the basis of the ReWorks operation system improves video acquisition and processing efficiency and improves video processing timeliness.
Description
Technical field
The present invention relates to a kind of webcam driver realization technology, specifically be based on the method for the USB webcam driver realization of ReWorks operating system.
Background technology
The Godson series processors is the universal cpu that institute's independent research is calculated by the Chinese Academy of Sciences, and wherein Godson 1 series processors is towards Industry Control, consumer electronics Embedded Application such as (mobile phone/MP4/ palm PCs etc.).Godson 1A chip is based on the high performance-price ratio system-on-a-chip of GS232 processor core, and chip integration has become 32 bit processors nuclear, 2D GPU, VGA and LCD display interface and South Bridge chip group function.Can satisfy field demands such as ultralow price cloud terminal, Industry Control/data acquisition, the network equipment, consumer electronics.
The ReWorks embedded OS is the embedded real-time operating system that whole source codes were developed, had to the 32nd technological achievement based on " 95 ", " 15 " of science and technology group of China Electronics voluntarily, is applicable to plurality of target hardware environment (x86, mips).ReWorks operating system adopts object-oriented and Microkernel exploitation, has hard real-time cutting and scalability, and the VxWorks compatible layer is provided.
The high-speed transfer speed of USB and hot plug are found broad application the USB technology, and especially in the video transmission, USB performs to maximum with its advantage.But at present to the research of USB webcam driver mostly based on Windows and Linux system, at present still not to the research of USB webcam driver under the homemade embedded OS ReWorks system.
USB equipment is made up of hardware and software two parts.Hardware mainly is made up of console controller, is responsible for the transmission of USB data; Depositing simultaneously the software information about USB equipment in the USB equipment on the non-volatile memory medium EEPROM, these software informations comprise the hardware information, interface message, terminal point information, configuration, information of USB equipment and to the information of Control on Communication.
Each USB equipment has only a device descriptor, and the inside comprises the information such as maximum data packet size of equipment supplier's ID, product IDs and revision ID, device class and default endpoint; USB equipment for multi-functional is arranged has a plurality of configurations, can make it be configured to different functions; Have 1 or a plurality of interface under each configuration, at interface modes spare interface, the maximum load of specified endpoint can be set as required; Have a plurality of end points under each interface, end points is the communication interface between USB equipment and the main frame, it has specified the size of address, transmission direction and the transmission maximum data packet of endpoint communication, according to the size of maximum data packet, the maximum load of each data transmission can be set.
USB protocol stack under the ReWorks system, the USB master controller is bottom hardware, mainly contain 2 types of UHCI (Universal Host Controller Interface universal host machine control unit interface) and OHCI (the open host controller interface of Open Host Controller Interface), the USB master controller drives the driving that realizes bottom USB master controller, and it is the bridge that USB D bus driver is communicated by letter with the USB master controller that the USB master controller drives; The USBD bus driver provides API (Application Programming Interface application programming) interface for the USB client software, for top layer visit bottom provides call function; Top layer is the USB client software, is the driver at specific USB equipment.
Summary of the invention
Technical assignment of the present invention is at above weak point, a kind of efficient that has improved video acquisition and processing is provided, utilize the hard real-time of ReWorks operating system simultaneously, further improve the method that realizes based on the USB webcam driver of ReWorks operating system of the real-time of Video processing.
The technical solution adopted for the present invention to solve the technical problems is: under ReWorks operating system, the USB webcam driver realizes comprising the steps:
(1), the detection of USB camera: ReWorks operating system is identified the USB camera by the classification of USB camera;
(2), the initialization of USB camera: the UVC that transplants under the Linux operating system increases income program in ReWorks operating system, carries out initialization to the USB camera by the UVC program of increasing income;
(3), the collection of USB camera data: the collection to USB camera data under the ReWorks operating system asks to realize by sending IRP.
The English spelling initial of IRP(receiving point, be translated as initial receiving point) request: when upper level applications is communicated by letter with bsp driver, application program can be sent the I/O request, operating system converts corresponding I/O request to corresponding IRP request, and different IRP request meetings is dispatched to different sending in the routine according to type and handles.
Under ReWorks operating system, the USB webcam driver realizes comprising the steps:
Under the ReWorks operating system, function usbdClientRegister is the device name to a VIDEO_CLASS of host registration, this function can return the operation handle usbdHandle of an operation USBD layer after successful execution, this operation handle is used for later on to USBD layer API function calls;
(1), the detection of USB camera: function usbdDynamicAttach-Register is used for the plug of Dynamic Recognition USB kind equipment, its classification parameter all is made as a constant USBD_NOTIFY_ALL, represent all USB classes, USB subclass and USB agreement, can identify the plug of the USB camera of all USB classes;
(2), the initialization of USB camera: function usbdDynamicAttach-Register can call call back function usbVideoDevAttachCallback plug equipment USB camera is carried out initialization after successful execution is identified the USB camera; The parameter of call back function usbVideoDevAttachCallback is provided automatically by ReWorks operating system, does not need configuration, and by calling the usbVideoPhysDevCreate function data structure of USB camera is carried out initialization;
The UVC that transplants under the Linux increases income program in ReWorks operating system, carries out initialization to the USB camera by the UVC program of increasing income; The initialization of USB camera is that the control end points by the USB camera is configured USB camera register, the configuration function API function of the control end points of USB camera is usbVendorSpecific under the ReWorks operating system, and this API function can be realized the read-write to USB camera register;
(3), the collection of USB camera data, flow process is:
The capture program of USB camera data begins with the main function, at first distributes USB camera structure body and initialization, distributes the display buffer, opens USB camera equipment then, and to USB camera device initialize, reaches ready state; Initialization figure display interface is set up the video acquisition thread, is set up video demonstration thread; At last, call the ioctl function, open the USB camera, the beginning video acquisition, ready after, enter the major cycle of GTK forms; Start the video acquisition thread, gather video, handle video; Start video simultaneously and show thread, display video.
The initialization of USB camera comprises the setting of setting, frame per second and picture size of setting, the automatic exposure of setting, the compression quality of USB camera DSP (the Digital Signal Processing digital signal processing) initialization of chip, the unlatching of USB camera, brightness.
The USB camera uses 3,000,000 pixel USB camera modules.
The ReWorks operating system of this method is hardware platform based on the handheld computer of homemade Godson 1A processor, has realized driving and video acquisition to the USB camera under the ReWorks of above-mentioned hardware platform operating system.
The method that realizes based on the USB webcam driver of ReWorks operating system of the present invention is compared with prior art, exploitation to USB webcam driver under the embedded Reworks operating system, in conjunction with the make a video recording characteristics of first-class time transmission of actual USB, the UVC that transplants under the (SuSE) Linux OS increases income driven by program to Reworks operating system, has realized the driving of USB camera; Utilize ReWorks operating system, adopt the characteristics of real address space, avoided the address mapping between the kernel and consumer process under the Linux operating system, improved the efficient of video acquisition and processing; Utilize the hard real-time of ReWorks operating system simultaneously, further improve the real-time of Video processing, be with a wide range of applications.
Description of drawings
The present invention is further described below in conjunction with accompanying drawing.
Accompanying drawing 1 is the flow chart of steps based on the method for the USB webcam driver realization of ReWorks operating system;
Accompanying drawing 2 is the process flow diagram based on the collection of the USB camera data of the method for the USB webcam driver realization of ReWorks operating system.
The camera of mentioning among the figure all refers to the USB camera.
Embodiment
The invention will be further described below in conjunction with the drawings and specific embodiments.
The method that realizes based on the USB webcam driver of ReWorks operating system of the present invention, under ReWorks operating system, the USB webcam driver realizes comprising the steps:
(1), the detection of USB camera: ReWorks operating system is identified the USB camera by the classification of USB camera;
(2), the initialization of USB camera: the UVC that transplants under the Linux operating system increases income program in ReWorks operating system, carries out initialization to the USB camera by the UVC program of increasing income;
(3), the collection of USB camera data: the collection to USB camera data under the ReWorks operating system asks to realize by sending IRP.
The English spelling initial of IRP(receiving point, be translated as initial receiving point) request: when upper level applications is communicated by letter with bsp driver, application program can be sent the I/O request, operating system converts corresponding I/O request to corresponding IRP request, and different IRP request meetings is dispatched to different sending in the routine according to type and handles.
Under ReWorks operating system, the USB webcam driver realizes comprising the steps:
Under the ReWorks operating system, function usbdClientRegister is the device name to a VIDEO_CLASS of host registration, this function can return the operation handle usbdHandle of an operation USBD layer after successful execution, this operation handle is used for later on to USBD layer API function calls;
(1), the detection of USB camera: function usbdDynamicAttach-Register is used for the plug of Dynamic Recognition USB kind equipment, its classification parameter all is made as a constant USBD_NOTIFY_ALL, represent all USB classes, USB subclass and USB agreement, can identify the plug of the USB camera of all USB classes;
(2), the initialization of USB camera: function usbdDynamicAttach-Register can call call back function usbVideoDevAttachCallback plug equipment USB camera is carried out initialization after successful execution is identified the USB camera; The parameter of call back function usbVideoDevAttachCallback is provided automatically by ReWorks operating system, does not need configuration, and by calling the usbVideoPhysDevCreate function data structure of USB camera is carried out initialization;
The UVC that transplants under the Linux increases income program in ReWorks operating system, carries out initialization to the USB camera by the UVC program of increasing income; The initialization of USB camera is that the control end points by the USB camera is configured USB camera register, the configuration function API function of the control end points of USB camera is usbVendorSpecific under the ReWorks operating system, and this API function can be realized the read-write to USB camera register;
(3), the collection of USB camera data, flow process is:
The capture program of USB camera data begins with the main function, at first distributes USB camera structure body and initialization, distributes the display buffer, opens USB camera equipment then, and to USB camera device initialize, reaches ready state; Initialization figure display interface is set up the video acquisition thread, is set up video demonstration thread; At last, call the ioctl function, open the USB camera, the beginning video acquisition, ready after, enter the major cycle of GTK forms; Start the video acquisition thread, gather video, handle video; Start video simultaneously and show thread, display video.
The initialization of USB camera comprises the setting of setting, frame per second and picture size of setting, the automatic exposure of setting, the compression quality of USB camera DSP (the Digital Signal Processing digital signal processing) initialization of chip, the unlatching of USB camera, brightness.
The USB camera uses 3,000,000 pixel USB camera modules.
The ReWorks operating system of this method is hardware platform based on the handheld computer of homemade Godson 1A processor, has realized driving and video acquisition to the USB camera under the ReWorks of above-mentioned hardware platform operating system.
The method that realizes based on the USB webcam driver of ReWorks operating system of the present invention except the described technical characterictic of instructions, is the known technology of those skilled in the art.
Claims (5)
1. the method that realizes based on the USB webcam driver of ReWorks operating system is characterized in that under ReWorks operating system, realizes driving and the video acquisition of USB camera, comprises the steps:
(1), the detection of USB camera: ReWorks operating system is identified the USB camera by the classification of USB camera;
(2), the initialization of USB camera: the UVC that transplants under the (SuSE) Linux OS increases income program in ReWorks operating system, carries out initialization to the USB camera by the UVC program of increasing income;
(3), the collection of USB camera data: the collection to USB camera data under the ReWorks operating system asks to realize by sending IRP.
2. the method that realizes based on the USB webcam driver of ReWorks operating system according to claim 1 is characterized in that under ReWorks operating system, realizes driving and the video acquisition of USB camera, comprises the steps:
Under the ReWorks operating system, function usbdClientRegister is the device name to a VIDEO_CLASS of host registration, this function can return the operation handle usbdHandle of an operation USBD layer after successful execution, this operation handle is used for later on to USBD layer API function calls;
(1), the detection of USB camera: function usbdDynamicAttach-Register is used for the plug of Dynamic Recognition USB kind equipment, its classification parameter all is made as a constant USBD_NOTIFY_ALL, represent all USB classes, USB subclass and USB agreement, can identify the plug of the USB camera of all USB classes;
(2), the initialization of USB camera: function usbdDynamicAttach-Register can call call back function usbVideoDevAttachCallback plug equipment USB camera is carried out initialization after successful execution is identified the USB camera; The parameter of call back function usbVideoDevAttachCallback is provided automatically by ReWorks operating system, and by calling the usbVideoPhysDevCreate function data structure of USB camera is carried out initialization;
The UVC that transplants under the Linux increases income program in ReWorks operating system, carries out initialization to the USB camera by the UVC program of increasing income; The initialization of USB camera is that the control end points by the USB camera is configured USB camera register, the configuration function API function of the control end points of USB camera is usbVendorSpecific under the ReWorks operating system, and this API function can be realized the read-write to USB camera register;
(3), the collection of USB camera data, flow process is:
The capture program of USB camera data begins with the main function, at first distributes USB camera structure body and initialization, distributes the display buffer, opens USB camera equipment then, and to USB camera device initialize, reaches ready state; Initialization figure display interface is set up the video acquisition thread, is set up video demonstration thread; At last, call the ioctl function, open the USB camera, the beginning video acquisition, ready after, enter the major cycle of GTK forms; Start the video acquisition thread, gather video, handle video; Start video simultaneously and show thread, display video.
3. the method that realizes of the USB webcam driver based on ReWorks operating system according to claim 1, the initialization that it is characterized in that the USB camera comprise the setting of setting, frame per second and picture size of setting, the automatic exposure of setting, the compression quality of unlatching, the brightness of initialization, the USB camera of USB camera dsp chip.
4. the method that realizes based on the USB webcam driver of ReWorks operating system according to claim 1 is characterized in that the USB camera uses 3,000,000 pixel USB camera modules.
5. the method that realizes of the USB webcam driver based on ReWorks operating system according to claim 1, the ReWorks operating system that it is characterized in that this method is hardware platform based on the handheld computer of homemade Godson 1A processor, has realized driving and video acquisition to the USB camera under the ReWorks of above-mentioned hardware platform operating system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310177352XA CN103268238A (en) | 2013-05-15 | 2013-05-15 | Method for achieving drive of universal serial bus (USB) camera on basis of ReWorks operation system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310177352XA CN103268238A (en) | 2013-05-15 | 2013-05-15 | Method for achieving drive of universal serial bus (USB) camera on basis of ReWorks operation system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103268238A true CN103268238A (en) | 2013-08-28 |
Family
ID=49011871
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310177352XA Pending CN103268238A (en) | 2013-05-15 | 2013-05-15 | Method for achieving drive of universal serial bus (USB) camera on basis of ReWorks operation system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103268238A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105653985A (en) * | 2014-10-22 | 2016-06-08 | 北京中电瑞铠科技有限公司 | USB port plugging electron label method and device |
CN107493437A (en) * | 2017-09-21 | 2017-12-19 | 北京图森未来科技有限公司 | A kind of camera parameter control method and relevant device |
CN108200341A (en) * | 2018-01-15 | 2018-06-22 | 青岛海信移动通信技术股份有限公司 | Seamless handover method, device and the terminal device of camera |
CN108205503A (en) * | 2016-12-16 | 2018-06-26 | 龙芯中科技术有限公司 | Hardware driving compatibility method and terminal |
CN109508202A (en) * | 2018-09-27 | 2019-03-22 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Drive development system, method and medium for embedded operating system |
CN111031233A (en) * | 2019-11-13 | 2020-04-17 | 安凯(广州)微电子技术有限公司 | Digital image processing frame rate control method and device |
CN111510627A (en) * | 2020-04-23 | 2020-08-07 | Oppo广东移动通信有限公司 | Camera starting method and device, terminal and readable storage medium |
CN114827453A (en) * | 2022-03-08 | 2022-07-29 | 珠海亿智电子科技有限公司 | Quick startup device and method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003056808A1 (en) * | 2001-12-28 | 2003-07-10 | Core Logic Inc. | Digital camera apparatus further having function for acting as usb host and data transmission method thereof |
CN102692882A (en) * | 2012-06-21 | 2012-09-26 | 上海理工大学 | Wireless video control device for servo motor |
-
2013
- 2013-05-15 CN CN201310177352XA patent/CN103268238A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003056808A1 (en) * | 2001-12-28 | 2003-07-10 | Core Logic Inc. | Digital camera apparatus further having function for acting as usb host and data transmission method thereof |
CN102692882A (en) * | 2012-06-21 | 2012-09-26 | 上海理工大学 | Wireless video control device for servo motor |
Non-Patent Citations (3)
Title |
---|
刘春成: "基于嵌入式Linux的USB摄像头驱动开发", 《计算机工程与设计》 * |
张群 等: "基于嵌入式VxWorks USB摄像头驱动的实现", 《信息与电子工程》 * |
畅卫功: "嵌入式Linux中USB摄像头驱动的研究", 《微计算机信息》 * |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105653985B (en) * | 2014-10-22 | 2020-04-24 | 北京中电瑞铠科技有限公司 | Method and device for plugging electronic tag on USB port |
CN105653985A (en) * | 2014-10-22 | 2016-06-08 | 北京中电瑞铠科技有限公司 | USB port plugging electron label method and device |
CN108205503B (en) * | 2016-12-16 | 2020-11-06 | 龙芯中科技术有限公司 | Hardware drive compatible method and terminal |
CN108205503A (en) * | 2016-12-16 | 2018-06-26 | 龙芯中科技术有限公司 | Hardware driving compatibility method and terminal |
CN107493437B (en) * | 2017-09-21 | 2019-08-02 | 北京图森未来科技有限公司 | A kind of camera parameter control method and relevant device |
CN107493437A (en) * | 2017-09-21 | 2017-12-19 | 北京图森未来科技有限公司 | A kind of camera parameter control method and relevant device |
CN108200341A (en) * | 2018-01-15 | 2018-06-22 | 青岛海信移动通信技术股份有限公司 | Seamless handover method, device and the terminal device of camera |
CN109508202A (en) * | 2018-09-27 | 2019-03-22 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Drive development system, method and medium for embedded operating system |
CN109508202B (en) * | 2018-09-27 | 2021-07-30 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Drive development system, method and medium for embedded operating system |
CN111031233A (en) * | 2019-11-13 | 2020-04-17 | 安凯(广州)微电子技术有限公司 | Digital image processing frame rate control method and device |
CN111510627A (en) * | 2020-04-23 | 2020-08-07 | Oppo广东移动通信有限公司 | Camera starting method and device, terminal and readable storage medium |
CN111510627B (en) * | 2020-04-23 | 2022-03-18 | Oppo广东移动通信有限公司 | Camera starting method and device, terminal and readable storage medium |
CN114827453A (en) * | 2022-03-08 | 2022-07-29 | 珠海亿智电子科技有限公司 | Quick startup device and method |
CN114827453B (en) * | 2022-03-08 | 2023-12-29 | 珠海亿智电子科技有限公司 | Starting device and method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103268238A (en) | Method for achieving drive of universal serial bus (USB) camera on basis of ReWorks operation system | |
US9189261B2 (en) | Saving, transferring and recreating GPU context information across heterogeneous GPUs during hot migration of a virtual machine | |
WO2019169913A1 (en) | Data processing method, apparatus and system, and server | |
CN107527317B (en) | Data transmission system based on image processing | |
WO2020224488A1 (en) | Image processing method and apparatus, and device | |
EP2911342A1 (en) | Home gateway and intelligent terminal integrated system and communication method therefor | |
CN111240631A (en) | Method and system for virtually transmitting Linux virtual machine screen picture based on AMD display card | |
CN101634975B (en) | Method for realizing DMA data transmission and apparatus thereof | |
CN102402413A (en) | Electronic system communicating with image sensor, controller and controlling method | |
EP3559806B1 (en) | Accelerating para-virtualization network interface using direct memory access (dma) remapping | |
WO2015013981A1 (en) | Image display method and device | |
CN105450986B (en) | Video processing method under Linux | |
US20120166585A1 (en) | Apparatus and method for accelerating virtual desktop | |
CN103838694B (en) | FPGA high-speed USB interface data reading method | |
US11249934B2 (en) | Data access method and apparatus | |
TW202025799A (en) | Dispatching method and edge computing system | |
CN110602462B (en) | Industrial image detection device and method based on AI | |
CN1976310A (en) | Communication method and system using bus interface over a network | |
US7930445B2 (en) | Computer system using remote I/O and I/O data transfer method | |
WO2019184498A1 (en) | Video interactive method, computer device and storage medium | |
US20220050795A1 (en) | Data processing method, apparatus, and device | |
CN202004899U (en) | High definition CMOS (Complementary Metal-Oxide-Semiconductor Transistor) monitoring equipment | |
US9830288B2 (en) | System and method for transmitting graphics rendered on a primary computer to a secondary computer | |
CN114880136A (en) | Scanner using method and device, computing equipment and storage medium | |
WO2021217436A1 (en) | Infrared data processing method, chip, terminal and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20130828 |
|
WD01 | Invention patent application deemed withdrawn after publication |