Invention content
An embodiment of the present invention provides a kind of method and devices obtaining video image.The technical solution is as follows:
According to a first aspect of the embodiments of the present invention, an embodiment of the present invention provides it is a kind of obtain video image method,
For running the terminal for having software, the method includes:
When receiving the instruction for the opening camera that user issues in the operation interface of the software, obtains terminal and work as
Preceding available all camera informations, and show the camera information of acquisition;
Receive the target camera information that user chooses according to the camera information of display;
The target camera is handled, the target camera intake image is controlled;
The image of intake is handled and shown.
Optionally, described to obtain the currently available all camera informations of terminal, and show the camera information of acquisition, it wraps
It includes:
The device object in scheduled software development kit is called, the camera object of the currently available camera of terminal is obtained
Array;
The Name field in each camera object in the camera object array is read, obtains that terminal is currently available to be taken the photograph
As the name of head;
Name by the currently available camera of the terminal of acquisition includes in the operation interface of the software.
Optionally, described that the target camera is handled, the target camera intake image is controlled, including:
The corresponding camera object of the target camera is saved in the field that camera plays object;
It calls the camera to play the Play methods in object, instantiates the target camera;
Control the target camera intake image.
Optionally, the image of described pair of intake is handled and is shown, including:
In the Play methods, the parameter of absorbed image is set;
Start the data for reading the target camera by multimedia control, reads the position of the target camera intake
Scheme bitmap image datas;
System CopyMemory is adjusted back in the camera plays object, the bitmap image datas of reading are copied to
In video frame reception event;
The bitmap image datas are converted to the video frame pair for meeting the parameter in new video frame reception event
As being shown in the operation interface of the software.
Optionally, after the image of described pair of intake is handled and shown, the method further includes:
When receiving clicking operation of the user for the image currently shown, the display image being currently clicked is arranged
For the head portrait of the user, the target camera is closed.
The second aspect according to the ... of the embodiment of the present invention, an embodiment of the present invention provides a kind of dresses obtaining video image
It sets, for running the terminal for having software, described device includes:
Data obtaining module is configured as that the opening camera shooting that user issues in the operation interface of the software ought be received
When the instruction of head, the currently available all camera informations of terminal are obtained, and show the camera information of acquisition;
Information receiving module is configured as receiving the target camera letter that user chooses according to the camera information of display
Breath;
Image collection module is configured as handling the target camera, controls the target camera intake
Image;
Image display is configured as that the image of intake is handled and shown.
7, device according to claim 6, which is characterized in that described information acquisition module, including:
Acquisition of information submodule is configured as calling the device object in scheduled software development kit, it is current to obtain terminal
The camera object array of available camera;
Information reading submodule is configured as reading the Name words in the camera object array in each camera object
Section, obtains the name of the currently available camera of terminal;
Presentation of information submodule is configured as the name of the currently available camera of the terminal of acquisition including described soft
In the operation interface of part.
Optionally, described image acquisition module, including:
First processing submodule, is configured as the corresponding camera object of the target camera being saved in camera and broadcast
It is rivals in a contest in the field of elephant;
Second processing submodule is configured as calling the camera to play the Play methods in object, described in instantiation
Target camera;
Image acquisition submodule is configured as controlling the target camera intake image.
Optionally, described image display module, including:
Parameter setting submodule is configured as in the Play methods, and the parameter of absorbed image is arranged;
Digital independent submodule is configured as starting the data for reading the target camera by multimedia control, read
Take the bitmap bitmap image datas of the target camera intake;
Data processing submodule is configured as adjusting back system CopyMemory in the camera plays object, will read
The bitmap image datas taken copy in video frame reception event;
Image display sub-module is configured as being converted to the bitmap image datas in new video frame reception event
The video frame object for meeting the parameter is shown in the operation interface of the software.
Optionally, described device further includes:
Software head portrait setup module is configured as when receiving clicking operation of the user for the image currently shown,
It sets the display image being currently clicked in the head portrait of the user, closes the target camera.
Technical solution provided in an embodiment of the present invention can include the following benefits:
The technical solution that the embodiment of the present invention is provided, when receiving what user issued in the operation interface of the software
When opening the instruction of camera, the currently available all camera informations of terminal are obtained, and show the camera information of acquisition;It connects
Receive the target camera information that user chooses according to the camera information of display;The target camera is handled, is controlled
The target camera absorbs image;The image of intake is handled and shown.Currently available camera is all extracted
It uses for selection by the user, being smoothed out when ensureing to shoot using camera.
It should be understood that above general description and following detailed description is only exemplary and explanatory, not
It can the limitation present invention.
Specific implementation mode
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent and the consistent all embodiments of the present invention.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects being described in detail in claims, of the invention.
Fig. 1 is a kind of flow chart of acquisition video image shown according to an exemplary embodiment, and the present embodiment is obtained with this
The method for taking video image is applied to such as mobile phone, tablet computer, smart television, desktop computer or laptop computer (notes
This computer) etc. in terminals for illustrate.Referring to Fig. 1, the method for the acquisition video image may include following several steps
Suddenly:
In a step 101, when the instruction for receiving the opening camera that user issues in the operation interface of the software
When, the currently available all camera informations of terminal are obtained, and show the camera information of acquisition.
In a step 102, the target camera information that user chooses according to the camera information of display is received.
In step 103, the target camera is handled, controls the target camera intake image.
At step 104, the image of intake is handled and is shown.
In the technical scheme, described to obtain the currently available all camera informations of terminal, and show the camera shooting of acquisition
Header, including:
The device object in scheduled software development kit is called, the camera object of the currently available camera of terminal is obtained
Array;
The Name field in each camera object in the camera object array is read, obtains that terminal is currently available to be taken the photograph
As the name of head;
Name by the currently available camera of the terminal of acquisition includes in the operation interface of the software.
It is described that the target camera is handled in the technical program, the target camera intake image is controlled,
Including:
The corresponding camera object of the target camera is saved in the field that camera plays object;
It calls the camera to play the Play methods in object, instantiates the target camera;
Control the target camera intake image.
In one embodiment, the image of described pair of intake is handled and is shown, including:
In the Play methods, the parameter of absorbed image is set;
Start the data for reading the target camera by multimedia control, reads the position of the target camera intake
Scheme bitmap image datas;
System CopyMemory is adjusted back in the camera plays object, the bitmap image datas of reading are copied to
In video frame reception event;
The bitmap image datas are converted to the video frame pair for meeting the parameter in new video frame reception event
As being shown in the operation interface of the software.
In one embodiment, after the image of described pair of intake is handled and shown, the method further includes:
When receiving clicking operation of the user for the image currently shown, the display image being currently clicked is arranged
For the head portrait of the user, the target camera is closed.
In conclusion the technical solution that the embodiment of the present invention is provided, when receiving operation circle of the user in the software
When the instruction of the opening camera issued on face, the currently available all camera informations of terminal are obtained, and show taking the photograph for acquisition
As header;Receive the target camera information that user chooses according to the camera information of display;To the target camera into
Row processing controls the target camera intake image;The image of intake is handled and shown.By currently available camera shooting
Head all extracts to be used for selection by the user, being smoothed out when ensureing to shoot using camera.
Fig. 2 is a kind of method flow diagram of the acquisition video image shown according to another exemplary embodiment, the present embodiment
It is applied to mobile phone, tablet computer, smart television, desktop computer or laptop computer etc. in the method for the acquisition video image
It is illustrated in terminal.Referring to Fig. 2, the method for the acquisition video image may include the following steps:
In step 201, the instruction for the opening camera that user issues in the operation interface of the software is received.
In step 202, when the instruction for receiving the opening camera that user issues in the operation interface of the software
When, the currently available all camera informations of terminal are obtained, and show the camera information of acquisition.
In one embodiment, the currently available all camera informations of terminal are obtained, and show the camera letter of acquisition
Breath, can be with including:
The device object in scheduled software development kit is called, the camera object of the currently available camera of terminal is obtained
Array;
For example, camera can be used with DsDevice object acquisitions in exploitation software package DirectShow
DsDevice object arrays.
The Name field in each camera object in the camera object array is read, obtains that terminal is currently available to be taken the photograph
As the name of head;
Name by the currently available camera of the terminal of acquisition includes in the operation interface of the software.
For example, the Name field of DsDevice objects in DsDevice object arrays is shown in the operation interface of software
On, the target camera that selects oneself to think for user.
In step 203, the target camera information that user chooses according to the camera information of display is received.
Here, selection one oneself is thought to be used in the camera name that user can show in software operation interface
The information for the target camera that user selects is passed to by target camera, software.
In step 204, target camera is handled, control targe camera absorbs image.
In the technical program, the target camera is handled, controls target camera intake image, it can be with
Including:
The corresponding camera object of target camera is saved in the field that camera plays object;
It here, will after user is according to the available camera title selected target camera shown in software operation interface
This corresponding DsDevice object of target camera name is saved in the field that camera plays object.
It calls the camera to play the Play methods in object, instantiates target camera;
Control targe camera absorbs image.
In step 205, the image of intake is handled and is shown.
In one embodiment, the image of intake is handled and is shown, it can be with including:
In the Play methods, the parameter of absorbed image is set;
For example, in camera plays the play methods in object, the parameter of video is set, can be used including but not limited to:
The frame per second of video, width are high and whether use yuv format.
Start the data for reading the target camera by multimedia control, reads the bitmap of target camera intake
Bitmap image datas;
For example, creating IBaseFilter according to camera object DsDevice, and create ISampleGrabber pairs
As later, the RenderStream methods in ISampleGrabber objects being called to be passed to IBaseFilter objects;Then,
It calls the Play methods in IMediaControl objects to start the digital independent of target camera, reads the intake of target camera
Bitmap bitmap image datas.
System CopyMemory is adjusted back in the camera plays object, the bitmap image datas of reading are copied to
In video frame reception event;
The bitmap image datas are converted to the video frame pair for meeting the parameter in new video frame reception event
As being shown in the operation interface of the software.
For example, the calling system CopyMemory in the readjustment that camera plays object, bitmap image datas are replicated
To the event for having new video frame to receive of dishing out in new object, bitmap image datas are converted in new video frame reception event
It is shown in for ImageSource objects on the control of software operation interface, to complete the processing procedure of a video frame.It can be with
The bitmap image datas continuously read in the method repeatedly are handled, and the shape of video flowing is ultimately formed on interface
Formula is shown.
In step 206, when receiving clicking operation of the user for the image currently shown, by what is be currently clicked
Display image is set as the head portrait of the user, closes the target camera.
In one embodiment, after the video image shown on display interface is clicked in user, i.e., user confirms current aobvious
Show that the image of interface display is set as user's head portrait, then, the image shown in current interface is saved as into jpg data, and will
The jpg data are saved in local file, later, user's head portrait are shown jpg pictures thus, completes the setting of user's head portrait,
Close camera.
In conclusion the technical solution that the embodiment of the present invention is provided, when receiving operation circle of the user in the software
When the instruction of the opening camera issued on face, the currently available all camera informations of terminal are obtained, and show taking the photograph for acquisition
As header;Receive the target camera information that user chooses according to the camera information of display;To the target camera into
Row processing controls the target camera intake image;The image of intake is handled and shown.By currently available camera shooting
Head all extracts to be used for selection by the user, being smoothed out when ensureing to shoot using camera.
Following is apparatus of the present invention embodiment, can be used for executing the method for the present invention embodiment.For apparatus of the present invention reality
Undisclosed details in example is applied, the method for the present invention embodiment is please referred to.
Fig. 3 is a kind of block diagram of the device 300 of acquisition video image shown according to an exemplary embodiment, which regards
The device 300 of frequency image being implemented in combination with as some or all of of terminal by software, hardware or both, the end
End can be mobile phone, tablet computer, smart television, desktop computer or laptop computer.The device 300 of the acquisition video image
May include:
Data obtaining module 301 is configured as that the opening that user issues in the operation interface of the software ought be received
When the instruction of camera, the currently available all camera informations of terminal are obtained, and show the camera information of acquisition;
Information receiving module 302 is configured as receiving the target camera that user chooses according to the camera information of display
Information;
Image collection module 303 is configured as handling the target camera, controls the target camera and takes the photograph
Take image;
Image display 304 is configured as that the image of intake is handled and shown.
In conclusion the technical solution that the embodiment of the present invention is provided, when receiving operation circle of the user in the software
When the instruction of the opening camera issued on face, the currently available all camera informations of terminal are obtained, and show taking the photograph for acquisition
As header;Receive the target camera information that user chooses according to the camera information of display;To the target camera into
Row processing controls the target camera intake image;The image of intake is handled and shown.By currently available camera shooting
Head all extracts to be used for selection by the user, being smoothed out when ensureing to shoot using camera.
Fig. 4 is a kind of block diagram of the device 400 of acquisition video image shown according to an exemplary embodiment, which regards
The device 400 of frequency image being implemented in combination with as some or all of of terminal by software, hardware or both, the end
End can be mobile phone, tablet computer, smart television, desktop computer or laptop computer.The device 400 of the acquisition video image
May include:
Data obtaining module 401 is configured as that the opening that user issues in the operation interface of the software ought be received
When the instruction of camera, the currently available all camera informations of terminal are obtained, and show the camera information of acquisition;
Information receiving module 402 is configured as receiving the target camera that user chooses according to the camera information of display
Information;
Image collection module 403 is configured as handling the target camera, controls the target camera and takes the photograph
Take image;
Image display 404 is configured as that the image of intake is handled and shown.
Software head portrait setup module 405 is configured as when the clicking operation for receiving user for the image currently shown
When, it sets the display image being currently clicked in the head portrait of the user, closes the target camera.
Referring to Fig. 5, data obtaining module 401 as shown in Figure 4 may include:
Acquisition of information submodule 4011 is configured as calling the device object in scheduled software development kit, obtains terminal
The camera object array of currently available camera;
Information reading submodule 4012 is configured as reading in the camera object array in each camera object
Name field obtains the name of the currently available camera of terminal;
Presentation of information submodule 4013 is configured as the name of the currently available camera of the terminal of acquisition including in institute
It states in the operation interface of software.
Optionally, referring to Fig. 6, image collection module 403 as shown in Figure 4 may include:
First processing submodule 4031, is configured as the corresponding camera object of the target camera being saved in camera shooting
Head plays in the field of object;
Second processing submodule 4032 is configured as the Play methods for calling the camera to play in object, instantiation
The target camera;
Image acquisition submodule 4033 is configured as controlling the target camera intake image.
Optionally, referring to Fig. 7, image display 404 as shown in Figure 4 may include:
Parameter setting submodule 4041 is configured as in the Play methods, and the parameter of absorbed image is arranged;
Digital independent submodule 4042 is configured as starting the number for reading the target camera by multimedia control
According to reading the bitmap bitmap image datas of target camera intake;
Data processing submodule 4043 is configured as adjusting back system CopyMemory in the camera plays object,
The bitmap image datas of reading are copied in video frame reception event;
Image display sub-module 4044 is configured as in new video frame reception event turning the bitmap image datas
It is changed to and meets the video frame object of the parameter and be shown in the operation interface of the software.
The technical solution that the embodiment of the present invention is provided, when receiving what user issued in the operation interface of the software
When opening the instruction of camera, the currently available all camera informations of terminal are obtained, and show the camera information of acquisition;It connects
Receive the target camera information that user chooses according to the camera information of display;The target camera is handled, is controlled
The target camera absorbs image;The image of intake is handled and shown.Currently available camera is all extracted
It uses for selection by the user, being smoothed out when ensureing to shoot using camera.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, explanation will be not set forth in detail herein.
Referring to FIG. 8, a kind of for playing the device 500 of PPT files shown in it illustrates an exemplary embodiment
Block diagram.For example, device 500 can be the terminal devices such as desktop computer or laptop computer.
With reference to Fig. 7, device 500 may include following one or more components:Processing component 502, memory 504, power supply
Component 506, multimedia component 508, audio component 510, input/output (I/O) interface 512, sensor module 514, Yi Jitong
Believe component 516.
The integrated operation of 502 usual control device 500 of processing component, such as with display, call, data communication, phase
Machine operates and record operates associated operation.Processing component 502 may include that one or more processors 520 refer to execute
It enables, to complete all or part of step of the above-mentioned method for importing file in software.In addition, processing component 502 may include
One or more modules, convenient for the interaction between processing component 502 and other assemblies.For example, processing component 502 may include more
Media module, to facilitate the interaction between multimedia component 508 and processing component 502.
Memory 504 is configured as storing various types of data to support operation on device 500.These data
Example includes the instruction for any application or method that operate on device 500, contact data, telephone book data, message,
Picture, video etc..Memory 504 can be real by any kind of volatibility or non-volatile memory device or combination thereof
Existing, such as static RAM (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable is only
Read memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic
Disk or CD.
Power supply module 506 provides electric power for the various assemblies of device 500.Power supply module 506 may include power management system
System, one or more power supplys and other generated with for device 500, management and the associated component of distribution electric power.
Multimedia component 508 is included in the screen of one output interface of offer between device 500 and user.In some realities
It applies in example, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen can
To be implemented as touch screen, to receive input signal from the user.Touch panel include one or more touch sensors with
Sense the gesture on touch, slide, and touch panel.Touch sensor can not only sense the boundary of a touch or slide action, and
And also detection and touch or the relevant duration and pressure of slide.In some embodiments, multimedia component 508 includes
One front camera and/or rear camera.It is preceding when such as screening-mode or video mode when device 500 is in operation mode
External multi-medium data can be received by setting camera and/or rear camera.Each front camera and rear camera can
Be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 510 is configured as output and/or input audio signal.For example, audio component 510 includes a Mike
Wind (MIC), when device 500 is in operation mode, when such as call model, logging mode and speech recognition mode, microphone by with
It is set to reception external audio signal.The received audio signal can be further stored in memory 504 or via communication set
Part 516 is sent.In some embodiments, audio component 410 further includes a loud speaker, is used for exports audio signal.
I/O interfaces 512 provide interface between processing component 502 and peripheral interface module, and above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock
Determine button.
Sensor module 514 includes one or more sensors, and the state for providing various aspects for device 500 is commented
Estimate.For example, sensor module 514 can detect the state that opens/closes of device 500, the relative positioning of component, such as component
For the display and keypad of device 500, sensor module 514 can be with the position of 500 1 components of detection device 500 or device
Set change, the existence or non-existence that user contacts with device 500, the temperature of 500 orientation of device or acceleration/deceleration and device 500
Variation.Sensor module 514 may include proximity sensor, be configured to detect without any physical contact near
The presence of object.Sensor module 514 can also include optical sensor, such as CMOS or ccd image sensor, for being answered in imaging
With middle use.In some embodiments, which can also include acceleration transducer, gyro sensor, magnetic
Sensor, pressure sensor or temperature sensor.
Communication component 516 is configured to facilitate the communication of wired or wireless way between device 500 and other equipment.Device
500 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or combination thereof.In an exemplary implementation
In example, communication component 516 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel.
In one exemplary embodiment, communication component 516 further includes near-field communication (NFC) module, to promote short range communication.For example,
It can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology, bluetooth in NFC module
(BT) technology and other technologies are realized.
In the exemplary embodiment, device 500 can be believed by one or more application application-specific integrated circuit (ASIC), number
Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing above- mentioned information sorting technique.
In the exemplary embodiment, it includes the non-transitorycomputer readable storage medium instructed, example to additionally provide a kind of
Such as include the memory 404 of instruction, above-metioned instruction can be executed by the processor 520 of device 500 to complete above-mentioned acquisition video figure
The method of picture.For example, non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM,
Tape, floppy disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in storage medium is held by the processor of device 500
When row so that the method that device 500 is able to carry out above-mentioned acquisition video image.
It should be understood that the invention is not limited in the precision architectures for being described above and being shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.