blob: 4a61fe806cfe229424a5f70bc01f55857d7d5bc0 [file] [log] [blame]
kaiqiang.xiangd8184ff2024-10-09 14:35:02 +08001/* GStreamer
2 * Copyright (C) 2022 amlogic
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
17 * Boston, MA 02110-1335, USA.
18 */
19
20#include <gst/gst.h>
21#include <aml_ge2d.h>
22#include <gst/video/video.h>
23
24#define MAX_PLANES (3)
25typedef struct _GemBuffer
26{
27 gint width;
28 gint height;
29 gint planeCount;
30 guint handle[MAX_PLANES];
31 guint stride[MAX_PLANES];
32 guint offset[MAX_PLANES];
33 guint size[MAX_PLANES];
34 gint fd[MAX_PLANES];
35} GemBuffer;
36
37typedef struct _ROTBuffer{
38 gint index;
39 gboolean used;
40 GemBuffer gemBuf;
hanghang.luoa84a72e2024-12-18 13:37:58 +080041 GstBuffer *src_buf;
kaiqiang.xiangd8184ff2024-10-09 14:35:02 +080042}ROTBuffer;
43
44typedef enum
45{
46 WST_ROTATION_0 = 0,
47 WST_ROTATION_90 = 1,
48 WST_ROTATION_180 = 2,
49 WST_ROTATION_270 = 3,
50}ROTATION_DEGREE;
51
52
53ROTBuffer* rotation_buffer_setup(int numPlanes, int width, int height, int numBuffer);
54void rotation_buffer_teardown(ROTBuffer *pROTbuf, int numBuffer);
55GstFlowReturn rotation_transform(aml_ge2d_info_t *pge2dinfo, GstBuffer *inbuf, ROTBuffer *pROTbuf, ROTATION_DEGREE ROTDegree);
56gboolean rotation_init(aml_ge2d_t* pAmlge2d, aml_ge2d_info_t **pge2dinfo);
57gboolean rotation_exit(aml_ge2d_t* pAmlge2d);
58gboolean get_rotation_size(int src_w, int src_h, int* dst_w, int* dst_h);