summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2020-06-06 21:15:34 +0900
committerSeungha Yang <seungha@centricular.com>2020-06-06 21:19:48 +0900
commit0f74785b8ebc3a042f1e8593e516c793897623f1 (patch)
treeecd1c81ec37fd26c8ceb0b8b83f5f06e45910ef0
parentcec68584013292e4e31029f3cd348fcc1f4abeb1 (diff)
downloadgstreamer-plugins-bad-0f74785b8ebc3a042f1e8593e516c793897623f1.tar.gz
mfvideoenc: Set PAR to output IMFMediaType
We've set it to input IMFMediaType but not for output. So, if PAR is not 1:1, the input IMFMediaType will be accepted by MFT (default is 1:1). The PAR of input/output IMFMediaType must be identical Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1322>
-rw-r--r--sys/mediafoundation/gstmfvideoenc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/mediafoundation/gstmfvideoenc.cpp b/sys/mediafoundation/gstmfvideoenc.cpp
index 5d97cfcb5..4931fab67 100644
--- a/sys/mediafoundation/gstmfvideoenc.cpp
+++ b/sys/mediafoundation/gstmfvideoenc.cpp
@@ -173,6 +173,14 @@ gst_mf_video_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
return FALSE;
}
+ hr = MFSetAttributeRatio (out_type.Get (), MF_MT_PIXEL_ASPECT_RATIO,
+ GST_VIDEO_INFO_PAR_N (info), GST_VIDEO_INFO_PAR_D (info));
+ if (!gst_mf_result (hr)) {
+ GST_ERROR_OBJECT (self, "Couldn't set par %d/%d",
+ GST_VIDEO_INFO_PAR_N (info), GST_VIDEO_INFO_PAR_D (info));
+ return FALSE;
+ }
+
hr = out_type->SetUINT32 (MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive);
if (!gst_mf_result (hr)) {
GST_ERROR_OBJECT (self,