CN114089896A - Rendering image intercepting method and device - Google Patents

Rendering image intercepting method and device Download PDF

Info

Publication number
CN114089896A
CN114089896A CN202210036078.3A CN202210036078A CN114089896A CN 114089896 A CN114089896 A CN 114089896A CN 202210036078 A CN202210036078 A CN 202210036078A CN 114089896 A CN114089896 A CN 114089896A
Authority
CN
China
Prior art keywords
rendering
image
intercepting
rendered
screen
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
Application number
CN202210036078.3A
Other languages
Chinese (zh)
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.)
Beijing Weiling Times Technology Co Ltd
Original Assignee
Beijing Weiling Times Technology 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 Beijing Weiling Times Technology Co Ltd filed Critical Beijing Weiling Times Technology Co Ltd
Priority to CN202210036078.3A priority Critical patent/CN114089896A/en
Publication of CN114089896A publication Critical patent/CN114089896A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application provides a rendering image intercepting method, which comprises the following steps: acquiring the control right of a calling function for displaying an image to a screen through HOOK during rendering initialization; intercepting the calling function in a swap chain according to the control right, and acquiring a rendering image of a cache region in the swap chain. By calling an image from a buffer in which the image is rendered instead of capturing the image from the screen in between, the screenshot is made to consume computing resources of the computer device and the captured image is not limited by the display pixels.

Description

Rendering image intercepting method and device
Technical Field
The application requests to protect a screenshot technology, and particularly relates to a rendered image intercepting method. The application also relates to a rendering image intercepting device.
Background
The method comprises the steps of screenshot, namely a technology for intercepting content displayed on a screen and generating a picture, wherein the current screenshot modes comprise a system screenshot mode, a software screenshot mode and a tool screenshot mode, the system screenshot mode refers to a mode of carrying out screenshot operation by means of a picture intercepting tool carried by a system of computer equipment, the software screenshot mode refers to a mode of intercepting the picture by means of a picture intercepting tool of a communication software base material, and the tool screenshot mode refers to the mode of intercepting the picture by means of a special screenshot tool.
At present, the screenshot function is one of the essential functions of computer equipment and numerous software, but the screenshot in the prior art is realized by intercepting the content displayed by a display, the screenshot method generates consumption of additional computer computing resources, so that the computer generates pause in the screenshot process, and pixels of the intercepted picture are limited by the pixels of the display.
Disclosure of Invention
In order to solve the problems that the current picture is captured and pixels of the captured picture are limited, the application provides a rendering image capturing method. The application also relates to a rendering image intercepting device.
The application provides a rendering image intercepting method, which comprises the following steps:
acquiring the control right of a calling function for displaying an image to a screen through HOOK during rendering initialization;
intercepting the calling function in a swap chain according to the control right, and acquiring a rendering image of a cache region in the swap chain.
Optionally, the rendered image is rendered by using a DirectX12 engine, and the rendering step of the DirectX12 engine includes:
enumerating and selecting a display card;
creating a command object, a swap chain and an RTV;
rendering pictures through the display card, and storing rendering results into a buffer area;
and rendering the rendering picture in the buffer area to a screen through the calling function.
Optionally, the cache region is disposed in a memory.
Optionally, the rendered image is sent to an encoder for encoding, and then sent to a screenshot obtaining end for display.
Optionally, the rendered image is a game screen.
The present application further provides a rendering image intercepting apparatus, including:
the intercepting module is used for acquiring the control right of a calling function presented to a screen by an image through HOOK during rendering initialization;
and the calling module is used for intercepting the calling function in the exchange chain according to the control right and acquiring the rendering image of the cache region in the exchange chain.
Optionally, the rendered image is rendered by using a DirectX12 engine, and the rendering step of the DirectX12 engine includes:
enumerating and selecting a display card;
creating a command object, a swap chain and an RTV;
rendering pictures through the display card, and storing rendering results into a buffer area;
and rendering the rendering picture in the buffer area to a screen through the calling function.
Optionally, the cache region is disposed in a memory.
Optionally, the rendered image is sent to an encoder for encoding, and then sent to a screenshot obtaining end for display.
Optionally, the rendered image is a game screen.
Compared with the prior art, the application has the advantages that:
the application provides a rendering image intercepting method, which comprises the following steps: acquiring the control right of a calling function for displaying an image to a screen through HOOK during rendering initialization; intercepting the calling function in a swap chain according to the control right, and acquiring a rendering image of a cache region in the swap chain. By calling an image from a buffer in which the image is rendered instead of capturing the image from the screen in between, the screenshot is made to consume computing resources of the computer device and the captured image is not limited by the display pixels.
Drawings
FIG. 1 is a flow chart of rendering image capture in the present application.
Fig. 2 is a schematic diagram in this application.
FIG. 3 is a schematic diagram of a rendering image capture device according to the present application.
Detailed Description
The following embodiments are all examples provided to illustrate the specific implementation processes of the technical solutions to be protected by the present application in detail, but the present application may also adopt other embodiments different from the description herein to obtain the same concept, and those skilled in the art may implement the present application by reasonable inference and technical means instead under the guidance of the concept of the present application, so that the present application is not limited by the following specific embodiments.
The application provides a rendering image intercepting method, which comprises the following steps: acquiring the control right of a calling function for displaying an image to a screen through HOOK during rendering initialization; intercepting the calling function in a swap chain according to the control right, and acquiring a rendering image of a cache region in the swap chain. By calling an image from a buffer in which the image is rendered instead of capturing the image from the screen in between, the screenshot is made to consume computing resources of the computer device and the captured image is not limited by the display pixels.
FIG. 1 is a flow chart of rendering image capture in the present application.
Referring to fig. 1, in the process of initializing rendering, S101 obtains control right of a call function for presenting an image to a screen through a HOOK.
In the process of rendering and displaying an image by rendering data to form rendering data, firstly, rendering initialization setting needs to be performed on an image rendering engine, wherein the initialization setting refers to setting of parameters of image rendering and setting of a cache area address. After the initialization of the rendering engine is completed, the image data is rendered through the rendering engine firstly, then the rendered image is cached in the image cache region for temporary storage, and finally the rendered image in the image cache region is displayed on a display screen of a user side through a calling function.
In the present application, the rendering engine obtains the control right of the call function through the HOOK function when the rendering is initialized. The HOOK function is an intercept function, also called a HOOK function, and can change the execution behavior of the call function, thereby obtaining the control right of the call function.
In the application, the image is preferably a game image, and in the running process of a game, if screenshot operation is performed, a user interface is blocked, so that user experience is reduced.
The rendering engine is preferably a DirectX12 engine, and the DirectX12 engine supports API-DirectX12, is a multimedia programming interface created by microsoft corporation, and is an application program interface.
The DirectX12 engine can enable a game or a multimedia program taking windows as a platform to obtain higher execution efficiency, strengthen 3D graphics and sound effects, provide a common hardware driving standard for designers, enable game developers not to write different drivers for each brand of hardware, and reduce the complexity of hardware installation and setting by users. The DirectX12 engine has been widely used in Microsoft-Windows, Microsoft-XBOX360, and Microsoft-XBOX video game development.
FIG. 2 is a rendering flow diagram of the DirectX12 engine in the present application.
Referring to fig. 2, the rendering step of the DirectX12 engine is as follows:
s201 enumerates and selects the display card.
Specifically, the DirectX12 engine enumerates and selects the graphics cards by creating DXGIFactory, including enumerating all the callable graphics cards, and selecting the adopted graphics card according to the status of the graphics card. Wherein the status of the graphics card means that: whether the graphics card is being used, whether the graphics card can support current image rendering, and the like.
S202 creates a command object, exchange chain, RTV.
The command object may also be referred to as a rendering item, the swap chain is a set of buffers for displaying frames to a user, which may be the image buffer in this application, and the RTV is an image selection system for selecting a screenshot.
S203, rendering the picture through the display card, and storing the rendering result in the cache region, namely the image cache region. In the present application, the image buffer is disposed in a memory.
S204, rendering pictures in the buffer area are displayed on a screen through the calling function.
Referring to fig. 1, S102 intercepts the call function in the swap chain according to the control right, and obtains a rendering image of a buffer area in the swap chain.
And after the rendering of the image is finished, starting the calling function, and displaying the rendered image of the cache region on a display screen.
According to the technical scheme, the rendering engine acquires the control right of the calling function during rendering initialization, calls the rendering image in the image cache region according to the control right of the calling function, sends the rendering image to the encoder for encoding, and then sends the rendering image to the screenshot acquiring end for displaying.
In the application, the screenshot obtaining end and the user end are different display ends. Taking a game as an example, the user side may be a display side when the user plays the game, and the screenshot obtaining side is a display side for the game maintainer to obtain a picture for displaying in order to maintain the game.
In a preferred embodiment, in a cloud game scene, the rendering and caching of the game picture are performed in a cloud service, and the capturing of the image is also performed in a cloud server. Specifically, the image cache is searched from the image cache region according to the user ID, and the cached image is obtained.
The present application further provides a rendering image intercepting apparatus, including:
the intercepting module is used for acquiring the control right of a calling function presented to a screen by an image through HOOK during rendering initialization;
and the calling module is used for intercepting the calling function in the exchange chain according to the control right and acquiring the rendering image of the cache region in the exchange chain.
FIG. 3 is a schematic diagram of a rendering image capture device according to the present application.
Referring to fig. 3, an intercept module 301 is used for obtaining control right of a call function of image presentation to a screen through HOOK at the time of rendering initialization.
In the process from image rendering to display, firstly, rendering initialization setting needs to be performed on an image rendering engine, wherein the initialization setting refers to setting of parameters of image rendering and setting of a cache area address. And then, rendering the image data through a rendering engine, caching the rendered image into an image cache region, and finally displaying the rendered image in the image cache region on a display screen through a calling function.
In the application, the rendering engine obtains the control right of the calling function through HOOK at the rendering initialization node. The HOOK is an intercept function, also called a HOOK function, and can change the execution behavior of the call function, thereby obtaining the control right of the call function.
In the application, the image is preferably a game image, and during the running process of the game, if a screenshot operation is performed, the user interface is jammed, so that the user experience is reduced. The rendering engine is preferably a DirectX12 engine.
The rendering engine is preferably a DirectX12 engine, the DirectX12 engine supports apidirect x12, is a multimedia programming interface created by microsoft corporation, and is an Application Program Interface (API).
The DirectX12 engine can enable a game or a multimedia program taking windows as a platform to obtain higher execution efficiency, strengthen 3D graphics and sound effects, provide a common hardware driving standard for designers, enable game developers not to write different drivers for each brand of hardware, and reduce the complexity of hardware installation and setting by users. The DirectX12 engine has been widely used in Microsoft Windows, Microsoft XBOX360, and Microsoft XBOX video game development.
Referring to fig. 2, the rendering step of the DirectX12 engine is as follows:
s201 enumerates and selects the display card.
Specifically, the DirectX12 engine enumerates and selects the graphics cards by creating DXGIFactory, including enumerating all the callable graphics cards, and selecting the adopted graphics card according to the status of the graphics card. Wherein the status of the graphics card means that: whether the graphics card is being used, whether the graphics card can support current image rendering, and the like.
S202 creates a command object, exchange chain, RTV.
The command object may also be referred to as a rendering item, the swap chain is a set of buffers for displaying frames to a user, which may be the image buffer in this application, and the RTV is an image selection system for selecting a screenshot.
S203, rendering the picture through the display card, and storing the rendering result in the cache region, namely the image cache region. In the present application, the image buffer is disposed in a memory.
S204, rendering pictures in the buffer area are displayed on a screen through the calling function.
Referring to fig. 3, the calling module 302 is configured to intercept the calling function in the swap chain according to the control right, and obtain a rendering image of a cache region in the swap chain.
And after the rendering of the image is finished, starting the calling function, and displaying the rendered image of the cache region on a display screen.
And the rendering engine acquires the control right of the calling function during rendering initialization, calls the rendering image according to the control right of the calling function, sends the rendering image to an encoder for encoding, and then sends the rendering image to a screenshot acquiring end for displaying.
In the application, the screenshot obtaining end and the user end are different display ends. Taking a game as an example, the user side may be a display side when the user plays the game, and the screenshot obtaining side is a display side for the game maintainer to obtain a picture for displaying in order to maintain the game.
In a preferred embodiment, the rendering image intercepting device is deployed in a cloud server. In a cloud game scene, the rendering and the caching of the game picture are performed in a cloud service, and the image interception is also performed in a cloud server. Specifically, the image cache is searched from the image cache region according to the user ID, and the cached image is obtained for display.

