media: Spanify IvfParser::ParseNextFrame [chromium/src : main]

0 views
Skip to first unread message

Stephen Nusko (Gerrit)

unread,
Mar 1, 2026, 8:47:07 PMMar 1
to Bryan Enrique Gonzalez, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
Attention needed from Bryan Enrique Gonzalez

Stephen Nusko added 7 comments

File media/gpu/v4l2/test/av1_decoder.h
Line 113, Patchset 2 (Latest): base::raw_span<const uint8_t> ivf_frame_data_;
Stephen Nusko . unresolved

Is this file only used in tests? (I.E. no performance concerns about this raw_span?

File media/gpu/v4l2/test/av1_decoder.cc
Line 602, Patchset 2 (Latest): base::span<const uint8_t> temp_ivf_frame_data;
if (!ivf_parser_->ParseNextFrame(&ivf_frame_header_,
&temp_ivf_frame_data)) {
return ParsingResult::kEOStream;
}
ivf_frame_data_ = temp_ivf_frame_data;
Stephen Nusko . unresolved

What do you think about restricting the scope of this temporary (along with swiching to returning a span?

```
if (auto frame = ivf_parser_->ParseNextFrame(&ivf_frame_header_); frame.empty()) {
return ParsingResult::kEOStream;
} else {
ivf_frame_data_ = frame;
}
```
Line 639, Patchset 2 (Latest): buffer->mmapped_planes()[0].CopyIn(ivf_frame_data_.data(),
ivf_frame_data_.size());
}
Stephen Nusko . unresolved

This looks like test code and also it seems like it is very common to break apart the span and pass it through as a pointer + size and they store it already in a raw_ptr + length.

How do you think about switching MappedPlane's raw_ptr + length to a base::raw_span and adding a span overload for this case (then a follow up could remove usage of the non-span version), but here we could start by using it.

File media/gpu/v4l2/test/vp8_decoder.cc
Line 69, Patchset 2 (Latest): media::Vp8FrameHeader vp8_frame_header;
Stephen Nusko . unresolved

Strangely this type also holds a raw_ptr + length so should really just hold a raw_span, but definitely out of scope here, but there are only 6 callers of this `vp8_parser.ParseFrame` should we just add a span version and update it as well?

File media/gpu/v4l2/test/vp9_decoder.cc
Line 241, Patchset 2 (Latest): vp9_parser_->SetStream(ivf_frame_data.data(), ivf_frame_data.size(),
Stephen Nusko . unresolved

Same here it holds a raw_ptr already but at least we should add a span version of this function for now and migrate users over.

File media/gpu/vaapi/test/av1_decoder.h
Line 68, Patchset 2 (Latest): base::raw_span<const uint8_t> ivf_frame_data_;
Stephen Nusko . unresolved

Is this file only used in tests? I.E. no performance concerns about this raw_span?

File media/parsers/ivf_parser.h
Line 67, Patchset 2 (Latest): bool ParseNextFrame(IvfFrameHeader* frame_header,
Stephen Nusko . unresolved

I think I agree with the TODO `// TODO(crbug.com/40284755): 'ParseNextFrame' should return a span.` shouldn't ParseNextFrame return the span not update a span out param?

I.E this should be

```
for (auto bytes = ivf_parser.ParseNextFrame(...);
!bytes.empty(); bytes = ivf_parser.ParseNextFrame()) {
```
Open in Gerrit

Related details

Attention is currently required from:
  • Bryan Enrique Gonzalez
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
Gerrit-Change-Number: 7618331
Gerrit-PatchSet: 2
Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
Gerrit-Attention: Bryan Enrique Gonzalez <bryanen...@google.com>
Gerrit-Comment-Date: Mon, 02 Mar 2026 01:46:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Bryan Enrique Gonzalez (Gerrit)

unread,
Mar 2, 2026, 10:35:28 PMMar 2
to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com

Bryan Enrique Gonzalez added 7 comments

File media/gpu/v4l2/test/av1_decoder.h
Line 113, Patchset 2: base::raw_span<const uint8_t> ivf_frame_data_;
Stephen Nusko . resolved

Is this file only used in tests? (I.E. no performance concerns about this raw_span?

Bryan Enrique Gonzalez

Yes, it is only used in `//media/gpu/v4l2:v4l2_stateless_decoder`

File media/gpu/v4l2/test/av1_decoder.cc
Line 602, Patchset 2: base::span<const uint8_t> temp_ivf_frame_data;

if (!ivf_parser_->ParseNextFrame(&ivf_frame_header_,
&temp_ivf_frame_data)) {
return ParsingResult::kEOStream;
}
ivf_frame_data_ = temp_ivf_frame_data;
Stephen Nusko . resolved

What do you think about restricting the scope of this temporary (along with swiching to returning a span?

```
if (auto frame = ivf_parser_->ParseNextFrame(&ivf_frame_header_); frame.empty()) {
return ParsingResult::kEOStream;
} else {
ivf_frame_data_ = frame;
}
```
Bryan Enrique Gonzalez

Done

Line 639, Patchset 2: buffer->mmapped_planes()[0].CopyIn(ivf_frame_data_.data(),
ivf_frame_data_.size());
}
Stephen Nusko . resolved

This looks like test code and also it seems like it is very common to break apart the span and pass it through as a pointer + size and they store it already in a raw_ptr + length.

How do you think about switching MappedPlane's raw_ptr + length to a base::raw_span and adding a span overload for this case (then a follow up could remove usage of the non-span version), but here we could start by using it.

Bryan Enrique Gonzalez

Done

File media/gpu/v4l2/test/vp8_decoder.cc
Line 69, Patchset 2: media::Vp8FrameHeader vp8_frame_header;
Stephen Nusko . resolved

Strangely this type also holds a raw_ptr + length so should really just hold a raw_span, but definitely out of scope here, but there are only 6 callers of this `vp8_parser.ParseFrame` should we just add a span version and update it as well?

Bryan Enrique Gonzalez

Done

File media/gpu/v4l2/test/vp9_decoder.cc
Line 241, Patchset 2: vp9_parser_->SetStream(ivf_frame_data.data(), ivf_frame_data.size(),
Stephen Nusko . resolved

Same here it holds a raw_ptr already but at least we should add a span version of this function for now and migrate users over.

Bryan Enrique Gonzalez

Done

File media/gpu/vaapi/test/av1_decoder.h
Line 68, Patchset 2: base::raw_span<const uint8_t> ivf_frame_data_;
Stephen Nusko . resolved

Is this file only used in tests? I.E. no performance concerns about this raw_span?

Bryan Enrique Gonzalez

Yes, it is only used in `//media/gpu/vaapi:decode_test`

File media/parsers/ivf_parser.h
Line 67, Patchset 2: bool ParseNextFrame(IvfFrameHeader* frame_header,
Stephen Nusko . resolved

I think I agree with the TODO `// TODO(crbug.com/40284755): 'ParseNextFrame' should return a span.` shouldn't ParseNextFrame return the span not update a span out param?

I.E this should be

```
for (auto bytes = ivf_parser.ParseNextFrame(...);
!bytes.empty(); bytes = ivf_parser.ParseNextFrame()) {
```
Bryan Enrique Gonzalez

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
    Gerrit-Change-Number: 7618331
    Gerrit-PatchSet: 3
    Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
    Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-Comment-Date: Tue, 03 Mar 2026 03:35:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Stephen Nusko (Gerrit)

    unread,
    Mar 4, 2026, 2:58:06 AMMar 4
    to Bryan Enrique Gonzalez, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
    Attention needed from Bryan Enrique Gonzalez

    Stephen Nusko voted and added 4 comments

    Votes added by Stephen Nusko

    Code-Review+1

    4 comments

    File media/parsers/ivf_parser_unittest.cc
    Line 43, Patchset 4 (Latest): EXPECT_FALSE(payload.empty());
    Stephen Nusko . unresolved

    Isn't this impossible? we have a !payload.empty() inside the for loop condition.

    File media/parsers/vp8_parser.h
    Line 216, Patchset 4 (Latest): raw_ptr<const uint8_t, AllowPtrArithmetic | DanglingUntriaged> stream_;
    Stephen Nusko . unresolved

    Add a TODO that this should be a raw_span? I think I remember there being somewhere else as well in one of the other headers could you double check?

    File media/parsers/vp9_parser.h
    Line 370, Patchset 4 (Latest): void SetStream(const uint8_t* stream,
    Stephen Nusko . unresolved

    Should we add UNSAFE_BUFFER_USAGE? or to many callsites?

    File third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
    Line 39, Patchset 4 (Latest): auto buffer_span = base::span(buffer);
    Stephen Nusko . unresolved

    We don't really need `buffer_span` anymore just pass `base::span(buffer)` into the function directly?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Bryan Enrique Gonzalez
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
      Gerrit-Change-Number: 7618331
      Gerrit-PatchSet: 4
      Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
      Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
      Gerrit-Attention: Bryan Enrique Gonzalez <bryanen...@google.com>
      Gerrit-Comment-Date: Wed, 04 Mar 2026 07:57:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Bryan Enrique Gonzalez (Gerrit)

      unread,
      Mar 4, 2026, 6:25:26 PMMar 4
      to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
      Attention needed from Stephen Nusko

      Bryan Enrique Gonzalez added 4 comments

      File media/parsers/ivf_parser_unittest.cc
      Line 43, Patchset 4: EXPECT_FALSE(payload.empty());
      Stephen Nusko . resolved

      Isn't this impossible? we have a !payload.empty() inside the for loop condition.

      Bryan Enrique Gonzalez

      You're right! Thanks!

      File media/parsers/vp8_parser.h
      Line 216, Patchset 4: raw_ptr<const uint8_t, AllowPtrArithmetic | DanglingUntriaged> stream_;
      Stephen Nusko . resolved

      Add a TODO that this should be a raw_span? I think I remember there being somewhere else as well in one of the other headers could you double check?

      Bryan Enrique Gonzalez

      Done

      File media/parsers/vp9_parser.h
      Line 370, Patchset 4: void SetStream(const uint8_t* stream,
      Stephen Nusko . resolved

      Should we add UNSAFE_BUFFER_USAGE? or to many callsites?

      Bryan Enrique Gonzalez

      There were like 2 extra files, so I did update those too.

      File third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
      Line 39, Patchset 4: auto buffer_span = base::span(buffer);
      Stephen Nusko . resolved

      We don't really need `buffer_span` anymore just pass `base::span(buffer)` into the function directly?

      Bryan Enrique Gonzalez

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Stephen Nusko
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
        Gerrit-Change-Number: 7618331
        Gerrit-PatchSet: 5
        Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
        Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
        Gerrit-Comment-Date: Wed, 04 Mar 2026 23:25:14 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Stephen Nusko (Gerrit)

        unread,
        Mar 5, 2026, 12:25:15 AMMar 5
        to Bryan Enrique Gonzalez, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
        Attention needed from Bryan Enrique Gonzalez

        Stephen Nusko added 2 comments

        File media/gpu/test/raw_video.cc
        Line 346, Patchset 6 (Latest): UNSAFE_TODO(
        std::memcpy(vp9_data + vp9_data_size, packet->data, packet->size));
        Stephen Nusko . unresolved

        It might be nice to make this a span earlier to cover this one as well?

        CreateMemoryMappedFile above has methods to get access to a bytes span, if we wrap the packet into a span at the top we can do it once and do the rest of the work using span checked methods.

        File media/parsers/vp9_parser_unittest.cc
        Line 132, Patchset 6 (Latest):void Vp9ParserTest::CheckSubsampleValues(
        Stephen Nusko . unresolved

        There isn't a lot of callsites, just update `superframe` to be span?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Bryan Enrique Gonzalez
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
          Gerrit-Change-Number: 7618331
          Gerrit-PatchSet: 6
          Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
          Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
          Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
          Gerrit-Attention: Bryan Enrique Gonzalez <bryanen...@google.com>
          Gerrit-Comment-Date: Thu, 05 Mar 2026 05:24:53 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Bryan Enrique Gonzalez (Gerrit)

          unread,
          Mar 5, 2026, 3:41:19 PMMar 5
          to Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
          Attention needed from Stephen Nusko

          Bryan Enrique Gonzalez added 2 comments

          File media/gpu/test/raw_video.cc

          std::memcpy(vp9_data + vp9_data_size, packet->data, packet->size));
          Stephen Nusko . resolved

          It might be nice to make this a span earlier to cover this one as well?

          CreateMemoryMappedFile above has methods to get access to a bytes span, if we wrap the packet into a span at the top we can do it once and do the rest of the work using span checked methods.

          Bryan Enrique Gonzalez

          Done

          File media/parsers/vp9_parser_unittest.cc
          Line 132, Patchset 6:void Vp9ParserTest::CheckSubsampleValues(
          Stephen Nusko . resolved

          There isn't a lot of callsites, just update `superframe` to be span?

          Bryan Enrique Gonzalez

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Stephen Nusko
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
            Gerrit-Change-Number: 7618331
            Gerrit-PatchSet: 7
            Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
            Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
            Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
            Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
            Gerrit-Comment-Date: Thu, 05 Mar 2026 20:41:11 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Stephen Nusko (Gerrit)

            unread,
            Mar 9, 2026, 4:35:42 AM (13 days ago) Mar 9
            to Bryan Enrique Gonzalez, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
            Attention needed from Bryan Enrique Gonzalez

            Stephen Nusko added 11 comments

            Patchset-level comments
            File-level comment, Patchset 7 (Latest):
            Stephen Nusko . resolved

            I've retriggered the gpu-fyi to see if the test failure reproduces in which case we'll need to investigate it.

            File media/gpu/av1_decoder_unittest.cc
            Line 273, Patchset 7 (Latest): for (base::span<const uint8_t> data =
            Stephen Nusko . unresolved

            optional nit: `auto` might be reasonable here if you change the name from `data` to `bytes`?

            I.E.

            ```
            for (auto bytes = ...
            ```

            If that reads okay then update here and others.

            File media/gpu/test/raw_video.cc
            Line 343, Patchset 7 (Latest): base::span(packet->data, base::checked_cast<size_t>(packet->size)));
            Stephen Nusko . unresolved

            I think we can upgrade this to a UNSAFE_BUFFERS with a safety comment.

            ```
            // SAFETY: `av_read_frame` returns 0 if okay, and < 0 on error/end of file. On error the packet will be blank, however we checked that `av_read_frame` is >= 0 in the while loop above. On Success which is our case here `packet->buf` will be initialized, this has the side effect of also initializing the `packet->data` and `packet->size` fields that we create this span from.
            // See:
            // * `av_read_frame`: https://ffmpeg.org/doxygen/6.1/group__lavf__decoding.html#ga4fdb3084415a82e3810de6ee60e46a61
            // * `AVPacket`: https://ffmpeg.org/doxygen/6.1/structAVPacket.html
            base::span<const uint8_t> packet_span = UNSAFE_BUFFERS(
            base::span(packet->data, base::checked_cast<size_t>(packet->size)));
            ```
            File media/gpu/test/video_encoder/decoder_buffer_validator.cc
            Line 202, Patchset 7 (Latest): const DecoderBuffer& decoder_buffer = *buffer;
            Stephen Nusko . unresolved

            Do we need this variable anymore? I think we can remove it and just go `*buffer` when calling `ParseFrame`?

            Here and below

            File media/gpu/v4l2/test/v4l2_ioctl_shim.h
            Line 42, Patchset 7 (Latest): MmappedPlane(void* start, size_t len)
            : buffer(base::span(static_cast<uint8_t*>(start), len)) {}
            Stephen Nusko . unresolved

            How many times is this called? hard to tell from code search since we don't have cross referencing...

            Can you either

            1) Remove this constructor replacing it with a base::span<uint8_t> one?
            2) Add a new constructor that takes a span? and then just delegate this one to it? and add a comment deprecating this constructor.

            Thanks!

            Line 39, Patchset 7 (Latest): base::raw_span<uint8_t> buffer;
            Stephen Nusko . unresolved

            Can you make this const?

            I.E.

            `const base::raw_span<uint8_t> buffer`

            The reason I want to is because we eventually call munmap using this buffer, and we don't want to accidentally cause this buffer to ever get changed in position and size (even if we CopyIn data inside (the data that is pointed to is mutable the buffer itself isn't).

            Line 8, Patchset 7 (Latest):#ifdef UNSAFE_BUFFERS_BUILD
            // TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
            #pragma allow_unsafe_buffers
            #endif
            Stephen Nusko . unresolved

            I think you can remove this, you'll just need to I htink add a single UNSAFE_TODO in the MmappedPlane constructor?

            File media/gpu/v4l2/test/video_decoder.cc
            Line 216, Patchset 7 (Latest): const uint8_t* src = planes[0].buffer.data();
            const uint8_t* src_uv = src + src_size.width() * src_size.height();
            Stephen Nusko . unresolved

            Let's change this a bit so that we avoid the UNSAFE_TODO pointer + size logic (`src + ...`).

            ```
            const size_t kFullSize = src_size.width() * src_size.height();
            base::span<const uint8_t> src = planes[0].buffer;
            base::span<const uint8_t> src_uv = src.subspan(kFullSize);
            libyuv::NV12ToI420(src.data(), src_size.width(), src_uv.data(), src_size.width(), ... );
            ```

            And I THINK my understanding is that each of these should be kFullSize, so if you want you could also try

            ```
            const size_t kFullSize = src_size.width() * src_size.height();
            base::span<const uint8_t> src = planes[0].buffer.subspan(0, kFullSize);
            base::span<const uint8_t> src_uv = planes[0].buffer.subspan(kFullSize, kFullSize);
            libyuv::NV12ToI420(src.data(), src_size.width(), src_uv.data(), src_size.width(), ... );
            ```

            But only if it passes tests and doesn't crash 😄 because I'm not sure if 2 is the "real" semantics intended, I think it is because `src_size.width()` is passed as the stride which then is multipled by the number of rows (height), so option 1) is completely safe (it just does what the current code does a bit safer (because the index to `src_uv` is now bounds checked), but 2 is even safer because it ensures that assuming no bug in libyuv we will not write out of bounds of the `planes[0].buffer`.

            File media/parsers/ivf_parser.h
            Line 73, Patchset 7 (Latest): raw_ptr<const uint8_t, AllowPtrArithmetic> ptr_;
            Stephen Nusko . unresolved

            Is it unreasonable to make this private member variable a raw_span directly?

            Feels like that shouldn't be to hard, since nothing outside can call it.

            I see that Initialize might take a bit more work (although there isn't to many), but this switch of `ptr_` and `end_` to be a single raw_span should be straight forward and easy, and actually a performance improvement.

            Line 59, Patchset 7 (Latest): bool Initialize(const uint8_t* stream,
            size_t size,
            Stephen Nusko . unresolved

            Add a TODO to switch this to a span.

            File media/parsers/ivf_parser.cc
            Line 68, Patchset 7 (Latest): return {};
            Stephen Nusko . unresolved

            It says in the comment you added in the header:

            ```
            // It is also guaranteed the span will be of size |frame_header->frame_size|
            ```

            But in these error conditions we don't ensure that `frame_header->frame_size` is zero.

            Can you either

            1) Update the header to make clear that only on success do we promise this
            2) Actually set it to zero here and below.

            But it appears that 1) is easier to do since the second if condition implies that sometimes there isn't enough data for frame_size, but frame_size still has a valid value.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Bryan Enrique Gonzalez
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
              Gerrit-Change-Number: 7618331
              Gerrit-PatchSet: 7
              Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
              Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
              Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
              Gerrit-Attention: Bryan Enrique Gonzalez <bryanen...@google.com>
              Gerrit-Comment-Date: Mon, 09 Mar 2026 08:35:10 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Bryan Enrique Gonzalez (Gerrit)

              unread,
              Mar 11, 2026, 8:25:25 PM (10 days ago) Mar 11
              to AyeAye, Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
              Attention needed from Stephen Nusko

              Bryan Enrique Gonzalez added 10 comments

              File media/gpu/av1_decoder_unittest.cc
              Line 273, Patchset 7: for (base::span<const uint8_t> data =
              Stephen Nusko . resolved

              optional nit: `auto` might be reasonable here if you change the name from `data` to `bytes`?

              I.E.

              ```
              for (auto bytes = ...
              ```

              If that reads okay then update here and others.

              Bryan Enrique Gonzalez

              Done

              File media/gpu/test/raw_video.cc
              Line 343, Patchset 7: base::span(packet->data, base::checked_cast<size_t>(packet->size)));
              Stephen Nusko . resolved

              I think we can upgrade this to a UNSAFE_BUFFERS with a safety comment.

              ```
              // SAFETY: `av_read_frame` returns 0 if okay, and < 0 on error/end of file. On error the packet will be blank, however we checked that `av_read_frame` is >= 0 in the while loop above. On Success which is our case here `packet->buf` will be initialized, this has the side effect of also initializing the `packet->data` and `packet->size` fields that we create this span from.
              // See:
              // * `av_read_frame`: https://ffmpeg.org/doxygen/6.1/group__lavf__decoding.html#ga4fdb3084415a82e3810de6ee60e46a61
              // * `AVPacket`: https://ffmpeg.org/doxygen/6.1/structAVPacket.html
              base::span<const uint8_t> packet_span = UNSAFE_BUFFERS(
              base::span(packet->data, base::checked_cast<size_t>(packet->size)));
              ```
              Bryan Enrique Gonzalez

              Done

              File media/gpu/test/video_encoder/decoder_buffer_validator.cc
              Line 202, Patchset 7: const DecoderBuffer& decoder_buffer = *buffer;
              Stephen Nusko . resolved

              Do we need this variable anymore? I think we can remove it and just go `*buffer` when calling `ParseFrame`?

              Here and below

              Bryan Enrique Gonzalez

              Done

              File media/gpu/v4l2/test/v4l2_ioctl_shim.h
              Line 42, Patchset 7: MmappedPlane(void* start, size_t len)

              : buffer(base::span(static_cast<uint8_t*>(start), len)) {}
              Stephen Nusko . resolved

              How many times is this called? hard to tell from code search since we don't have cross referencing...

              Can you either

              1) Remove this constructor replacing it with a base::span<uint8_t> one?
              2) Add a new constructor that takes a span? and then just delegate this one to it? and add a comment deprecating this constructor.

              Thanks!

              Bryan Enrique Gonzalez

              Done

              Line 39, Patchset 7: base::raw_span<uint8_t> buffer;
              Stephen Nusko . resolved

              Can you make this const?

              I.E.

              `const base::raw_span<uint8_t> buffer`

              The reason I want to is because we eventually call munmap using this buffer, and we don't want to accidentally cause this buffer to ever get changed in position and size (even if we CopyIn data inside (the data that is pointed to is mutable the buffer itself isn't).

              Bryan Enrique Gonzalez

              Done

              Line 8, Patchset 7:#ifdef UNSAFE_BUFFERS_BUILD

              // TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
              #pragma allow_unsafe_buffers
              #endif
              Stephen Nusko . resolved

              I think you can remove this, you'll just need to I htink add a single UNSAFE_TODO in the MmappedPlane constructor?

              Bryan Enrique Gonzalez

              Done

              File media/gpu/v4l2/test/video_decoder.cc
              Line 216, Patchset 7: const uint8_t* src = planes[0].buffer.data();

              const uint8_t* src_uv = src + src_size.width() * src_size.height();
              Stephen Nusko . resolved

              Let's change this a bit so that we avoid the UNSAFE_TODO pointer + size logic (`src + ...`).

              ```
              const size_t kFullSize = src_size.width() * src_size.height();
              base::span<const uint8_t> src = planes[0].buffer;
              base::span<const uint8_t> src_uv = src.subspan(kFullSize);
              libyuv::NV12ToI420(src.data(), src_size.width(), src_uv.data(), src_size.width(), ... );
              ```

              And I THINK my understanding is that each of these should be kFullSize, so if you want you could also try

              ```
              const size_t kFullSize = src_size.width() * src_size.height();
              base::span<const uint8_t> src = planes[0].buffer.subspan(0, kFullSize);
              base::span<const uint8_t> src_uv = planes[0].buffer.subspan(kFullSize, kFullSize);
              libyuv::NV12ToI420(src.data(), src_size.width(), src_uv.data(), src_size.width(), ... );
              ```

              But only if it passes tests and doesn't crash 😄 because I'm not sure if 2 is the "real" semantics intended, I think it is because `src_size.width()` is passed as the stride which then is multipled by the number of rows (height), so option 1) is completely safe (it just does what the current code does a bit safer (because the index to `src_uv` is now bounds checked), but 2 is even safer because it ensures that assuming no bug in libyuv we will not write out of bounds of the `planes[0].buffer`.

              Bryan Enrique Gonzalez

              Done

              File media/parsers/ivf_parser.h
              Line 73, Patchset 7: raw_ptr<const uint8_t, AllowPtrArithmetic> ptr_;
              Stephen Nusko . resolved

              Is it unreasonable to make this private member variable a raw_span directly?

              Feels like that shouldn't be to hard, since nothing outside can call it.

              I see that Initialize might take a bit more work (although there isn't to many), but this switch of `ptr_` and `end_` to be a single raw_span should be straight forward and easy, and actually a performance improvement.

              Bryan Enrique Gonzalez

              Done

              Line 59, Patchset 7: bool Initialize(const uint8_t* stream,
              size_t size,
              Stephen Nusko . resolved

              Add a TODO to switch this to a span.

              Bryan Enrique Gonzalez

              Done

              File media/parsers/ivf_parser.cc
              Line 68, Patchset 7: return {};
              Stephen Nusko . resolved

              It says in the comment you added in the header:

              ```
              // It is also guaranteed the span will be of size |frame_header->frame_size|
              ```

              But in these error conditions we don't ensure that `frame_header->frame_size` is zero.

              Can you either

              1) Update the header to make clear that only on success do we promise this
              2) Actually set it to zero here and below.

              But it appears that 1) is easier to do since the second if condition implies that sometimes there isn't enough data for frame_size, but frame_size still has a valid value.

              Bryan Enrique Gonzalez

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Stephen Nusko
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                Gerrit-Change-Number: 7618331
                Gerrit-PatchSet: 8
                Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
                Gerrit-Comment-Date: Thu, 12 Mar 2026 00:25:05 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Stephen Nusko (Gerrit)

                unread,
                Mar 12, 2026, 1:06:26 AM (10 days ago) Mar 12
                to Bryan Enrique Gonzalez, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
                Attention needed from Bryan Enrique Gonzalez

                Stephen Nusko added 3 comments

                File media/gpu/v4l2/test/v4l2_ioctl_shim.cc
                Line 159, Patchset 8 (Latest): for (const auto& [buffer, bytes_used] : mmapped_planes_) {
                Stephen Nusko . unresolved

                nit: '_' is the normal name for an unused variable.

                ```suggestion
                for (const auto& [buffer, _] : mapped_planes_) {
                ```
                File media/gpu/v4l2/test/video_decoder.cc
                Line 218, Patchset 8 (Latest): base::span<const uint8_t> src = planes[0].buffer.first(kFullSize);
                base::span<const uint8_t> src_uv = src.subspan(kFullSize, kFullSize);
                Stephen Nusko . unresolved

                Please add a comment about what each represents and check that it matches, this code as written makes src_uv an empty span.

                Why?

                Because

                `base::span<const uint8_t> src = planes[0].buffer.first(kFullSize);`

                makes `src` be a span of size kFullSpan

                `base::span<const uint8_t> src_uv = src.subspan(kFullSize, kFullSize);`

                Makes srv_uv a span that starts kFullSpan after the start of `src` (which remember is size kFullSpan, and should have kFullSpan elements (this should crash when tested.

                You need something like

                ```
                base::span<const uint8_t> src = planes[0].buffer.first(kFullSize);

                base::span<const uint8_t> src_uv = planes[0].buffer.subspan(kFullSize, kFullSize);
                ```

                So each is independently sized, this is a little tricky and as such you should add a comment describing that state.

                ```
                // planes[0].buffer represents a buffer split into a single plan where the main pixels are found in the kFullSize bytes and the srv_uv is encoded in the next kFullSize bytes.
                // planes[0].buffer == | kFullSize src bytes | kFullSize src_uv bytes|.
                ...
                ```

                This also likely means that these aren't tested on the CQ, could you see if you can track down how they work and verify them locally?

                File media/parsers/ivf_parser.cc
                Stephen Nusko . resolved

                It says in the comment you added in the header:

                ```
                // It is also guaranteed the span will be of size |frame_header->frame_size|
                ```

                But in these error conditions we don't ensure that `frame_header->frame_size` is zero.

                Can you either

                1) Update the header to make clear that only on success do we promise this
                2) Actually set it to zero here and below.

                But it appears that 1) is easier to do since the second if condition implies that sometimes there isn't enough data for frame_size, but frame_size still has a valid value.

                Bryan Enrique Gonzalez

                Done

                Stephen Nusko

                In this scenario it helps the reviewer if you said which you did (you did 1.)

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Bryan Enrique Gonzalez
                Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  • requirement is not satisfiedReview-Enforcement
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                  Gerrit-Change-Number: 7618331
                  Gerrit-PatchSet: 8
                  Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                  Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                  Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                  Gerrit-Attention: Bryan Enrique Gonzalez <bryanen...@google.com>
                  Gerrit-Comment-Date: Thu, 12 Mar 2026 05:05:57 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Bryan Enrique Gonzalez <bryanen...@google.com>
                  Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Bryan Enrique Gonzalez (Gerrit)

                  unread,
                  Mar 18, 2026, 3:14:37 PM (3 days ago) Mar 18
                  to AyeAye, Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com

                  Bryan Enrique Gonzalez added 2 comments

                  File media/gpu/v4l2/test/v4l2_ioctl_shim.cc
                  Line 159, Patchset 8: for (const auto& [buffer, bytes_used] : mmapped_planes_) {
                  Stephen Nusko . resolved

                  nit: '_' is the normal name for an unused variable.

                  ```suggestion
                  for (const auto& [buffer, _] : mapped_planes_) {
                  ```
                  Bryan Enrique Gonzalez

                  Done

                  File media/parsers/ivf_parser.cc
                  Stephen Nusko . resolved

                  It says in the comment you added in the header:

                  ```
                  // It is also guaranteed the span will be of size |frame_header->frame_size|
                  ```

                  But in these error conditions we don't ensure that `frame_header->frame_size` is zero.

                  Can you either

                  1) Update the header to make clear that only on success do we promise this
                  2) Actually set it to zero here and below.

                  But it appears that 1) is easier to do since the second if condition implies that sometimes there isn't enough data for frame_size, but frame_size still has a valid value.

                  Bryan Enrique Gonzalez

                  Done

                  Stephen Nusko

                  In this scenario it helps the reviewer if you said which you did (you did 1.)

                  Bryan Enrique Gonzalez

                  Oops, sorry, forgot to mention. Thanks!

                  Open in Gerrit

                  Related details

                  Attention set is empty
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  • requirement is not satisfiedReview-Enforcement
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                  Gerrit-Change-Number: 7618331
                  Gerrit-PatchSet: 9
                  Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                  Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                  Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                  Gerrit-Comment-Date: Wed, 18 Mar 2026 19:14:21 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Stephen Nusko (Gerrit)

                  unread,
                  Mar 18, 2026, 9:01:32 PM (3 days ago) Mar 18
                  to Bryan Enrique Gonzalez, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
                  Attention needed from Bryan Enrique Gonzalez

                  Stephen Nusko voted and added 1 comment

                  Votes added by Stephen Nusko

                  Code-Review+1

                  1 comment

                  Patchset-level comments
                  File-level comment, Patchset 9 (Latest):
                  Stephen Nusko . resolved

                  LGTM, lets do the local chromeOS test to ensure it actually works, and then do follow up CL to switch some of these raw_ptr + size into raw_spans.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Bryan Enrique Gonzalez
                  Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Owners
                    • requirement is not satisfiedCode-Review
                    • requirement is not satisfiedNo-Unresolved-Comments
                    • requirement satisfiedReview-Enforcement
                    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                    Gerrit-MessageType: comment
                    Gerrit-Project: chromium/src
                    Gerrit-Branch: main
                    Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                    Gerrit-Change-Number: 7618331
                    Gerrit-PatchSet: 9
                    Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                    Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                    Gerrit-Attention: Bryan Enrique Gonzalez <bryanen...@google.com>
                    Gerrit-Comment-Date: Thu, 19 Mar 2026 01:00:56 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Bryan Enrique Gonzalez (Gerrit)

                    unread,
                    Mar 20, 2026, 5:14:25 PM (yesterday) Mar 20
                    to Hirokazu Honda, Dale Curtis, Stephen Nusko, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
                    Attention needed from Dale Curtis and Hirokazu Honda

                    Bryan Enrique Gonzalez added 1 comment

                    Patchset-level comments
                    Stephen Nusko . resolved

                    LGTM, lets do the local chromeOS test to ensure it actually works, and then do follow up CL to switch some of these raw_ptr + size into raw_spans.

                    Bryan Enrique Gonzalez

                    CL passed local tests :)
                    Thanks @hi...@chromium.org

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Dale Curtis
                    • Hirokazu Honda
                    Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Owners
                    • requirement is not satisfiedCode-Review
                    • requirement is not satisfiedNo-Unresolved-Comments
                    • requirement satisfiedReview-Enforcement
                    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                    Gerrit-MessageType: comment
                    Gerrit-Project: chromium/src
                    Gerrit-Branch: main
                    Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                    Gerrit-Change-Number: 7618331
                    Gerrit-PatchSet: 9
                    Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                    Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
                    Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
                    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                    Gerrit-Attention: Hirokazu Honda <hi...@chromium.org>
                    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
                    Gerrit-Comment-Date: Fri, 20 Mar 2026 21:14:13 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Bryan Enrique Gonzalez (Gerrit)

                    unread,
                    Mar 20, 2026, 5:26:39 PM (yesterday) Mar 20
                    to Guido Urdaneta, Hirokazu Honda, Dale Curtis, Stephen Nusko, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
                    Attention needed from Dale Curtis, Guido Urdaneta and Hirokazu Honda

                    Bryan Enrique Gonzalez added 1 comment

                    Patchset-level comments
                    Bryan Enrique Gonzalez . resolved

                    Hi! Could you please help me with a review? I was hoping you could help me with following areas:

                    Thank you everyone

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Dale Curtis
                    • Guido Urdaneta
                    • Hirokazu Honda
                    Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Owners
                    • requirement is not satisfiedCode-Review
                    • requirement is not satisfiedNo-Unresolved-Comments
                    • requirement satisfiedReview-Enforcement
                    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                    Gerrit-MessageType: comment
                    Gerrit-Project: chromium/src
                    Gerrit-Branch: main
                    Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                    Gerrit-Change-Number: 7618331
                    Gerrit-PatchSet: 9
                    Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                    Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
                    Gerrit-Reviewer: Guido Urdaneta <gui...@chromium.org>
                    Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
                    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                    Gerrit-Attention: Hirokazu Honda <hi...@chromium.org>
                    Gerrit-Attention: Guido Urdaneta <gui...@chromium.org>
                    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
                    Gerrit-Comment-Date: Fri, 20 Mar 2026 21:26:24 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Bryan Enrique Gonzalez (Gerrit)

                    unread,
                    Mar 20, 2026, 5:27:12 PM (yesterday) Mar 20
                    to Guido Urdaneta, Hirokazu Honda, Dale Curtis, Stephen Nusko, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, blink-...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, fuzzin...@chromium.org, kinuko...@chromium.org, media-cro...@chromium.org, vaapi-...@chromium.org, video-networking...@google.com
                    Attention needed from Dale Curtis, Guido Urdaneta and Hirokazu Honda

                    Bryan Enrique Gonzalez added 1 comment

                    File media/gpu/v4l2/test/video_decoder.cc
                    Line 218, Patchset 8: base::span<const uint8_t> src = planes[0].buffer.first(kFullSize);

                    base::span<const uint8_t> src_uv = src.subspan(kFullSize, kFullSize);
                    Stephen Nusko . resolved

                    Please add a comment about what each represents and check that it matches, this code as written makes src_uv an empty span.

                    Why?

                    Because

                    `base::span<const uint8_t> src = planes[0].buffer.first(kFullSize);`

                    makes `src` be a span of size kFullSpan

                    `base::span<const uint8_t> src_uv = src.subspan(kFullSize, kFullSize);`

                    Makes srv_uv a span that starts kFullSpan after the start of `src` (which remember is size kFullSpan, and should have kFullSpan elements (this should crash when tested.

                    You need something like

                    ```
                    base::span<const uint8_t> src = planes[0].buffer.first(kFullSize);
                    base::span<const uint8_t> src_uv = planes[0].buffer.subspan(kFullSize, kFullSize);
                    ```

                    So each is independently sized, this is a little tricky and as such you should add a comment describing that state.

                    ```
                    // planes[0].buffer represents a buffer split into a single plan where the main pixels are found in the kFullSize bytes and the srv_uv is encoded in the next kFullSize bytes.
                    // planes[0].buffer == | kFullSize src bytes | kFullSize src_uv bytes|.
                    ...
                    ```

                    This also likely means that these aren't tested on the CQ, could you see if you can track down how they work and verify them locally?

                    Bryan Enrique Gonzalez

                    Done

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Dale Curtis
                    • Guido Urdaneta
                    • Hirokazu Honda
                    Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not satisfiedCode-Owners
                      • requirement is not satisfiedCode-Review
                      • requirement satisfiedReview-Enforcement
                      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                      Gerrit-MessageType: comment
                      Gerrit-Project: chromium/src
                      Gerrit-Branch: main
                      Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                      Gerrit-Change-Number: 7618331
                      Gerrit-PatchSet: 9
                      Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                      Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
                      Gerrit-Reviewer: Guido Urdaneta <gui...@chromium.org>
                      Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
                      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                      Gerrit-Attention: Hirokazu Honda <hi...@chromium.org>
                      Gerrit-Attention: Guido Urdaneta <gui...@chromium.org>
                      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
                      Gerrit-Comment-Date: Fri, 20 Mar 2026 21:26:50 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: No
                      Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Hirokazu Honda (Gerrit)

                      unread,
                      7:14 PM (4 hours ago) 7:14 PM
                      to blink-...@chromium.org
                      Attention needed from Bryan Enrique Gonzalez, Dale Curtis and Guido Urdaneta

                      Hirokazu Honda voted Code-Review+1

                      Code-Review+1
                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Bryan Enrique Gonzalez
                      • Dale Curtis
                      • Guido Urdaneta
                      Submit Requirements:
                        • requirement satisfiedCode-Coverage
                        • requirement is not satisfiedCode-Owners
                        • requirement satisfiedCode-Review
                        • requirement satisfiedReview-Enforcement
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: chromium/src
                        Gerrit-Branch: main
                        Gerrit-Change-Id: I5a4c43190e59a1921ca0424753696698169145da
                        Gerrit-Change-Number: 7618331
                        Gerrit-PatchSet: 9
                        Gerrit-Owner: Bryan Enrique Gonzalez <bryanen...@google.com>
                        Gerrit-Reviewer: Bryan Enrique Gonzalez <bryanen...@google.com>
                        Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
                        Gerrit-Reviewer: Guido Urdaneta <gui...@chromium.org>
                        Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
                        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                        Gerrit-Attention: Bryan Enrique Gonzalez <bryanen...@google.com>
                        Gerrit-Attention: Guido Urdaneta <gui...@chromium.org>
                        Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
                        Gerrit-Comment-Date: Sat, 21 Mar 2026 23:14:12 +0000
                        Gerrit-HasComments: No
                        Gerrit-Has-Labels: Yes
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy
                        Reply all
                        Reply to author
                        Forward
                        0 new messages