Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Entertainment » microsoft.public.windowsmedia.sdk
Thread: Sliders and FF/RW needed, not in saved ASF file...

HTVi
TV Discussion Newsgroups

Sliders and FF/RW needed, not in saved ASF file...
dl0 <dl0banter[ at ]gmail.com> 6/7/2007 6:33:43 PM
After figuring out what was wrong with my WMVCopy, I now have
downloaded files from an encoder. This is fantastic. What's missing
however, are the slider and FF/RW control on the media player. I'm
sure this has something to do with the ASF file (duh) and I'm thinking
there are probably some settings/functions I need to execute on the
ASF samples as they come in... Where is this stuff located? Is it in
the ASF control or in the Writers?

Thanks,
D

Re: Sliders and FF/RW needed, not in saved ASF file...
"Alessandro Angeli" <nobody[ at ]nowhere.in.the.net> 6/7/2007 8:03:12 PM
From: "dl0"

[Quoted Text]
> After figuring out what was wrong with my WMVCopy, I now
> have downloaded files from an encoder. This is
> fantastic. What's missing however, are the slider and
> FF/RW control on the media player. I'm sure this has
> something to do with the ASF file (duh) and I'm thinking
> there are probably some settings/functions I need to
> execute on the ASF samples as they come in... Where is
> this stuff located? Is it in the ASF control or in the
> Writers?

You need an index for the file. It should be created by
default but, if it's not, you can try to enable it
explicitly:

- at the end of CWMVCopy::CreateWriter(), right after the
call to m_pWriter->SetOutputFilename(), enumerate the sinks
with m_pWriterAdvanced->GetSinkCount()/GetSink()

- for each sink (there should be only 1), if the sink
supports IWMWriterFileSink3, call
IWMWriterFileSink3::SetAutoIndexing(TRUE)

If that doesn't work, index the file after writing it in
CWMVCopy::Copy(): release everything, then create an indexer
with WMCreateIndexer(). You should index at least the video
streams as
WMT_IT_PRESENTATION_TIME/3000millisecs/WMT_IT_NEAREST_CLEAN_POINT
(or 1000ms, but you'd better also index audio and image
streams).

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


Re: Sliders and FF/RW needed, not in saved ASF file...
dl0 <dl0banter[ at ]gmail.com> 6/7/2007 8:51:11 PM
On Jun 7, 2:03 pm, "Alessandro Angeli" <nob...[ at ]nowhere.in.the.net>
wrote:
[Quoted Text]
> From: "dl0"
>
> > After figuring out what was wrong with my WMVCopy, I now
> > have downloaded files from an encoder. This is
> > fantastic. What's missing however, are the slider and
> > FF/RW control on the media player. I'm sure this has
> > something to do with the ASF file (duh) and I'm thinking
> > there are probably some settings/functions I need to
> > execute on the ASF samples as they come in... Where is
> > this stuff located? Is it in the ASF control or in the
> > Writers?
>
> You need an index for the file. It should be created by
> default but, if it's not, you can try to enable it
> explicitly:
>
> - at the end of CWMVCopy::CreateWriter(), right after the
> call to m_pWriter->SetOutputFilename(), enumerate the sinks
> with m_pWriterAdvanced->GetSinkCount()/GetSink()
>
> - for each sink (there should be only 1), if the sink
> supports IWMWriterFileSink3, call
> IWMWriterFileSink3::SetAutoIndexing(TRUE)
>
> If that doesn't work, index the file after writing it in
> CWMVCopy::Copy(): release everything, then create an indexer
> with WMCreateIndexer(). You should index at least the video
> streams as
> WMT_IT_PRESENTATION_TIME/3000millisecs/WMT_IT_NEAREST_CLEAN_POINT
> (or 1000ms, but you'd better also index audio and image
> streams).
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> //http://www.riseoftheants.com/mmx/faq.htm

I'm currently attempting to do the CreateIndexer method of doing
this. Where I am stuck at is where you assign the OnStatus callback
explicitly in the

hr = m_pIndexer->StartIndexing( pwszOutputFile, &CWMVCopy::OnStatus,
NULL );

call. This isn't working because of a casting issue. I found where
he appears to be templatizing each of the callbacks but I don't see
any assignment there. Also, I haven't quite clued into where the
assignment of these things is happening for the other interfaces that
us OnStatus. Since he appears to be templatizing everything and then
doing an AddRef for each using the same pointer, I'm not exactly sure
how you "get it back". If I can find that pointer in the above
function call (as far as I understand) it seems I can pass it to the
StartIndexing method.

