I have found a difference in the smoothness of video with my code using theora as compared to the sample code provided by you for the theora module. I will be highly obliged if you could help me out on the same. My code which creates a wrapper for theora is as below. Your help is solicited.
[Code]
'-----------------------------------------------------------------------------
' File: TheoraMovie.bmx
' Author: Ramesh D
' Description: TheoraMovie class for playing movies in Theora Format
' Usage: To create a TheoraMovie object the Create function of TheoraMovie is called with the parameters as follows: video file path, audio file path, x position,y position, width, height
'-----------------------------------------------------------------------------
Import pantson.theora
SuperStrict
Type TheoraMovie
Field _vid:Ttheora
'Field _aud:TSound
Field _frameimg:TImage
Field _xpos:Int
Field _ypos:Int
Field _width:Int
Field _height:Int
Field _state:Int
Field _soundchannel:TChannel
Const SkipVideo:Int = 1
Const EndVideo:Int = 2
Const StartVideo:Int = 3
Function Create:TheoraMovie(vidname:String,audname:String,xpos:Int,ypos:Int,width:Int,height:Int)
Local mov:TheoraMovie = New TheoraMovie
mov._vid=OpenTheora(vidname)
'mov._aud = LoadSound(audname)
mov._xpos=xpos
mov._ypos=ypos
mov._width=width
mov._height=height
mov._state=StartVideo
Return mov
End Function
Method ProcessInput(id:Int,x:Int,y:Int,data:Int)
Select(id)
Case EVENT_KEYDOWN
If data=KEY_ESCAPE
_state=SkipVideo
Close()
End If
End Select
End Method
Method Start()
_frameimg=CreateImage(TheoraWidth(_vid),TheoraHeight(_vid))
StartTheora(_vid)
'_soundchannel=PlaySound(_aud)
_vid.autoloop=False
End Method
Method Update(elapsedTime:Int)
End Method
Method Draw:Int()
If (DrawTheoraImage(_vid,_frameimg) = True)
DrawImage _frameimg,_xpos,_ypos
End If
Return _vid.eot
End Method
Method Close()
'StopChannel(_soundchannel)
CloseTheora(_vid)
End Method
Method EndOfMovie:Int()
Return _vid.eot
End Method
Method Pause()
'PauseChannel(_soundchannel)
PauseTheora(_vid)
End Method
End Type
'-------------------------------------------------------------------------------------------------------------------------------------
'Main loop
Local m:TheoraMovie
Graphics 800,600,0
' load in movie
m = TheoraMovie.Create("C:\\EAS_M.ogg","C:\\EAS_S.ogg",0,0,800,600)
m.Start()
' loop until EndOfTheora
While Not m.EndOfMovie() And Not KeyDown(key_escape)
m.Draw()
Flip
Wend
' close
m.Close()
End
[/Code]
Thanking You
Regards
[Code]
'-----------------------------------------------------------------------------
' File: TheoraMovie.bmx
' Author: Ramesh D
' Description: TheoraMovie class for playing movies in Theora Format
' Usage: To create a TheoraMovie object the Create function of TheoraMovie is called with the parameters as follows: video file path, audio file path, x position,y position, width, height
'-----------------------------------------------------------------------------
Import pantson.theora
SuperStrict
Type TheoraMovie
Field _vid:Ttheora
'Field _aud:TSound
Field _frameimg:TImage
Field _xpos:Int
Field _ypos:Int
Field _width:Int
Field _height:Int
Field _state:Int
Field _soundchannel:TChannel
Const SkipVideo:Int = 1
Const EndVideo:Int = 2
Const StartVideo:Int = 3
Function Create:TheoraMovie(vidname:String,audname:String,xpos:Int,ypos:Int,width:Int,height:Int)
Local mov:TheoraMovie = New TheoraMovie
mov._vid=OpenTheora(vidname)
'mov._aud = LoadSound(audname)
mov._xpos=xpos
mov._ypos=ypos
mov._width=width
mov._height=height
mov._state=StartVideo
Return mov
End Function
Method ProcessInput(id:Int,x:Int,y:Int,data:Int)
Select(id)
Case EVENT_KEYDOWN
If data=KEY_ESCAPE
_state=SkipVideo
Close()
End If
End Select
End Method
Method Start()
_frameimg=CreateImage(TheoraWidth(_vid),TheoraHeight(_vid))
StartTheora(_vid)
'_soundchannel=PlaySound(_aud)
_vid.autoloop=False
End Method
Method Update(elapsedTime:Int)
End Method
Method Draw:Int()
If (DrawTheoraImage(_vid,_frameimg) = True)
DrawImage _frameimg,_xpos,_ypos
End If
Return _vid.eot
End Method
Method Close()
'StopChannel(_soundchannel)
CloseTheora(_vid)
End Method
Method EndOfMovie:Int()
Return _vid.eot
End Method
Method Pause()
'PauseChannel(_soundchannel)
PauseTheora(_vid)
End Method
End Type
'-------------------------------------------------------------------------------------------------------------------------------------
'Main loop
Local m:TheoraMovie
Graphics 800,600,0
' load in movie
m = TheoraMovie.Create("C:\\EAS_M.ogg","C:\\EAS_S.ogg",0,0,800,600)
m.Start()
' loop until EndOfTheora
While Not m.EndOfMovie() And Not KeyDown(key_escape)
m.Draw()
Flip
Wend
' close
m.Close()
End
[/Code]
Thanking You
Regards