Claims (10)

1. A rendered image clipping method, comprising:
acquiring the control right of a calling function for displaying an image to a screen through HOOK during rendering initialization;
intercepting the calling function in a swap chain according to the control right, and acquiring a rendering image of a cache region in the swap chain.
2. The rendered image intercepting method according to claim 1, wherein the rendered image is rendered using a DirectX12 engine, and the step of rendering by the DirectX12 engine comprises:
enumerating and selecting a display card;
creating a command object, a swap chain and an RTV;
rendering pictures through the display card, and storing rendering results into a buffer area;
and rendering the rendering picture in the buffer area to a screen through the calling function.
3. The rendered image intercepting method according to claim 1 or 2, wherein the buffer area is provided in a memory.
4. The rendered image capture method of claim 1, wherein the rendered image is sent to an encoder for encoding and then sent to a screenshot capture terminal for display.
5. The rendered image capture method of claim 1, wherein the rendered image is a game screen.
6. A rendered image capture apparatus, comprising:
the intercepting module is used for acquiring the control right of a calling function presented to a screen by an image through HOOK during rendering initialization;
and the calling module is used for intercepting the calling function in the exchange chain according to the control right and acquiring the rendering image of the cache region in the exchange chain.
7. The rendering image intercepting apparatus of claim 6, wherein the rendering image is rendered using a DirectX12 engine, the rendering step of the DirectX12 engine comprising:
enumerating and selecting a display card;
creating a command object, a swap chain and an RTV;
rendering pictures through the display card, and storing rendering results into a buffer area;
and rendering the rendering picture in the buffer area to a screen through the calling function.
8. The rendering image intercepting apparatus of claim 6 or 7, wherein the buffer is provided in a memory.
9. The rendering image intercepting device of claim 6, wherein the rendering image is sent to an encoder for encoding and then sent to a screenshot obtaining end for displaying.
10. The rendering image intercepting apparatus according to claim 6, wherein the rendering image is a game screen.
CN202210036078.3A 2022-01-13 2022-01-13 Rendering image intercepting method and device Pending CN114089896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210036078.3A CN114089896A (en) 2022-01-13 2022-01-13 Rendering image intercepting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210036078.3A CN114089896A (en) 2022-01-13 2022-01-13 Rendering image intercepting method and device

