Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit ab671b8

Browse files
committed
Send correct frame size to renderer.
1 parent d7d67a5 commit ab671b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

talk/owt/sdk/base/win/msdkvideodecoder.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ int32_t MSDKVideoDecoder::Decode(
370370
sts = m_mfxSession->SyncOperation(syncp, MSDK_DEC_WAIT_INTERVAL);
371371
if (sts >= MFX_ERR_NONE) {
372372
mfxMemId dxMemId = pOutputSurface->Data.MemId;
373+
mfxFrameInfo frame_info = pOutputSurface->Info;
373374
mfxHDLPair pair = {nullptr};
374375
// Maybe we should also send the allocator as part of the frame
375376
// handle for locking/unlocking purpose.
@@ -383,10 +384,12 @@ int32_t MSDKVideoDecoder::Decode(
383384
D3D11_TEXTURE2D_DESC texture_desc;
384385
memset(&texture_desc, 0, sizeof(texture_desc));
385386
surface_handle->texture->GetDesc(&texture_desc);
386-
387+
// TODO(johny): we should extend the buffer structure to include
388+
// not only the CropW|CropH value, but also the CropX|CropY for the
389+
// renderer to correctly setup the video processor input view.
387390
rtc::scoped_refptr<owt::base::NativeHandleBuffer> buffer =
388391
new rtc::RefCountedObject<owt::base::NativeHandleBuffer>(
389-
(void*)surface_handle.get(), texture_desc.Width, texture_desc.Height);
392+
(void*)surface_handle.get(), frame_info.CropW, frame_info.CropH);
390393
webrtc::VideoFrame decoded_frame(buffer, inputImage.Timestamp(), 0,
391394
webrtc::kVideoRotation_0);
392395
decoded_frame.set_ntp_time_ms(inputImage.ntp_time_ms_);

0 commit comments

Comments
 (0)