Discussion:
WMSDK get file size
(too old to reply)
malikcis
2009-11-26 15:22:07 UTC
Permalink
Hi,

Does any one know how to get running file size using WMSDK?
I am using following API:

IWMWriter* mWriter;
...
mWriter->SetOutputFilename(mDestFile);

I also have following other API's:

IWMProfileManager * mProfileManager;
IWMProfile * mProfile;
IWMWriter* mWriter;
IWMHeaderInfo* mIHeaderInfo;
IWMWriterAdvanced* mIWriterAdvanced;
IWMWriterAdvanced3* mIWriterAdvanced3;

Thanks, Malik
Alessandro Angeli
2009-11-27 18:01:42 UTC
Permalink
From: "malikcis"
Post by malikcis
Does any one know how to get running file size using
IWMWriterAdvanced::GetSink()
IWMWriterFileSink2::GetFileSize()
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
malikcis
2009-12-01 11:50:02 UTC
Permalink
Hi Alessandro,

I tried several combinations arround following code without success:
IWMWriterSink **ppSink;
mIWriterAdvanced->GetSink(0, ppSink);

QWORD cbFile;
mIWriterFileSink2->GetFileSize(&cbFile);

Do you have a sample code. That will help a lot.
Is there any other mechanism without using mIWriterFileSink2?
Post by Alessandro Angeli
From: "malikcis"
Post by malikcis
Does any one know how to get running file size using
IWMWriterAdvanced::GetSink()
IWMWriterFileSink2::GetFileSize()
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
.
Alessandro Angeli
2009-12-01 19:18:31 UTC
Permalink
From: "malikcis"
Post by malikcis
I tried several combinations arround following code
IWMWriterSink **ppSink;
mIWriterAdvanced->GetSink(0, ppSink);
QWORD cbFile;
mIWriterFileSink2->GetFileSize(&cbFile);
Do you have a sample code. That will help a lot.
Is there any other mechanism without using
mIWriterFileSink2?
Your code is incomplete and you did not specify what is not
working, so I don't really know what to tell you. That is
the way it should be done.

You could also try Kernel32.dll!GetFileSize(), but that may
be approximate since it will not count the unflushed data
and it may not work if the stock file sink opens the file in
exclusive mode.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Loading...