Commit 44323658 authored by Dan Sanders's avatar Dan Sanders Committed by Commit Bot

[media] Enable MojoVideoDecoder by default.

Experiments have been uneventful for many weeks. Enable by default for M72.

TimeToFirstFrame is negatively impacted by this change, as the startup IPC now
hops throught the browser where before it went directly over the GPU channel.
The cost is typically less than 30ms. Reconfigurations are faster because
PictureBuffer allocation no longer requires any IPC.

Bug: 522298
Change-Id: I40ea00150f7dadfe2319e2cdb27e3be5f29a702c
Reviewed-on: https://chromium-review.googlesource.com/c/1315940
Commit-Queue: Dan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605752}
parent 7caea766
......@@ -259,16 +259,9 @@ const base::Feature kBackgroundVideoPauseOptimization{
const base::Feature kMemoryPressureBasedSourceBufferGC{
"MemoryPressureBasedSourceBufferGC", base::FEATURE_DISABLED_BY_DEFAULT};
// Enable MojoVideoDecoder. On Android, we use this by default. Elsewhere,
// it's experimental.
const base::Feature kMojoVideoDecoder {
"MojoVideoDecoder",
#if defined(OS_ANDROID)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
// Enable MojoVideoDecoder, replacing GpuVideoDecoder.
const base::Feature kMojoVideoDecoder{"MojoVideoDecoder",
base::FEATURE_ENABLED_BY_DEFAULT};
// Enable The D3D11 Video decoder. Must also enable MojoVideoDecoder for
// this to have any effect.
......
......@@ -770,11 +770,8 @@ bool DXVAVideoDecodeAccelerator::Initialize(const Config& config,
break;
}
}
if (!profile_supported) {
RETURN_AND_NOTIFY_ON_FAILURE(false,
"Unsupported h.264, vp8, or vp9 profile",
PLATFORM_FAILURE, false);
}
RETURN_ON_FAILURE(profile_supported, "Unsupported h.264, vp8, or vp9 profile",
false);
if (config.profile == VP9PROFILE_PROFILE2 ||
config.profile == VP9PROFILE_PROFILE3 ||
......@@ -819,47 +816,38 @@ bool DXVAVideoDecodeAccelerator::Initialize(const Config& config,
::GetProcAddress(dxgi_manager_dll, "MFCreateDXGIDeviceManager"));
}
RETURN_AND_NOTIFY_ON_FAILURE(make_context_current_cb_.Run(),
"Failed to make context current",
PLATFORM_FAILURE, false);
RETURN_ON_FAILURE(make_context_current_cb_.Run(),
"Failed to make context current", false);
RETURN_AND_NOTIFY_ON_FAILURE(
RETURN_ON_FAILURE(
gl::g_driver_egl.ext.b_EGL_ANGLE_surface_d3d_texture_2d_share_handle,
"EGL_ANGLE_surface_d3d_texture_2d_share_handle unavailable",
PLATFORM_FAILURE, false);
"EGL_ANGLE_surface_d3d_texture_2d_share_handle unavailable", false);
RETURN_AND_NOTIFY_ON_FAILURE(gl::GLFence::IsSupported(),
"GL fences are unsupported", PLATFORM_FAILURE,
false);
RETURN_ON_FAILURE(gl::GLFence::IsSupported(), "GL fences are unsupported",
false);
State state = GetState();
RETURN_AND_NOTIFY_ON_FAILURE((state == kUninitialized),
"Initialize: invalid state: " << state,
ILLEGAL_STATE, false);
RETURN_ON_FAILURE((state == kUninitialized),
"Initialize: invalid state: " << state, false);
RETURN_AND_NOTIFY_ON_FAILURE(InitializeMediaFoundation(),
"Could not initialize Media Foundartion",
PLATFORM_FAILURE, false);
RETURN_ON_FAILURE(InitializeMediaFoundation(),
"Could not initialize Media Foundartion", false);
config_ = config;
RETURN_AND_NOTIFY_ON_FAILURE(InitDecoder(config.profile),
"Failed to initialize decoder", PLATFORM_FAILURE,
false);
RETURN_ON_FAILURE(InitDecoder(config.profile), "Failed to initialize decoder",
false);
RETURN_AND_NOTIFY_ON_FAILURE(GetStreamsInfoAndBufferReqs(),
"Failed to get input/output stream info.",
PLATFORM_FAILURE, false);
RETURN_ON_FAILURE(GetStreamsInfoAndBufferReqs(),
"Failed to get input/output stream info.", false);
RETURN_AND_NOTIFY_ON_FAILURE(
RETURN_ON_FAILURE(
SendMFTMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, 0),
"Send MFT_MESSAGE_NOTIFY_BEGIN_STREAMING notification failed",
PLATFORM_FAILURE, false);
"Send MFT_MESSAGE_NOTIFY_BEGIN_STREAMING notification failed", false);
RETURN_AND_NOTIFY_ON_FAILURE(
RETURN_ON_FAILURE(
SendMFTMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, 0),
"Send MFT_MESSAGE_NOTIFY_START_OF_STREAM notification failed",
PLATFORM_FAILURE, false);
"Send MFT_MESSAGE_NOTIFY_START_OF_STREAM notification failed", false);
if (codec_ == kCodecH264)
config_change_detector_.reset(new H264ConfigChangeDetector);
......
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