Commit 5947b309 authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/linux: Mark frames output by media::VideoDecoders as POWER_EFFICIENT.

This CL adds additional metadata to video frames being output by the new
media::VideoDecoders to mark the frames as POWER_EFFICIENT.

TEST=./video_decode_accelerator_tests

BUG=998547

Change-Id: I7b6c1c91c4ff43fbfc6f4f49fe9d2ffb8e2e401e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792206Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: David Staessens <dstaessens@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699562}
parent a81b884b
......@@ -325,6 +325,9 @@ void VideoDecoderPipeline::OnFrameDecoded(scoped_refptr<VideoFrame> frame) {
DCHECK(frame_converter_);
DVLOGF(4);
// Flag that the video frame was decoded in a power efficient way.
frame->metadata()->SetBoolean(VideoFrameMetadata::POWER_EFFICIENT, true);
frame_converter_->ConvertFrame(std::move(frame));
}
......
......@@ -307,6 +307,10 @@ void TestVDAVideoDecoder::PictureReady(const Picture& picture) {
DCHECK(wrapped_video_frame);
// Flag that the video frame was decoded in a power efficient way.
wrapped_video_frame->metadata()->SetBoolean(
VideoFrameMetadata::POWER_EFFICIENT, true);
// It's important to bind the original video frame to the destruction callback
// of the wrapped frame, to avoid deleting it before rendering of the wrapped
// frame is done. A reference to the video frame is already stored in
......
......@@ -349,6 +349,7 @@ void VideoDecoderClient::DecodeDoneTask(media::DecodeStatus status) {
void VideoDecoderClient::FrameReadyTask(scoped_refptr<VideoFrame> video_frame) {
DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_client_sequence_checker_);
DCHECK(video_frame->metadata()->IsTrue(VideoFrameMetadata::POWER_EFFICIENT));
frame_renderer_->RenderFrame(video_frame);
......
......@@ -1121,7 +1121,6 @@ void V4L2SliceVideoDecoder::RunOutputCB(scoped_refptr<VideoFrame> frame,
frame = std::move(wrapped_frame);
}
frame->metadata()->SetBoolean(VideoFrameMetadata::POWER_EFFICIENT, true);
// Although the document of VideoDecoder says "should run |output_cb| as soon
// as possible (without thread trampolining)", MojoVideoDecoderService still
......
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