CN1770096A - Acquisition method for video frequency information of overlay surface - Google Patents

Acquisition method for video frequency information of overlay surface Download PDF

Info

Publication number
CN1770096A
CN1770096A CN 200410052127 CN200410052127A CN1770096A CN 1770096 A CN1770096 A CN 1770096A CN 200410052127 CN200410052127 CN 200410052127 CN 200410052127 A CN200410052127 A CN 200410052127A CN 1770096 A CN1770096 A CN 1770096A
Authority
CN
China
Prior art keywords
pointer
component object
covering surfaces
covering
model interface
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.)
Granted
Application number
CN 200410052127
Other languages
Chinese (zh)
Other versions
CN100367199C (en
Inventor
张禹
梁柱
文强
刘奇勇
刘程伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CNB2004100521274A priority Critical patent/CN100367199C/en
Publication of CN1770096A publication Critical patent/CN1770096A/en
Application granted granted Critical
Publication of CN100367199C publication Critical patent/CN100367199C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for acquiring covering surface video information which comprises steps of: establishing new component object method in current application program space; getting new component model interface pointer from the new component object; taking the new component model interface pointer as header pointer, entering chained list to seek all saved components object model interfaces; calling present component object pointer to acquire covering surface pointer and employ it to get the video data and characteristics information of the covering surface; restoring image according to the video data and characteristics information.

Description

Method for acquiring covering surface video information
Technical field
The present invention relates to the screen capture technology, relate in particular to a kind of method for acquiring covering surface video information.
Background technology
Present most media player has all used the Directx technology, and for the most existing display card, can use Overlay (covering surfaces) the technology show events video of Directdraw.Covering surfaces is the surface with display card tenability, is generally used for show events video, recorded video or static bitmap.The support of described covering surfaces is that display card provides by hardware fully, and DirectDraw supports the characteristic that display device driver is supported, DirectDraw can not the emulation covering surfaces.
The principle of work of covering surfaces is very similar with the principle that transparent plastic paper covers, and described covering surfaces can be envisioned as a slice transparent plastic paper, and drawing on this sheet plastic paper also can place it in the display front.When plastic paper covers the display front, can see covering surfaces and first type surface, remove plastic paper after, first type surface does not change.When showing a covering surfaces, tell exactly as seen how where device driver make covering surfaces, when the display device sweep trace repaints on the display, check each pixel on the first type surface then, see that whether being capped the surface replaces; If, display card just extracts related pixel from covering surfaces data substitute, display card generates the synthetic surface of first type surface and covering surfaces on display, produce transparent and drawing effect and do not need to change each surperficial content, described synthetic surface is directly delivered to display by video data stream and is shown.
Because it is the operation of hardware level that covering surfaces processing and pixel substitute, can seamlessly synthesize first type surface and covering surfaces by enough different pixel formats, so there is not tangible performance loss.
Therefore, if player has adopted the mode displaying video of covering surfaces, video content appears on the covering surfaces, it is the video content that can't obtain covering surfaces that prior art is carried out the just simple first type surface of catching of screen capture, can cause like this to grasp video data and be not the desired video data even present a slice black in video window.
Prior art is that simple extracting on-screen data is kept at this locality, can not in time share and be distributed to other good friends, adds the Video Capture characteristic at instant communication situation, and the communication that can strengthen both sides is experienced; In addition, prior art can only grasp a two field picture at every turn, can not once grasp multiple image and conversion generation GIF (GIF(Graphic Interchange format)) file.
Summary of the invention
The invention provides a kind of method for acquiring covering surface video information, solve the problem that to catch the covering surfaces video data in the prior art.
For addressing the above problem, method for acquiring covering surface video information of the present invention may further comprise the steps: 1) set up new component object example in the process space of current application program; 2) from this New Parent object, obtain New Parent object model interface pointer; 3) be owner pointer with described New Parent object model interface pointer, enter chained list, seek the The Component Object Model interface of all preservations along chained list; 4) call current component object pointer and obtain the covering surfaces pointer; 5) utilize the covering surfaces pointer to obtain the video data and the characteristic information of this covering surfaces; 6) according to the video data of this covering surfaces and characteristic information reorganization reproduced image.
Further, comprise step 3), 4): whether the process identification (PID) of The Component Object Model interface of judging this preservation is identical with the process identification (PID) of current application program; If identical, then expression finds current process to use component object, returns the The Component Object Model interface pointer and the component object pointer of this preservation; If the process identification (PID) of the process identification (PID) of the The Component Object Model interface of preserving and current application program is inequality, the The Component Object Model interface pointer of then changing another version is as New Parent object model interface pointer execution in step 3).As seen whether the first type surface of judging this component object have covering surfaces sign and covering surfaces; If can, execution in step 4); If the first type surface of component object does not have covering surfaces to identify or covering surfaces is invisible, then return or grasp first type surface
Further, described video information is that single frames obtains, and then reproduced image is stored with bitmap format.
Further, described video information is that multiframe is obtained, then by predetermined frame number, the time interval, scaling repeating said steps 1) to 6), reproduced image is stored with GIF(Graphic Interchange format).
Further, described video data refer to can with the video chromatism data of the conversion in three primary colors space, the pointer that obtains the buffer zone of the video data of preserving this covering surfaces correspondence by the covering surfaces pointer obtains.
Further, carry out this method and comprise step before: set up system's hook program, the keyboard message of responding system; When after pressing the button of next appointment on the player, the hook program begins to carry out following step; Judge that whether current application program has used DirectDraw, if do not have, then returns; If have, then execution in step 1).
Compared with prior art, the present invention has the following advantages:
Can catch the video information of covering surfaces, and can finish static state and dynamically obtain;
The picture format that reproduces (static state is obtained the employing bitmap format, dynamically obtains and adopts GIF(Graphic Interchange format)) then reaches transmission and demonstration in the JICQ easily on the net.
Description of drawings
Fig. 1 is a method for acquiring covering surface video information process flow diagram of the present invention.
Embodiment
The screen capture method is only operated first type surface in the prior art, when adopting covering surfaces to show, then can't obtain the video data of covering surfaces and can't obtain definite video data, can definitely obtain video data so must be able to get access to the video information of covering surfaces.
DirectDraw, create various different types of " surfaces " (Surface) by DirectDraw object (in the present specification with component object as its Chinese appellation), lip-deep content can freely be copied, be made up, and generates Protean figure.The DirectDraw object is used for representing viewing hardware, can be used to inquire about and obtain various supports The Component Object Model interface (com interface, the basis of being devoted to reuse the object-oriented system of interface resource), the cooperation grade is set, operation display mode and display surface.Each surface is represented by corresponding surface-object.By the entity of pointer to object access object and then access object representative, APIs (application programming interface) forms by object with based on com interface usually in DirectDraw.
DirectDraw can be surface creation in display memory (video memory) or Installed System Memory, and display memory is divided into conventional display memory and AGP Accelerated Graphics Port internal memory.Because the display memory capacity is limited, so which part storage area each surface specifically should be created in should make overall planning, generally will use frequently, need surface hardware-accelerated or the realization function be arranged in display memory.If you are the position of designated surface establishment not, DirectDraw will at first create the surface at conventional display memory, when conventional display memory is not enough, if the support AGP of system internal memory then uses the AGP internal memory earlier, final using system internal memory.
DirectDraw manages video memory, allows directly storage and manipulation bitmap in video memory.Utilize vision hardware Bliter (position piece transmitter) to carry out the Blit (position piece transmission) of bitmap in video memory inside.
Following several types is divided on described surface: (1) first type surface (Primary Surface): the surface that promptly shows on screen; Each DirectDraw object can only have a first type surface, and the size of first type surface, position and form can not be changed by the current display mode decision of system.
(2) off-screen surfaces (Off-screen Surface): this type of surface can not be directly visible.In general, the surface, backstage is often used for the memory buffer as parts such as the smart animation of recreation, background graphics.
(3) covering surfaces (Overlay Surface): being positioned at video memory, and can covering any position that is presented at first type surface, is a kind of surface by hardware supported, and DirectDraw can not emulation.Hide some pith such as menu, the dialog box etc. in the first type surface in order to prevent covering surfaces, covering surfaces is also high the chroma key function, when having only color value in the first type surface identical with the chroma key value, just covering surfaces covers first type surface.
When the beginning real-time video shows, at first start DirectDraw interface (being the The Component Object Model interface), create first type surface and covering surfaces, and write down the information of relevant covering surfaces, as size, data layout, memory address etc., select a color as chroma key for covering surfaces simultaneously, normally carmetta.According to the information initializing hardware device of covering surfaces, DMA (direct memory access (DMA)) equipment is directly sent into video data in the video memory at covering surfaces place then.When display window moved or change size, video capture engine can send the notice driver update and show that driver should be filled the color of chroma key in video window, and mobile covering surfaces makes it align with video window.
Please refer to shown in Figure 1ly, method for acquiring covering surface video information of the present invention may further comprise the steps:
1) in the process space of current application program, sets up new DirectDraw object (component object) example, because use the The Component Object Model interface must create the DirectDraw object earlier;
2) from this New Parent object, obtain New Parent object model interface pointer;
3) because the employed all The Component Object Model interface pointer of system are preserved in internal memory with the form of chained list, be owner pointer, enter chained list, seek the The Component Object Model interface of all preservations along chained list with described New Parent object model interface pointer;
4) judge whether the process identification (PID) of The Component Object Model interface of this preservation is identical with the process identification (PID) of current application program;
5) if identical, then expression finds current process to use component object, returns the The Component Object Model interface pointer and the component object pointer of this preservation; If different, the The Component Object Model interface pointer of then changing another version re-executes step 3) as New Parent object model interface pointer;
6) as seen whether the first type surface of judging this component object have covering surfaces sign and covering surfaces, because each DirectDraw object can only have a first type surface, exists so covering surfaces relies on first type surface;
7) if then call current component object pointer and obtain the covering surfaces pointer; If do not have covering surfaces sign or covering surfaces invisible, then return or grasp the first type surface video information;
8) utilize the covering surfaces pointer to obtain the video data and the characteristic information of this covering surfaces, described video data refer to can with the video chromatism data of the conversion in three primary colors space, the pointer that obtains the buffer zone of the video data of preserving this covering surfaces correspondence by the covering surfaces pointer obtains; Described characteristic information refers to form, the length of video data, width, highly, the color figure place of span, video data and the buffer pointer of preserving video data;
9) according to the video data of this covering surfaces and characteristic information reorganization reproduced image, the video data that corresponding corresponding format converts the video chromatism data to the three primary colors space is basis again.
Obtain if described video information is a single frames, then reproduced image is stored with bitmap format; (animation) obtains if described video information is multiframe, then by predetermined frame number, the time interval, scaling repeating said steps 1) to 9), reproduced image is stored with GIF(Graphic Interchange format) (GIF form).Can directly show animation at webpage like this; Also can in the JICQ of supporting the GIF form, show animation, pass to the good friend and watch.
Comprise step before carrying out this method: set up system's hook program, the keyboard message of responding system; When after pressing the button of next appointment on the player, the hook program begins to carry out following step; Judge that whether current application program has used DirectDraw, if do not have, then returns; If have, then execution in step 1).
In concrete the enforcement, adopt and realize as minor function:
Use DirectDrawCreate function creation component object.
IDirectDraw represents the com interface that DirectDraw provides, and IDirectdraw7 then represents the com interface of the 7th version; Call the DirectDrawCreate api function and can access newly-built component object pointer; Can call QueryInterface (IID_DirectDraw7, (Void then *) ﹠amp; M_pDirectDraw7)) function is obtained the The Component Object Model interface pointer of IDirectdraw7, i.e. New Parent object model interface pointer.
The Component Object Model interface pointer with acquisition IDirectdraw7 is an owner pointer, enters chained list, judges whether 12 bytes backward can visit; If can visit, judge then whether the content of preceding four bytes of this sheet internal memory is identical with the IDirectdraw7 object handle; If identical, then the region of memory of preserving the IDirectdraw7 object information is found in expression, calls pdwProcessID=(DWORD then *) (((LPBYTE) * (pdwDirectDraw+1))+0x14) can obtain using the process identification (PID) (ID) of this component object interface (being IDirectdraw7), wherein represents this sheet region of memory with pdwDirectDraw;
The acquisition methods of current process of application program sign (ID) is: DWORD dwProcessID=GetCurrentProcessId ();
Relatively judge process identification (PID) and the current process of application program sign of the IDirectdraw7 that obtains; If identical then expression finds current process to use component object, return the The Component Object Model interface pointer and the component object pointer of this preservation.
The EnumSurfaces of invocation component object obtains the covering surfaces pointer, specifically call into:
if(SUCCEEDED(pDirectDraw4->EnumSurfaces(
DDENUMSURFACES_DOESEXIST,
&ddsd2,
this,
EnumSurfacesCallback2)))
The covering surfaces pointer that obtains is saved in the m_m_pPrimaryDirectDrawSurface4 member variable.
Because the characteristic information of all surface is filled in DDSURFACEDESC structure and the DDPIXELFORMAT structure, can obtain characteristic information so call the GetSurfaceDesc method to covering surfaces, as:
DDSURFACEDESC2?ddsd2={0};
m_pPrimaryDirectDrawSurface4->GetSurfaceDesc(&ddsd2)
After extracting finishes, with the video chromatism data (YUV is generally YUV2, YV12, YUYV UYUV) is converted to RGB (three primary colors) data, preserve and copy to Clipboard in for the use.
Described YUV follows following formula to the conversion of RGB:
R=Y+1.403*(U-128)
G=Y-0.344*(U-128)-0.714*(V-128)
B=Y+1.773*(V-128)
If static state is captured (single frames obtains), only capture frame data of current broadcast, only the RGB data in the buffer zone need be generated BMP (bitmap) file, and store in the shear plate;
If dynamically grab screen pattern (multiframe is obtained), then the ratio of the data based application appointment of the RGB in the buffer zone is carried out convergent-divergent after, be inserted in the file object of GIF; Repeat to grab the screen process then, until generating the gif file of specifying frame number.
In sum, method for acquiring covering surface video information of the present invention can be caught the video information of covering surfaces, and can be by certain format reproduced image/animation.