The program claims indexing is on but it isn't in the files I'm
downloading so I started my attempt; I'm stuck at the point I
mentioned but I'm still looking.

Thanks for your help...
D

Re: Sliders and FF/RW needed, not in saved ASF file...
dl0 <dl0banter[ at ]gmail.com> 6/7/2007 10:48:12 PM
On Jun 7, 2:51 pm, dl0 <dl0ban...[ at ]gmail.com> wrote:
[Quoted Text]
> On Jun 7, 2:03 pm, "Alessandro Angeli" <nob...[ at ]nowhere.in.the.net>
> wrote:
>
>
>
>
>
> > From: "dl0"
>
> > > After figuring out what was wrong with my WMVCopy, I now
> > > have downloaded files from an encoder. This is
> > > fantastic. What's missing however, are the slider and
> > > FF/RW control on the media player. I'm sure this has
> > > something to do with the ASF file (duh) and I'm thinking
> > > there are probably some settings/functions I need to
> > > execute on the ASF samples as they come in... Where is
> > > this stuff located? Is it in the ASF control or in the
> > > Writers?
>
> > You need an index for the file. It should be created by
> > default but, if it's not, you can try to enable it
> > explicitly:
>
> > - at the end of CWMVCopy::CreateWriter(), right after the
> > call to m_pWriter->SetOutputFilename(), enumerate the sinks
> > with m_pWriterAdvanced->GetSinkCount()/GetSink()
>
> > - for each sink (there should be only 1), if the sink
> > supports IWMWriterFileSink3, call
> > IWMWriterFileSink3::SetAutoIndexing(TRUE)
>
> > If that doesn't work, index the file after writing it in
> > CWMVCopy::Copy(): release everything, then create an indexer
> > with WMCreateIndexer(). You should index at least the video
> > streams as
> > WMT_IT_PRESENTATION_TIME/3000millisecs/WMT_IT_NEAREST_CLEAN_POINT
> > (or 1000ms, but you'd better also index audio and image
> > streams).
>
> > --
> > // Alessandro Angeli
> > // MVP :: DirectShow / MediaFoundation
> > // mvpnews at riseoftheants dot com
> > //http://www.riseoftheants.com/mmx/faq.htm
>
> I'm currently attempting to do the CreateIndexer method of doing
> this. Where I am stuck at is where you assign the OnStatus callback
> explicitly in the
>
> hr = m_pIndexer->StartIndexing( pwszOutputFile, &CWMVCopy::OnStatus,
> NULL );
>
> call. This isn't working because of a casting issue. I found where
> he appears to be templatizing each of the callbacks but I don't see
> any assignment there. Also, I haven't quite clued into where the
> assignment of these things is happening for the other interfaces that
> us OnStatus. Since he appears to be templatizing everything and then
> doing an AddRef for each using the same pointer, I'm not exactly sure
> how you "get it back". If I can find that pointer in the above
> function call (as far as I understand) it seems I can pass it to the
> StartIndexing method.
>
> The program claims indexing is on but it isn't in the files I'm
> downloading so I started my attempt; I'm stuck at the point I
> mentioned but I'm still looking.
>
> Thanks for your help...
> D- Hide quoted text -
>
> - Show quoted text -

What about this?

:-)

Re: Sliders and FF/RW needed, not in saved ASF file...
"Alessandro Angeli" <nobody[ at ]nowhere.in.the.net> 6/8/2007 3:02:56 AM
From: "dl0"

[Quoted Text]
> What about this?


People have lives, you know?

> I'm currently attempting to do the CreateIndexer method of
> doing
> this. Where I am stuck at is where you assign the
> OnStatus callback
> explicitly in the
>
> hr = m_pIndexer->StartIndexing( pwszOutputFile,
> &CWMVCopy::OnStatus,
> NULL );
>
> call. This isn't working because of a casting issue.

Why would you expect it to work? The method expects a
pointer to a class (IWMStatusCallback*) while you are trying
to pass a pointer to a virtual method. The callback is *not*
a function but an interface.

> I found where
> he appears to be templatizing each of the callbacks but I
> don't see
> any assignment there.

There are no templates in the sample.

> Also, I haven't quite clued into where the
> assignment of these things is happening for the other
> interfaces that
> us OnStatus.

IWMReaderCallbackAdvanced : IWMReaderCallback :
IWMStatusCallback : IUnknown

The sample is using IWMReaderCallbackAdvanced and not just
IWMStatusCallback, but IWMReaderCallbackAdvanced inherits
IWMStatusCallback.

