Skip to content
Snippets Groups Projects
  1. Oct 20, 2020
  2. Oct 19, 2020
    • Steve Lhomme's avatar
    • Steve Lhomme's avatar
      video_filter: add the possibility to full draining support · 012f2e68
      Steve Lhomme authored
      This type of draining is usually done before flushing (discontinuity) or before
      closing a filter modules.
      
      For now only the "in-line" draining is used.
      
      Ref #12155
      012f2e68
    • Steve Lhomme's avatar
      video_output: rework the first frame prepare · fc0fd84a
      Steve Lhomme authored
      The goal of this piece of code is to make sure we use
      ThreadDisplayPreparePicture with a displayed.current. It doesn't matter if it's
      the first or not. It won't be the first after a flush, for example. We don't
      need a temporary variable which is more confusing.
      
      ThreadDisplayPreparePicture with reuse will either use the picture remaining in
      the static filter chain, reuse the kept decoded+prepared picture if there is
      one, or get a picture from the decoder and prepare it. This picture is then
      set in displayed.current, since it was NULL.
      fc0fd84a
    • Steve Lhomme's avatar
    • Steve Lhomme's avatar
      picture: remove unneeded picture_HasChainedPics() · 06d3a334
      Steve Lhomme authored
      Now the p_next can only be used for picture chains, not chained pictures in one
      output.
      06d3a334
    • Steve Lhomme's avatar
    • Steve Lhomme's avatar
      eb9cbc8e
    • Steve Lhomme's avatar
      picture_chain: remove unused vlc_picture_chain_AppendChain · aa6649ea
      Steve Lhomme authored
      It was only temporary until we can properly drain pictures from filters. Now a
      filter must never return chained pictures. It must implement a drain instead.
      aa6649ea
    • Steve Lhomme's avatar
      filter_chain: remove dead code · 0032ac20
      Steve Lhomme authored
      - FilterChainVideoFilter
      - FilterDeletePictures
      - pending picture chain
      0032ac20
    • Steve Lhomme's avatar
      filter_chain: drain pictures filtering in filter_chain_VideoFilter() · f558ba7c
      Steve Lhomme authored
      In the past the drained pictures were stored in chained_filter_t::pending. Now
      they are either drained explicitly (filter_chain_VideoDrain) or dropped as
      they used to before doing a new filter call.
      
      Filtering with a NULL picture is no longer allowed.
      f558ba7c
    • Steve Lhomme's avatar
      filter_chain: rework filter_chain_VideoDrain() · 1a066f2d
      Steve Lhomme authored
      From the last filter in the chain to the first we:
      
      - drain to get a picture
      - if there is a picture we use it to filter it
      - if we have a picture from running all the filters, we return it
      - otherwise we try again to drain the filter that produced a picture
      - if that filter doesn't produce a picture anymore, we try the previous filter
        in the chain
      1a066f2d
    • Steve Lhomme's avatar
      3cd2573e
    • Steve Lhomme's avatar
      transcode: video: reindent code · 408156b5
      Steve Lhomme authored
      No functional changes
      408156b5
    • Steve Lhomme's avatar
      transcode: video: drain all filter chains sequentially until they're dry · 6f1ba397
      Steve Lhomme authored
      Loop while there are pictures to encode.
      
      - Start by filtering the first picture through each filter chain, and encode
      the result.
      - Then drain the first (non-null) filter chain and pass the result through
      the other filter chain, and encode the result.
      - Then drain the second (non-null) filter chain and pass the result through
      the other filter chain, and encode the result.
      - And so on, until there is no more filtered pictures to encode.
      6f1ba397
    • Steve Lhomme's avatar
      09963043
    • Steve Lhomme's avatar
    • Steve Lhomme's avatar
      filter_chain: separate the picture filtering from filter draining · aa040136
      Steve Lhomme authored
      The draining is done after the picture filtering. This is equivalent to how
      a picture was returned with all the chained pictures.
      
      filter_chain_VideoFilter does the same part as filter_chain_VideoFilter() when
      called with a NULL picture.
      
      For now filter_chain_VideoFilter() still handles the case where a NULL picture
      is used.
      aa040136
    • Steve Lhomme's avatar
      d41cd5ed
    • Steve Lhomme's avatar
      mmal/deinterlace: implement draining of extra pictures in deinterlacer · 81f5e56e
      Steve Lhomme authored
      Fix the source picture was released after turning it into a MMAL_BUFFER_HEADER_T.
      Not sure how this could work.
      
      The while loop to create output picture is turned into single calls. One in the
      filter function and others in the drain calls.
      The assert done before returning a valid picture is moved up in the Filter
      callback.
      
      We no longer return pictures chained using vlc_picture_chain_AppendChain().
      81f5e56e
    • Steve Lhomme's avatar
      vdpau: implement draining of extra pictures in deinterlacer · db1d094a
      Steve Lhomme authored
      We no longer return pictures chained using vlc_picture_chain_AppendChain().
      
      The original code was returning the source picture, with a few metadata changed
      and a secondary picture attached.
      
      The secondary picture, with a different date, is prepared during the drain. We
      keep a reference to the primary picture while waiting for the drain. This kept
      picture is released during a Flush or on Close.
      
      The last_pts that was used locally when chaining picture is kept as
      prev_last_pts to generate the secondary picture(s) during the drain.
      db1d094a
    • Steve Lhomme's avatar
      vaapi: implement draining of extra pictures in x2 deinterlacer · 8aa88740
      Steve Lhomme authored
      The picture used to create secondary pictures (cur) is kept as long as pictures
      are produced by the drain. It comes from the picture history so it will be
      released from there.
      
      cur_frame was either 0 (primary output) or 1 (secondary output). The value is
      used the same way in the filter and drain functions.
      
      The i_field_dur duration shift is only done for the drained picture.
      
      We no longer return pictures chained using vlc_picture_chain_AppendChain().
      8aa88740
    • Steve Lhomme's avatar
      deinterlace: implement draining of extra pictures · fd8cb4d9
      Steve Lhomme authored
      Each filter using the common deinterlacing code now calls DoDrain (similar to
      DoDeinterlacing) to do its draining.
      
      We no longer return pictures chained using vlc_picture_chain_AppendChain().
      
      DoDraining calls DoDeinterlacing internally with a NULL input picture. To
      create secondary pictures, the state to create the same pictures that were
      appended before is kept in the filter p_sys. The prev_pic is the original
      picture used to create the primary and secondary pictures. The picture is
      released when there is no more pictures to produce from this picture or during
      a Flush.
      
      Now DoDeinterlacing() only outputs one picture at a time. By default it outputs
      the current_field == 0 picture, then extra pictures up to max_fields.
      fd8cb4d9
    • Steve Lhomme's avatar
      fps: implement draining of extra pictures · 395366e7
      Steve Lhomme authored
      The p_previous_pic keeps the picture that was returned by Filter(), which is
      the basis for the extra pictures created during the drain, by incrementing by
      one "framerate tick" each output. We need to keep a reference as the output
      picture might be released by the caller, before the drain is called.
      
      We keep the original date of the incoming picture so we can compare to the
      "framerate" ticks to know if we need extra pictures or not.
      
      When expanding the frame rate, we have the following output:
      - pic0 -> original date
             -> original date + tick 1
      - pic1 -> original date + tick 2
             -> original date + tick 3
      - pic2 -> original date + tick 4
             -> original date + tick 5
      
      The date of the incoming picture is always included in the last output
      frame date + duration.
      
      The code assumes that enough drain calls will be done until the next filter
      call. (A flush in between is good as well)
      
      We no longer return pictures chained using vlc_picture_chain_AppendChain().
      395366e7
    • Steve Lhomme's avatar
      fps: only set the start date if there wasn't one set · eddb93aa
      Steve Lhomme authored
      If pictures are far in the future without a flush we fill the gap with extra
      pictures according to the "framerate" tick.
      
      Otherwise that code was never called since the condition to reset the clock was
      the same used to produce extra pictures.
      eddb93aa
    • Steve Lhomme's avatar
Loading