Claims (6)

1. method for acquiring covering surface video information may further comprise the steps:
1) in the process space of current application program, sets up new component object example;
2) from this New Parent object, obtain New Parent object model interface pointer;
3) be owner pointer with described New Parent object model interface pointer, enter chained list, seek the The Component Object Model interface of all preservations along chained list;
4) call current component object pointer and obtain the covering surfaces pointer;
5) utilize the covering surfaces pointer to obtain the video data and the characteristic information of this covering surfaces;
6) according to the video data of this covering surfaces and characteristic information reorganization reproduced image.
2. method for acquiring covering surface video information as claimed in claim 1 is characterized in that, also comprises step between described step (3) and the step (4):
Whether the process identification (PID) of The Component Object Model interface of judging this preservation is identical with the process identification (PID) of current application program;
If identical, then expression finds current process to use component object, returns the The Component Object Model interface pointer and the component object pointer of this preservation;
If the process identification (PID) of the process identification (PID) of the The Component Object Model interface of preserving and current application program is inequality, the The Component Object Model interface pointer of then changing another version is as New Parent object model interface pointer execution in step 3)
As seen whether the first type surface of judging this component object have covering surfaces sign and covering surfaces;
If the first type surface of component object does not have covering surfaces to identify or covering surfaces is invisible, then return or grasp first type surface.
3. method for acquiring covering surface video information as claimed in claim 1 is characterized in that, described video information is that single frames obtains, and then reproduced image is stored with bitmap format.
4. method for acquiring covering surface video information as claimed in claim 1 is characterized in that, described video information is that multiframe is obtained, then by predetermined frame number, the time interval, scaling repeating said steps 1) to 6), reproduced image is stored with GIF(Graphic Interchange format).
5. as claim 2 or 3 described method for acquiring covering surface video information, it is characterized in that, described video data refer to can with the video chromatism data of the conversion in three primary colors space, the pointer that obtains the buffer zone of the video data of preserving this covering surfaces correspondence by the covering surfaces pointer obtains.
6. as each described method for acquiring covering surface video information of claim 1 to 3, it is characterized in that, carry out this method and comprise step before:
Set up system's hook program, the keyboard message of responding system;
When after pressing the button of next appointment on the player, the hook program begins to carry out following step;
Judge that whether current application program has used DirectDraw, if do not have, then returns;
If have, then execution in step 1).
CNB2004100521274A 2004-11-05 2004-11-05 Acquisition method for video frequency information of overlay surface Active CN100367199C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100521274A CN100367199C (en) 2004-11-05 2004-11-05 Acquisition method for video frequency information of overlay surface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100521274A CN100367199C (en) 2004-11-05 2004-11-05 Acquisition method for video frequency information of overlay surface