> Since he appears to be templatizing everything and then
> doing an AddRef for each using the same pointer, I'm not
> exactly sure
> how you "get it back".

Again, there are no templates and, if you are referring to
the implementation of CWMVCopy::QueryInterface(), it is not
AddRef()ing the same pointer but the same object instance
(itself) and returning different pointers, depending on the
branch that gets executed, which are just stored in the same
result parameter.

> If I can find that pointer in the above
> function call (as far as I understand) it seems I can pass
> it to the
> StartIndexing method.

As the sample shows when using IWMReaderCallbackAdvanced,
you need to use 'this' to let the compiler cast it to a
reference to IWMStatusCallback (see the call to
m_pReader->Open()). Also, notice that you will get the same
CWMVCopy::OnStatus() implementation the sample uses for the
copy, which may or may not work for the indexing.

> The program claims indexing is on but it isn't in the
> files I'm
> downloading so I started my attempt; I'm stuck at the
> point I
> mentioned but I'm still looking.

It occurred to me now that the problem may also be the
seekable and stridable flags in the streaming header, which
should be false while you need true. In
CWMVCopy::CopyAttribute(), after all the attributes have
been copied, set those 2 attributes to true.

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


Re: Sliders and FF/RW needed, not in saved ASF file...
dl0 <dl0banter[ at ]gmail.com> 6/8/2007 5:42:59 PM
On Jun 7, 9:02 pm, "Alessandro Angeli" <nob...[ at ]nowhere.in.the.net>
wrote:
[Quoted Text]
> From: "dl0"
>
> > What about this?
>
> People have lives, you know?
>
> > I'm currently attempting to do the CreateIndexer method of
> > doing
> > this. Where I am stuck at is where you assign the
> > OnStatus callback
> > explicitly in the
>
> > hr = m_pIndexer->StartIndexing( pwszOutputFile,
> > &CWMVCopy::OnStatus,
> > NULL );
>
> > call. This isn't working because of a casting issue.
>
> Why would you expect it to work? The method expects a
> pointer to a class (IWMStatusCallback*) while you are trying
> to pass a pointer to a virtual method. The callback is *not*
> a function but an interface.
>
> > I found where
> > he appears to be templatizing each of the callbacks but I
> > don't see
> > any assignment there.
>
> There are no templates in the sample.
>
> > Also, I haven't quite clued into where the
> > assignment of these things is happening for the other
> > interfaces that
> > us OnStatus.
>
> IWMReaderCallbackAdvanced : IWMReaderCallback :
> IWMStatusCallback : IUnknown
>
> The sample is using IWMReaderCallbackAdvanced and not just
> IWMStatusCallback, but IWMReaderCallbackAdvanced inherits
> IWMStatusCallback.
>
> > Since he appears to be templatizing everything and then
> > doing an AddRef for each using the same pointer, I'm not
> > exactly sure
> > how you "get it back".
>
> Again, there are no templates and, if you are referring to
> the implementation of CWMVCopy::QueryInterface(), it is not
> AddRef()ing the same pointer but the same object instance
> (itself) and returning different pointers, depending on the
> branch that gets executed, which are just stored in the same
> result parameter.
>
> > If I can find that pointer in the above
> > function call (as far as I understand) it seems I can pass
> > it to the
> > StartIndexing method.
>
> As the sample shows when using IWMReaderCallbackAdvanced,
> you need to use 'this' to let the compiler cast it to a
> reference to IWMStatusCallback (see the call to
> m_pReader->Open()). Also, notice that you will get the same
> CWMVCopy::OnStatus() implementation the sample uses for the
> copy, which may or may not work for the indexing.
>
> > The program claims indexing is on but it isn't in the
> > files I'm
> > downloading so I started my attempt; I'm stuck at the
> > point I
> > mentioned but I'm still looking.
>
> It occurred to me now that the problem may also be the
> seekable and stridable flags in the streaming header, which
> should be false while you need true. In
> CWMVCopy::CopyAttribute(), after all the attributes have
> been copied, set those 2 attributes to true.
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> //http://www.riseoftheants.com/mmx/faq.htm

Oh man, I was referring to this as in this->method() :-)

It was a lame attempt at sarcasm. I was answering my own questions
with "What about this?" as in the pointer. Lame, I know.

I figured out the indexer because what it was looking for in reference
to its OnStatus callback pointer was simply "this". I haven't used C+
+ for about 10 years so I had attempted stuff like this->OnStatus and
the Classname::OnStatus and was looking for what I was missing and
finally arrived at "this" and it worked perfectly.

I really appreciate your time and I have learned bunches of stuff
about this API from you guys.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen