Skip to content

Commit fda8598

Browse files
committed
Added rotation sample code.
Signed-off-by: Furong Zhang <[email protected]>
1 parent 4cd4308 commit fda8598

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Configuration information for video process test case.
2+
# This application will firstly load yuv frames to one type of surface(NV12/YV12/I420)
3+
# you require. After video processing, the processed content (NV12/YV12/I420 surface)
4+
# will be stored to frames(yv12 format in file).
5+
# Supported features include scaling and implicit format conversion(NV12<->YV12<->I420).
6+
# you can modify this configuration file to set the corresponding parameters.
7+
8+
#1.Source YUV(RGB) file information
9+
SRC_FILE_NAME: ./bigship_1280_720p_25fps_10frames_writer1280x720_noised.nv12
10+
SRC_FRAME_WIDTH: 1280
11+
SRC_FRAME_HEIGHT: 720
12+
SRC_FRAME_FORMAT: NV12
13+
14+
#Note .nv12 files are in NV12 format
15+
SRC_FILE_FORMAT: NV12
16+
17+
#2.Destination YUV(RGB) file information
18+
DST_FILE_NAME: ./scaling_out_720x1280.nv12
19+
DST_FRAME_WIDTH: 720
20+
DST_FRAME_HEIGHT: 1280
21+
DST_FRAME_FORMAT: NV12
22+
23+
DST_FILE_FORMAT: NV12
24+
25+
#3.How many frames to be processed
26+
FRAME_SUM: 1
27+
28+
#4.How to use this template
29+
#./vppscaling_csc process_rotation.cfg.template

videoprocess/vppscaling_csc.cpp

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2018, Intel Corporation
2+
* Copyright (c) 2009-2023, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -1002,7 +1002,8 @@ video_frame_process(VASurfaceID in_surface_id,
10021002
memset(&pipeline_param, 0, sizeof(pipeline_param));
10031003
pipeline_param.surface = in_surface_id;
10041004
pipeline_param.surface_region = &surface_region;
1005-
pipeline_param.output_region = &output_region;
1005+
pipeline_param.output_region = &output_region;
1006+
pipeline_param.rotation_state = VA_ROTATION_90;
10061007

10071008
va_status = vaCreateBuffer(va_dpy,
10081009
context_id,
@@ -1105,6 +1106,20 @@ vpp_context_create()
11051106
1,
11061107
&context_id);
11071108
CHECK_VASTATUS(va_status, "vaCreateContext");
1109+
1110+
VABufferID *filters = nullptr;
1111+
unsigned int num_filters = 0;
1112+
VAProcPipelineCaps pipeline_caps = {};
1113+
va_status = vaQueryVideoProcPipelineCaps(va_dpy,
1114+
context_id,
1115+
filters,
1116+
num_filters,
1117+
&pipeline_caps);
1118+
CHECK_VASTATUS(va_status, "vaQueryVideoProcPipeineCaps");
1119+
if (pipeline_caps.rotation_flags & (1 << VA_ROTATION_90)) {
1120+
printf("Clockwise rotation by 90 degrees is supported!\n");
1121+
}
1122+
11081123
return va_status;
11091124
}
11101125

0 commit comments

Comments
 (0)