From: Ashendra S. <ash...@sp...> - 2004-07-09 15:12:31
|
This would mean i would have to divide up the slices within decode.c and spawn threads there so that they could share a common xine frame to draw to, or is this achievable at a higher level in the decode chain? I think i've managed to get libmpeg2 to selectively decode the slices i'm interested in but am unable to get xine the display even the incomplete frames because of incomplete timecode info. picture->current_frame and picture->backward_frame_reference_frame are the same with picture->forward_reference_frame=0. I'm using an almost unmodified version of parse_chunk and it expects to recieve complete frames, do i maybe have to rearrange the entire structure of decode.c or is there any easier way to do this that i'm not thinking of? thanks, > Hi, > > > I was trying to get libmpeg2 to decode only slices it was passed, so the > > app (xine here) would then accumulate the decoded slices and reassemble > > them into a complete frame. I'm trying to get xine to simultaneously run > > multiple instances of libmpeg2 each of which decodes separate slices in > > parallel. From libmpeg2's point of view, it would not be changed in any > > way. I was wondering now what would be the most efficient way of > > reassembling the decoded slices into complete frames. > > I think you could simply have one target xine frame where all threads are > writing their decoded slices to. If MPEG2 slices do not overlap (not sure > about that, but I think this is true) there should be no race conditions. > Then you could add a lock-protected counter which counts the amount of > slices that finished decoding. Everyone who increments this counter would > check, if all slices are done and, if so, draws the frame. > > Michael -- Ashendra |