2010-04-23 16:05:58 +00:00
|
|
|
/*
|
|
|
|
* gstvaapidecoder.h - VA decoder abstraction
|
|
|
|
*
|
2012-01-16 09:41:10 +00:00
|
|
|
* Copyright (C) 2010-2011 Splitted-Desktop Systems
|
2012-01-16 09:42:55 +00:00
|
|
|
* Copyright (C) 2011 Intel Corporation
|
2010-04-23 16:05:58 +00:00
|
|
|
*
|
2010-05-03 07:07:27 +00:00
|
|
|
* 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.
|
2010-04-23 16:05:58 +00:00
|
|
|
*
|
2010-05-03 07:07:27 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2010-04-23 16:05:58 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2010-05-03 07:07:27 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2010-04-23 16:05:58 +00:00
|
|
|
*
|
2010-05-03 07:07:27 +00:00
|
|
|
* 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
|
2010-04-23 16:05:58 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GST_VAAPI_DECODER_H
|
|
|
|
#define GST_VAAPI_DECODER_H
|
|
|
|
|
|
|
|
#include <gst/gstbuffer.h>
|
|
|
|
#include <gst/vaapi/gstvaapicontext.h>
|
|
|
|
#include <gst/vaapi/gstvaapisurfaceproxy.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_VAAPI_TYPE_DECODER \
|
|
|
|
(gst_vaapi_decoder_get_type())
|
|
|
|
|
|
|
|
#define GST_VAAPI_DECODER(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), \
|
|
|
|
GST_VAAPI_TYPE_DECODER, \
|
|
|
|
GstVaapiDecoder))
|
|
|
|
|
|
|
|
#define GST_VAAPI_DECODER_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass), \
|
|
|
|
GST_VAAPI_TYPE_DECODER, \
|
|
|
|
GstVaapiDecoderClass))
|
|
|
|
|
|
|
|
#define GST_VAAPI_IS_DECODER(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_DECODER))
|
|
|
|
|
|
|
|
#define GST_VAAPI_IS_DECODER_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_DECODER))
|
|
|
|
|
|
|
|
#define GST_VAAPI_DECODER_GET_CLASS(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS((obj), \
|
|
|
|
GST_VAAPI_TYPE_DECODER, \
|
|
|
|
GstVaapiDecoderClass))
|
|
|
|
|
|
|
|
typedef struct _GstVaapiDecoder GstVaapiDecoder;
|
|
|
|
typedef struct _GstVaapiDecoderPrivate GstVaapiDecoderPrivate;
|
|
|
|
typedef struct _GstVaapiDecoderClass GstVaapiDecoderClass;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVaapiDecoderStatus:
|
|
|
|
* @GST_VAAPI_DECODER_STATUS_SUCCESS: Success.
|
2010-04-27 11:59:23 +00:00
|
|
|
* @GST_VAAPI_DECODER_STATUS_END_OF_STREAM: End-Of-Stream.
|
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED: No memory left.
|
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED: Decoder initialization failure.
|
2010-04-28 22:16:10 +00:00
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC: Unsupported codec.
|
2010-04-27 11:59:23 +00:00
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA: Not enough input data to decode.
|
2010-05-15 05:36:15 +00:00
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE: No surface left to hold the decoded picture.
|
2010-04-27 11:59:23 +00:00
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE: Invalid surface.
|
2011-08-05 09:52:43 +00:00
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER: Invalid or unsupported bitstream data.
|
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE: Unsupported codec profile.
|
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT: Unsupported chroma format.
|
2010-04-27 11:59:23 +00:00
|
|
|
* @GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN: Unknown error.
|
2010-04-23 16:05:58 +00:00
|
|
|
*
|
|
|
|
* Decoder status for gst_vaapi_decoder_get_surface().
|
|
|
|
*/
|
2012-09-04 11:40:04 +00:00
|
|
|
typedef enum {
|
2010-04-23 16:05:58 +00:00
|
|
|
GST_VAAPI_DECODER_STATUS_SUCCESS = 0,
|
|
|
|
GST_VAAPI_DECODER_STATUS_END_OF_STREAM,
|
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED,
|
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED,
|
2010-04-28 22:16:10 +00:00
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC,
|
2010-04-27 11:59:23 +00:00
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA,
|
2010-05-15 05:36:15 +00:00
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE,
|
2010-04-27 11:59:23 +00:00
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE,
|
2011-08-05 09:52:43 +00:00
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER,
|
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE,
|
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT,
|
2010-05-15 04:35:00 +00:00
|
|
|
GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN = -1
|
2012-09-04 11:40:04 +00:00
|
|
|
} GstVaapiDecoderStatus;
|
2010-04-23 16:05:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVaapiDecoder:
|
|
|
|
*
|
|
|
|
* A VA decoder base instance.
|
|
|
|
*/
|
|
|
|
struct _GstVaapiDecoder {
|
|
|
|
/*< private >*/
|
|
|
|
GObject parent_instance;
|
|
|
|
|
|
|
|
GstVaapiDecoderPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVaapiDecoderClass:
|
|
|
|
*
|
|
|
|
* A VA decoder base class.
|
|
|
|
*/
|
|
|
|
struct _GstVaapiDecoderClass {
|
|
|
|
/*< private >*/
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
2010-04-27 15:26:19 +00:00
|
|
|
GstVaapiDecoderStatus (*decode)(GstVaapiDecoder *decoder, GstBuffer *buffer);
|
2010-04-23 16:05:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GType
|
2012-06-29 06:19:51 +00:00
|
|
|
gst_vaapi_decoder_get_type(void) G_GNUC_CONST;
|
2010-04-23 16:05:58 +00:00
|
|
|
|
2010-05-15 15:33:20 +00:00
|
|
|
GstCaps *
|
|
|
|
gst_vaapi_decoder_get_caps(GstVaapiDecoder *decoder);
|
|
|
|
|
2010-04-23 16:05:58 +00:00
|
|
|
gboolean
|
|
|
|
gst_vaapi_decoder_put_buffer(GstVaapiDecoder *decoder, GstBuffer *buf);
|
|
|
|
|
|
|
|
GstVaapiSurfaceProxy *
|
|
|
|
gst_vaapi_decoder_get_surface(
|
|
|
|
GstVaapiDecoder *decoder,
|
|
|
|
GstVaapiDecoderStatus *pstatus
|
|
|
|
);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* GST_VAAPI_DECODER_H */
|