|
You can rationalize being a jerk if you want to, but it will not improve you.
Rich
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Richie308 wrote: You can rationalize being a jerk lazy unskilled developer if you want to, but it will not improve you.
led mike
|
|
|
|
|
It's not your job to police the boards for people whom you think are lazy. If you think someone is lazy, just don't answer them.
This is not YOUR board, you don't make the rules. Quit trying to prove you're better than the next guy, and shut up.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Richie308 wrote: and shut up.
I am not the one that had to post a question asking for help, or did that fact escape you? If I feel like handing out other advice along with the particular solution some lazy mental midget asks for I will. All your whining won't stop me.
Richie308 wrote: It's not your job to police the boards
But apparently it is your job? Obviously logic is not one of your strong skills.
led mike
|
|
|
|
|
|
I'm sorry for reposting this but I was not able to get back to work on this project until just now.
I am currently designing a 2D/3D interface package based on Direct3D, but need to include a DirectShow VMR9 window in the interface which will be diplaying video from a capture card or pre-recorded videos.
The problem is that I have a render loop that constantly updates and redraws the interface, which causes the embedded video to flash. Is there a way that I can tell part of a surface not to be redrawn, i.e. the surface behind the vid window? It is on top of a large fullscreen size surface which holds a background image. Else is there a simple way to place individual frames of a my video onto a Direct3D surface which can then be drawn on top of the backgroung image.
I'm fairly new to Direct3D and very new to DirectShow. Any help is appreciated.
Thanks,
Dustin
P.S. I have tried using ExcludeClipRect() but it appaerantly only works with GDI. I have also tried telling the video to repaint after the interface was drawn, but to no avail.
|
|
|
|
|
Writing your own renderer is one option. The sample base classes included with the DirectShow
SDK make it relatively simple.
The Texture3D9 Sample[^] in the DirectShow SDK may help for rendering video to a Direct3D surface.
|
|
|
|
|
I've tried looking through that sample but can't really make heads or tails of it, mainly because I don't really have a clue about how DirectShow actually works. I have searched everywhere for a good tutorial, but everone I can find does things that I don't need and doesn't do the things that I do.
I've got a file loading and playing just fine with full control over playback, but that's where my success ends. I need to be able to load multiple videos and play them back based on events generated by the interface. The problem is I don't know how the videos are actually stored. Do I need to create a multiple IVMRWindowlessControl9 or IGraphBuilder. Which interfaces can be reused and which cannot.
If anybody knows of a good tutorial that would teach me all this I would very much appreciate it. It seems DirectShow is far less popular than the other DirectX APIs.
Thanks for your help,
Dustin
|
|
|
|
|
Using the VMR in windowless mode is not too helpful since you only have control at the window
(HWND) level.
Using the VMR in renderless mode provides almost exactly what you need to do except the Direct3D
surfaces are created to match the video stream. If you're already managing the surfaces and the
video is secondary then this is (in a sense) the reverse of what you need.
If you have code running with direct show and the only problem is flicker then I still think the
easiest route would be to write your own renderer instead of the VMR (unless you're really using
the mixing features of the renderer).
I personally found the Windows Media Format SDK to be more flexible, although I work mainly with
ASF files (.wma, .wmv, etc.) and prefer to write my own renderers. If you can work with ASF files
then it's fairly simple (and there's decent sample code in the SDK) to read streams from a file.
Using the asynchronous reader you can set up to read a file and you'll get a callback called for
each frame of video, at the right time, and in the right order. What you do with the frame is up
to you. If you work with 24-bit RGB video, it's a fairly simple blt to a Direct3D surface, GDI
device context, or whatever.
A downside is, besides mpeg-4, the only video codes included for free are the windows media
codecs.
Might be worth taking a look at the Windows Media Format SDK[^]
|
|
|
|
|
Thank you very much for the advice. You're right, I do not need most of the features in VMR and I can work with any format I want as I am authoring the videos. I will give it a go, although there may be more questions coming.
Thanks for always being so helpful Mark,
Dustin
|
|
|
|
|
Mark,
I just wanted to let you know I fixed the problem. All I did was take the '9' off of everything regarding VMR so that I am now using the original version VMR7. I have no idea why this fixed the problem or even what inspired me to try it, but it now works. I just LOVE Microsoft.
Thanks for the help,
Dustin
|
|
|
|
|
Cool! I'll note that for future reference, thanks!
Cheers!
Mark
|
|
|
|
|
I have created a new button with CreateWindow() and option WS_VISIBLE | WS_CHILD.
How can I modify these options later in the code ? Is it possible?
For example, How can I tell the button that it is WS_OVERLAPPEDWINDOW now?
|
|
|
|
|
You want a button with WS_OVERLAPPED (title bar and border), WS_CAPTION, WS_SYSMENU,
WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles?
Check out the SetWindowLong()/SetWindowLongPtr() APIs.
Mark
|
|
|
|
|
I will look for them, thanks.
If you have a short example , it would be great.
|
|
|
|
|
LONG lCurrentStyle = ::SetWindowLong(hwnd, GWL_STYLE);
lCurrentStyle |= WS_OVERLAPPEDWINDOW;
::SetWindowLong(hwnd, GWL_STYLE, lCurrentStyle);
Check out the docs for SetWindowLong(). You may need to call SetWindowPos() or other API
after setting certain styles.
|
|
|
|
|
Thank you for help!
I understand how it works now. And it works well
Problem solved.
|
|
|
|
|
You can use ModifyStyle , too.
ModifyStyle(0,WS_OVERLAPPEDWINDOW );
|
|
|
|
|
It looks like what I was searching for, but... I can't find it.
I'm not using MFC, CView Cstatic etc...
I'm using "windows.h" with HWND etc...
Where can I find this method or something similar ?
|
|
|
|
|
You need to use SetWindowLong then.
e.g. If you want to add WS_CHILD style to a window you can do like this,
SetWindowLong(hWnd,GWL_STYLE,WS_CHILD);
|
|
|
|
|
Thank you 
|
|
|
|
|
Hi people,
Code C++ with header files included after compile in visual studio 6?
I would like see this code.
Somebody help me?
Thx!!
|
|
|
|
|
John Shaft wrote: Code C++ with header files included after compile in visual studio 6?
I don't understand what you are asking ?
code what ?
|
|
|
|
|
I would like to see source code of header files and pragmas used in my source, when I compile in Visual Studio 6. I wanna see complete source code. Intermediate files?
It's possible?
Sorry by my English.
Thx!

|
|
|
|
|
ok, I get it.
I'm not certain you can do it from WITHIN VC6, or if the command line CL.exe ( or whatever it's called ) can do this.
with G++ ( gnu/linux compiler ) you can call the compiler with the -E switch to preprocess the file.
The keyword here is preprocess, this will "expand all the headers, #defines and other stuff.
for your information this can create a BIG file.
I created the following program :
#include <iostream>
int main()
{
std::cout << "tata";
return 1;
}
and generated the preprocessed file and the file is 600+ K. ( 24000 lines )
have a look at the CL.exe documentation on MSDN to see if there's a switch to preprocess the file.
|
|
|
|