Summary of the invention
The method that the embodiment of the invention provides a kind of portable terminal image to show on the one hand provides a kind of terminal device on the other hand, can the image on the mobile terminal display screen be shown on computer screen in real time.
On the one hand, the method that a kind of portable terminal image that the embodiment of the invention provides shows comprises:
Obtain the resolution and the time interval of from the video memory of said portable terminal, gathering picture;
From the video memory of said portable terminal, gather picture with the said resolution of obtaining and the time interval;
The said picture that collects is generated the stream medium data that satisfies the transmission of USB interface camera;
Said stream medium data is exported to computing machine through USB interface, on computer display, show in real time so that said computing machine receives the back;
Wherein, said portable terminal is configured to the USB interface camera in computer operating system, and said resolution is corresponding with the resolution of USB interface camera, and the said time interval is corresponding with the frame rate of the stream medium data of USB interface camera transmission.
On the other hand, a kind of portable terminal that the embodiment of the invention provides comprises:
Equipment configuration module is used for said portable terminal is configured to the USB interface camera in computer operating system;
Resolution and time interval acquisition module are used for obtaining the resolution and the time interval of gathering picture from the video memory of said portable terminal;
The picture acquisition module is used for gathering picture with the said resolution of obtaining and the time interval from the video memory of said portable terminal;
Modular converter is used for the said picture that collects and generates the stream medium data that satisfies the transmission of USB interface camera;
Output module is used for said stream medium data is exported to computing machine through USB interface, shows in real time on computer display so that said computing machine receives the back;
Wherein, said resolution is corresponding with the resolution of USB interface camera, and the said time interval is corresponding with the frame rate of the stream medium data of USB interface camera transmission.
Can know by above technical scheme; In the embodiment of the invention; Portable terminal is configured to the USB interface camera in operation system of computer, from the video memory of said portable terminal, gather picture with resolution and the time interval set, and the stream medium data that the USB interface camera is exported is satisfied in the picture generation that will saidly collect; At last said stream medium data is exported to computing machine through USB interface; So that said computing machine receives the back and on computer display, shows in real time, after portable terminal and computing machine are set up data communication through USB interface, just can the displayed image on the mobile terminal display screen be shown on the display screen of personal computer in real time like this; Can show the displaying contents of portable terminal like this by the bigger display screen of computing machine, improve user experience.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Method embodiment
Camera is widely used in Video chat, ordinary video monitoring etc. as a kind of video input apparatus.Its basic functional principle is with the frame rate of the picture that collects to set, such as being transferred on the display screen for 30 frame/seconds, can realize continuously dynamic video transmission.And the USB interface camera is supported plug and play and hot plug, uses general.The embodiment of the invention promptly is to be the USB interface camera with mobile terminal configuration, and computing machine is exported to through USB interface in the pictorial data that can on mobile terminal display screen, show conversion back, and through showing in real time on the computer screen.
Shown in accompanying drawing 1, the method that the embodiment of the invention provides a kind of portable terminal image to show.Wherein, said portable terminal is configured to the USB interface camera in computer operating system.
Particularly, can it be configured to the USB interface camera through the device descriptor of configuration portable terminal, wherein, key is following two parameters in the configuration device descriptor:
bDeviceClass:0xEF DeviceClassCode
bDeviceSubClass:0x02?DeviceSubclassCode
Further; When portable terminal and the computing machine that is configured to the USB interface camera set up data communication through USB interface; The USB interface webcam driver software that can utilize operation system of computer to be equipped with does not need to install on computers other drive softwares again.Existing computer operating system; With windows operating system is example; Usually all in operating system, carried the drive software of USB interface camera; Perhaps the user has installed the drive software of USB interface camera in operating system, therefore can realize the plug and play of USB interface camera.Can know referring to top description; Portable terminal is configured to the USB interface camera through the configuration device descriptor in operation system of computer, therefore just can utilize in the computer operating system; The USB interface webcam driver software that has been equipped with such as windows operating system; The realization portable terminal no longer need be installed other drive softwares when utilizing the real-time displayed image of computer display, thereby realizes plug and play.Describing computing machine below in detail is identified as portable terminal the USB interface camera, is the process of its install driver:
At first; The usb hub of computer-side is being kept watch on the voltage of the signal wire of its each port; When portable terminal inserted the main frame of computing machine through USB interface, the level of signal wire can change, and this moment, main frame learnt that promptly the USB device insertion has been communicated with.
Main frame sends Get Descriptor (high byte of wValue field is 0x01, the indication equipment descriptor) the request first time and obtains device descriptor then; Wherein, device descriptor provides the multiple information of USB device, comprising: the size of the maximum bag of USB device, the config. number that USB device is supported and the out of Memory of relevant this USB device etc.Because the device descriptor of portable terminal has been configured to a USB interface camera, computing machine can know that the USB device of this insertion is a USB interface camera equipment.Preferably; Portable terminal can be provided with option or pattern, such as " computing machine display mode ", before or after portable terminal passes through USB interface and computing machine is communicated with; If the user has selected " computing machine display mode "; Mean to be the USB interface camera with mobile terminal configuration, the portable terminal device descriptor that will be configured to the USB interface camera automatically accesses so, so that computing machine is identified as the USB interface camera with it.
Then; After the device descriptor after computing machine has read configuration; If before specified the index of relevant character string descriptor (be used for describing manufacturer, product and Equipment Serial Number information etc.) in the device descriptor that reads, main frame will send several times Get Descriptor (high byte of wValue field is 0x03, the expression character string descriptor) order again and obtain these character strings and describe; This moment, main frame will pop-up window; The USB device of show finding, i.e. the information of portable terminal is such as business men, product description, model etc.Usually the USB interface camera can be shown as " USB Web Camera " on main frame; Because portable terminal is just in order to show image on computer display in real time in the embodiment of the invention; And be configured to the USB interface camera; Be not real USB interface camera, therefore can it be revised as other titles, such as " Terminal Display Device ".
At last, main frame has been known above-mentioned information from the USB device that inserts after, just beginning to the USB device that inserts, also is portable terminal, install driver.Portable terminal reports concrete VID (Vendor ID through device descriptor; The ID of production firm)/PID (Product ID; Product IDs) information, the user chooses the VID/PID of the USB interface webcam driver that computer operating system has been equipped with, and can realize accomplishing automatically drive installation.Loaded after the USB device driving, it is that this USB device is selected a suitable configuration that main frame sends the Set_Configuration command request.
So far, the USB enumeration process finishes, USB device, and the portable terminal that also promptly is configured to the USB interface camera just can use.
With reference to figure 1, the method that a kind of portable terminal image that the embodiment of the invention provides shows specifically comprises the steps:
Step 11 is obtained the resolution and the time interval of from the video memory of said portable terminal, gathering picture;
Common USB interface camera has the resolution of 1,300,000 pixels, 300,000 pixels etc., and the portable terminal that therefore is configured to the USB interface camera also can adopt above-mentioned resolution to the resolution of the picture setting that collects.Preferably, portable terminal is configured to be provided with the resolution of said picture.Such as, the user hopes to watch the video that stores in the portable terminal through computer screen, and resolution that can said picture is set to 1,300,000 pixels, i.e. 1280 * 1024 resolution.Like this, when portable terminal is gathered picture collection picture from the video memory of said portable terminal, just can remove to gather picture with the resolution of setting before.Also can, the resolution of an acquiescence is set, such as 300,000 pixels.
But; Because it is through in the USB interface insertion process at the portable terminal that is configured to the USB interface camera that computing machine is confirmed resolution information; Accomplish in the device descriptor through mobile terminal reporting; Therefore, the user should accomplish said resolution setting earlier, portable terminal is connected with computing machine again.If portable terminal is with after computing machine has been connected, the user changes said resolution again, and having no progeny in then need USB being connected connects once more again, to guarantee that calculating function shows according to the resolution after upgrading.
In addition, the frame rate of USB interface camera Streaming Media output is 30 frame/seconds or 24 frame/seconds usually, and therefore, the said time interval can be 1/30 second or 1/24 second.With 1/30 second time interval be example, can collect 30 pictures in the pictorial data from video memory 1 second.Same, time interval of acquiescence also can be set, such as 1/30 second.
When terminal and computing machine are set up data communication, can report the above-mentioned time interval and resolution through device descriptor, the terminal can obtain before gathering picture.
Step 12 is gathered picture with the said resolution of obtaining and the time interval from the video memory of said portable terminal;
Store the pictorial data of application program in the portable terminal video memory; This pictorial data is exported to the display process chip in the portable terminal; Pictorial data after being processed then is through EBI on the display screen of portable terminal; Such as rgb interface or MDDI interface, can be exported on the display screen of portable terminal and shown.
The embodiment of the invention is at first with the pictorial data of storing in the portable terminal video memory; No longer export the display process chip to; But read out with the said resolution of obtaining and the time interval, thereby collect plurality of pictures, so that export computing machine after the subsequent treatment to.
Step 13 generates the stream medium data that satisfies the transmission of USB interface camera with the said picture that collects;
Because the embodiment of the invention is that mobile terminal configuration is carried out the MPTS media data for the USB interface camera; So just should the picture that collect be generated the stream medium data that satisfies the output of USB interface camera; Generative process as for concrete belongs to prior art, is not giving unnecessary details.Such as; The said picture that collects is generated the stream medium data that satisfies the transmission of USB interface camera; At least can comprise the picture format that the picture that collects is configured to be suitable for the output of USB interface camera: YUV and RGB all can be used as the pixel format that is selected output in the embodiment of the invention; Wherein, RGB24 can be used as preferred as the pixel format of main flow.But be understood that easily this does not constitute the qualification to it.In addition, can also be included as the said picture that collects and add frame head, postamble, or the like.
Step 14 is exported to computing machine with said stream medium data through USB interface, shows in real time on computer display so that said computing machine receives the back;
Owing to be the picture of gathering with the time interval of setting in the step 12, when the output stream media data, can export so with said time interval rate corresponding.Such as, in the step 12, gather said picture with 1/30 second the time interval, so in this step, just can be with rate corresponding 30 frames/second output stream media data.Wherein, are frame rate of present USB interface camera video output protocol 30 frame/seconds.
After computing machine receives said stream medium data, can it be shown on display screen.As for, after computing machine receives said stream medium data, how to handle said stream medium data; Displayed image how, this and prior USB interface camera and process flow media data how after computing machine is communicated with, how the process of displayed image is similar; Belong to prior art, repeat no more at this.
Preferably, the said picture that collects being generated the stream medium data that satisfies the transmission of USB interface camera comprises: compress the said picture that collects.
Can reduce transmission bandwidth during transmission of flow media data after the compression, specifically how carry out processed compressed and belong to the state of the art, repeat no more at this.
Like this, after portable terminal was set up data communication through USB interface and computing machine, the image on the mobile terminal display screen just can show on computer screen in real time.
Further, in order to reach the purpose of energy-conservation reduction power consumption, when portable terminal and personal computer are set up data communication, and the image that shows on the display screen with portable terminal is when showing on computer screen, display screen that can the temporary close portable terminal.Perhaps, after the user selected portable terminal to get into " computing machine display mode ", the display screen of portable terminal can be closed.
In the embodiment of the invention; Said portable terminal is configured to the USB interface camera in operation system of computer; From the video memory of said portable terminal, gather picture with the certain resolution and the time interval; And the said picture that collects generated the stream medium data that satisfies the transmission of USB interface camera, and at last said stream medium data is exported to computing machine through USB interface, so that receiving the back, said computing machine on computer display, shows in real time; Like this after portable terminal and computing machine are set up data communication through USB interface; Just can the displayed image on the mobile terminal display screen be shown on the display screen of personal computer in real time, can show the displaying contents of portable terminal like this, improve user experience by the bigger display screen of computing machine; Secondly; Through the device descriptor of configuration portable terminal, when portable terminal and personal computer are set up data communication through USB interface, the USB interface webcam driver software that can utilize computer operating system to be equipped with; Thereby do not need other drive softwares are installed again, be user-friendly to; Once more, the resolution of gathering picture can be set, like this, the image that on computer screen, shows does not receive the restriction of resolution of the display screen of portable terminal, can show image more clearly.
Apparatus embodiments
Shown in accompanying drawing 2, the embodiment of the invention provides a kind of portable terminal, and this terminal comprises with lower module:
Equipment configuration module 21 is used for said portable terminal is configured to the USB interface camera in computer operating system;
Resolution and time interval acquisition module 22 are used for obtaining the resolution and the time interval of gathering picture from the video memory of said portable terminal;
Picture acquisition module 23 is used for gathering picture with the said resolution of obtaining and the time interval from the video memory of said portable terminal;
Modular converter 24 is used for the said picture that collects and generates the stream medium data that satisfies the transmission of USB interface camera;
Output module 25 is used for said stream medium data is exported to computing machine through USB interface, shows in real time on computer display so that said computing machine receives the back;
Wherein, said resolution is corresponding with the resolution of USB interface camera, and the said time interval is corresponding with the frame rate of the stream medium data of USB interface camera transmission.
Further, said portable terminal also comprises:
Compression module 26 when being used for that the said picture that collects generated the stream medium data that satisfies the transmission of USB interface camera, compresses the said picture that collects.
Preferably, said portable terminal is a mobile phone, and said mobile phone also comprises: radio circuit, microphone, loudspeaker, power supply;
Said radio circuit is used to set up communicating by letter of mobile phone and wireless network, realizes the Data Receiving and the transmission of mobile phone and wireless network;
Said microphone is used to gather sound and the sound of gathering is converted into voice data, so that said mobile phone sends said voice data through said radio circuit to wireless network;
Said loudspeaker is used for said mobile phone is passed through said radio circuit from the voice data that wireless network receives, and is reduced to sound and plays this sound to the user;
Said power supply is used to each circuit or the device power supply of said mobile phone.
The course of work and principle of work that portable terminal is relevant with it, similar with the method embodiment that describes before, repeat no more at this.
In the embodiment of the invention; Picture acquisition module 23 is gathered picture with the resolution and the time interval of obtaining from the video memory of said portable terminal; Modular converter 24 generates the stream medium data that satisfies the output of USB interface camera with the said picture that collects; Output module 25 is exported to computing machine with said stream medium data through USB interface; So that said computing machine receives the back and on computer display, shows in real time, after portable terminal and computing machine are set up data communication, just can the displayed image on the mobile terminal display screen be shown on computer screen like this; Can show the displaying contents of portable terminal like this by the bigger display screen of computing machine, improve user experience.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method; Be to instruct relevant hardware to accomplish through computer program; Described program can be stored in the computer read/write memory medium; This program can comprise the flow process like the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
In a word, the above is merely preferred embodiment of the present invention, is not to be used to limit protection scope of the present invention.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.