Kodi Community Forum
[WINDOWS] Internal Directshow Based Player [NO LONGER DEVELOPED] - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: [WINDOWS] Internal Directshow Based Player [NO LONGER DEVELOPED] (/showthread.php?tid=61355)



- blinkseb - 2010-11-04

cl0ud Wrote:Sorry to continue this topic but can I ask why DSPlayer needs to pass a direct 3d surface to the renderer?

Because it's a D3D application, not a simple Windows app. Everything you see on the screen is drawn on a D3DSurface, including the video.

DirectShow does not work that way, it creates its own window to renderer on, especially on VMR Windowed mode.

We need to have access to the D3D surface, and it's even not enough, we need to known *when* we should render the frame. That's why the renderer included in dsplayer are custom ones.


- cl0ud - 2010-11-05

I see, so I want to get my head around this.

XBMC-DSPlayer draws its navigational interface (play, stop, pause, seek, etc) to a direct3d surface that it created, correct?

DirectShow creates its own direct3d surface to render on?

I didn't realise that DSPlayer uses a custom renderer, I thought it was using an existing direct show renderer.

So your custom renderer renders to the same direct3d surface that the interface controls are drawn onto, does that sound right?

Therefore the problem is that MadVR renders to its own surface and so once a frame is rendered by madVR you probably need some way to get the rendered frame from MadVR and then draw it onto the Direct3D surface used by DSPlayer, along with any interface controls that need to be shown?

Am I understanding this correctly?

MadVR does all of the rendering of the video frame, would it not be enough to draw DSPlayer controls onto the MadVR surface? if MadVR is able to expose the surface.


- tiben20 - 2010-11-05

cl0ud Wrote:I see, so I want to get my head around this.

XBMC-DSPlayer draws its navigational interface (play, stop, pause, seek, etc) to a direct3d surface that it created, correct?

DirectShow creates its own direct3d surface to render on?

I didn't realise that DSPlayer uses a custom renderer, I thought it was using an existing direct show renderer.

So your custom renderer renders to the same direct3d surface that the interface controls are drawn onto, does that sound right?

Therefore the problem is that MadVR renders to its own surface and so once a frame is rendered by madVR you probably need some way to get the rendered frame from MadVR and then draw it onto the Direct3D surface used by DSPlayer, along with any interface controls that need to be shown?

Am I understanding this correctly?

MadVR does all of the rendering of the video frame, would it not be enough to draw DSPlayer controls onto the MadVR surface? if MadVR is able to expose the surface.
Dsplayer is like dvdplayer when it come to start the file but instead of creating a process for the video its starting a custom renderer which share the same d3d device as the main xbmc process. This is mainly why it is so easy to get a d3d error with the shared d3d device. The gui as nothing to do at all with the video renderer its only using a callback when a surface is ready to be drawn. If the callback timeout its only going to skip the part where it render the surface and draw the xbmc gui. This is why you can get a black screen with the gui over it when there a problem with your renderer(old problem).


- cl0ud - 2010-11-05

Ok so basically the reason why you use a shared direct3d surface and a custom renderer is because you are rendering the video frame and the gui to same surface?

So is this the only major reason why you cannot use a renderer that creates its own direct3d surface?


- tiben20 - 2010-11-05

cl0ud Wrote:Ok so basically the reason why you use a shared direct3d surface and a custom renderer is because you are rendering the video frame and the gui to same surface?

So is this the only major reason why you cannot use a renderer that creates its own direct3d surface?
No i didnt said shared d3d surface. I said a shared direct3d device.
In direct3d an application is using only one direct3d device. The d3d surfaces are created from the same d3d device. Were directly creating the d3d surface from the rendering thread but the d3d device pointer is coming from xbmc.


- blinkseb - 2010-11-05

cl0ud Wrote:Ok so basically the reason why you use a shared direct3d surface and a custom renderer is because you are rendering the video frame and the gui to same surface?

So is this the only major reason why you cannot use a renderer that creates its own direct3d surface?

