|
liur17 wrote: how can I get the type of mpeg file? I have to identify the file type(mpeg1 or mpeg2) programmly
so that I can add the according filter. ???
2 possible ways I can think of:
1) After the successful AddSourceFilter() call, obtain a IFileSourceFilter interface from the
source filter and use the IFileSourceFilter::GetCurFile() method to get the media type (looking
for MPEG subtypes).
2) Let intelligent connect insert the necessary filters for you.
Use AddSourceFilter() and SetOutputFileName() like you're doing, add the compressor filter you
want for the destination AVI file, and use RenderStream() to connect the filters added by
AddSourceFilter() and SetOutputFileName(), with the intermediate compressor filter.
If you have suitable MPEG filters installed, intelligent connect will insert them for you.
If not, RenderStream() will fail.
A second call to RenderStream() will connect an audio stream to the AVI muxer if it's available
(again, see here[^] for an example.
You can try this in graphedit by manually adding a filesource async filter, setting the input
filename, add a filewriter filter, set the output filename, add an AVI Mux filter, and connect
the filesource to the filewriter filter.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
I got it. Thank you for your kind reply.
|
|
|
|
|
|
1. For UI Localization: Is is possible to have VC++.Net 2003 application with resources in .rc file for one language (English) and resouce only dll for another language (Japanese)?
2. What modification in code required to handle the switching between .rc and dll resources @ runtime to display the appropriate UI resources in the corresponding language? (either after changing the locale of the English OS or running the application on Japanese OS)?
Thanks & Regards,
Neeraj
|
|
|
|
|
Hi all,
Part of the app I'm developing downloads fairly large files via HTTP. Everything works great, except for when the clients network connection is dropped. I have tried using WSAGetLastError, but it always returns 0. The thread just keeps pulling mystical data, then it just stops after about 300 or so KB. No crash or anything.
do
{
len = recv( Socket, buffer, sizeof( buffer ), 0 );
if( ( pos + len ) > contentLength )
return 0;
memcpy( body + pos, buffer, len );
pos += len;
int error = WSAGetLastError( );
if( error )
return 0;
} while( len > 0 );
To simulate a network drop I am turning my modem off.
Has anyone got a solution to this?
|
|
|
|
|
Silly me. I just realised that the socket was blocking.
I set it to non-blocking and it works fine.
|
|
|
|
|
<br />
class Foo<br />
{<br />
private:<br />
int (*pf)(int);<br />
<br />
public:<br />
Foo()<br />
{<br />
this->pf = &Foo::cube;
}<br />
<br />
private:<br />
int cube(int n) {return n*n*n;}<br />
<br />
};<br />
how do i get that statement in the constructor working? any help is greatly appreciated.
|
|
|
|
|
eirche wrote: int (*pf)(int);
Should make this a member function pointer. So it should be...
int (<code>Foo::</code>*pf)(int);
|
|
|
|
|
thank you for the quick response. it's working like a charm.
|
|
|
|
|
set the cube() member function either static or global...
|
|
|
|
|
hi all
I use in my program WaitForMultipleObjects function for chake if some process that I use stop or not, but If some ot the programs made mistake this funtion dont returns.
how I can chake my programs are runing or thay stoped?
|
|
|
|
|
can you please write a proper english ?
i can't get a word of what you're saying...
|
|
|
|
|
|
david bagaturia wrote: how I can chake my programs are runing or thay stoped?
Programatically:
When you create the process, store the handler. You can then later check handler after handler if the process is still running.
Physically:
Hit Ctrl+Shift+Esc, go to process tab, and check if your processes are still alive.
|
|
|
|
|
Perhaps something like this:
bool HasProcessExited(HANDLE hProcess)
{
return WaitForSingleObject(hProcess, 0)==WAIT_OBJECT_0;
}
Steve
|
|
|
|
|
Could you please tell , what type of handles are you using for WaitForMultipleObject()?
AJay
|
|
|
|
|
ok.
I create come process and if it status is Not Responding... WaitForMultipleObjects(...) function dont returns and sow my program wait and it is tsoped too.
I whont to know my process whorks or not?
or it have "Not Responding..." status.
|
|
|
|
|
I am not totally clear on what you are experiencing. But here's some thoughts.
1. Don't wait inside a windows message handler. If you block for an extended period inside the message handling thread -- you could be seen as "not responding".
2. Use a reasonably short timeout on your wait. You can always wait twice.
3. Make sure you are using the correct handle in your Wait() call. How are you getting this process handle?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
"How are you getting this process handle?"
CreateProcessA(NULL, CmdLine, NULL, NULL,<br />
FALSE, dwCreationFlags, NULL,<br />
NULL, &si, &pi)
sow I get this handle 'pi.hProcess'.
thanks.
|
|
|
|
|
Hello,
I'm trying to catch mouse buttons (5) via the XBUTTONS and would like to do this in an MFC environment. I have seen some examples in Win32, but not MFC.
I have declared the following in the CMainFrame message map
ON_MESSAGE(WM_APPCOMMAND, OnAppCommand)
then try to process it within the function...
LRESULT CMainFrame::OnAppCommand(WPARAM wParam, LPARAM lParam),
...but this function never gets called.
Any help greatly appreciated.
Cheers,
Grant.
|
|
|
|
|
Maybe you need to put it into the CView class instead.
Maybe the message does not make it to the mainframe.
|
|
|
|
|
Hi Everybody!
I am currently trying to build an application for videoconferencing between 2 computers using Wifi.
Since I have already began to program some functionnality with directshow, I was wondering if it there was any existing directshow filter for broadcasting audio and video streams.
Actually, I am looking for a directshow filter on which it's possible to connect an audio source filter and a video source filter on it.
Thanks a lot for your help!
|
|
|
|
|
djin94 wrote: I was wondering if it there was any existing directshow filter for broadcasting audio and video streams.
Maybe 3rd-party, but there's not a filter included with DirectShow.
The Windows Media Format SDK has a network writer sink for broadcasting ASF format media.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Hi Thanks for the answer.
Do you know if windows media format SDK is compatible with Directshow connectivity. I mean : Can I connect my Directshow source filter directly to it.
Djin
|
|
|
|
|
djin94 wrote: Can I connect my Directshow source filter directly to it.
Not directly. It takes a little work but less work than writing your own streaming code.
With Windows Media Format, you basically configure a profile for the streams, pass uncompressed
samples, and it does the rest.
The trick is to get those samples from DirectShow. One easy way is with the grabber filter.
Another harder way is to write a custom filter.
Download Windows Media Format 9 Seres SDK[^]
The WMF network reader/writer does not use RTP AFAIK. It does use HTTP protocol for easy
firewall traversal.
There may be 3rd-party DirectShow filters to do it as well.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|