Infognition forum
March 11, 2010, 05:33:27 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Last GraphEditPlus version: 1.4.0   Last Video Enhancer version: 1.9.3
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Screen Capture Source Filter  (Read 1330 times)
markr
Newbie
*

Karma: +0/-0
Posts: 23


View Profile
« on: September 17, 2009, 10:22:44 PM »

What is the best screen capture source filter for DirectShow? 
Logged
Dee Mon
Administrator
Full Member
*****

Karma: +7/-0
Posts: 246



View Profile WWW
« Reply #1 on: September 18, 2009, 08:01:35 AM »

The one we will release. Wink
In DirectShow SDK there is a sample filter capturing desktop, it's in ...\DirectShow\Filters\PushSource\.
And there are some commercial filters of which I don't know much.
Logged
markr
Newbie
*

Karma: +0/-0
Posts: 23


View Profile
« Reply #2 on: September 18, 2009, 07:01:35 PM »

I am very interested in the one you will release.  When do you expect that to happen as I really need one right now?

Thanks, Mark
Logged
Dee Mon
Administrator
Full Member
*****

Karma: +7/-0
Posts: 246



View Profile WWW
« Reply #3 on: September 18, 2009, 10:21:41 PM »

It was planned for this autumn, but not in September. Try using the filter from SDK for start.
Logged
markr
Newbie
*

Karma: +0/-0
Posts: 23


View Profile
« Reply #4 on: September 19, 2009, 12:08:47 AM »

I compiled that sample and it works as expected, but I was hoping to have the mouse pointer image overlaid so the mouse movement could be tracked, as well as some image indicator, such as a colored circle or something when the mouse is clicked.  I'm not a C++ programmer, but doing all my work in C#.  So how difficult would it be to add this capability to the SDK PushSource sample?  Do you know of any C++ code samples that would help?

Or, would it degrade performance if a SampleGrabber were inserted downstream in the graph and then the mouse tracking images, etc. added to the sample from within C# code?

Also, will the screen capture filter you plan to release have mouse tracking as well as the ability to use ScreenPressor?

Thanks again..
« Last Edit: September 19, 2009, 12:11:44 AM by markr » Logged
markr
Newbie
*

Karma: +0/-0
Posts: 23


View Profile
« Reply #5 on: September 19, 2009, 02:13:34 AM »

...would I be on the right path to look into the Windows API for SetWindowsHookEx function to set a callback for mouse events and use this within the PushSource code?
It seems like this is a possible way:

1.  call the SetWindowsHookEx function when the PushSource filter is created to create a callback function for the idHook parameter of WH_MOUSE_LL.
 
2.  create the callback function to mirror the LowLevelMouseProc function with this syntax:

LRESULT CALLBACK LowLevelMouseProc(
    int nCode,
    WPARAM wParam,
    LPARAM lParam
);

3.  use two global BOOL variables - for left and right mouse click - within the LowLevelMouseProc function that would store 'true' when the mouse button was down and 'false' when the mouse button was up.  Also create a POINT variable to store the mouse position.

4.  get the value of the BOOL variables from within the FillBuffer method.  If either BOOL vars are 'true', create some type of bitmap indicator at the specified mouse position, such as a colored circle (maybe different color for left and right click) and modify the screen bitmap to show this colored circle.

5.  add some type of bitmap mouse pointer as well for every frame at the specified X and Y position indicated by the POINT variable.

If this is a viable solution, any additional comments would be greatly appreciated.  If this is not the direction I should take, please point me in the right direction.

Thanks again...
Logged
Dee Mon
Administrator
Full Member
*****

Karma: +7/-0
Posts: 246



View Profile WWW
« Reply #6 on: September 19, 2009, 11:58:27 AM »

From what I've heard, usually when people grab screen they have to draw mouse pointer themselves as a sprite. What you describe here is one possible way, seems fine for me. Using samplegrabber from C# will probably involve marshalling of the whole frame which is too slow.

There is an open source screen recording app called CamStudio, you can look how they managed the mouse there. Note that CamStudio itself is quite slow (low FPS), so don't copy it all. Wink
Logged
Dee Mon
Administrator
Full Member
*****

Karma: +7/-0
Posts: 246



View Profile WWW
« Reply #7 on: September 19, 2009, 11:59:51 AM »

And yes, I guess our capture filter will draw mouse events and work with ScreenPressor.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!