Set viewPort for QVideoFrameFormat #506
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If we, for example, did not apply cropping, then for the correct display of the frame, we should set viewPort. Here is a real example of when these changes make sense:
When decoding a video stream with HW MediaCodec, the frame parameters change from 1280x720 to 1280x736 at startup. We opened an issue on ffmpeg regarding the fact that this information should be sent to us in the frame https://trac.ffmpeg.org/ticket/11317 (a patch has been prepared and I hope it will be merged soon). With their patch and apply_cropping 0, we get a frame with the following parameters at the output: width=1280 height=736 crops top=0 bottom=16 left=0 right=0, so I think it would be good to set viewPort for this case, in other cases this will not affect the stream since the crops will be zero.