Publications (1)

Publication Number Publication Date
CN114089896A true CN114089896A (en) 2022-02-25

Family

ID=80308499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210036078.3A Pending CN114089896A (en) 2022-01-13 2022-01-13 Rendering image intercepting method and device

Country Status (1)

Country Link
CN (1) CN114089896A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116185743A (en) * 2023-04-24 2023-05-30 芯瞳半导体技术(山东)有限公司 Dual graphics card contrast debugging method, device and medium of OpenGL interface
CN117075786A (en) * 2023-07-12 2023-11-17 荣耀终端有限公司 Page display method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140155161A1 (en) * 2012-12-05 2014-06-05 Camber Corporation Image Rendering Systems and Methods
CN103853576A (en) * 2012-12-06 2014-06-11 腾讯科技(深圳)有限公司 Screenshot method and device
CN105069831A (en) * 2015-07-28 2015-11-18 广州爱拍网络科技有限公司 Method and system for acquiring OpenGL rendering picture based on Hook technology
CN105072461A (en) * 2015-07-03 2015-11-18 北京奇虎科技有限公司 Data processing method and device
CN106406862A (en) * 2016-08-31 2017-02-15 福建省天奕网络科技有限公司 Screen acquisition method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140155161A1 (en) * 2012-12-05 2014-06-05 Camber Corporation Image Rendering Systems and Methods
CN103853576A (en) * 2012-12-06 2014-06-11 腾讯科技(深圳)有限公司 Screenshot method and device
CN105072461A (en) * 2015-07-03 2015-11-18 北京奇虎科技有限公司 Data processing method and device
CN105069831A (en) * 2015-07-28 2015-11-18 广州爱拍网络科技有限公司 Method and system for acquiring OpenGL rendering picture based on Hook technology
CN106406862A (en) * 2016-08-31 2017-02-15 福建省天奕网络科技有限公司 Screen acquisition method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116185743A (en) * 2023-04-24 2023-05-30 芯瞳半导体技术(山东)有限公司 Dual graphics card contrast debugging method, device and medium of OpenGL interface
CN117075786A (en) * 2023-07-12 2023-11-17 荣耀终端有限公司 Page display method and electronic equipment

