WMEncoder SDK - How to use SetCaptureParent for the PrePrevi
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
WMEncoder SDK - How to use SetCaptureParent for the PrePrevi

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Encoders
Author Message
Tobze
Guest





Posted: Wed Nov 03, 2004 8:32 pm    Post subject: WMEncoder SDK - How to use SetCaptureParent for the PrePrevi Reply with quote

Hi everybody,

anybody experience with WMEncoder SDK 9 in C++?
I've got problems with the PrePreview Interface. I'cant show a stream
from an external device on my Dialog.

Hope somebody can help me!!!!
Thanks

Here's my code so far:


//////
// Initialize WMEncoder

hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMEncoder,
NULL,
CLSCTX_INPROC_SERVER,
IID_IWMEncoder2,
(void**) &pEncoder);

// Retrieve the source group collection.
hr = pEncoder->get_SourceGroupCollection(&pSrcGrpColl);

// Add a source group to the collection.
hr = pSrcGrpColl->Add(CComBSTR("SG_1"), &pSrcGrp);
hr = pSrcGrp->QueryInterface(IID_IWMEncSourceGroup2,
(void**)&pSrcGrp2);


//Add a video and audio source to the source group.
hr = pSrcGrp->AddSource(WMENC_VIDEO, &pSrcVid);

// Add the device as the audio source and video source.
hr = pSrcVid->SetInput(CComBSTR("Device://Microsoft DV-Kamera und
Videorekorder"));

// Initialize the encoding session.
hr = pEncoder->PrepareToEncode(VARIANT_TRUE);

//////
//Creating the PrePreview-Window

HWND m_hWnd;
long stream;

CWnd *pWindow;
pWindow = new CWnd;
pWindow->Create(_T("STATIC"),"PrePreview",
WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP,
CRect(122,38,362,218),this,1234);
m_Wnd = pWindow->GetSafeHwnd();

hr = pSrcVid->GetSourcePlugin((IUnknown**)&pPrePreview)
hr = pPrePreview->SetCaptureParent((long)m_hWnd);
///End

Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Encoders All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB