Click here to Skip to main content
15,892,737 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: writing Bitmap data as Binary Into XML file Pin
002comp6-Aug-09 21:28
002comp6-Aug-09 21:28 
GeneralRe: writing Bitmap data as Binary Into XML file Pin
Cedric Moonen6-Aug-09 21:54
Cedric Moonen6-Aug-09 21:54 
AnswerRe: writing Bitmap data as Binary Into XML file Pin
CPallini6-Aug-09 21:11
mveCPallini6-Aug-09 21:11 
QuestionCan CSocket be used in this way? Pin
includeh106-Aug-09 18:30
includeh106-Aug-09 18:30 
AnswerRe: Can CSocket be used in this way? Pin
«_Superman_»6-Aug-09 18:52
professional«_Superman_»6-Aug-09 18:52 
AnswerRe: Can CSocket be used in this way? Pin
Rajesh R Subramanian6-Aug-09 19:46
professionalRajesh R Subramanian6-Aug-09 19:46 
AnswerRe: Can CSocket be used in this way? Pin
Moak8-Aug-09 8:28
Moak8-Aug-09 8:28 
Questionafter calling GetCurrentBuffer(&lBufferSize,NULL), lBufferSize is minus value. Pin
rambojanggoon6-Aug-09 16:52
rambojanggoon6-Aug-09 16:52 
Hi,
to capture video screen in DirectShow , I did as follwing...

it's woring well in case of *.wmv file...
but in case of *.avi didn't work...

After calling ...GetCurrentBuffer(&lBufferSize,NULL);
the value of lBufferSize is minus...(for example -2838382392 )
I don't know why lBufferSize is minus value...

void CTest::play()
{

m_pGB = NULL;
m_pMC = NULL;
m_pVW = NULL;
m_pBV = NULL;
m_pME = NULL;
m_pMS = NULL;
m_pSampleGrabber = NULL;
m_pSG = NULL;

CoInitialize(NULL);

CString m_file;
WCHAR wFileName[MAX_PATH];
TCHAR m_szFileName[MAX_PATH];
m_file = m_,"C:\\cs\\mds\\movie\\a.avi";
#ifndef UNICODE
MultiByteToWideChar(CP_ACP, 0, m_file , -1, wFileName, MAX_PATH) ;
#else
lstrcpy(wFileName, m_szFileName);
#endif

CoCreateInstance(CLSID_FilterGraph,NULL,CLSCTX_INPROC,IID_IGraphBuilder,(void**)&m_pGB);
CoCreateInstance(CLSID_SampleGrabber,NULL,CLSCTX_INPROC,IID_IBaseFilter,(void**)&m_pSampleGrabber);
m_pGB->AddFilter(m_pSampleGrabber,L"Sample Grabber");

AM_MEDIA_TYPE m_pMedia;
ZeroMemory(&m_pMedia,sizeof(m_pMedia));
m_pMedia.majortype = MEDIATYPE_Video;
m_pMedia.subtype = MEDIASUBTYPE_RGB24;

m_pSampleGrabber->QueryInterface(IID_ISampleGrabber,(void**)&m_pSG);
if(m_pSG != NULL)
{
m_pSG->;SetMediaType(&m_pMedia);
m_pSG->SetBufferSamples(TRUE);
}

m_pGB->QueryInterface(IID_IMediaControl,(void**)&m_pMC);
m_pGB->QueryInterface(IID_IVideoWindow,(void**)&m_pVW);
m_pGB->QueryInterface(IID_IBasicVideo,(void**)&m_pBV);
m_pGB->QueryInterface(IID_IMediaEventEx,(void**)&m_pME);
m_pGB->QueryInterface(IID_IMediaSeeking,(void**)&m_pMS);

m_pGB->RenderFile(wFileName,NULL);


m_pMC->Run();

}
void CTest::ScreenShot()
{

m_pSampleGrabber->QueryInterface(IID_ISampleGrabber,(void**)&m_pSG);
if(m_pSG == NULL)
{
return;
}

long lBufferSize;
m_pSG->GetCurrentBuffer(&lBufferSize, NULL);

BYTE* pBuffer = new BYTE[lBufferSize];
if (!pBuffer)
return;

m_pSG->GetCurrentBuffer(&lBufferSize, (long *)pBuffer);
if (m_pSG != NULL)SaveImage(...);

delete pBuffer;
}
AnswerRe: after calling GetCurrentBuffer(&lBufferSize,NULL), lBufferSize is minus value. Pin
Cedric Moonen6-Aug-09 20:29
Cedric Moonen6-Aug-09 20:29 
QuestionUsing a map with an class inherited from pair. Pin
thelonesquirrely6-Aug-09 14:11
thelonesquirrely6-Aug-09 14:11 
AnswerRe: Using a map with an class inherited from pair. Pin
Garth J Lancaster6-Aug-09 14:42
professionalGarth J Lancaster6-Aug-09 14:42 
Questiontime and space complexity? Pin
sam_psycho6-Aug-09 8:35
sam_psycho6-Aug-09 8:35 
AnswerRe: time and space complexity? Pin
Luc Pattyn6-Aug-09 9:04
sitebuilderLuc Pattyn6-Aug-09 9:04 
GeneralRe: time and space complexity? Pin
sam_psycho6-Aug-09 9:38
sam_psycho6-Aug-09 9:38 
AnswerRe: time and space complexity? Pin
CPallini6-Aug-09 10:21
mveCPallini6-Aug-09 10:21 
GeneralRe: time and space complexity? Pin
sam_psycho6-Aug-09 10:29
sam_psycho6-Aug-09 10:29 
AnswerRe: time and space complexity? Pin
RomanMzh6-Aug-09 13:15
RomanMzh6-Aug-09 13:15 
AnswerRe: time and space complexity? Pin
Adam Roderick J6-Aug-09 17:48
Adam Roderick J6-Aug-09 17:48 
QuestionCAsynSocket CWinthread Question Pin
ForNow6-Aug-09 6:39
ForNow6-Aug-09 6:39 
AnswerRe: CAsynSocket CWinthread Question Pin
sashoalm6-Aug-09 22:10
sashoalm6-Aug-09 22:10 
GeneralRe: CAsynSocket CWinthread Question Pin
ForNow7-Aug-09 1:02
ForNow7-Aug-09 1:02 
GeneralRe: CAsynSocket CWinthread Question Pin
sashoalm7-Aug-09 1:50
sashoalm7-Aug-09 1:50 
GeneralRe: CAsynSocket CWinthread Question Pin
ForNow7-Aug-09 12:10
ForNow7-Aug-09 12:10 
GeneralRe: CAsynSocket CWinthread Question Pin
ForNow7-Aug-09 12:18
ForNow7-Aug-09 12:18 
GeneralRe: CAsynSocket CWinthread Question Pin
sashoalm8-Aug-09 1:15
sashoalm8-Aug-09 1:15 

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.