On Sun, Jul 3, 2016 at 8:15 AM Paweł Goliński <golp...@gmail.com> wrote:

> Hi!
>
> I’m wondering what’s MLT requirement when it comes to producer’s supplied
> mlt_frame_get_image() and mlt_frame_get_audio() functions. Should they
> always work? Let me explain what I mean by that…
>
> In my producer I’m using a library which produces data asynchronously for
> a media file,
> and puts it into main memory (e.g. on heap). Basically what I get from the
> library is raw
> audio/image data stream of „in-sequence” frames. I’m moving this data to
> caches, from
> which my producer’s mlt_frame_get_image() and mlt_frame_get_audio() read
> data when it becomes available.
>
> So let’s say consumer requested frames for mlt_positions in that sequence:
> 1 2 3 4 10 11 12 13 18 19 20 5 6 7 8
>
> The questions are: Do I have a guarantee that consumer will get frames
> get_image() and get_audio() in that exactly sequence also?


Yes, the consumer gets them in the sequence it requests them.


> Can consumer call get_image(), get_audio() multiple times?
>

Yes, but a producer's get_image or get_audio function pointer is pushed
onto the frame's respective operation stacks only once, and they should be
popped on the first call to producer. Therefore, when consumer calls these
again, it usually gets the data stored on the frame.


>
> I’m asking because my producer’s design assumes that get_image()
> and get_audio() will be called in exactly that sequence, and exactly
>

You can not assume a frame's get_image will be called before get_audio.


> once [that is, when consumer calls get_frame(), I assume it will call
> get_image()
> and get_audio() somewhere in the future, but before next frame’s
> get_image()
> and get_audio() and it will do it exactly once] and I’m wondering whether
> the assumption is correct…
>

That sounds OK as long as you do not assume image before audio.


> (because if it isn’t, I may be in situation where data requested by MLT
> will never be in my cache again
> and I have a deadlock, so probably will need to redesign few things)
>
>
> Best,
> Paweł
>
>
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to