<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
Alexis de Lattre wrote:<br>
<blockquote type="cite" cite="mid20030805222358.GA11091@via.ecp.fr">
<pre wrap="">On Tue, Aug 05, 2003, Mathew, Tisson K wrote :
</pre>
<blockquote type="cite">
<pre wrap="">Does VLC support live video streaming on windows?
</pre>
</blockquote>
<pre wrap=""><!---->
No... this feature is "Linux only", as explained on
<a class="moz-txt-link-freetext" href="http://www.videolan.org/vlc/features.html">http://www.videolan.org/vlc/features.html</a>
We would love to have a "Direct Show" input for VLC... but no developer
have volunteered for this work.
</pre>
</blockquote>
Here's some DirectX 8.1 code off codeguru from which someone could hack<br>
out the video device part. I don't know anything about various issues<br>
that would make this unworkable or way too primitive to be usable.<br>
<br>
<br>
Relevant Functions:<br>
<a class="moz-txt-link-freetext" href="CPreviewMovieDlg::GetDeviceInterfaces(">CPreviewMovieDlg::GetDeviceInterfaces(</a>)<br>
<a class="moz-txt-link-freetext" href="CPreviewMovieDlg::FindCaptureDevice(IBaseFilter**">CPreviewMovieDlg::FindCaptureDevice(IBaseFilter**</a> ppBaseFilter)<br>
<a class="moz-txt-link-freetext" href="CPreviewMovieDlg::CaptureVideo(">CPreviewMovieDlg::CaptureVideo(</a>)<br>
<a class="moz-txt-link-freetext" href="CPreviewMovieDlg::CloseInterfaces(">CPreviewMovieDlg::CloseInterfaces(</a>)<br>
<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.codeguru.com/directx/DirectXApp.html">http://www.codeguru.com/directx/DirectXApp.html</a><br>
<br>
Excerpt: <br>
===============================================<br>
BOOL <a class="moz-txt-link-freetext" href="CPreviewMovieDlg::OnInitDialog(">CPreviewMovieDlg::OnInitDialog(</a>) <br>
{<br>
<a class="moz-txt-link-freetext" href="CDialog::OnInitDialog(">CDialog::OnInitDialog(</a>);<br>
<br>
HRESULT hr;<br>
hr = CaptureVideo();<br>
if(FAILED(hr))<br>
{<br>
CloseInterfaces();<br>
OnOK();<br>
}<br>
<br>
return TRUE;<br>
}<br>
HRESULT <a class="moz-txt-link-freetext" href="CPreviewMovieDlg::CaptureVideo(">CPreviewMovieDlg::CaptureVideo(</a>)<br>
{<br>
HRESULT hr;<br>
IBaseFilter *pBaseFilter = NULL;<br>
<br>
//Get DirectShow Interfaces<br>
hr = GetDeviceInterfaces();<br>
if(FAILED(hr))<br>
{<br>
TRACE1(("Could not initialize the video interfaces!
hr=0x%x"), hr);<br>
return hr;<br>
}<br>
<br>
// Attach the filter graph to the capture graph<br>
hr = m_pCaptureGraphBuilder->SetFiltergraph(m_pGraphBuilder);<br>
if(FAILED(hr))<br>
{<br>
TRACE1(("Could not set the filter graph to capture
graph! hr=0x%x"), hr);<br>
return hr;<br>
}<br>
<br>
// Add our graph to the running object table, which will allow<br>
// the GraphEdit application to "spy" on our graph<br>
#ifdef REGISTER_FILTERGRAPH<br>
hr = AddGraphToRot(m_pGraphBuilder, &m_dwGraphRegister);<br>
if (FAILED(hr))<br>
{<br>
TRACE1(TEXT("Failed to register filter graph with ROT!
hr=0x%x"), hr);<br>
m_dwGraphRegister = 0;<br>
}<br>
#endif<br>
<br>
// Use the system device enumerator and class enumerator to find<br>
// a video capture/preview device, such as a desktop USB video
camera.<br>
hr = FindCaptureDevice(&pBaseFilter);<br>
if(FAILED(hr))<br>
{<br>
return hr;<br>
}<br>
<br>
// Add Capture filter to our graph.<br>
hr = m_pGraphBuilder->AddFilter(pBaseFilter, L"Video
Capture");<br>
if(FAILED(hr))<br>
{<br>
TRACE1(TEXT("Couldn't add capture filter to graph! hr=0x%x"),
hr);<br>
pBaseFilter->Release();<br>
return hr;<br>
}<br>
<br>
hr =
m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,<br>
&MEDIATYPE_Video,
pBaseFilter, NULL, NULL);<br>
if (FAILED(hr))<br>
{<br>
TRACE1(TEXT("Couldn't render capture stream. "<br>
"The device may already be in use.\r\n\r\nhr=0x%x"),
hr);<br>
<br>
pBaseFilter->Release();<br>
return hr;<br>
}<br>
<br>
// Now that the filter has been added to the graph and we have<br>
// rendered its stream, we can release this reference to the filter.<br>
pBaseFilter->Release();<br>
<br>
// Set video window style and position<br>
hr = SetupVideoWindow();<br>
if (FAILED(hr))<br>
{<br>
TRACE1(TEXT("Couldn't initialize video window! hr=0x%x"), hr);<br>
return hr;<br>
}<br>
<br>
// Start previewing video data<br>
hr = m_pMediaControl->Run();<br>
if(FAILED(hr))<br>
{<br>
TRACE1(TEXT("Couldn't run the graph! hr=0x%x"), hr);<br>
return hr;<br>
}<br>
<br>
return S_OK;<br>
}<br>
<br>
HRESULT <a class="moz-txt-link-freetext" href="CPreviewMovieDlg::GetDeviceInterfaces(">CPreviewMovieDlg::GetDeviceInterfaces(</a>)<br>
{<br>
HRESULT hr;<br>
<br>
//Create the filter graph<br>
hr = CoCreateInstance (CLSID_FilterGraph, NULL, CLSCTX_INPROC,<br>
IID_IGraphBuilder, (void **)&m_pGraphBuilder);<br>
<br>
if(FAILED(hr))<br>
return hr;<br>
<br>
//Create the Capture graph<br>
hr = CoCreateInstance (CLSID_CaptureGraphBuilder2, NULL,
CLSCTX_INPROC,<br>
IID_ICaptureGraphBuilder2, (void
**)&m_pCaptureGraphBuilder);<br>
<br>
if(FAILED(hr))<br>
return hr;<br>
<br>
//Obtain the interfaces for media control, video and media
event interfaces<br>
hr = m_pGraphBuilder->QueryInterface (IID_IMediaControl,
(void **)&m_pMediaControl);<br>
<br>
if(FAILED(hr))<br>
return hr;<br>
<br>
hr = m_pGraphBuilder->QueryInterface (IID_IVideoWindow,
(void **)&m_pViewWindow);<br>
<br>
if(FAILED(hr))<br>
return hr;<br>
<br>
hr = m_pGraphBuilder->QueryInterface (IID_IMediaEvent, (void
**)&m_pMediaEventEx);<br>
<br>
if(FAILED(hr))<br>
return hr;<br>
<br>
//Set the window handle used to process graph events<br>
m_pMediaEventEx->SetNotifyWindow((OAHWND)m_hWnd,
WM_GRAPHNOTIFY, 0);<br>
<br>
return hr;<br>
}<br>
HRESULT <a class="moz-txt-link-freetext" href="CPreviewMovieDlg::FindCaptureDevice(IBaseFilter**">CPreviewMovieDlg::FindCaptureDevice(IBaseFilter**</a> ppBaseFilter)<br>
{<br>
IBaseFilter *pBase = NULL;<br>
HRESULT hr;<br>
CComPtr <IMoniker> pMoniker = NULL;<br>
ULONG lFetched;<br>
<br>
// Create the system device enumerator<br>
CComPtr <ICreateDevEnum> pDevEnum = NULL;<br>
<br>
hr = CoCreateInstance (CLSID_SystemDeviceEnum, NULL,
CLSCTX_INPROC,<br>
IID_ICreateDevEnum, (void **)&pDevEnum);<br>
<br>
if(FAILED(hr))<br>
{<br>
TRACE1(("Failed to create the device enumerator!
hr=0x%x"), hr);<br>
return hr;<br>
}<br>
<br>
// Create an enumerator for the video capture devices<br>
CComPtr <IEnumMoniker> pClassEnum = NULL;<br>
<br>
hr = pDevEnum->CreateClassEnumerator
(CLSID_VideoInputDeviceCategory, &pClassEnum, 0);<br>
<br>
if(FAILED(hr))<br>
{<br>
TRACE1(("Failed to create the class enumerator!
hr=0x%x"), hr);<br>
return hr;<br>
}<br>
<br>
// If there are no enumerators for the requested type, then <br>
// CreateClassEnumerator will succeed, but pClassEnum will be NULL.<br>
if (pClassEnum == NULL)<br>
{<br>
MessageBox(TEXT("No video capture device was detected.\r\n\r\n")<br>
TEXT("This program requires a video capture device,
such as a USB WebCam,\r\n")<br>
TEXT("to be installed and working properly. The
program will now close."),<br>
TEXT("No Video Capture Hardware"), MB_OK |
MB_ICONINFORMATION);<br>
return E_FAIL;<br>
}<br>
<br>
// Note that if the Next() call succeeds but there are no monikers,<br>
// it will return S_FALSE (which is not a failure). Therefore, we<br>
// check that the return code is S_OK instead of using SUCCEEDED()
macro.<br>
<br>
//loop while we can still enumerate, the enumeration succeeds, and
while we have'nt yet found a dv camera<br>
while( (pClassEnum->Next(1, &pMoniker, &lFetched))
== S_OK)<br>
{<br>
// getting the propert page to get the device name<br>
IPropertyBag *pBag;<br>
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
reinterpret_cast<PVOID *>(&pBag));<br>
if ( SUCCEEDED(hr) )<br>
{<br>
VARIANT var;<br>
var.vt = VT_BSTR;<br>
hr = pBag->Read(L"FriendlyName", &var, NULL);<br>
if ( SUCCEEDED(hr) )<br>
{<br>
CString strDevName;<br>
<br>
USES_CONVERSION;<br>
strDevName = W2A(var.bstrVal);<br>
<br>
m_cboDevice.AddString(strDevName);<br>
<br>
SysFreeString(var.bstrVal);<br>
<br>
// Bind Moniker to a filter object<br>
hr = pMoniker->BindToObject(0, 0,
IID_IBaseFilter, reinterpret_cast<LPVOID *>(&pBase));<br>
if (FAILED(hr))<br>
{<br>
TRACE1(TEXT("Couldn't bind
moniker to filter object! hr=0x%x"), hr);<br>
return hr;<br>
}<br>
}<br>
pBag->Release();<br>
}<br>
}<br>
<br>
*ppBaseFilter = pBase;<br>
<br>
return hr;<br>
}<br>
<br>
<br>
<br>
</body>
</html>