media_play on locked panel bmap

Posted By: BySharDe

media_play on locked panel bmap - 07/20/12 06:47

I tested a demo postprocessing on a movie.
see http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=404795#Post404795

However, I found that the panel texture playing movie on it, do not have a "lock/unloack" mechanism. It means that when you apply bmap_process, the source image(movie texture) may have parts of two different frames' content, which will come into "interlacement".

How to make sure that
1 lock the panel to be played with movie
2 finish playing a full frame of movie
3 unlock the movie panel
4 processing it
5 lock the movie panel and play the next frame
and so on ?
This is some of "thread synchronization", right?
Posted By: BySharDe

Re: media_play on locked panel bmap - 07/20/12 07:03

The idea is like this

Code:
movie_handle = media_play(file1, myblack, 100);
while(media_playing(movie_handle))
{
	bmap_lock(myblack,0); // 1.work a little
	bmap_lock(P.bmap,0);
	
	media_pause(movie_handle); // 2.work well but cause low movie speed

	bmap_process(P.bmap,myblack,mysunglass);
	
	media_start(movie_handle);
	
	bmap_unlock(myblack);
	bmap_unlock(P.bmap);
	
	wait(1);
}


© 2024 lite-C Forums