|
Hi there!
Is there any way to figure out the video file width and heigth before loading it using vmr9 or other filters?
Thanks in advance,
Andrew
|
|
|
|
|
Hi
you want the video width height through a filter wether vmr9 or any othr,then note that a Directhow Filter only returns the data when it will receive a MediaSample.
|
|
|
|
|
Hello,
I'm using C++ Builder 2007 prof. from Borland. I will make my own icon's but I can't find my Image Editor. Can sombody help my were I find them. It's not on the CD or. I have the program full instalt.
Jelle.
|
|
|
|
|
While there may be some Builder users here, this is a Visual C++ board,
so you may also want to ask on a Borland-centric board as well
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
can any one help me to solve this problem i am a new leaener to direct show.
i have created custom filetrs and pins and connected them but why it is not able to play the file.
After compiling its not giving any error and running successiflly. but it is not rendering. can any one help me..
here is the code.
/*
BuildingFilter.cpp
This program is to create our own filters
*/
#include <DShow.h>
#include <InitGuid.h>
#include <dmo.h>
//#include <dmoimpl.h>
#include <dmodshow.h>
//audio filters defined
#define INITGUID // have to define this so next line actually creates GUID structure
DEFINE_GUID(CLSID_WmAudioDecoderDmo,0x2eeb4adf, 0x4578, 0x4d10, 0xbc, 0xa7, 0xbb, 0x95, 0x5f, 0x56, 0x32, 0x0a);
DEFINE_GUID(IID_IDMOWrapperFilter,0x52d6f586,0x9f0f,0x4824,0x8f,0xc8,0xe3,0x2c,0xa0,0x49,0x30,0xc2);
//DEFINE_GUID(CLSID_WmAudioDecoderDmo,0x874131cb, 0x4ecc, 0x443b, 0x89, 0x48, 0x74, 0x6b, 0x89, 0x59, 0x5d, 0x20);
DEFINE_GUID(CLSID_WMVVideoDecoder, 0x4A69B442, 0x28BE, 0x4991, 0x96,0x9C, 0xB5, 0x00, 0xAD, 0xF5, 0xD8, 0xA8);
//DEFINE_GUID(CLSID_WmVideoDecoderDmo,0x82d353df, 0x90BD, 0x4382, 0x8b, 0xc2, 0x3f, 0x61, 0x92, 0xB7, 0x6e, 0x34);
void main(void)
{
IGraphBuilder* g_pGraphBuilder = NULL; // assume graph builder already created
IBaseFilter* g_pSource = NULL; //source filter
IBaseFilter* g_pVideoRender = NULL; //video render
IBaseFilter* g_pAudioRender = NULL; //sound render
IFileSourceFilter* pFileSourceInt = NULL;
IBaseFilter *pDmoFilter = NULL;
IBaseFilter *pDmoFilterV = NULL;
IDMOWrapperFilter *g_pAudioParser;
IDMOWrapperFilter *g_pVideoParser;
HRESULT hr;
IMediaControl *gControl = NULL;
IMediaEvent *gEvent = NULL;
IEnumPins* EnumPins = NULL;
IPin* OutPin = NULL;
IPin* InPin = NULL;
ULONG fetched;
PIN_INFO pinfo, pinfoVideoParser, pinfoVideoParserOut, pinfoVideoRenderer;
IEnumPins* EnumPinsV = NULL;
IPin* OutPinV = NULL;
IPin* InPinV = NULL;
ULONG fetchedV;
PIN_INFO pinfoV;
long evCode=10;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph, NULL,CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void **)&g_pGraphBuilder);
hr = g_pGraphBuilder->QueryInterface(IID_IMediaControl, (void **)&gControl);
hr = g_pGraphBuilder->QueryInterface(IID_IMediaEvent, (void **)&gEvent);
CoCreateInstance(CLSID_WMAsfReader, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pSource);
//CoCreateInstance(CLSID_WmAudioDecoderDmo, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pAudioParser);
//CoCreateInstance(CLSID_WmVideoDecoderDmo, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pVideoParser);
CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pAudioRender);
CoCreateInstance(CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pVideoRender);
// Create the DMO audio Wrapper filter.
hr = CoCreateInstance(CLSID_DMOWrapperFilter, NULL, CLSCTX_INPROC, IID_IBaseFilter, reinterpret_cast<void**>(&pDmoFilter));
pDmoFilter->QueryInterface(IID_IDMOWrapperFilter, (void **)&g_pAudioParser);
g_pAudioParser->Init(CLSID_WmAudioDecoderDmo, DMOCATEGORY_AUDIO_DECODER);
g_pAudioParser->Release();
//add DMO audio filter to the filter graph.
g_pGraphBuilder->AddFilter(g_pSource,NULL);
g_pGraphBuilder->AddFilter(pDmoFilter ,L"Audio transfer");
// Create the DMO video Wrapper filter.
hr = CoCreateInstance(CLSID_DMOWrapperFilter, NULL, CLSCTX_INPROC, IID_IBaseFilter, reinterpret_cast<void**>(&pDmoFilterV));
pDmoFilterV->QueryInterface(IID_IDMOWrapperFilter, (void **)&g_pVideoParser);
g_pVideoParser->Init(CLSID_WmAudioDecoderDmo, DMOCATEGORY_VIDEO_DECODER);
g_pVideoParser->Release();
//add the DMO video wrapper filter.
g_pGraphBuilder->AddFilter(pDmoFilterV ,L"Video transfer");
// g_pGraphBuilder->AddFilter(g_pVideoParser, NULL);
g_pGraphBuilder->AddFilter(g_pAudioRender,NULL);
g_pGraphBuilder->AddFilter(g_pVideoRender,NULL);
hr = g_pSource->QueryInterface(IID_IFileSourceFilter, (void**)&pFileSourceInt);
hr = pFileSourceInt->Load(L"C:\\Documents and Settings\\amiyakumar.d\\My Documents\\Jog_Top-Down_View\\video.wmv",NULL);
if( hr == E_FAIL)
printf("\n Failed to open the file\n");
// find 2 source output pins
g_pSource->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &OutPin, &fetched); //1 pins for source audio
OutPin->QueryPinInfo(&pinfo);
EnumPins->Next(1, &OutPinV, &fetched); //1 pins for source video
OutPinV->QueryPinInfo(&pinfoV);
/*
// find audio parser input
pDmoFilter->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPin, &fetched);
InPin->QueryPinInfo(&pinfo);
pinfo.pFilter->Release();
if(pinfo.dir == PINDIR_OUTPUT)
{
InPin->Release();
EnumPins->Next(1, &InPin, &fetched);
}
//connect
g_pGraphBuilder->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
//pinfo.pFilter->Release(); // make sure you release the returned IBaseFilter interface
//pinfoV.pFilter->Release();
if (pinfo.dir == PINDIR_INPUT) // check if we have wrong pin (not input pin)
{
OutPin->Release();
EnumPins->Next(1, &OutPin, &fetched); // if so, get next pin
}
EnumPins->Release();
// find audio parser output
pDmoFilter->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &OutPin, &fetched);
InPin->QueryPinInfo(&pinfo);
pinfo.pFilter->Release();
if (pinfo.dir == PINDIR_INPUT)
{
OutPin->Release();
EnumPins->Next(1, &OutPin, &fetched);
InPin->QueryPinInfo(&pinfo);
}
EnumPins->Release();
// find audio render input
g_pAudioRender->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPin, &fetched);
InPin->QueryPinInfo(&pinfo);
pinfo.pFilter->Release();
if(pinfo.dir == PINDIR_OUTPUT)
{
InPin->Release();
EnumPins->Next(1, &InPin, &fetched);
}
// connect
g_pGraphBuilder->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
*/
// find video parser input
pDmoFilterV->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPinV, &fetchedV);
InPinV->QueryPinInfo(&pinfoVideoParser);
//pinfoVideoParser.pFilter->Release();
/*
if(pinfoVideoParser.dir == PINDIR_OUTPUT)
{
InPinV->Release();
EnumPins->Next(1, &InPinV, &fetchedV);
}
*/
// connect
g_pGraphBuilder->Connect(OutPinV, InPinV);
//InPinV->Release();
//OutPin->Release();
// find video parser output
pDmoFilterV->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &OutPinV, &fetchedV);
OutPinV->QueryPinInfo(&pinfoVideoParserOut);
while(pinfoVideoParserOut.dir == PINDIR_INPUT)
{
EnumPins->Next(1, &OutPinV, &fetchedV);
OutPinV->QueryPinInfo(&pinfoVideoParserOut);
}
//pinfoVideoParserOut.pFilter->Release();
// find video render input
g_pVideoRender->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPinV, &fetchedV);
InPinV->QueryPinInfo(&pinfoVideoRenderer);
//pinfoVideoRenderer.pFilter->Release();
/*
if(pinfoVideoRenderer.dir == PINDIR_OUTPUT)
{
InPinV->Release();
EnumPinsV->Next(1, &InPinV, &fetchedV);
}
*/
// connect
g_pGraphBuilder->Connect(OutPinV, InPinV);
//InPinV->Release();
//OutPinV->Release();
// hr = g_pGraphBuilder->QueryInterface(IID_IMediaControl, (void **)&gControl);
// hr = g_pGraphBuilder->QueryInterface(IID_IMediaEvent, (void **)&gEvent);
hr = gControl->Run();
gEvent->WaitForCompletion(INFINITE, &evCode);
hr = gControl->Stop();
gControl->Release();
gEvent->Release();
pFileSourceInt->Release();
g_pAudioRender->Release();
// g_pVideoRender->Release();
// g_pAudioParser->Release();
// g_pVideoParser->Release();
g_pSource->Release();
g_pGraphBuilder->Release();
CoUninitialize();
}
amiya kumar das
|
|
|
|
|
Hello,
I wonder if anyone out there has some experience in using color management with GDI+?
Specifically, when retrieving pixels from a GDI+ Bitmap using the LockBits/UnlockBits methods with a BitmapData object, should I assume that the RGB values in the BitmapData scan0 buffer are in linear light RGB space or gamma corrected RGB space? If gamma corrected, what white point/specific RGB space is used? Does it depend on how the Bitmap was constructed? Here are specific situations I need to know about:
- If a GDI+ Bitmap is constructed using one of the methods that indicates embedded color management will be used, such as Bitmap::Bitmap(const WCHAR *filename,BOOL useIcm), how does that Bitmap apply color correction when useIcm is set to TRUE? Does it hand me gamma corrected RGB values in the BitmapData scan0 buffer, or linear light RGB values? What does it hand me if useIcm is set to FALSE?
- If I later pass new data to the Bitmap above (constructed with useIcm = TRUE), using my own buffer and the ImageLockModeUserInputBuf flag, do I have to do my own gamma correction? That is, will the Bitmap object assume my data is linear RGB or gamma corrected RGB?
- If I then draw the Bitmap to the screen or to a printer with a Graphics object constructed using Graphics::Graphics(HWND hwnd, BOOL icm), with icm set to TRUE, does the Graphics object expect the data in the Bitmap object to be gamma corrected or linear RGB? With what white point? Does it depend on how the Bitmap was constructed? What if the Graphics object was created with icm set to FALSE? What if either the Bitmap or the Graphics object uses ICM, and the other doesn't?
- If I now use one of the Graphics::DrawImage methods with an ImageAttributes object, is the RGB data in the Bitmap object assumed to be in linear RGB? How do all these things interact?
Excuse me if there is already documentation on this somewhere, but I have been unable to find it. I would very much like to know if there is some comprehensive documentation somewhere about how GDI+ uses ICM.
Any information would be appreciated, but especially on the topic of what to do when passing my own pixel buffer to a Bitmap object using a BitmapData object with the ImageLockModeUserInputBuf flag set. Do I have to do all the color management on the data myself in that case? Or would that cause problems because the Bitmap expects to do that itself?
Thanks for any help you can give.
|
|
|
|
|
plz can someone help me to get a FREE version of infragistics NetAdbantage for .Net from onother source of "www.infragistics.com" ?
|
|
|
|
|
Hi how do create fonts in font lab. Are there a step by step instructions I can follow?
|
|
|
|
|
I have no idea where you got the idea that this site supports FontLab. Try a better source of information on it, like this[^].
|
|
|
|
|
|
Mark Salsbery wrote: CodeProject - Your Visual Studio and .NET Resource - and Typography?
CodeProject Atlas -- Supporting the world since 2007
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I'm experimenting with DirectX but am having trouble finding free software to create model(.x) files.
If anyone knows of any good free software (yes i'm a poor student, so I can't afford professional stuff) I'd love to know about it.
I do have access to Solidworks (2006 SP4.1), none of the lecturers round here seem to know if you can make .x files with it?
Can anyone help me?
Mark.
|
|
|
|
|
MarkBrock wrote: I'm experimenting with DirectX but am having trouble finding free software to create model(.x) files.
http://www.blender.org/features-gallery/features/[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Thanks heaps!
that's exactly what I've been looking for .
Mark.
|
|
|
|
|
MarkBrock wrote: that's exactly what I've been looking for
Its a good product, but it is not alone, so if you find something it can't do, ask. There are about half a dozen free modelers of various quality, more so than half a dozen in the low quality area (or too young to know). There are translators, and various processing/modifiers to do things blender does not.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
This[^] might help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for the link Pete, the software looks really good.
Anything that is easier to use than Blender will make me a very happy man at the moment .
Mark.
|
|
|
|
|
Performing quantum physics with a nail brush and a small dog is easier than using Blender. I do a lot of 3D work and I have problems with Blender. I far prefer to use SoftImage|XSI and Maya to do the work. If you had the money, I would recommend Cinema4D because it is by far the easiest of these applications to use.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I posted this in the C# forum and then saw this forum on Graphics..(probably is better placed here, please excuse the double post)
I'm trying to draw lines that will show up as overlays on top of the buttons that I am drawing. The buttons are just standard buttons with images on them, but they occlude the lines when I draw the lines in the Form on paint method. Is there a way to paint the lines after the buttons have been drawn, in order to make the lines visible on top of the buttons?
I thought of a transparent form overlayed that I could draw to, but I thought that this would stop me from interfacing with the buttons.
Any Ideas?
James
|
|
|
|
|
Painting on the form doesn't work, because all form drawing takes place on a layer behind the controls. I see two possible solutions, depending on what you're trying to accomplish...
1) If you just need to draw something on the button itself, try subclassing the button and inserting your own OnPaint code (After a base.OnPaint call)
2) If you're drawing on both the form -and- the button, like an arrow pointing to the control, your transparent form idea might work.
It might take some tweaking, but you can override the WndProc method to pass the WM_NCHITTEST message (I think that's the one), always returning the value for Nothing (I think the constant is called HTNOTHING).
Windows calls this when the user tries to interact with something, to determine which process/thread/control should receive the event. This basically tells it that your form isn't really there, as far as input is concerned.
|
|
|
|
|
Hey friends..
CDC::Arc/CDC::Pie are not supported in Windows CE..
I have tried to draw Arc using simple for loop and x = cos(Angle) * radius...
and then CDC::SetPixel used to Glow it...
but
there is Aliasing problem...
Is there any efficient Algorith to Draw Arc/Pie
Thanks in advance...:
|
|
|
|
|
Hi!
I having a bit of trouble with drawing an arc and I hope somebody
here could give me a hint.
What I want is to draw an arc given the following parameters: a
bounding box (x1,y1,x2,y2) and a start- and end-angle.
The center point of the arc is the same as the center point of
the bounding box, and the start- and end-angle determines how
long the arc should be.
In example, a square bounding box and a start-angle of 0 and end-
angle of 360 will give a perfect circle (the inscribed circle of
the bounding box), while a "squashed" box and angles of 110 - 200
will give a quarter of an equally squashed circle (starting at 110
degrees).
Moreover, I would like to draw filled arcs (like a pie slice)
as well.
Can anybody give me a hint or an algorithm to look at? I've looked
at the normal Bresenham circle algo and think it should be possible
to adapt this, but I've been unsuccessfull so far.
WinCE Does not support MFC's ARC/Pie .
|
|
|
|
|
Hi!
i would like know about the possibility of programming 3d graphs in vb (6 if is possible) without use directx, i know what is possible in OpenGl, but i not know a good about this theme, someboy can tell me where i can found more information?, thanks very much for your help.
|
|
|
|
|
haggenx wrote: programming 3d graphs in vb (6 if is possible) without use directx
I have never attempted it, but you can download the vb sources from Nehe and "try" them to see if they match what ever level VB you are attempting to use. http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=05[^] (scroll to the bottom for all the sources for the same project)
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
|