Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I finnally got video rendering to texture FINNALLY but it only works in windowed mode, as soon as i go to full screen it only renders the first frame and then stops ?! Please help

       Public Sub PlayVideo(ByVal video As Dx9.Video)
           Try
           AddHandler video.TextureReadyToRender, AddressOf RenderVideo
           VBVid = New VertexBuffer(GetType(CustomVertex.TransformedTextured), 4, Me.device, 0, CustomVertex.TransformedTextured.Format, Pool.Default)
           Dim Verts As CustomVertex.TransformedTextured() = DirectCast(VBVid.Lock(0, 0), CustomVertex.TransformedTextured())
           With Verts(0)
               .X = 0
               .Y = 0
               .Z = 0
               .Rhw = 1
               .Tu = 0
               .Tv = 0
           End With
           With Verts(1)
               .X = device.DisplayMode.Width
               .Y = 0
               .Z = 0
               .Rhw = 1
               .Tu = 1
               .Tv = 0
           End With
           With Verts(2)
               .X = 0
               .Y = device.DisplayMode.Height
               .Z = 0
               .Rhw = 1
               .Tu = 0
               .Tv = 1
           End With
           With Verts(3)
               .X = device.DisplayMode.Width
               .Y = device.DisplayMode.Height
               .Z = 0
               .Rhw = 1
               .Tu = 1
               .Tv = 1
           End With
           VBVid.Unlock()
               video.RenderToTexture(device)
           Catch ex As Exception
               Debug.WriteLine(ex.ToString)
               LastException = ex
           End Try
       End Sub
       Private Sub RenderVideo(ByVal sender As Object, ByVal e As TextureRenderEventArgs)
           Clear(System.Drawing.Color.Black)
           BeginScene()
           device.SetStreamSource(0, VBVid, 0)
           device.VertexFormat = VBVid.Description.VertexFormat
           device.SetTexture(0, e.Texture)
           device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2)
           EndScene()
           Present()
       End Sub

All this is inside my D3D class which has a working initialised device, Note that it worked in Windowed mode, the DX9.video currently is just an audiovideoplayback.video (or whatever the basic dx video is) there is outside of the class another addhandler for video.ending that starts the gameloop (as this is the intro movie that im trying to get to work.

Posted

are u using the correct references

 

use the 900 references for ALL DX .. in ur project

 

reason so MS tried to be i dunno ... ****????**

the summer update 9.0B (901 references) does not contain support for hte video hence that could be a reason y ur video is not able to work properly only the 9.0A SDK works.. n now u can no longer dl it..

 

its not ur code i guess.

 

but den again if u revert to 900 there wld be a lot of problems in ur code.. sooner or later..

 

Hope MS comes out with the 901 reference for video...

Posted

umm

 

I just looked through my refrences and there is only a 900 build for audio video playback there is not 1901 build?! still doesnt work though!? and now im getting the No instance of the object in an unknown module error which is annoying (theres allready a post on fixing this here i just have to find it so dont reply to that error just video on this post please)

Posted

fwah..

 

ya MS decided to take out the audio video .. in summer update seriously dun ask me.. y i also would like to know y 2.

 

cos 900 video reference is incompatiable with 901 references of DX hence ur error.. i guess

  • 2 weeks later...
Posted

What is now Really Confussing

 

Ive just found out (i cant believe i didnt relise this) that i was using the 900 build for everything and getting that problem? Ive tried to use the 1901 build but im having trouble just getting it to initialize, ill frig with the 1901 build latter.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...