Click here to Skip to main content
15,909,896 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: winInet - FTP - overlapped i/o operation in progress - Pin
Jayapal Chandran17-Jul-07 9:31
Jayapal Chandran17-Jul-07 9:31 
QuestionRe: winInet - FTP - overlapped i/o operation in progress - Pin
Jayapal Chandran19-Jul-07 5:39
Jayapal Chandran19-Jul-07 5:39 
AnswerRe: winInet - FTP - overlapped i/o operation in progress - Pin
Mark Salsbery19-Jul-07 6:02
Mark Salsbery19-Jul-07 6:02 
GeneralRe: winInet - FTP - overlapped i/o operation in progress - Pin
Jayapal Chandran19-Jul-07 7:25
Jayapal Chandran19-Jul-07 7:25 
GeneralRe: winInet - FTP - overlapped i/o operation in progress - Pin
Mark Salsbery19-Jul-07 7:31
Mark Salsbery19-Jul-07 7:31 
GeneralRe: winInet - FTP - overlapped i/o operation in progress - Pin
Jayapal Chandran19-Jul-07 8:12
Jayapal Chandran19-Jul-07 8:12 
QuestionRe: winInet - FTP - overlapped i/o operation in progress - Pin
Jayapal Chandran24-Jul-07 3:13
Jayapal Chandran24-Jul-07 3:13 
Questionhelp: no audio in directshow DES Pin
liur1717-Jul-07 5:33
liur1717-Jul-07 5:33 
I wrote a program to trim a segment mpeg file to avi file, the video in the avi file is ok, but I can't output the audio into it. when I try to find out the output pin of the audio group, it returns error code:"the group does not has output pin", should I exract audio from mpeg file to a new file then add it to Timeline? please give any suggestion. my code is following:
//Video
hr = pTL->CreateEmptyNode(&pVideoGroupObj, TIMELINE_MAJOR_TYPE_GROUP);
hr = pVideoGroupObj->QueryInterface(IID_IAMTimelineGroup, (void **)&pVideoGroup);
AM_MEDIA_TYPE mtVideo;
ZeroMemory(&mtVideo, sizeof(AM_MEDIA_TYPE));
mtVideo.majortype = MEDIATYPE_Video;
mtVideo.subtype = MEDIASUBTYPE_RGB555;
mtVideo.pbFormat = (BYTE*)CoTaskMemAlloc(sizeof(VIDEOINFOHEADER));

VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADER*)mtVideo.pbFormat;
ZeroMemory(pVideoHeader, sizeof(VIDEOINFOHEADER));
//the m_mtSrcVideo is AM_MEDIA_TYPE info. gotten from mpeg file.
VIDEOINFOHEADER *pVideoHeader0 = (VIDEOINFOHEADER*)m_mtSrcVideo.pbFormat;
pVideoHeader->bmiHeader.biBitCount = pVideoHeader0->bmiHeader.biBitCount;
pVideoHeader->bmiHeader.biWidth = pVideoHeader0->bmiHeader.biWidth;
pVideoHeader->bmiHeader.biHeight = pVideoHeader0->bmiHeader.biHeight;
pVideoHeader->bmiHeader.biPlanes = pVideoHeader0->bmiHeader.biPlanes;
pVideoHeader->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
pVideoHeader->bmiHeader.biSizeImage = DIBSIZE(pVideoHeader->bmiHeader);
mtVideo.formattype = FORMAT_VideoInfo;
mtVideo.cbFormat = sizeof(VIDEOINFOHEADER);
mtVideo.bFixedSizeSamples = TRUE;
mtVideo.lSampleSize = DIBSIZE(pVideoHeader->bmiHeader);
hr = pVideoGroup->SetMediaType(&mtVideo);

hr = pTL->AddGroup(pVideoGroupObj);

hr = pTL->CreateEmptyNode(&pVideoTrackObj, TIMELINE_MAJOR_TYPE_TRACK);

hr = pVideoGroup->QueryInterface(IID_IAMTimelineComp, (void **)&pVideoComp);

hr = pVideoComp->VTrackInsBefore(pVideoTrackObj, 0);
hr = pVideoTrackObj->QueryInterface(IID_IAMTimelineTrack, (void **)&pVideoTrack);

hr = pTL->CreateEmptyNode(&pVideoSourceObj, TIMELINE_MAJOR_TYPE_SOURCE);

hr = pVideoSourceObj->QueryInterface(IID_IAMTimelineSrc, (void **)&pVideoSource);

//Audio
hr = pTL->CreateEmptyNode(&pAudioGroupObj, TIMELINE_MAJOR_TYPE_GROUP);

hr = pAudioGroupObj->QueryInterface(IID_IAMTimelineGroup, (void **)&pAudioGroup);

AM_MEDIA_TYPE mtAudio;
ZeroMemory(&mtAudio, sizeof(AM_MEDIA_TYPE));
mtVideo.majortype = MEDIATYPE_Audio;
mtAudio.subtype = MEDIASUBTYPE_PCM;
mtAudio.bFixedSizeSamples = m_mtSrcAudio.bFixedSizeSamples;
//the m_mtSrcAudio is AM_MEDIA_TYPE info. gotten from mpeg file.
mtAudio.lSampleSize = m_mtSrcAudio.lSampleSize;
mtAudio.formattype = FORMAT_WaveFormatEx;
mtAudio.cbFormat = sizeof(WAVEFORMATEX);
WAVEFORMATEX wf;
ZeroMemory(&wf, sizeof(wf));

