mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
h264: add support for video cropping.
If the encoded stream has the frame_cropping_flag set, then associate the cropping rectangle to GstVaapiPicture. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
0829d94f38
commit
976d27841a
1 changed files with 10 additions and 2 deletions
|
@ -540,8 +540,6 @@ dpb_output(
|
|||
return TRUE;
|
||||
picture = fs->buffers[0];
|
||||
}
|
||||
|
||||
/* XXX: update cropping rectangle */
|
||||
return gst_vaapi_picture_output(GST_VAAPI_PICTURE_CAST(picture));
|
||||
}
|
||||
|
||||
|
@ -2556,6 +2554,16 @@ decode_picture(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit)
|
|||
gst_vaapi_picture_replace(&priv->current_picture, picture);
|
||||
gst_vaapi_picture_unref(picture);
|
||||
|
||||
/* Update cropping rectangle */
|
||||
if (sps->frame_cropping_flag) {
|
||||
GstVaapiRectangle crop_rect;
|
||||
crop_rect.x = sps->crop_rect_x;
|
||||
crop_rect.y = sps->crop_rect_y;
|
||||
crop_rect.width = sps->crop_rect_width;
|
||||
crop_rect.height = sps->crop_rect_height;
|
||||
gst_vaapi_picture_set_crop_rect(&picture->base, &crop_rect);
|
||||
}
|
||||
|
||||
picture->pps = pps;
|
||||
|
||||
status = ensure_quant_matrix(decoder, picture);
|
||||
|
|
Loading…
Reference in a new issue