Similar Documents

Publication Publication Date Title
US20210168441A1 (en) Video-Processing Method, Electronic Device, and Computer-Readable Storage Medium
CN111433743B (en) APP remote control method and related equipment
US6762761B2 (en) Method and system for graphics rendering using hardware-event-triggered execution of captured graphics hardware instructions
CN114089896A (en) Rendering image intercepting method and device
CN111737019B (en) Method and device for scheduling video memory resources and computer storage medium
CN110750664B (en) Picture display method and device
CN116821040B (en) Display acceleration method, device and medium based on GPU direct memory access
CN113655975B (en) Image display method, image display device, electronic apparatus, and medium
CN113900754A (en) Desktop sharing method and device, computer equipment and storage medium
CN112316433A (en) Game picture rendering method, device, server and storage medium
CN114968152B (en) Method for reducing VIRTIO-GPU extra performance loss
CN113838184A (en) Rendering method, device and system
CN107911700B (en) Virtualization-based hardware decoding method, decoding equipment and storage medium
CN114090168A (en) Self-adaptive adjusting method for image output window of QEMU (QEMU virtual machine)
CN113986064A (en) Cloud desktop cursor processing method and device and storage medium
US9471956B2 (en) Graphic remoting system with masked DMA and graphic processing method
US20110298816A1 (en) Updating graphical display content
CN114595021A (en) Method and device for repairing splash screen, electronic equipment, chip and storage medium
CN113934500A (en) Rendering method, rendering device, storage medium and electronic equipment
CN108235144B (en) Playing content obtaining method and device and computing equipment
CN116166367B (en) Method for improving display frame buffer image reading efficiency
CN111013144B (en) Game picture drawing and rendering method and device and mobile terminal
CN115080165B (en) Applet processing method, device, storage medium and mobile terminal
KR101337558B1 (en) Mobile terminal having hub function for high resolution images or stereoscopic images, and method for providing high resolution images or stereoscopic images using the mobile terminal
CN111127296B (en) Efficient picture rendering method in large-screen visual system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220225

RJ01 Rejection of invention patent application after publication