|
See here[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
please someone can let me know how i can capture data from FM tuner card.
either using windows wave APIs, directShow or directSound.
Thanks in Advance
|
|
|
|
|
Have you tried searching for "audio capture" articles here at CodeProject?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi. I have always wanted to create custom themes/skins for WindowsXP and i recently downloaded WindowBlinds to do just that. I decided to delete it but instead want to know how to actually apply a skin (theme) to a single application. WindowBlinds can do it but i'm not sure how and i don't like the idea of a program messing around with my system files. I thought that i could create a file (.theme or .msstyle ?) and apply it. Does anyone know how to or more importantly where i could find how to do it. Just to be clear, i only want to skin one application not the whole desktop.
thanx
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
I'm looking for a technique to embed an avi movie and a jpg image in the same space upon an onclick command for one or the other. I have the script to do either but need to be able to do both.
thanks,
brucedw
|
|
|
|
|
Hi everybody...
I've finally got to glue a direct3d render into a mfc dialog box...
Now, my next endevour....
I would really like to get my animation background ( i think it's called backbuffer) to be transparent, please...
I can set the background to a specific colour alright
(with: d3ddev->Clear(0,NULL,D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); )
, but i wasn't able to make it transparent
any thoughts? ideas? critics? proposals? spitting? lol
anyway, good night and thanks in advance
Nuno
|
|
|
|
|
gosh....
i love you guys...
your thoughts have been so crystal clear that can barelly read them...
( considering some non-expensive reading-rehab clinics nearby )
^^
Nuno
|
|
|
|
|
Hi to all of you,
I am a new programmer on OpenGL.
I am currently working on an application where I have a Debian Linux PC with two usb industrial cameras,acquiring images at a rate of 25fps. Each image data is sent by sockets to a windows PC. The format of the received buffer at the windows PC side is buffer[0]='top left image pixel', buffer[640*480]='bottom right image pixel'. I want know to proccess these buffers an display a video on an OpenGL window at a similar frame rate, or even lower,i.e. even 5-10 frames per second will do for me.
I am using Dev-C++ on the windows PC.
Can anynone advised me with an appropriate approach?,i.e. what is I mean the most appropriate method to follow.
Cheers,
DoctorDoctor
|
|
|
|
|
DoctorDoctor wrote: Can anynone advised me with an appropriate approach?,i.e. what is I mean the most appropriate method to follow.
The easiest, and one line solution, for you is glDrawPixels()[^], you have the right format, direction is easily manipulated with glPixelZoom()[^] and it is compatible with all levels of OpenGL.
but... it does not make it available as a texture. Do you need it as a texture within OpenGL? what graphics card do you have? There are several solutions here, the best are avail on recent generation cards.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Yes,
I need it as texture since its a 2D object. I managed to display a single frame. How can I redraw on the same window?
I am using
myInit();//reads in the pixels
glutDisplayFunc(myDisplay);// display callback function
glutMainLoop();// shows the window and loops to accepts and processes input events
Myproblem is that now I need to continue displaying frames on the same opened OpenGL window, in order for it to look like video.
|
|
|
|
|
|
I'm a newer in directx ,I cant find many directx functions and structures in msdn,likeLPDIRECTDRAWSURFACE7, BltFast. please who can tell me where i can find them?
|
|
|
|
|
Check the documentation to include which file to include and make sure that the include directory of DirectX SDK is there in the Include Directories of Visuatio Studio (Check Tools->Option Menu)
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Instead of MSDN, you'll probably want the DirectX SDK (as sarath mentioned) - you'll find more
than you ever wanted to know in that SDK
See Microsoft DirectX Downloads[^]
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
heloo guys..thanks alot u really doing agreat job ..any way i have finally created strings for each shape (lines,polygons,..) each string contains informations about the shape( x1,y1,x2,y2,R,G,B,pen width) ..Now how can i make my prog read from the text and draw the shapes ..as example the line string :
public void AddSv(Line l , ref string str)
{
if(drawwhat==1)// as one means lines
str +="1"+"\n"+l.First.X.ToString()+"\n"+
l.First.Y.ToString()+"\n"+
l.Second.X.ToString()+"\n"+
l.Second.Y.ToString()+"\n"+
l.Pen.Color.R.ToString()+"\n"+
l.Pen.Color.G.ToString()+"\n"+
l.Pen.Color.B.ToString()+"\n"+
l.Pen.Width.ToString()+"\n\n";
after i draw the line i click on save to send the informations to the text :
private void button1_Click(object sender, System.EventArgs e)
{
//save
System.IO.FileStream fs = new System.IO.FileStream("c:\\graphics.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
StreamWriter streamWriter=new StreamWriter(fs);
streamWriter.WriteLine(LineSv);
streamWriter.Flush();
streamWriter.Close();
fs.Close();
}
Regards;);
|
|
|
|
|
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
i didnt get any usefull answer ..plzz i will appreciate any helppp !;)
|
|
|
|
|
Sorry I didn't see that you asked a question
Can't you use a StreamReader to read the lines? You can use the System.Convert class to
convert the strings back into the appropriate types.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Please don't cross post, choose a forum and stick to it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have an IP camera hooked up to my laptop - locally I can see video. How do I re-broadcast the video out my 2 network connection so it can be seen from the web, or at least another computer.
What I need is a netmeeting type project that can use an IP camera instead of a capture card.
tks
xlthim
|
|
|
|
|
Try hunting for IP camera Sony, www.axis.com might be a good sample.. alternatively, you can use your webcam to capture video and stream it over HTTP.. is you are looking for ready product for that.. LEADTOOLS might be of help.. if you have looking for sample code and want to learn the how-to of it, then you already are at codeproject.. so what are you waiting for buddy...
|
|
|
|
|
I've done that for some cameras that contain a web server in them (usually IP cameras do). All you have to do is implement the browser side. In my case a simple GET or POST is enough for the camera to start outputing JPEG sequences which you can forward as you like.
I've also encoutered other more complex servers that require the browser to install ActiveX controlls or something like that. I didn't want to go to all that trouble, so I just sniffed the packets with Ethereal, then saved them so that I can use them in my application. I don't know how they work (because I didn't bother looking at their contents), but they do.
Rilhas
|
|
|
|
|
Hi,
I'm looking for a plugin that allows to open Corel CMX files. I know this is a rather unusual request, but any help would be greatly appreciated.
Thanks in advance.
|
|
|
|
|
I need to create audio peaks for the audio stream from an AVI. For this I intend to use DirectShow by using SampleGrabber. I adapted some of the samples from the SDK.
There is only one problem here: I receive the audio samples in real-time (i.e. the same as I would be playing the file), but I need this process to be much faster. I was advised to set the graph SyncSource to NULL and by this the samples will be processed as quickly as possible. Unfortunatelly I get no effect by doing this.
I'm attaching here the code I'm using, perhaps I'm doing something wrong and somebody can help me out
Thanks alot !
#include <windows.h>
#include <streams.h>
#include <stdio.h>
#include <atlbase.h>
#include <qedit.h>
int GrabBitmaps(TCHAR * szFile);
HRESULT GetPin(IBaseFilter * pFilter, PIN_DIRECTION dirrequired, int iNum, IPin **ppPin);
IPin * GetInPin ( IBaseFilter *pFilter, int Num );
IPin * GetOutPin( IBaseFilter *pFilter, int Num );
class CSampleGrabberCB : public ISampleGrabberCB {
public:
STDMETHODIMP_(ULONG) AddRef() { return 2; }
STDMETHODIMP_(ULONG) Release() { return 1; }
STDMETHODIMP QueryInterface(REFIID riid, void ** ppv) {
CheckPointer(ppv,E_POINTER);
if( riid == IID_ISampleGrabberCB || riid == IID_IUnknown ) {
*ppv = (void *) static_cast<ISampleGrabberCB*> ( this );
return NOERROR;
}
return E_NOINTERFACE;
}
STDMETHODIMP SampleCB( double SampleTime, IMediaSample * pSample ) {return 0;}
STDMETHODIMP BufferCB( double SampleTime, BYTE * pBuffer, long BufferSize ) {
_tprintf(TEXT("Found a sample at %f s\t[%ld]\r\n"), SampleTime , BufferSize );
return 0;
}
}
int _tmain(int argc, TCHAR* argv[]) {
if( argc != 2 || !argv || !argv[1] ) {
_tprintf( TEXT("GrabBitmaps: You must specify a media filename!\r\n") );
_tprintf( TEXT("Usage: GrabBitmaps Filename\r\n"));
return 0;
}
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
TCHAR szFile[MAX_PATH];
_tcsncpy(szFile, argv[1], MAX_PATH-1);
szFile[MAX_PATH-1] = 0;
int nSuccess = GrabBitmaps(szFile);
CoUninitialize();
return nSuccess;
}
int GrabBitmaps(TCHAR * szFile ) {
USES_CONVERSION;
CComPtr< ISampleGrabber > pGrabber;
CComPtr< IBaseFilter > pSource;
CComPtr< IGraphBuilder > pGraph;
CComPtr< IVideoWindow > pVideoWindow;
HRESULT hr;
if (!szFile) return -1;
_tprintf(TEXT("Grabbing bitmaps from %s.\r\n"), szFile);
pGrabber.CoCreateInstance( CLSID_SampleGrabber );
if( !pGrabber ) {
_tprintf( TEXT("Could not create CLSID_SampleGrabber\r\n") );
return -1;
}
CComQIPtr<IBaseFilter, &IID_IBaseFilter> pGrabberBase(pGrabber);
pSource.CoCreateInstance(CLSID_AsyncReader);
if (!pSource) {
_tprintf( TEXT("Could not create source filter\r\n") );
return -1;
}
pGraph.CoCreateInstance(CLSID_FilterGraph);
if( !pGraph ) {
_tprintf( TEXT("Could not not create the graph\r\n") );
return -1;
}
hr = pGraph->AddFilter( pSource, L"Source" );
hr = pGraph->AddFilter( pGrabberBase, L"Grabber" );
CComQIPtr<IFileSourceFilter, &IID_IFileSourceFilter> pLoad(pSource);
hr = pLoad->Load( T2W( szFile ), NULL );
if (FAILED(hr)) {
_tprintf( TEXT("Could not load the media file\r\n") );
return -1;
}
CMediaType GrabType;
GrabType.SetType(&MEDIATYPE_Audio);
GrabType.SetSubtype(&MEDIASUBTYPE_PCM);
GrabType.SetFormatType(&FORMAT_WaveFormatEx);
hr = pGrabber->SetMediaType(&GrabType);
CComPtr< IPin > pSourcePin;
CComPtr< IPin > pGrabPin;
pSourcePin = GetOutPin( pSource, 0 );
pGrabPin = GetInPin( pGrabberBase, 0 );
hr = pGraph->Connect( pSourcePin, pGrabPin );
if( FAILED( hr ) ) {
_tprintf( TEXT("Could not connect source filter to grabber\r\n") );
return -1;
}
CComPtr <IPin> pGrabOutPin = GetOutPin( pGrabberBase, 0 );
hr = pGraph->Render( pGrabOutPin );
if( FAILED( hr ) ) {
_tprintf( TEXT("Could not render grabber output pin\r\n") );
return -1;
}
hr = pGrabber->SetBufferSamples( FALSE );
hr = pGrabber->SetOneShot(FALSE);
CSampleGrabberCB CB;
hr = pGrabber->SetCallback(&CB, 1);
CComQIPtr<IMediaFilter, &IID_IMediaFilter> pFilter(pGraph);
hr = pFilter->SetSyncSource(NULL);
if (FAILED(hr)) printf("SetNoClock: Failed to set sync source! hr=0x%x\n", hr);
CComQIPtr<IVideoWindow, &IID_IVideoWindow> pWindow(pGraph);
if (pWindow) hr = pWindow->put_AutoShow(OAFALSE);
CComQIPtr< IMediaControl, &IID_IMediaControl > pControl( pGraph );
hr = pControl->Run( );
CComQIPtr< IMediaEvent, &IID_IMediaEvent > pEvent( pGraph );
long EvCode = 0;
hr = pEvent->WaitForCompletion( INFINITE, &EvCode );
_tprintf(TEXT("Sample grabbing complete.\r\n"));
return 0;
}
HRESULT GetPin( IBaseFilter * pFilter, PIN_DIRECTION dirrequired, int iNum, IPin **ppPin) {
CComPtr< IEnumPins > pEnum;
*ppPin = NULL;
HRESULT hr = pFilter->EnumPins(&pEnum);
if(FAILED(hr)) return hr;
ULONG ulFound;
IPin *pPin;
hr = E_FAIL;
while (S_OK == pEnum->Next(1, &pPin, &ulFound)) {
PIN_DIRECTION pindir = (PIN_DIRECTION)3;
pPin->QueryDirection(&pindir);
if (pindir == dirrequired) {
if (iNum == 0) {
*ppPin = pPin;
hr = S_OK;
break;
}
iNum--;
}
pPin->Release();
}
return hr;
}
IPin * GetInPin( IBaseFilter * pFilter, int nPin ) {
CComPtr<IPin> pComPin=0;
GetPin(pFilter, PINDIR_INPUT, nPin, &pComPin);
return pComPin;
}
IPin * GetOutPin( IBaseFilter * pFilter, int nPin ) {
CComPtr<IPin> pComPin=0;
GetPin(pFilter, PINDIR_OUTPUT, nPin, &pComPin);
return pComPin;
}
|
|
|
|
|
What do you need to do with the output - does it need to be rendered? Is there a video stream
as well as the audio stream?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|