mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
msdk: vpp: rotate output frame
When vpp rotation is 90 or 270, the output frame should be rotated, too. Example: gst-launch-1.0 -vf videotestsrc \ ! video/x-raw,width=720,height=480 \ ! msdkvpp rotation=90 ! vaapisink
This commit is contained in:
parent
b43651cf99
commit
bd3caf0c04
1 changed files with 10 additions and 0 deletions
|
@ -28,6 +28,10 @@
|
|||
#include "gstmsdkvpputil.h"
|
||||
#include "msdk-enums.h"
|
||||
|
||||
#define SWAP_GINT(a, b) do { \
|
||||
const gint t = a; a = b; b = t; \
|
||||
} while (0)
|
||||
|
||||
gboolean
|
||||
gst_msdkvpp_is_deinterlace_enabled (GstMsdkVPP * msdkvpp, GstVideoInfo * vip)
|
||||
{
|
||||
|
@ -75,6 +79,12 @@ fixate_output_frame_size (GstMsdkVPP * thiz, GstVideoInfo * vinfo,
|
|||
from_w = GST_VIDEO_INFO_WIDTH (vinfo);
|
||||
from_h = GST_VIDEO_INFO_HEIGHT (vinfo);
|
||||
|
||||
/* compensate for rotation if needed */
|
||||
if (thiz->rotation == 90 || thiz->rotation == 270) {
|
||||
SWAP_GINT (from_w, from_h);
|
||||
SWAP_GINT (from_par_n, from_par_d);
|
||||
}
|
||||
|
||||
gst_structure_get_int (outs, "width", &w);
|
||||
gst_structure_get_int (outs, "height", &h);
|
||||
|
||||
|
|
Loading…
Reference in a new issue