|
1 | 1 | /*
|
2 |
| -* Copyright (c) 2009-2018, Intel Corporation |
| 2 | +* Copyright (c) 2009-2023, Intel Corporation |
3 | 3 | *
|
4 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a
|
5 | 5 | * copy of this software and associated documentation files (the "Software"),
|
@@ -74,6 +74,7 @@ static uint32_t g_src_file_fourcc = VA_FOURCC('I', '4', '2', '0');
|
74 | 74 | static uint32_t g_dst_file_fourcc = VA_FOURCC('Y', 'V', '1', '2');
|
75 | 75 |
|
76 | 76 | static uint32_t g_frame_count = 0;
|
| 77 | +static uint32_t g_rotation_angle = 0; |
77 | 78 |
|
78 | 79 | static int8_t
|
79 | 80 | read_value_string(FILE *fp, const char* field_name, char* value)
|
@@ -1003,6 +1004,10 @@ video_frame_process(VASurfaceID in_surface_id,
|
1003 | 1004 | pipeline_param.surface = in_surface_id;
|
1004 | 1005 | pipeline_param.surface_region = &surface_region;
|
1005 | 1006 | pipeline_param.output_region = &output_region;
|
| 1007 | + if (g_rotation_angle == 1 ) |
| 1008 | + { |
| 1009 | + pipeline_param.rotation_state = VA_ROTATION_90; |
| 1010 | + } |
1006 | 1011 |
|
1007 | 1012 | va_status = vaCreateBuffer(va_dpy,
|
1008 | 1013 | context_id,
|
@@ -1105,6 +1110,20 @@ vpp_context_create()
|
1105 | 1110 | 1,
|
1106 | 1111 | &context_id);
|
1107 | 1112 | CHECK_VASTATUS(va_status, "vaCreateContext");
|
| 1113 | + |
| 1114 | + VABufferID *filters = nullptr; |
| 1115 | + unsigned int num_filters = 0; |
| 1116 | + VAProcPipelineCaps pipeline_caps = {}; |
| 1117 | + va_status = vaQueryVideoProcPipelineCaps(va_dpy, |
| 1118 | + context_id, |
| 1119 | + filters, |
| 1120 | + num_filters, |
| 1121 | + &pipeline_caps); |
| 1122 | + CHECK_VASTATUS(va_status, "vaQueryVideoProcPipeineCaps"); |
| 1123 | + if (pipeline_caps.rotation_flags & (1 << VA_ROTATION_90)) { |
| 1124 | + printf("Clockwise rotation by 90 degrees is supported!\n"); |
| 1125 | + } |
| 1126 | + |
1108 | 1127 | return va_status;
|
1109 | 1128 | }
|
1110 | 1129 |
|
@@ -1190,6 +1209,7 @@ parse_basic_parameters()
|
1190 | 1209 | parse_fourcc_and_format(str, &g_dst_file_fourcc, NULL);
|
1191 | 1210 |
|
1192 | 1211 | read_value_uint32(g_config_file_fd, "FRAME_SUM", &g_frame_count);
|
| 1212 | + read_value_uint32(g_config_file_fd, "ROTATION", &g_rotation_angle); |
1193 | 1213 |
|
1194 | 1214 | if (g_in_pic_width != g_out_pic_width ||
|
1195 | 1215 | g_in_pic_height != g_out_pic_height)
|
|
0 commit comments