Skip to content
Snippets Groups Projects
  1. Dec 22, 2023
  2. Dec 21, 2023
  3. Dec 20, 2023
    • Aaron Boxer's avatar
    • Marek Vasut's avatar
      v4l2codecs: Switch gst_codec_picture_ts_ns() to gst_util_uint64_scale_int() · 5f3d4215
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      Instead of plain multiplication, use gst_util_uint64_scale_int()
      to achieve the same effect with additional checks.
      
      Part-of: <gstreamer/gstreamer!5791>
      5f3d4215
    • Marek Vasut's avatar
      v4l2codecs: Deduplicate picture frame number to timestamp in ns · 3335af0e
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      Add macro which converts picture frame number to suitable timestamp in
      nanoseconds for use in V4L2 VB2 buffer lookup. Since multiple codecs do
      the same operation and almost all got it wrong, do it in one place so it
      can be fixed in one place again, if needed.
      
      Part-of: <gstreamer/gstreamer!5791>
      3335af0e
    • Marek Vasut's avatar
      vp9decoder: Simplify gst_v4l2_codecs_vp9_dec_fill_refs() · 552a1716
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      In case reference_frames is NULL, return outright. Remove the
      duplicate check from subsequent conditionals. No functional change.
      
      Part-of: <gstreamer/gstreamer!5791>
      552a1716
    • Marek Vasut's avatar
      h265decoder: Align wraparound fix · 4560cdff
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      Instead of casting GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) to u64,
      use 1000ULL which is also u64 . This only aligns the behavior here
      with '*decoder: Fix multiplication wraparound' commits.
      
      Part-of: <gstreamer/gstreamer!5791>
      4560cdff
    • Marek Vasut's avatar
      h264decoder: Align wraparound fix · 7725aa7d
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      Instead of casting GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) to u64,
      use 1000ULL which is also u64 . This only aligns the behavior here
      with '*decoder: Fix multiplication wraparound' commits.
      
      Part-of: <gstreamer/gstreamer!5791>
      7725aa7d
    • Marek Vasut's avatar
      mpeg2decoder: Fix multiplication wraparound · 3cbf09d0
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      The GstMpeg2Picture system_frame_number is guint32, constant 1000 is guint32,
      GstV4l2CodecMpeg2Dec *_ref_ts multiplication result is u64 .
      
      ```
      u64 result = (u32)((u32)system_frame_number * (u32)1000);
      ```
      behaves the same as
      ```
      u64 result = (u32)(((u32)system_frame_number * (u32)1000) & 0xffffffff);
      ```
      
      so in case `system_frame_number > 4294967295 / 1000`, the `result` will
      wrap around. Since the `result` is really used as a cookie used to look
      up V4L2 buffers related to the currently decoded frame, this wraparound
      leads to visible corruption during MPEG2 decoding. At 30 FPS this occurs
      after cca. 40 hours of playback .
      
      Fix this by changing the 1000 from u32 to u64, i.e.:
      ```
      u64 result = (u64)((u32)system_frame_number * (u64)1000ULL);
      ```
      this way, the wraparound is prevented and the correct cookie is used.
      
      Part-of: <gstreamer/gstreamer!5791>
      3cbf09d0
    • Marek Vasut's avatar
      av1decoder: Fix multiplication wraparound · 50fb6f8c
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      The GstAV1Picture system_frame_number is guint32, constant 1000 is guint32,
      GstV4l2CodecAV1Dec v4l2_av1_frame.*_frame_ts multiplication result is u64 .
      
      ```
      u64 result = (u32)((u32)system_frame_number * (u32)1000);
      ```
      behaves the same as
      ```
      u64 result = (u32)(((u32)system_frame_number * (u32)1000) & 0xffffffff);
      ```
      
      so in case `system_frame_number > 4294967295 / 1000`, the `result` will
      wrap around. Since the `result` is really used as a cookie used to look
      up V4L2 buffers related to the currently decoded frame, this wraparound
      leads to visible corruption during AV1 decoding. At 30 FPS this occurs
      after cca. 40 hours of playback .
      
      Fix this by changing the 1000 from u32 to u64, i.e.:
      ```
      u64 result = (u64)((u32)system_frame_number * (u64)1000ULL);
      ```
      this way, the wraparound is prevented and the correct cookie is used.
      
      Part-of: <gstreamer/gstreamer!5791>
      50fb6f8c
    • Marek Vasut's avatar
      vp9decoder: Fix multiplication wraparound · 6f74818a
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      The GstVp9Picture system_frame_number is guint32, constant 1000 is guint32,
      GstV4l2CodecVp9Dec v4l2_vp9_frame.*_frame_ts multiplication result is u64 .
      
      ```
      u64 result = (u32)((u32)system_frame_number * (u32)1000);
      ```
      behaves the same as
      ```
      u64 result = (u32)(((u32)system_frame_number * (u32)1000) & 0xffffffff);
      ```
      
      so in case `system_frame_number > 4294967295 / 1000`, the `result` will
      wrap around. Since the `result` is really used as a cookie used to look
      up V4L2 buffers related to the currently decoded frame, this wraparound
      leads to visible corruption during VP9 decoding. At 30 FPS this occurs
      after cca. 40 hours of playback .
      
      Fix this by changing the 1000 from u32 to u64, i.e.:
      ```
      u64 result = (u64)((u32)system_frame_number * (u64)1000ULL);
      ```
      this way, the wraparound is prevented and the correct cookie is used.
      
      Part-of: <gstreamer/gstreamer!5791>
      6f74818a
    • Marek Vasut's avatar
      vp8decoder: Fix multiplication wraparound · 15c9a6ca
      Marek Vasut authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      The GstVp8Picture system_frame_number is guint32, constant 1000 is guint32,
      GstV4l2CodecVp8Dec v4l2_vp8_frame.*_frame_ts multiplication result is u64 .
      
      ```
      u64 result = (u32)((u32)system_frame_number * (u32)1000);
      ```
      behaves the same as
      ```
      u64 result = (u32)(((u32)system_frame_number * (u32)1000) & 0xffffffff);
      ```
      
      so in case `system_frame_number > 4294967295 / 1000`, the `result` will
      wrap around. Since the `result` is really used as a cookie used to look
      up V4L2 buffers related to the currently decoded frame, this wraparound
      leads to visible corruption during VP8 decoding. At 30 FPS this occurs
      after cca. 40 hours of playback .
      
      Fix this by changing the 1000 from u32 to u64, i.e.:
      ```
      u64 result = (u64)((u32)system_frame_number * (u64)1000ULL);
      ```
      this way, the wraparound is prevented and the correct cookie is used.
      
      Part-of: <gstreamer/gstreamer!5791>
      15c9a6ca
    • Xavier Claessens's avatar
      ntv2: Use a patch overlay instead of diff · 71b51f10
      Xavier Claessens authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      It is easier to maintain plain meson.build file instead of a diff. We
      can edit it directly.
      
      Part-of: <gstreamer/gstreamer!5843>
      71b51f10
    • Mengkejiergeli Ba's avatar
      h264parse: Remove dead code · 141cd387
      Mengkejiergeli Ba authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      Part-of: <gstreamer/gstreamer!5833>
      141cd387
    • Sebastian Dröge's avatar
      video-format: Fix format order once again · 2e86fb69
      Sebastian Dröge authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
      RGBA should be before RBGA. Both the Python script and the gstreamer-rs
      tests agree on that, but somehow this is not caught by the CI.
      
      Part-of: <gstreamer/gstreamer!5837>
      2e86fb69
  4. Dec 19, 2023
  5. Dec 18, 2023
  6. Dec 17, 2023
Loading