In my NewDisplay program I can switch the laptop camera on, move the picture from one corner of the screen to another, make the picture bigger or smaller (including full-screen) and everything is hunkydory.
Except: with one of my laptops the computer reports "there is no webcam". Even when I run the webcam prog in stand-alone mode, it doesn't recognise a camera.
However I also have a program called "webcam-DShow" by Richard Russell, 26 Nov 2020 which does work on all the laptops, including the recalcitrant one. The only problem is that I can't do with it what I can with the other prog. The video feed appears in a "preview graph", which looks like a window but is produced by FNsys7(). Unlike a window, the preview graph doesn't appear amenable to being resized or moved using SYS"SetWindowPos".
Does anyone have any experience with using this program?
webcam_DShow
Re: webcam_DShow
My own tests suggest otherwise. Moving and re-sizing the Direct Show preview window appears to be working fine for me. Are you sure you're using the correct window handle? How did you find it?
-
- Posts: 327
- Joined: Wed 04 Apr 2018, 06:36
Re: webcam_DShow
The program contains the lines:
I assumed that hr% was the window handle, though I was puzzled as hr% is used in several other places in the program.
Thanks.
Code: Select all
REM Build the video preview graph:
hr%=FNsys7(pBuild.RenderStream%,pBuild%,PIN_CATEGORY_PREVIEW%,MEDIATYPE_Video%,pCap%,FALSE,FALSE)
Thanks.
Re: webcam_DShow
hr% is an HRESULT, as the documentation of any of the functions which return it would have confirmed. For example the documentation of ICaptureGraphBuilder2::RenderStream here.
I find it incomprehensible that anybody would assume something when a Google search would find the true answer in a few seconds.
-
- Posts: 327
- Joined: Wed 04 Apr 2018, 06:36
Re: webcam_DShow
The trouble is that you expect the same level of expertise as you yourself possess. I read through all the documentation for D-Show I could find on the MicroSoft website and I'm afraid that I was left none the wiser. It might as well have been written in Dutch - double-Dutch - for all the good it did me.
It must be very frustrating for you to have to deal with ignoramuses like me. Sorry.
It must be very frustrating for you to have to deal with ignoramuses like me. Sorry.
-
- Posts: 327
- Joined: Wed 04 Apr 2018, 06:36
Re: webcam_DShow
Just to explain a bit further; looking at the page you referenced in your reply (which I had already seen, as I mentioned) why a graph? I want a video picture, not a graph. I assume this business about "pins" is metaphorical - the only pins I know of require a soldering iron to make connections. How, then, does one connect to a software "pin"? And my level of comprehension goes down from there!
Re: webcam_DShow
I can't answer any of those questions, because I don't know any more about it than you do! You seem to think I understand that stuff, but I don't. It's all complete gobbledegook to me.KenDown wrote: ↑Tue 13 Dec 2022, 06:47 Just to explain a bit further; looking at the page you referenced in your reply (which I had already seen, as I mentioned) why a graph? I want a video picture, not a graph. I assume this business about "pins" is metaphorical - the only pins I know of require a soldering iron to make connections. How, then, does one connect to a software "pin"? And my level of comprehension goes down from there!
Fortunately, i didn't need any understanding to write the webcam_DShow program that you are using. I will no doubt have found a worked example coded in C or C++, and simply translated it to BBC BASIC. So long as there are no mistakes in the translation it should run.
And you don't need any understanding of that complicated Microsoft stuff either, in order to add the ability to move and re-size the window. You just need an appreciation that it is a standard window (it certainly looks like one!) plus the window handle.
But that's where your approach went wrong, by assuming something that you had no right to assume. When I said you could have looked at the Microsoft documentation of the function returning hr% I wasn't suggesting that you would understand it - I don't - but that you could see what the returned value means.
In that documentation it quite clearly states Return Values: Returns an HRESULT value, that's enough to tell you that it isn't a window handle. It doesn't require any understanding of C, nor does it require any understanding of render graphs.
So with that one simple step you would have known that your challenge was to find the window handle. There are several ways - you don't need me to help you with that - and once you have the handle my experiments showed that you can move and resize the window at will.
In the future, don't be intimidated by Microsoft documentation. Don't think that you need to understand all of it to understand any of it, you don't. Ignore the stuff you don't understand and concentrate on what you do, such as the meaning of a parameter or a return value. That will often be all you need to know to solve whatever problem you have with your BBC BASIC program.