Commit aba6fd2c authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: do not report partial frame if we haven't met frame data

The frame splitter is set to report a partial frame even if we have not
met any frame data so far. The VDA can accommodate this, but the VD code
can be made simpler if we don't report these false positives.

BUG=b:149663704
TEST=vdatest passing on Hana.

Change-Id: I6a48ed0202386e8432243f0543b75779fa05312e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2131168
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756662}
parent 97251a5d
...@@ -184,6 +184,7 @@ bool H264InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data, ...@@ -184,6 +184,7 @@ bool H264InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data,
h264_parser_->SetStream(data, size); h264_parser_->SetStream(data, size);
H264NALU nalu; H264NALU nalu;
H264Parser::Result result; H264Parser::Result result;
bool has_frame_data = false;
*endpos = 0; *endpos = 0;
// Keep on peeking the next NALs while they don't indicate a frame // Keep on peeking the next NALs while they don't indicate a frame
...@@ -197,7 +198,8 @@ bool H264InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data, ...@@ -197,7 +198,8 @@ bool H264InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data,
} }
if (result == H264Parser::kEOStream) { if (result == H264Parser::kEOStream) {
// We've reached the end of the buffer before finding a frame boundary. // We've reached the end of the buffer before finding a frame boundary.
partial_frame_pending_ = true; if (has_frame_data)
partial_frame_pending_ = true;
*endpos = size; *endpos = size;
return true; return true;
} }
...@@ -207,6 +209,8 @@ bool H264InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data, ...@@ -207,6 +209,8 @@ bool H264InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data,
if (nalu.size < 1) if (nalu.size < 1)
return false; return false;
has_frame_data = true;
// For these two, if the "first_mb_in_slice" field is zero, start a // For these two, if the "first_mb_in_slice" field is zero, start a
// new frame and return. This field is Exp-Golomb coded starting on // new frame and return. This field is Exp-Golomb coded starting on
// the eighth data bit of the NAL; a zero value is encoded with a // the eighth data bit of the NAL; a zero value is encoded with a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment