Bug 1867626 - do not create dcomp surface handle and no need to update new size to media engine. r=jolin

We should only use one dcomp handle which can fit for all different size
of videos, and the media engine seems already knowing the size of the
new video size, which is why the engine dispatches
`MF_MEDIA_ENGINE_EVENT_FORMATCHANGE` to us.


Therefore, we don't need to call `UpdateVideoStream` when the video size
change, but we still need to notify `resize` to media element, which
will be implemented in bug 1867634.

Differential Revision: https://phabricator.services.mozilla.com/D195156
This commit is contained in:
alwu 2023-12-04 22:39:43 +00:00
Родитель 0a15b03add
Коммит b3ad79d9bb
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -223,6 +223,8 @@ void MFMediaEngineParent::HandleMediaEngineEvent(
break;
}
case MF_MEDIA_ENGINE_EVENT_FORMATCHANGE:
// TODO : add callback to notify resizing in bug 1867634.
break;
case MF_MEDIA_ENGINE_EVENT_FIRSTFRAMEREADY: {
if (mMediaEngine->HasVideo()) {
EnsureDcompSurfaceHandle();
@ -594,8 +596,7 @@ void MFMediaEngineParent::EnsureDcompSurfaceHandle() {
RETURN_VOID_IF_FAILED(mMediaEngine->GetNativeVideoSize(&width, &height));
if (width != mDisplayWidth || height != mDisplayHeight) {
// Update stream size before asking for a handle. If we don't update the
// size, media engine will create the dcomp surface in a wrong size. If
// the size isn't changed, then we don't need to recreate the surface.
// size, media engine will create the dcomp surface in a wrong size.
LOG("Update video size [%lux%lu] -> [%lux%lu] ", mDisplayWidth,
mDisplayHeight, width, height);
ENGINE_MARKER_TEXT("MFMediaEngineParent,UpdateVideoSize",