mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
d5542fa8c0
Add fei codec objects to surface proxy since handling the fei buffers(codec objects here) external to gstvaapisurfaceproxy will make the code complicated. Especially considering the behavior of encoder where the input frame order from upstream and output frame order to the downstream are not sequential. Other contributors: Zhong, Xiaoxia <xiaoxia.zhong@intel.com> xiaominc <xiaomin.chen@intel.com> Leilei <leilei.shang@intel.com> Li, Jing B <jing.b.li@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=785712 https://bugzilla.gnome.org/show_bug.cgi?id=784667
201 lines
6.4 KiB
C
201 lines
6.4 KiB
C
/*
|
|
* gstvaapisurfaceproxy.h - VA surface proxy
|
|
*
|
|
* Copyright (C) 2010-2011 Splitted-Desktop Systems
|
|
* Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
|
|
* Copyright (C) 2011-2013 Intel Corporation
|
|
* Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
* as published by the Free Software Foundation; either version 2.1
|
|
* 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
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef GST_VAAPI_SURFACE_PROXY_H
|
|
#define GST_VAAPI_SURFACE_PROXY_H
|
|
|
|
#include <gst/vaapi/gstvaapisurface.h>
|
|
#include <gst/vaapi/gstvaapisurfacepool.h>
|
|
|
|
#if USE_H264_FEI_ENCODER
|
|
#include <gst/vaapi/gstvaapifei_objects.h>
|
|
#endif
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
/**
|
|
* GstVaapiSurfaceProxyFlags:
|
|
* @GST_VAAPI_SURFACE_PROXY_FLAG_INTERLACED: interlaced frame
|
|
* @GST_VAAPI_SURFACE_PROXY_FLAG_TFF: top-field-first
|
|
* @GST_VAAPI_SURFACE_PROXY_FLAG_RFF: repeat-first-field
|
|
* @GST_VAAPI_SURFACE_PROXY_FLAG_ONEFIELD: only one field is available
|
|
* @GST_VAAPI_SURFACE_PROXY_FLAG_FFB: first frame in bundle, e.g. the first
|
|
* view component of a MultiView Coded (MVC) frame
|
|
* @GST_VAAPI_SURFACE_PROXY_FLAG_CORRUPTED: the underlying surface is
|
|
* corrupted somehow, e.g. reconstructed from invalid references
|
|
* @GST_VAAPI_SURFACE_PROXY_FLAG_LAST: first flag that can be used by subclasses
|
|
*
|
|
* Flags for #GstVaapiDecoderFrame.
|
|
*/
|
|
typedef enum
|
|
{
|
|
GST_VAAPI_SURFACE_PROXY_FLAG_INTERLACED = (1 << 0),
|
|
GST_VAAPI_SURFACE_PROXY_FLAG_TFF = (1 << 1),
|
|
GST_VAAPI_SURFACE_PROXY_FLAG_RFF = (1 << 2),
|
|
GST_VAAPI_SURFACE_PROXY_FLAG_ONEFIELD = (1 << 3),
|
|
GST_VAAPI_SURFACE_PROXY_FLAG_FFB = (1 << 4),
|
|
GST_VAAPI_SURFACE_PROXY_FLAG_CORRUPTED = (1 << 5),
|
|
GST_VAAPI_SURFACE_PROXY_FLAG_LAST = (1 << 8)
|
|
} GstVaapiSurfaceProxyFlags;
|
|
|
|
/**
|
|
* GST_VAAPI_SURFACE_PROXY_SURFACE:
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
*
|
|
* Macro that evaluates to the #GstVaapiSurface of @proxy.
|
|
*/
|
|
#define GST_VAAPI_SURFACE_PROXY_SURFACE(proxy) \
|
|
gst_vaapi_surface_proxy_get_surface (proxy)
|
|
|
|
/**
|
|
* GST_VAAPI_SURFACE_PROXY_SURFACE_ID:
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
*
|
|
* Macro that evaluates to the VA surface ID of the underlying @proxy
|
|
* surface.
|
|
*/
|
|
#define GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy) \
|
|
gst_vaapi_surface_proxy_get_surface_id (proxy)
|
|
|
|
/**
|
|
* GST_VAAPI_SURFACE_PROXY_VIEW_ID:
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
*
|
|
* Macro that evaluates to the decoded view ID of the underlying @proxy
|
|
* surface.
|
|
*/
|
|
#define GST_VAAPI_SURFACE_PROXY_VIEW_ID(proxy) \
|
|
gst_vaapi_surface_proxy_get_view_id (proxy)
|
|
|
|
/**
|
|
* GST_VAAPI_SURFACE_PROXY_TIMESTAMP:
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
*
|
|
* Macro that evaluates to the presentation timestamp of the
|
|
* underlying @proxy surface.
|
|
*/
|
|
#define GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy) \
|
|
gst_vaapi_surface_proxy_get_timestamp (proxy)
|
|
|
|
/**
|
|
* GST_VAAPI_SURFACE_PROXY_DURATION:
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
*
|
|
* Macro that evaluates to the presentation duration of the
|
|
* underlying @proxy surface.
|
|
*/
|
|
#define GST_VAAPI_SURFACE_PROXY_DURATION(proxy) \
|
|
gst_vaapi_surface_proxy_get_duration (proxy)
|
|
|
|
GstVaapiSurfaceProxy *
|
|
gst_vaapi_surface_proxy_new (GstVaapiSurface * surface);
|
|
|
|
GstVaapiSurfaceProxy *
|
|
gst_vaapi_surface_proxy_new_from_pool (GstVaapiSurfacePool * pool);
|
|
|
|
GstVaapiSurfaceProxy *
|
|
gst_vaapi_surface_proxy_copy (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiSurfaceProxy *
|
|
gst_vaapi_surface_proxy_ref (GstVaapiSurfaceProxy * proxy);
|
|
|
|
void
|
|
gst_vaapi_surface_proxy_unref (GstVaapiSurfaceProxy * proxy);
|
|
|
|
void
|
|
gst_vaapi_surface_proxy_replace (GstVaapiSurfaceProxy ** old_proxy_ptr,
|
|
GstVaapiSurfaceProxy * new_proxy);
|
|
|
|
guint
|
|
gst_vaapi_surface_proxy_get_flags (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiSurface *
|
|
gst_vaapi_surface_proxy_get_surface (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiID
|
|
gst_vaapi_surface_proxy_get_surface_id (GstVaapiSurfaceProxy * proxy);
|
|
|
|
guintptr
|
|
gst_vaapi_surface_proxy_get_view_id (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstClockTime
|
|
gst_vaapi_surface_proxy_get_timestamp (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstClockTime
|
|
gst_vaapi_surface_proxy_get_duration (GstVaapiSurfaceProxy * proxy);
|
|
|
|
void
|
|
gst_vaapi_surface_proxy_set_destroy_notify (GstVaapiSurfaceProxy * proxy,
|
|
GDestroyNotify destroy_func, gpointer user_data);
|
|
|
|
const GstVaapiRectangle *
|
|
gst_vaapi_surface_proxy_get_crop_rect (GstVaapiSurfaceProxy * proxy);
|
|
|
|
void
|
|
gst_vaapi_surface_proxy_set_crop_rect (GstVaapiSurfaceProxy * proxy,
|
|
const GstVaapiRectangle * crop_rect);
|
|
|
|
#if USE_H264_FEI_ENCODER
|
|
|
|
GstVaapiEncFeiMbCode *
|
|
gst_vaapi_surface_proxy_get_fei_mb_code (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiEncFeiMv *
|
|
gst_vaapi_surface_proxy_get_fei_mv (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiEncFeiDistortion *
|
|
gst_vaapi_surface_proxy_get_fei_distortion (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiEncFeiQp *
|
|
gst_vaapi_surface_proxy_get_fei_qp (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiEncFeiMvPredictor *
|
|
gst_vaapi_surface_proxy_get_fei_mv_predictor (GstVaapiSurfaceProxy * proxy);
|
|
|
|
GstVaapiEncFeiMbControl *
|
|
gst_vaapi_surface_proxy_get_fei_mb_control (GstVaapiSurfaceProxy * proxy);
|
|
|
|
void
|
|
gst_vaapi_surface_proxy_set_fei_mb_code (GstVaapiSurfaceProxy * proxy,
|
|
GstVaapiEncFeiMbCode *mbcode);
|
|
void
|
|
gst_vaapi_surface_proxy_set_fei_mv (GstVaapiSurfaceProxy * proxy,
|
|
GstVaapiEncFeiMv *mv);
|
|
void
|
|
gst_vaapi_surface_proxy_set_fei_distortion (GstVaapiSurfaceProxy * proxy,
|
|
GstVaapiEncFeiDistortion *dist);
|
|
void
|
|
gst_vaapi_surface_proxy_set_fei_qp (GstVaapiSurfaceProxy * proxy,
|
|
GstVaapiEncFeiQp *mbcode);
|
|
void
|
|
gst_vaapi_surface_proxy_set_fei_mv_predictor (GstVaapiSurfaceProxy * proxy,
|
|
GstVaapiEncFeiMvPredictor *mvpred);
|
|
void
|
|
gst_vaapi_surface_proxy_set_fei_mb_control (GstVaapiSurfaceProxy * proxy,
|
|
GstVaapiEncFeiMbControl *mbcntrl);
|
|
#endif
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* GST_VAAPI_SURFACE_PROXY_H */
|