blob: af7991f8ec4fd3b3a59fcb66c68b70d8b42d543f [file] [log] [blame] [edit]
/*
* Copyright (c) 2014, Freescale Semiconductor, Inc. All rights reserved.
* Copyright 2017 NXP
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_VPU_H__
#define __GST_VPU_H__
#include "vpu_wrapper.h"
G_BEGIN_DECLS
#define DEFAULT_FRAME_BUFFER_ALIGNMENT_H 16
#define DEFAULT_FRAME_BUFFER_ALIGNMENT_H_HANTRO_TILE 8
#define DEFAULT_FRAME_BUFFER_ALIGNMENT_V 16
#define DEFAULT_FRAME_BUFFER_ALIGNMENT_V_HANTRO 8
#define DEFAULT_FRAME_BUFFER_ALIGNMENT_H_AMPHION 256
#define DEFAULT_FRAME_BUFFER_ALIGNMENT_V_AMPHION 256
#define ALIGN(ptr,align) ((align) ? ((((unsigned long)(ptr))+(align)-1)/(align)*(align)) : ((unsigned long)(ptr)))
typedef struct
{
VpuCodStd std;
const gchar *mime;
} VPUMapper;
static VPUMapper vpu_mappers[] = {
{VPU_V_HEVC, "video/x-h265"},
{VPU_V_VP9, "video/x-vp9"},
{VPU_V_VP8, "video/x-vp8"},
{VPU_V_VP6, "video/x-vp6-flash"},
{VPU_V_AVC, "video/x-h264"},
{VPU_V_MPEG2, "video/mpeg, systemstream=(boolean)false, mpegversion=(int){1,2}"},
{VPU_V_MPEG4, "video/mpeg, mpegversion=(int)4"},
{VPU_V_H263, "video/x-h263"},
{VPU_V_SORENSON, "video/x-flash-video, flvversion=(int)1"},
{VPU_V_DIVX3, "video/x-divx, divxversion=(int)3"},
{VPU_V_DIVX4, "video/x-divx, divxversion=(int)4"},
{VPU_V_DIVX56, "video/x-divx, divxversion=(int){5,6}"},
{VPU_V_XVID, "video/x-xvid"},
{VPU_V_AVS, "video/x-cavs"},
{VPU_V_VC1, "video/x-wmv, wmvversion=(int)3, format=(string)WMV3"},
{VPU_V_VC1_AP, "video/x-wmv, wmvversion=(int)3, format=(string)WVC1"},
{VPU_V_RV, "video/x-pn-realvideo"},
{VPU_V_MJPG, "image/jpeg"},
{VPU_V_WEBP, "image/webp"},
{-1, NULL}
};
typedef struct {
VpuMemInfo mem_info;
GList * internal_virt_mem;
GList * internal_phy_mem;
} VpuInternalMem;
gint gst_vpu_find_std (GstCaps * caps);
gboolean gst_vpu_free_internal_mem (VpuInternalMem * vpu_internal_mem);
gboolean gst_vpu_allocate_internal_mem (VpuInternalMem * vpu_internal_mem);
gboolean gst_vpu_register_frame_buffer (GList * gstbuffer_in_vpudec, \
GstVideoInfo *info, VpuFrameBuffer * vpuframebuffers);
G_END_DECLS
#endif /* __GST_VPU_H__ */