blob: 3a18b095bd7be8baa1d8eafbaf0014791af10349 [file] [log] [blame]
/* GStreamer
* Copyright (C) 2022 amlogic
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
* Boston, MA 02110-1335, USA.
*/
#include <gst/gst.h>
#include <aml_ge2d.h>
#include <gst/video/video.h>
#define MAX_PLANES (3)
typedef struct _GemBuffer
{
gint width;
gint height;
gint planeCount;
guint handle[MAX_PLANES];
guint stride[MAX_PLANES];
guint offset[MAX_PLANES];
guint size[MAX_PLANES];
gint fd[MAX_PLANES];
} GemBuffer;
typedef struct _ROTBuffer{
gint index;
gboolean used;
GemBuffer gemBuf;
}ROTBuffer;
typedef enum
{
WST_ROTATION_0 = 0,
WST_ROTATION_90 = 1,
WST_ROTATION_180 = 2,
WST_ROTATION_270 = 3,
}ROTATION_DEGREE;
ROTBuffer* rotation_buffer_setup(int numPlanes, int width, int height, int numBuffer);
void rotation_buffer_teardown(ROTBuffer *pROTbuf, int numBuffer);
GstFlowReturn rotation_transform(aml_ge2d_info_t *pge2dinfo, GstBuffer *inbuf, ROTBuffer *pROTbuf, ROTATION_DEGREE ROTDegree);
gboolean rotation_init(aml_ge2d_t* pAmlge2d, aml_ge2d_info_t **pge2dinfo);
gboolean rotation_exit(aml_ge2d_t* pAmlge2d);
gboolean get_rotation_size(int src_w, int src_h, int* dst_w, int* dst_h);