[MPlayer-G2-dev] get_buffer/release_buffer vs. get_image/mpi
Ivan Kalvachev
ivan at cacad.com
Sun Jun 15 05:05:21 CEST 2003
Arpi said:
> Hi,
>
> I've spent some time thinking on the $SUBJ, but i finally found a small
> issue being a show-stopper: releasing teh buffer.
> I don't really understand/knwo how is it done in ffmpeg (Michael?) but I
> see it as a big issue in our codec/filter layer:
> Ok, you do get_buffer() at any time (init or decode), and when filled by
> content (decoded video) you return it to caller. But when and where will
> it be released? The codec cannot release it, as it have to return it to
> caller and the caller will use its content. The caller can't release it,
> as it don't know about the allocators future plans (maybe its used as
> reference frame...)
> Maybe some kind of reference counters could help there, but it adds
> extra complexity, while my primary goal was simplify the buffering code.
>
> So i've decided to keep the mpi stuff for now, maybe we'll check
> get/release thingie again at g3 :)
>
> But i still have some idea, by simplifying mpi a bit (remove _IP and
> _IPB types, and the one-get_image-per-one-decode-call restriction) but
> keep the current per-filter allocation and release-at-uninit
> implementation. But i'm not even sure it worth the mess.
>
>
> A'rpi / Astral & ESP-team
>
Sorry, I cannot understand what are you talking about?
I think that get/release_buffer works this way.
get_buffer when new frame is needed, codec gives the type (I,P or B)
release_buffer, then the frame is: compleate(drown/skiped) and displayed
and no longer used for prediction. ( i think that ffmpeg have some age
thing, donno why, probably this way it counts how many prediction buffer
it requers).
The only problem is that the displayed frame for the decoder is not
displayed frame for the mplayer, as mplayer should keep sync.
The bad side is that it is possible to allocate all available buffers, and
to stick on waiting for flip_page. Workaround it to allocate TEMP buffer
and render into it. This also leads to buffer ahead
Maybe i should send you a patch of my xvmc implementation.
For it I have made full use of get/release . I used 2 flags - first one
set by codec, sencond set by video system. If both flags are cleared then
buffer is free.
I warn you xvmc doesn't work yet, so i may have scrued up things compleatly:/
Best Regards
Ivan Kalvachev
More information about the MPlayer-G2-dev
mailing list