Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help with Template Container of Pointers to any type Pin
John R. Shaw3-Jun-10 12:08
John R. Shaw3-Jun-10 12:08 
GeneralRe: Help with Template Container of Pointers to any type Pin
zZDimonZz7-Jun-10 6:29
zZDimonZz7-Jun-10 6:29 
AnswerRe: Help with Template Container of Pointers to any type Pin
Stephen Hewitt3-Jun-10 13:58
Stephen Hewitt3-Jun-10 13:58 
AnswerRe: Help with Template Container of Pointers to any type Pin
Aescleal3-Jun-10 20:50
Aescleal3-Jun-10 20:50 
NewsBusco programadores C++ / DirectX - Motor videojuegos Pin
ThundThund3-Jun-10 8:28
ThundThund3-Jun-10 8:28 
GeneralRe: Busco programadores C++ / DirectX - Motor videojuegos Pin
loyal ginger3-Jun-10 9:42
loyal ginger3-Jun-10 9:42 
GeneralRe: Busco programadores C++ / DirectX - Motor videojuegos Pin
ThundThund3-Jun-10 9:43
ThundThund3-Jun-10 9:43 
QuestionDirectshow question Pin
godspeed1233-Jun-10 7:59
godspeed1233-Jun-10 7:59 
Hi
I have set up a video and connected it to a sample grabber correctly, so that I can see the image, but I cant get sound out, I have tried to render sound, but dont know how to connect it up, any help would be greatly appreciated.

I have attached the following code snippet that shows what I have.

HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);

hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
hr = pGraph->QueryInterface(IID_IMediaEventEx, (void **)&pEvent);
hr = pGraph->QueryInterface(IID_IBasicAudio, reinterpret_cast<void**>(&m_pAudio));
hr = pGraph->QueryInterface(IID_IMediaSeeking, reinterpret_cast<void**>(&pSeeking));

hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pGrabberF);

if (FAILED(hr))
{
// Return an error.
}
hr = pGraph->AddFilter(pGrabberF, L"Sample Grabber");

CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pSoundRenderer);
hr = pGraph->AddFilter(g_pSoundRenderer, NULL);

// hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pGrabberF);

// hr = pGraph->AddFilter(
if (FAILED(hr) )
{
// Return an error.
}

pGrabberF->QueryInterface(IID_ISampleGrabber, (void**)&pGrabber);

//ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Stream;
//mt.subtype = GUID_NULL;//MEDIASUBTYPE_RGB24;
hr = pGrabber->SetMediaType(&mt);


hr = pGraph->AddSourceFilter(fileName.AllocSysString(), L"Source", &pSrc);
if (FAILED(hr))
{
// Return an error code.
}
hr = ConnectFilters(pGraph, pSrc, pGrabberF);

// Create the NULL renderer and connect

hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, reinterpret_cast<void**>(&m_pNullRenderer));
hr = pGraph->AddFilter(m_pNullRenderer, L"NullRenderer");
hr = ConnectFilters(pGraph, pGrabberF, m_pNullRenderer);
AnswerRe: Directshow question Pin
Hristo-Bojilov4-Jun-10 9:01
Hristo-Bojilov4-Jun-10 9:01 
QuestionVS2010 - project setup Pin
Ed SHaw3-Jun-10 0:59
Ed SHaw3-Jun-10 0:59 
AnswerRe: VS2010 - project setup Pin
«_Superman_»3-Jun-10 1:05
professional«_Superman_»3-Jun-10 1:05 
QuestionGDI leak in "Tree View" with TVS_CHECKBOXES property Pin
139135068422-Jun-10 21:57
139135068422-Jun-10 21:57 
AnswerRe: GDI leak in "Tree View" with TVS_CHECKBOXES property Pin
139135068423-Jun-10 0:24
139135068423-Jun-10 0:24 
QuestionCommandLine execution problem Pin
krishna_CP2-Jun-10 21:04
krishna_CP2-Jun-10 21:04 
AnswerRe: CommandLine execution problem Pin
Richard MacCutchan2-Jun-10 21:13
mveRichard MacCutchan2-Jun-10 21:13 
AnswerRe: CommandLine execution problem Pin
KarstenK2-Jun-10 21:32
mveKarstenK2-Jun-10 21:32 
GeneralRe: CommandLine execution problem DOS Error code 1073741819 Pin
krishna_CP2-Jun-10 22:39
krishna_CP2-Jun-10 22:39 
GeneralRe: CommandLine execution problem DOS Error code 1073741819 Pin
KarstenK2-Jun-10 22:49
mveKarstenK2-Jun-10 22:49 
QuestionLoading bitmap in Dialog in OnPaint() Pin
Anu_Bala2-Jun-10 18:00
Anu_Bala2-Jun-10 18:00 
AnswerRe: Loading bitmap in Dialog in OnPaint() Pin
Aescleal2-Jun-10 20:34
Aescleal2-Jun-10 20:34 
AnswerRe: Loading bitmap in Dialog in OnPaint() Pin
Niklas L2-Jun-10 21:03
Niklas L2-Jun-10 21:03 
AnswerRe: Loading bitmap in Dialog in OnPaint() Pin
KarstenK2-Jun-10 21:35
mveKarstenK2-Jun-10 21:35 
AnswerRe: Loading bitmap in Dialog in OnPaint() Pin
CPallini2-Jun-10 21:36
mveCPallini2-Jun-10 21:36 
Questionconverting visual c++ 6 to visual studio 2010 error message error C1083: Cannot open source file No such file or directory Pin
ywimmer2-Jun-10 15:46
ywimmer2-Jun-10 15:46 
AnswerRe: converting visual c++ 6 to visual studio 2010 error message error C1083: Cannot open source file No such file or directory Pin
Anthony Mushrow2-Jun-10 17:00
professionalAnthony Mushrow2-Jun-10 17:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.