If we know what to draw (= having a D3D surface), it's not an issue, as we can simply render the texture in our scene, but:
* DirectShow provides no way to request such texture, so we need a special way to do it (ie, knowing we are dealing with madvr and calling specials functions)
* Biggest problem is that we have *no* way to know when we are supposed to draw the frame! The only solution is that madVR must act as a mixer (see http://msdn.microsoft.com/en-us/library/ms701624%28v=VS.85%29.aspx). If madVR implements the EVR Mixer, we can easily use it.

Unless if madVR is able to act like a mixer, there won't be any possible support of it.


- EnderExx - 2010-11-05

Can anyone help me out I'm trying to get the dsplayer version of XBMC working on my HTPC. I'm using a Radeon HD 5670 card and I have tried multiple guides following them to the letter and read the wikis.

When I try to play something with dsplayer it says working in the bottom right hand corner for a second then the screen goes black for a split second then...reverts me right back to whatever I had selected to play via the xbmc interface. Please help.


- cl0ud - 2010-11-05

I've had another talk with MadShi,

he said he can add a callback function into madVR which will be called for every frame(after the frame has been rendered) and provide the surface interface for xbmc to draw onto. would that work for you?


- tiben20 - 2010-11-06

cl0ud Wrote:I've had another talk with MadShi,

he said he can add a callback function into madVR which will be called for every frame(after the frame has been rendered) and provide the surface interface for xbmc to draw onto. would that work for you?
It need a callback which contain the d3d surface. Because its the video which is rendered onto the xbmc gui. Currently madvr might be done in a way subtitles can be rendered onto.


- alexrose1uk - 2010-11-06

EnderExx Wrote:Can anyone help me out I'm trying to get the dsplayer version of XBMC working on my HTPC. I'm using a Radeon HD 5670 card and I have tried multiple guides following them to the letter and read the wikis.

When I try to play something with dsplayer it says working in the bottom right hand corner for a second then the screen goes black for a split second then...reverts me right back to whatever I had selected to play via the xbmc interface. Please help.

What you COULD be seeing is DVDPlayer dying, as it was broken in some recent DSplayer builds, and unless you've explicitly told it to, DSPlayer builds don't default to video playback with DSPlayer, they still use DVDPlayer.


Just to put yourself back to square one, I'd uninstall any codec packs or whatever you might be using on your PC, and your current install of XBMC, making sure to delete the profiles folder, and then check if MPC-HC will play the file *just to make sure there is no system wide issue*.

Once you've verified your system isn't going a little funny, install the latest build of DSPlayer, and install the FFDShow it comes with.

Do not change ANY configuration/xml files at this point, as you might have done before.

Open XBMC, and navigate to to the file you want to play, rather than just clicking (which uses DVDPlayer, the default XBMC player). Click C, which will bring up an options menu for the file. There should be an option saying 'play using', and inside this you can chose between DVDPlayer/DSPlayer.
Select DSPlayer and see if the file will play.

See if that helps at all.
The wikis and guides are a little confusing and could do with being tidied up. These days there is no reason to edit the XMLs immediately, unless its to change the default media player from DVDPlayer to DSPlayer.


Only reason I haven't swapped to DSPlayer yet is because I'm waiting for some of the fixes that have been made since the last release, which should come once Dharma has been brought out of beta, plus I know there's major improvements planned so looking forward to it. Smile

PS. There's a users support thread that might get you better support, this thread is really for the advanced people Smile


- blinkseb - 2010-11-06

cl0ud Wrote:I've had another talk with MadShi,

he said he can add a callback function into madVR which will be called for every frame(after the frame has been rendered) and provide the surface interface for xbmc to draw onto. would that work for you?

Well, it would need a lot of code rewriting, but I think it can be done.


- tiben20 - 2010-11-06

blinkseb Wrote:Well, it would need a lot of code rewriting, but I think it can be done.
its not that much we already use the callback way for both renderer. The only thing that would be trouble is if madvr is directly using the d3ddevice to render is stuff. If i remember how they its done in mpc-hc i think they provide the d3d device pointer to madvr.And madvr create is own 3d surface. And it also do the begin and endscene which would be a big trouble with xbmc.


- cl0ud - 2010-11-06

Couldn't it be done like this?

MadVR calls being scene
MadVR renders a frame
MadVR calls a callback function passing the d3 surface interface
XBMC renders the gui onto the surface
MadVR calls end scene.

just like rendering subtitles over the top of the video frame but instead your rendering gui stuff.


- liquidskin76 - 2010-11-06

EnderExx Wrote:Can anyone help me out I'm trying to get the dsplayer version of XBMC working on my HTPC. I'm using a Radeon HD 5670 card and I have tried multiple guides following them to the letter and read the wikis.

When I try to play something with dsplayer it says working in the bottom right hand corner for a second then the screen goes black for a split second then...reverts me right back to whatever I had selected to play via the xbmc interface. Please help.

Hi EnderExx,

Post a debug log via pastebin. That should tell us where it's tripping up. Wink It will be codec related.

One quick thing... are you using ffdshow dxva?

Cheers


- blinkseb - 2010-11-06

cl0ud Wrote:Couldn't it be done like this?

MadVR calls being scene
MadVR renders a frame
MadVR calls a callback function passing the d3 surface interface
XBMC renders the gui onto the surface
MadVR calls end scene.

just like rendering subtitles over the top of the video frame but instead your rendering gui stuff.

It's not possible, because you need to use the same D3D Device that xbmc. Moreover, beginscene has a lot of chance to have been already called.