Code review

johny5

18-07-2009 18:18:10

Hello.

I've reviewed your small project of Theora integration with Ogre.
A couple comments:
1. Small syntax bug, Theora Video Frame, line 48: delete[] mBuffer

2. Function requestWork
TheoraVideoClip* TheoraVideoManager::requestWork()
{
if (mClips.size() == 0) return NULL;
return mClips.front();
}
implemented in such a way, that it'll not allow to decode more than one video clip simultaneously. It refers to the Handle multiple videos thread

3. If you're using threads - it's time to consider synchronizations. This naive code:
mClip->mAssignedWorkerThread=this;

mClip->decodeNextFrame();

mClip->mAssignedWorkerThread=NULL;

would never work properly.


Good luck!

johny5

19-08-2009 09:57:26

I've refactored the source code of Kreso, & laying out the result as a .rar archive.
Here is a list of changes:

Good changes
* Source code refactoring to the cleaner architecture
* True multithreading video decoding, currently using 1-2 decoding threads (potentially any number of threads, just 1-2 is a reasonable number)
* Proper interthread synchronization (however not thoroughly tested, only "multiple video" demo is tested)
* Fast mutex synchronization, video decoding performance greatly boosted
* No black right-bottom areas anymore while using TexturePtr (you may want to remove any texture matrixes if you've used it before)

Bad/breaking up changes:
* VS2005 project now
* Include/Lib paths are changed, so you should tune them manually
* "Use Unicode Character Set" for project settings
* _SECURE_SCL=0 macro for release build
(to summ, if you want to keep all the same project settings you have, just use your project file and simply update files list.
I guess it is simplier then track all the changes I made for myself)
* Lack of Linux support in couple of places, but it would be not difficult to port WINAPI/Intrinsic calls to the Linux analogs, because they're localized and to the lowest notch


There is still room for optimization, esp. concerning audio decoding. So, during developing of my own project (Tachyon Wars) I promise I will release optimization & bugfix updates will be implemented for my project.

Evgeny

Kreso

29-10-2009 08:27:51

Cool! I'll review your changes in the next few days and see what I'll include.

and yes, I know some parts aren't perfect, the project is still early beta.