diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2013-02-18 16:28:27 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-07-08 18:54:15 +0200 |
commit | 0b1faa62d0ce64bddbfd9abb5a9ce666943027d3 (patch) | |
tree | 3512c625084223ef8ee45176ca681a9b7ec3fdb1 /gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c | |
parent | f9ae0c0de4bc569dd3b4cdf5c18d776e9be50ff8 (diff) | |
download | gst-vaapi-0b1faa62d0ce64bddbfd9abb5a9ce666943027d3.tar.gz |
mpeg2: add support for video cropping.
If the stream has a sequence_display_extenion, then attach the
display_horizontal/display_vertical dimension as the cropping
rectangle width/height to the GstVaapiPicture.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c index bb67bd5c..fdc6596b 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c @@ -1471,6 +1471,17 @@ gst_vaapi_decoder_mpeg2_start_frame(GstVaapiDecoder *base_decoder, gst_vaapi_picture_replace(&priv->current_picture, picture); gst_vaapi_picture_unref(picture); + /* Update cropping rectangle */ + if (seq_display_ext) { + GstVaapiRectangle crop_rect; + crop_rect.x = 0; + crop_rect.y = 0; + crop_rect.width = seq_display_ext->display_horizontal_size; + crop_rect.height = seq_display_ext->display_vertical_size; + if (crop_rect.width <= priv->width && crop_rect.height <= priv->height) + gst_vaapi_picture_set_crop_rect(picture, &crop_rect); + } + status = ensure_quant_matrix(decoder, picture); if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { GST_ERROR("failed to reset quantizer matrix"); |