WAVEFORMATEX *pwf = (WAVEFORMATEX *)m_mtSrcAudio.pbFormat;
wf.nChannels = pwf->nChannels;
wf.nSamplesPerSec = pwf->nSamplesPerSec;
wf.wBitsPerSample = pwf->wBitsPerSample;
wf.nAvgBytesPerSec = pwf->nAvgBytesPerSec;
wf.nBlockAlign = pwf->nBlockAlign;
wf.wFormatTag = WAVE_FORMAT_PCM;
mtAudio.pbFormat = (BYTE *)&wf;

hr = pAudioGroup->SetMediaType(&mtAudio);

hr = pTL->AddGroup(pAudioGroupObj);

hr = pTL->CreateEmptyNode(&pAudioTrackObj, TIMELINE_MAJOR_TYPE_TRACK);

hr = pAudioGroup->QueryInterface(IID_IAMTimelineComp, (void **)&pAudioComp);

hr = pAudioComp->VTrackInsBefore(pAudioTrackObj, 0);

hr = pAudioTrackObj->QueryInterface(IID_IAMTimelineTrack, (void **)&pAudioTrack);

hr = pTL->CreateEmptyNode(&pAudioSourceObj, TIMELINE_MAJOR_TYPE_SOURCE);

hr = pAudioSourceObj->QueryInterface(IID_IAMTimelineSrc, (void **)&pAudioSource);

//Video
hr = pVideoSourceObj->SetStartStop(0, rtStop - rtStart);

hr = pVideoSource->SetMediaName(lpMpegFileName);
hr = pVideoSource->SetStreamNumber(0);

hr = pVideoSource->SetMediaTimes(rtStart, rtStop);

hr = pVideoTrack->SrcAdd(pVideoSourceObj);

//Audio
hr = pAudioSourceObj->SetStartStop(0, rtStop - rtStart);

hr = pAudioSource->SetMediaName(lpMpegFileName);
hr = pAudioSource->SetStreamNumber(1);

hr = pAudioSource->SetMediaTimes(rtStart, rtStop);

hr = pAudioTrack->SrcAdd(pAudioSourceObj);

hr = CoCreateInstance(CLSID_RenderEngine, NULL, CLSCTX_INPROC, IID_IRenderEngine, (void**)&pRender);
hr = pRender->SetTimelineObject(pTL);
hr = pRender->ConnectFrontEnd( );
hr = pRender->GetFilterGraph(&pGraph);
hr = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC, IID_ICaptureGraphBuilder2, (void **)&pBuilder);
pBuilder->SetFiltergraph(pGraph);
hr = pBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi, lpAviName, &pMux, NULL);
IPin *pPin0 = NULL;
hr = pRender->GetGroupOutputPin(0, &pPin0);
hr = pBuilder->RenderStream(NULL, NULL, pPin0, NULL, pMux);
IPin *pPin1 = NULL;
//below code return: hr=1, means "the group does not have output pin
//why??????
hr = pRender->GetGroupOutputPin(1, &pPin1);
hr = pBuilder->RenderStream(NULL, NULL, pPin1, NULL, pMux);
hr = pControl->Run();


QuestionSharing without seeing the code, possible? Pin
Joe Smith IX17-Jul-07 4:30
Joe Smith IX17-Jul-07 4:30 
AnswerRe: Sharing without seeing the code, possible? Pin
jhwurmbach17-Jul-07 5:01
jhwurmbach17-Jul-07 5:01 
GeneralRe: Sharing without seeing the code, possible? Pin
Joe Smith IX17-Jul-07 5:13
Joe Smith IX17-Jul-07 5:13 
GeneralRe: Sharing without seeing the code, possible? Pin
jhwurmbach17-Jul-07 5:28
jhwurmbach17-Jul-07 5:28 
GeneralRe: Sharing without seeing the code, possible? Pin
Joe Smith IX17-Jul-07 5:48
Joe Smith IX17-Jul-07 5:48 
GeneralRe: Sharing without seeing the code, possible? Pin
jhwurmbach17-Jul-07 5:55
jhwurmbach17-Jul-07 5:55 
GeneralRe: Sharing without seeing the code, possible? Pin
Joe Smith IX17-Jul-07 6:26
Joe Smith IX17-Jul-07 6:26 
GeneralRe: Sharing without seeing the code, possible? Pin
Mark Salsbery17-Jul-07 6:39
Mark Salsbery17-Jul-07 6:39 
GeneralRe: Sharing without seeing the code, possible? Pin
David Crow17-Jul-07 6:37
David Crow17-Jul-07 6:37 
AnswerRe: Sharing without seeing the code, possible? Pin
#realJSOP17-Jul-07 23:46
professional#realJSOP17-Jul-07 23:46 
QuestionSelectSinglenode syntax Pin
Maynka17-Jul-07 4:29
Maynka17-Jul-07 4:29 
AnswerRe: SelectSinglenode syntax Pin
Sam_c17-Jul-07 4:39
Sam_c17-Jul-07 4:39 
GeneralRe: SelectSinglenode syntax Pin
toxcct17-Jul-07 4:45
toxcct17-Jul-07 4:45 
GeneralRe: SelectSinglenode syntax Pin
Maynka17-Jul-07 5:04
Maynka17-Jul-07 5:04 
GeneralRe: SelectSinglenode syntax Pin
toxcct17-Jul-07 5:06
toxcct17-Jul-07 5:06 
AnswerRe: SelectSinglenode syntax Pin
Michael Dunn17-Jul-07 6:24
sitebuilderMichael Dunn17-Jul-07 6:24 
Questionhow to find differnce between laptop and desktop pc Pin
Sonani Prakash17-Jul-07 4:19
Sonani Prakash17-Jul-07 4:19 

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.