Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enabling DirectX va

35 views
Skip to first unread message

YS, Kim

unread,
Jun 15, 2004, 11:02:11 AM6/15/04
to
Hi, all.

I really want to get a Windows Media Source Filter which supports
directX VA.

Of course I know I can use WM Asf Reader , but it doesn't support
directx VA for streaming content.
In the Windows Media Format 9 SDK's documents, I found some
description as below


Enabling DirectX Video Acceleration
....
....
To enable DirectX VA for streamed content, you must create a custom
source filter like the one in the top diagram.
Basically, this filter will use the Windows Media Format SDK to
instantiate a WM Reader object, decompress the samples,
and send them downstream on its output pins. This discussion assumes
that you have created the source filter already
and are now ready to implement the DirectX VA support.
....
....


So, I've made a source filter using WM Reader object in the WMF9 SDK.
It works not bad. :-(

But , it is really hard to go ahead for enabling directx VA with my
source filter.
It tooks 2 weeks without any success.

In the documents (WMF SDK), it says ...

1. The player instantiates its source filter and a reader object.
The reader creates a video decoder DMO and sets the (compressed)
input type on it.
This must happen before the player attempts to configure its video
playback graph
because the SDK and the decoder DMO must be involved in the
negotiation process with the graph,
and the DMO must know the input format during step 9

Does it mean I have to create reader object and create a video decoder
DMO and connect them ?
Or, does it be made automatically when I call WMCreateReader(...)
for creating reader object ?

I can not find more informaation for enabling directx va. Could you
help me please ?

Thanks,
Kim.

Jeremy Noring

unread,
Jun 15, 2004, 3:48:00 PM6/15/04
to
First off, as far as I know the WM ASF Reader *does* support streamed
content. You can give it an http url from a windows media encoder instance,
or a program you wrote with a WMWriter embedded in it, and it should read it
with no problem. I've done this in my application for months now, and it
seems to work flawlessly. I don't know if this means the streamed content
is going to get DirectX VA, but I would think that it does since apparently
the DMO Wrapper filter is what supports DirectX VA.

Second, according to the WMFSDK:

"Beginning with the Windows Media Format 9 Series SDK, the DMO Wrapper
filter supports DirectX VA. This means that, for local playback,
applications can use the WM ASF Reader filter to play Windows Media-based
content and DirectX VA hardware acceleration will be invoked automatically
if the graphics card supports it."

The DMO decoder filter supports DirectX VA. Why not pass out compressed
samples in your source filter for the DMO decoder in DirectShow to decode
(which should automatically invoke VA), rather than dealing with it inside
of the reader?

--
Where am I going?
And why am I in this handbasket?


YS, Kim

unread,
Jun 15, 2004, 10:37:00 PM6/15/04
to
"Jeremy Noring" <some...@thenet.com> wrote in message news:<eFydrGxU...@TK2MSFTNGP12.phx.gbl>...

Thank you for replying.

I know I could use WM AFS Reader for reading streaming content (ASF).
But, the problem is Directx VA will be invoked automatically just for
local file not for streaming content.

This is described in WMFSDK also.
And WMFSDK says that I have to create a custom source filter for
enabling directx va with streaming content.

BTW, I'd like to know whether the reader object includes decoder DMO
inside its own already or not.
Anybody know this ?

Thanks

YS, Kim

unread,
Jun 16, 2004, 2:46:06 AM6/16/04
to
val...@nate.com (YS, Kim) wrote in message news:<fcc9accb.04061...@posting.google.com>...


I'm creating a custom source filter for Windows Media.

The source filter uses WM Reader object which is in WMFSDK.
My source filter works find without DXVA.

But I have to implement DXVA with my source filter.. T.T

Output pin inherited IAMVideoAcceleratorNotify interface.

Output pin overides IPin::Connect and
CBaseOutputpin::CompleteConnect.

In the Connect() , I can get IWMCodecAMVideoAccelerator from source
filter, and get IAMVideoAccelerator from down stream's input pin.
Then I called IWMCodecAMVideoAccelerator :: SetAccelerator (
IAMVideoAccelerator ) , and
I called CBaseOutputpin::Connect( pReceivepin, pmt );

In the CompleteConnect(), I called IWMCodecAMVideoAccelerator ::
NegotiateConnection ( AM_MEDIA_TYPE* type_info );

After then I expected my putput pin's GetUncompSurfaceInfo () is
called , but it never happens.

Have you any idea ?
Thanks, simon.
Kim.

Jeremy Noring

unread,
Jun 16, 2004, 12:27:29 PM6/16/04
to
> I know I could use WM AFS Reader for reading streaming content (ASF).
> But, the problem is Directx VA will be invoked automatically just for
> local file not for streaming content.

I think you're misinterpreting the documentation. It states that the WM ASF
Reader filter is incapable of streaming content, and you need to write your
own source filter if you want to stream media:

"...the WM ASF Reader filter does not support playback of streamed content.
Therefore, if you want to support DirectX VA when playing streamed content
in a custom player, you must use an alternate mechanism, which is the one
used by Windows Media Player beginning with the Windows Media 9 Series. "

However, the WM ASF Reader filter does accept streaming media. It'll take
mms:// and http:// sources with ease. Furthermore, the VA is implemented in
the DMO filter--not the source filter. What source filter you use has
*nothing* to do with whether or not VA is enabled. If you have the DMO
decoder filter in your graph, it's going to be added automatically
regardless of the source filter.


> And WMFSDK says that I have to create a custom source filter for
> enabling directx va with streaming content.


The WMFSDK states that DirectX VA is automatically enabled when you
introduce the DMO Decoder filter and a suitable video renderer into your
graph. So, in your source filter, all you need to do is output compressed
samples rather than doing the decompression inside of the filter. They'll
be decompressed by the DMO and that should provide you with VA. Rather than
decompressing the samples inside your source filter, pass them to the WMV
Decoder DMO filter.

If in doubt about all of this, render a local file verses a network file
with the ASF Reader Filter--both with identical profiles--and see if your
cpu usage is more or less with one over the other. I'd bet the barn that
your cpu usage is going to be almost identical.

YS, Kim

unread,
Jun 17, 2004, 12:23:31 AM6/17/04
to
Thank you so much, Jeremy.

After I read your reply, I re-read the WMFSDK documents "Enabling
DirectX Video Acceleration" , and now I found what I misunderstood
yet.

Ok, as you said, DirectX VA is implemented in the DMO.
I didn't know that the point before.
( I'm not good at english, you know that already ^^' )

To tell the truth, I've tried to make a custom player with WM ASF
Reader filter 2 weeks before.
It worked well for playing both of a local file and a streaming
content.
But, whenever it play a streaming content, it takes 10~20 seconds to
start play. And whenever I set a new position of the streaming
content, it takes 10~20 seconds to start at the position. This problem
becomes only when playing a streaming content not a local file. But
WMP9 has no problem like that.

(After I made a graph with WM ASF Reader filter, I called
IMediaControl::Run().
It always return after 10 ~ 20 seconds, and it causes my custom
player hangs
for 10 ~ 20 seconds. - Only with streaming content. )

So I thought that this problem was related with Directx VA and I had
to make a new source filter like WMP9's source filter.

Anyway, now I see the problem is not related with DirectX VA... so I
have to fix the problem from the beginning. ^^;

Really thanks again for a correct answer. You must be the most nice
man in this newsgroup.

Kim


"Jeremy Noring" <some...@thenet.com> wrote in message news:<ezzCT77U...@tk2msftngp13.phx.gbl>...

Iain

unread,
Jun 17, 2004, 4:12:52 AM6/17/04
to

"YS, Kim" <val...@nate.com> wrote in message
news:fcc9accb.0406...@posting.google.com...

> But, whenever it play a streaming content, it takes 10~20 seconds to
> start play. And whenever I set a new position of the streaming
> content, it takes 10~20 seconds to start at the position. This problem
> becomes only when playing a streaming content not a local file. But
> WMP9 has no problem like that.

You should look at the buffering properties on the filter (though I'm not
sure how you get to them). You should also make sure that you are using the
most recent ASF Reader filter (this is NOT the default).

Finally, the server determines if the stream can do without buffering (it's
called quick start or something) which is an option in the Verison 9 Media
Server. But I think it requires level 9 player components.

Iain


Jeremy Noring

unread,
Jun 17, 2004, 2:41:30 PM6/17/04
to
"YS, Kim" <val...@nate.com> wrote in message
news:fcc9accb.0406...@posting.google.com...
> Thank you so much, Jeremy.
>
> After I read your reply, I re-read the WMFSDK documents "Enabling
> DirectX Video Acceleration" , and now I found what I misunderstood
> yet.
>
> Ok, as you said, DirectX VA is implemented in the DMO.
> I didn't know that the point before.
> ( I'm not good at english, you know that already ^^' )

No worries--this stuff can be pretty confusing, even if English is your
*first* language. =)


> To tell the truth, I've tried to make a custom player with WM ASF
> Reader filter 2 weeks before.
> It worked well for playing both of a local file and a streaming
> content.
> But, whenever it play a streaming content, it takes 10~20 seconds to
> start play. And whenever I set a new position of the streaming
> content, it takes 10~20 seconds to start at the position. This problem
> becomes only when playing a streaming content not a local file. But
> WMP9 has no problem like that.

This is perhaps the biggest problem with the ASF Reader filter, especially
if using the "fast start" options on the Windows Media Server isn't
available for your application. I also wrote a source filter that
implements the Windows Media Format stuff, but I output compressed samples
instead of doing the decompression inside of my source filter. I'm shooting
for less than half a second. To do this, I'm going to have to remove all of
the WMF components entirely and parse the headers and packets myself. It'll
certainly be interesting....

I do know, however, that the buffering is internal to the WM ASF Reader
filter and has nothing to do with the DMO or VA stuff. It's just a sloppy
network implementation on MSFT's part.

Have you seen this site:

http://www.conferencexp.com

?

It may be useful to you if your application is entirely PC-based...

0 new messages