The control method that a kind of video shows
Technical field
The present invention relates to the control method that a kind of video shows.
Background technology
The video of mobile unit shows and processes generally needs proprietary video frequency processing chip to realize Special display effect, realize special efficacy (as amplify, dwindle, semi-transparent, picture-in-picture) method all be the DirectShow Interface realization that provides by Microsoft.This has just brought series of problems, will inevitably increase system cost such as proprietary video frequency processing chip, by the Interface realization special efficacy that DirectShow provides, system CPU occupancy rate is higher, in the limited situation of system resource, can't move other application programs, such as navigate application etc.On the other hand, by the Interface realization special efficacy that DirectShow provides, need the research staff to be familiar with the DirectShow programming.
Summary of the invention
For the video that solves above-mentioned existing mobile unit shows and processes the problem that exists, the invention provides a kind of design proposal of the video display control method based on directdraw.
The control method that a kind of video shows may further comprise the steps: (1) is carried out video source by the video source selected cell and is selected; (2) by the display parameter dispensing unit video of selecting is carried out the display parameter setting; (3) enable the cell enable video by demonstration and show rear display video; Described video source selected cell comprises the video source option interface and selects driver element by its video source of calling; Described display parameter dispensing unit comprises the display parameter configuration interface and connects the display driver unit that calls by it; Described demonstration enables the unit and comprises that demonstration enables interface and enables driver element by its demonstration of calling.
Concrete, the implementation method of described video source selected cell is:
(1) calling video source by the video source option interface selects driver element to select video source;
(2) video source is selected the driver element video device access, video source is set behind the successful access video equipment and obtains the signal condition of video, video source maybe can't be set or obtain then to return abnormal results and finish less than the signal condition of video and call if video device access is unsuccessful.(video source is set what refers to?)
(3) whether exist the information of normal signal to send to the display parameter dispensing unit this video source.
More specifically, the implementation method of described display parameter dispensing unit is:
(1) the display parameter dispensing unit has judged whether that the external command requirement is configured display parameter, if have then and to call the display driver unit by the display parameter configuration interface the corresponding display parameter of the video source chosen are configured, otherwise then skip the display parameter configuration;
(2) display parameter then return abnormal results and end is called if can't successfully dispose;
(3) relevant information that this video source is successfully disposed display parameter sends to and shows and enable the unit.
More specifically, described demonstration enables the implementation method of unit and is:
(1) demonstration that enables interface interchange by demonstration enables driver element and enables video and show;
(2) enable driver element and create the video surface by directdraw, then obtain this video surface memory address, maybe can't obtain this video surface memory address and then return abnormal results and finish and call if can't create the video surface;
(3) the video surface memory address that obtains is set to the address that video writes, and by the display screen display video.
More specifically, step (3) can be set to the screen writing address by the image signal processing unit video surface memory address of MCU inside, and will show by display screen after the vision signal processing.
Further, video source selects driver element by createfile video device access to be conducted interviews; By DeviceIoControl video source and the signal condition of obtaining video are set.
Further, described video source includes but not limited to video and the vehicle-mounted camera on vehicle-carrying DVD, the External memory equipment.
In sum, the present invention has following beneficial effect: (1) to the bottom layer driving encapsulation of packing, the research staff use video to show and the function processed more simple, convenient; (2) by encapsulation directdraw interface, avoid calling the DirectShow interface and carry out the video demonstration, the occupancy of CPU when effectively reducing the video demonstration.
Description of drawings
Fig. 1 is the overall flow synoptic diagram of the control method of a kind of video demonstration of the present invention.
Embodiment
In order to allow those skilled in the art can understand better technical scheme of the present invention, the invention will be further elaborated below in conjunction with accompanying drawing.
As shown in Figure 1, the present invention has disclosed the control method that a kind of video shows, may further comprise the steps: (1) is carried out video source by the video source selected cell and is selected; (2) by the display parameter dispensing unit video source of selecting is carried out the display parameter setting; (3) enable the cell enable video by demonstration and show rear display video; Described video source selected cell comprises the video source option interface and selects driver element by its video source of calling; Described display parameter dispensing unit comprises the display parameter configuration interface and connects the display driver unit that calls by it; Described demonstration enables the unit and comprises that demonstration enables interface and enables driver element by its demonstration of calling.
Specific implementation is as follows:
Call video source by the video source option interface and select driver element to select video source, video source can be vehicle-mounted DVD, can be the USB storage that is connected to vehicle carried video equipment also, or vehicle-mounted pick-up is first-class; Video source is selected driver element API " createfile " video device access (video equipment herein is a logical abstraction layer), the handle that returns according to API " createfile " after successful video device access utilizes API " DiviceIoControl " video source to be set (by video source is set, namely select a concrete video equipment) and obtain the signal condition (judging namely whether selected video source has normal vision signal) of video, video source maybe can't be set or obtain then to return abnormal results and finish less than the normal signal condition of video and call if video device access is unsuccessful.If above-mentioned steps is all normally carried out, this relevant information with this video source sends to the display parameter dispensing unit.
If the user does not use the display effect (such as brightness, contrast, saturation degree, picture-in-picture, semi-transparent etc.) of acquiescence, can also carry out the self-defined of display effect; The display parameter dispensing unit has judged whether that the external command requirement is configured display parameter, if have then and to call the display driver unit by the display parameter configuration interface the corresponding display parameter of the video source chosen are configured, otherwise then skip the display parameter configuration; Display parameter then return abnormal results and end is called if can't successfully dispose;
After configuring display parameter or skipping display parameter configurations, the relevant information of this video source sent to show and enable the unit.
Show that enable demonstration that the unit enables interface interchange by demonstration enables driver element and enable video and show; Enable driver element and create the video surface by API " directdraw ", then obtain this video surface memory address, maybe can't obtain this video surface memory address and then return abnormal results and finish and call if can't create the video surface; The video that obtains surface memory address is set to the address that the video of the image signal processing unit of MCU inside writes by API " DiviceIoControl ", and vision signal processed will afterwards show by display screen.
It is related that the present invention will enable the address that the video of the image signal processing unit of driver element memory address (be video surface memory address) and MCU inside writes, thereby realize purpose that video input is shown, this can efficiently reduce MCU(or CPU) occupancy reach more than 60%.
Present embodiment is more excellent embodiment of the present invention; need to prove; in the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art work as can make according to the present invention various corresponding changes and distortion, but these changes and distortion all should belong to the protection domain of the appended claim of the present invention.