2 * gstvaapidecoder.h - VA decoder abstraction
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Copyright (C) 2011 Intel Corporation
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1
10 * of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301 USA
23 #ifndef GST_VAAPI_DECODER_H
24 #define GST_VAAPI_DECODER_H
26 #include <gst/gstbuffer.h>
27 #include <gst/vaapi/gstvaapicontext.h>
28 #include <gst/vaapi/gstvaapisurfaceproxy.h>
32 #define GST_VAAPI_TYPE_DECODER \
33 (gst_vaapi_decoder_get_type())
35 #define GST_VAAPI_DECODER(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
37 GST_VAAPI_TYPE_DECODER, \
40 #define GST_VAAPI_DECODER_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_CAST((klass), \
42 GST_VAAPI_TYPE_DECODER, \
43 GstVaapiDecoderClass))
45 #define GST_VAAPI_IS_DECODER(obj) \
46 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_DECODER))
48 #define GST_VAAPI_IS_DECODER_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_DECODER))
51 #define GST_VAAPI_DECODER_GET_CLASS(obj) \
52 (G_TYPE_INSTANCE_GET_CLASS((obj), \
53 GST_VAAPI_TYPE_DECODER, \
54 GstVaapiDecoderClass))
56 typedef struct _GstVaapiDecoder GstVaapiDecoder;
57 typedef struct _GstVaapiDecoderPrivate GstVaapiDecoderPrivate;
58 typedef struct _GstVaapiDecoderClass GstVaapiDecoderClass;
61 * GstVaapiDecoderStatus:
62 * @GST_VAAPI_DECODER_STATUS_SUCCESS: Success.
63 * @GST_VAAPI_DECODER_STATUS_END_OF_STREAM: End-Of-Stream.
64 * @GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED: No memory left.
65 * @GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED: Decoder initialization failure.
66 * @GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC: Unsupported codec.
67 * @GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA: Not enough input data to decode.
68 * @GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE: No surface left to hold the decoded picture.
69 * @GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE: Invalid surface.
70 * @GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER: Invalid or unsupported bitstream data.
71 * @GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE: Unsupported codec profile.
72 * @GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT: Unsupported chroma format.
73 * @GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN: Unknown error.
75 * Decoder status for gst_vaapi_decoder_get_surface().
78 GST_VAAPI_DECODER_STATUS_SUCCESS = 0,
79 GST_VAAPI_DECODER_STATUS_END_OF_STREAM,
80 GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED,
81 GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED,
82 GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC,
83 GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA,
84 GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE,
85 GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE,
86 GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER,
87 GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE,
88 GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT,
89 GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN = -1
90 } GstVaapiDecoderStatus;
95 * A VA decoder base instance.
97 struct _GstVaapiDecoder {
99 GObject parent_instance;
101 GstVaapiDecoderPrivate *priv;
105 * GstVaapiDecoderClass:
107 * A VA decoder base class.
109 struct _GstVaapiDecoderClass {
111 GObjectClass parent_class;
113 GstVaapiDecoderStatus (*decode)(GstVaapiDecoder *decoder, GstBuffer *buffer);
114 void (*clear_buffer)(GstVaapiDecoder *decoder);
118 gst_vaapi_decoder_get_type(void) G_GNUC_CONST;
121 gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder);
124 gst_vaapi_decoder_get_caps(GstVaapiDecoder *decoder);
127 gst_vaapi_decoder_put_buffer(GstVaapiDecoder *decoder, GstBuffer *buf);
129 GstVaapiSurfaceProxy *
130 gst_vaapi_decoder_get_surface(
131 GstVaapiDecoder *decoder,
132 GstVaapiDecoderStatus *pstatus,
137 gst_vaapi_decoder_clear_buffer(GstVaapiDecoder *decoder);
141 #endif /* GST_VAAPI_DECODER_H */