Publications (2)

Publication Number Publication Date
CN1770096A true CN1770096A (en) 2006-05-10
CN100367199C CN100367199C (en) 2008-02-06

Family

ID=36751419

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100521274A Active CN100367199C (en) 2004-11-05 2004-11-05 Acquisition method for video frequency information of overlay surface

Country Status (1)

Country Link
CN (1) CN100367199C (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023852A (en) * 2009-09-15 2011-04-20 深圳市巨龙科教高技术股份有限公司 Screen capture method and system
CN102103477B (en) * 2009-12-21 2012-09-05 联想(北京)有限公司 Display data acquiring method and system and electronic equipment
CN102929634A (en) * 2012-10-31 2013-02-13 惠州市德赛西威汽车电子有限公司 Control method for video display

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6064405A (en) * 1998-04-10 2000-05-16 Ati Technologies, Inc Method and apparatus for a cached video hardware cursor
US6614441B1 (en) * 2000-01-07 2003-09-02 Intel Corporation Method and mechanism of automatic video buffer flipping and display sequence management
CN1354445A (en) * 2001-12-11 2002-06-19 深圳安圣电气有限公司 Image processing method of remote image monitoring system based on IP network and its equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023852A (en) * 2009-09-15 2011-04-20 深圳市巨龙科教高技术股份有限公司 Screen capture method and system
CN102103477B (en) * 2009-12-21 2012-09-05 联想(北京)有限公司 Display data acquiring method and system and electronic equipment
CN102929634A (en) * 2012-10-31 2013-02-13 惠州市德赛西威汽车电子有限公司 Control method for video display
CN102929634B (en) * 2012-10-31 2016-03-23 惠州市德赛西威汽车电子股份有限公司 A kind of control method of video display

Also Published As

Publication number Publication date
CN100367199C (en) 2008-02-06

Similar Documents

Publication Publication Date Title
US11418832B2 (en) Video processing method, electronic device and computer-readable storage medium
US6573915B1 (en) Efficient capture of computer screens
CN110377263B (en) Image synthesis method, image synthesis device, electronic equipment and storage medium
KR100989010B1 (en) Systems and methods for generating visual representations of graphical data and digital document processing
CN111899322B (en) Video processing method, animation rendering SDK, equipment and computer storage medium
US20140125685A1 (en) Method and Apparatus for Displaying Images
CN1455372A (en) Screen sharing and synchronous recording method based on IP network
KR101728389B1 (en) Accelerating bitmap remoting by identifying and extracting 2d patterns from source bitmaps
CN114968152B (en) Method for reducing VIRTIO-GPU extra performance loss
US7580041B1 (en) Direct storage of compressed scan converted data
CN115209145A (en) Video compression method, system, device and readable storage medium
CA2439633A1 (en) Screen display processing apparatus, screen display processing method and computer program
CN105069150B (en) Compression, storage, back method and the compression of film recording, storage system
CN113691740A (en) Mobile terminal webpage video background processing method, system and storage medium
CN1770096A (en) Acquisition method for video frequency information of overlay surface
CN102685359A (en) Method for realizing hardware-acceleration-based video picture on remote desktop
CN114222185B (en) Video playing method, terminal equipment and storage medium
US20040008213A1 (en) Tagging multicolor images for improved compression
CN106303366B (en) Video coding method and device based on regional classification coding
CN112488911B (en) Method for rendering GIF file on HTML5 CANVAS CANVAS
CN112929682B (en) Method, device and system for transparently processing image background and electronic equipment
US20030160777A1 (en) Moving-image icon generating apparatus
CN101030363A (en) Image synthesizing device
CN114089896A (en) Rendering image intercepting method and device
CN110766599B (en) Method and system for preventing white screen from appearing when Qt Quick is used for drawing image

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant