diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-04-16 13:23:41 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-04-16 19:11:02 +0200 |
commit | a24e2164660b909b43d2c916d6651514603e6c07 (patch) | |
tree | 0974a97c64dfde3a5b2167633dcf8956f046ef5a /gst-libs/gst/vaapi | |
parent | 2ac474b207e0848367661fc4769f72da50779d92 (diff) | |
download | gst-vaapi-a24e2164660b909b43d2c916d6651514603e6c07.tar.gz |
decoder: rename GstVaapiDecoderFrame to GstVaapiParserFrame.
Rename GstVaapiDecoderFrame to GstVaapiParserFrame because this data
structure was only useful to parsing and a proper GstvaapiDecoderFrame
instance will be created instead.
Diffstat (limited to 'gst-libs/gst/vaapi')
-rw-r--r-- | gst-libs/gst/vaapi/Makefile.am | 4 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder.c | 15 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_priv.h | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiparser_frame.c (renamed from gst-libs/gst/vaapi/gstvaapidecoder_frame.c) | 46 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiparser_frame.h (renamed from gst-libs/gst/vaapi/gstvaapidecoder_frame.h) | 60 |
5 files changed, 57 insertions, 70 deletions
diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am index 9d20cd62..7c021a27 100644 --- a/gst-libs/gst/vaapi/Makefile.am +++ b/gst-libs/gst/vaapi/Makefile.am @@ -46,7 +46,6 @@ libgstvaapi_source_c = \ gstvaapicontext.c \ gstvaapidecoder.c \ gstvaapidecoder_dpb.c \ - gstvaapidecoder_frame.c \ gstvaapidecoder_h264.c \ gstvaapidecoder_mpeg2.c \ gstvaapidecoder_mpeg4.c \ @@ -61,6 +60,7 @@ libgstvaapi_source_c = \ gstvaapiminiobject.c \ gstvaapiobject.c \ gstvaapiparamspecs.c \ + gstvaapiparser_frame.c \ gstvaapiprofile.c \ gstvaapisubpicture.c \ gstvaapisurface.c \ @@ -105,13 +105,13 @@ libgstvaapi_source_priv_h = \ gstvaapicompat.h \ gstvaapidebug.h \ gstvaapidecoder_dpb.h \ - gstvaapidecoder_frame.h \ gstvaapidecoder_objects.h \ gstvaapidecoder_priv.h \ gstvaapidecoder_unit.h \ gstvaapidisplay_priv.h \ gstvaapiminiobject.h \ gstvaapiobject_priv.h \ + gstvaapiparser_frame.h \ gstvaapisurface_priv.h \ gstvaapisurfaceproxy_priv.h \ gstvaapiutils.h \ diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c index 1d3eb108..2a3dd76a 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder.c @@ -29,6 +29,7 @@ #include "gstvaapicompat.h" #include "gstvaapidecoder.h" #include "gstvaapidecoder_priv.h" +#include "gstvaapiparser_frame.h" #include "gstvaapisurfaceproxy_priv.h" #include "gstvaapiutils.h" #include "gstvaapi_priv.h" @@ -141,7 +142,7 @@ do_parse(GstVaapiDecoder *decoder, { GstVaapiDecoderPrivate * const priv = decoder->priv; GstVaapiParserState * const ps = &priv->parser_state; - GstVaapiDecoderFrame *frame; + GstVaapiParserFrame *frame; GstVaapiDecoderUnit *unit; GstVaapiDecoderStatus status; @@ -151,7 +152,7 @@ do_parse(GstVaapiDecoder *decoder, frame = gst_video_codec_frame_get_user_data(base_frame); if (!frame) { GstVideoCodecState * const codec_state = priv->codec_state; - frame = gst_vaapi_decoder_frame_new(codec_state->info.width, + frame = gst_vaapi_parser_frame_new(codec_state->info.width, codec_state->info.height); if (!frame) return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; @@ -188,7 +189,7 @@ do_parse(GstVaapiDecoder *decoder, } got_unit: - gst_vaapi_decoder_frame_append_unit(frame, unit); + gst_vaapi_parser_frame_append_unit(frame, unit); *got_unit_size_ptr = unit->size; *got_frame_ptr = GST_VAAPI_DECODER_UNIT_IS_FRAME_END(unit); return GST_VAAPI_DECODER_STATUS_SUCCESS; @@ -214,7 +215,7 @@ do_decode_units(GstVaapiDecoder *decoder, GArray *units) } static GstVaapiDecoderStatus -do_decode_1(GstVaapiDecoder *decoder, GstVaapiDecoderFrame *frame) +do_decode_1(GstVaapiDecoder *decoder, GstVaapiParserFrame *frame) { GstVaapiDecoderClass * const klass = GST_VAAPI_DECODER_GET_CLASS(decoder); GstVaapiDecoderStatus status; @@ -261,14 +262,14 @@ static inline GstVaapiDecoderStatus do_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *base_frame) { GstVaapiParserState * const ps = &decoder->priv->parser_state; - GstVaapiDecoderFrame * const frame = base_frame->user_data; + GstVaapiParserFrame * const frame = base_frame->user_data; GstVaapiDecoderStatus status; ps->current_frame = base_frame; - gst_vaapi_decoder_frame_ref(frame); + gst_vaapi_parser_frame_ref(frame); status = do_decode_1(decoder, frame); - gst_vaapi_decoder_frame_unref(frame); + gst_vaapi_parser_frame_unref(frame); switch ((guint)status) { case GST_VAAPI_DECODER_STATUS_DROP_FRAME: diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_priv.h b/gst-libs/gst/vaapi/gstvaapidecoder_priv.h index 4bf4afe1..12af49c0 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_priv.h +++ b/gst-libs/gst/vaapi/gstvaapidecoder_priv.h @@ -25,7 +25,7 @@ #include <glib.h> #include <gst/vaapi/gstvaapidecoder.h> -#include <gst/vaapi/gstvaapidecoder_frame.h> +#include <gst/vaapi/gstvaapidecoder_unit.h> #include <gst/vaapi/gstvaapicontext.h> G_BEGIN_DECLS diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_frame.c b/gst-libs/gst/vaapi/gstvaapiparser_frame.c index c2e659b8..9c87300c 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_frame.c +++ b/gst-libs/gst/vaapi/gstvaapiparser_frame.c @@ -1,5 +1,5 @@ /* - * gstvaapidecoder_frame.c - VA decoder frame + * gstvaapiparser_frame.c - VA parser frame * * Copyright (C) 2012-2013 Intel Corporation * @@ -20,21 +20,21 @@ */ /** - * SECTION:gstvaapidecoder_frame + * SECTION:gstvaapiparser_frame * @short_description: VA decoder frame */ #include "sysdeps.h" -#include "gstvaapidecoder_frame.h" +#include "gstvaapiparser_frame.h" static inline const GstVaapiMiniObjectClass * -gst_vaapi_decoder_frame_class(void) +gst_vaapi_parser_frame_class(void) { - static const GstVaapiMiniObjectClass GstVaapiDecoderFrameClass = { - sizeof(GstVaapiDecoderFrame), - (GDestroyNotify)gst_vaapi_decoder_frame_free + static const GstVaapiMiniObjectClass GstVaapiParserFrameClass = { + sizeof(GstVaapiParserFrame), + (GDestroyNotify)gst_vaapi_parser_frame_free }; - return &GstVaapiDecoderFrameClass; + return &GstVaapiParserFrameClass; } static inline gboolean @@ -65,22 +65,22 @@ free_units(GArray **units_ptr) } /** - * gst_vaapi_decoder_frame_new: + * gst_vaapi_parser_frame_new: * @width: frame width in pixels * @height: frame height in pixels * - * Creates a new #GstVaapiDecoderFrame object. + * Creates a new #GstVaapiParserFrame object. * - * Returns: The newly allocated #GstVaapiDecoderFrame + * Returns: The newly allocated #GstVaapiParserFrame */ -GstVaapiDecoderFrame * -gst_vaapi_decoder_frame_new(guint width, guint height) +GstVaapiParserFrame * +gst_vaapi_parser_frame_new(guint width, guint height) { - GstVaapiDecoderFrame *frame; + GstVaapiParserFrame *frame; guint num_slices; - frame = (GstVaapiDecoderFrame *) - gst_vaapi_mini_object_new(gst_vaapi_decoder_frame_class()); + frame = (GstVaapiParserFrame *) + gst_vaapi_mini_object_new(gst_vaapi_parser_frame_class()); if (!frame) return NULL; @@ -98,13 +98,13 @@ gst_vaapi_decoder_frame_new(guint width, guint height) return frame; error: - gst_vaapi_decoder_frame_unref(frame); + gst_vaapi_parser_frame_unref(frame); return NULL; } /** - * gst_vaapi_decoder_frame_free: - * @frame: a #GstVaapiDecoderFrame + * gst_vaapi_parser_frame_free: + * @frame: a #GstVaapiParserFrame * * Deallocates any internal resources bound to the supplied decoder * @frame. @@ -113,7 +113,7 @@ error: * sub-classes. */ void -gst_vaapi_decoder_frame_free(GstVaapiDecoderFrame *frame) +gst_vaapi_parser_frame_free(GstVaapiParserFrame *frame) { free_units(&frame->units); free_units(&frame->pre_units); @@ -121,14 +121,14 @@ gst_vaapi_decoder_frame_free(GstVaapiDecoderFrame *frame) } /** - * gst_vaapi_decoder_frame_append_unit: - * @frame: a #GstVaapiDecoderFrame + * gst_vaapi_parser_frame_append_unit: + * @frame: a #GstVaapiParserFrame * @unit: a #GstVaapiDecoderUnit * * Appends unit to the @frame. */ void -gst_vaapi_decoder_frame_append_unit(GstVaapiDecoderFrame *frame, +gst_vaapi_parser_frame_append_unit(GstVaapiParserFrame *frame, GstVaapiDecoderUnit *unit) { GArray **unit_array_ptr; diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_frame.h b/gst-libs/gst/vaapi/gstvaapiparser_frame.h index 84b5f6ff..b9b0b0b4 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_frame.h +++ b/gst-libs/gst/vaapi/gstvaapiparser_frame.h @@ -1,5 +1,5 @@ /* - * gstvaapidecoder_frame.h - VA decoder frame + * gstvaapiparser_frame.h - VA parser frame * * Copyright (C) 2012-2013 Intel Corporation * @@ -19,38 +19,24 @@ * Boston, MA 02110-1301 USA */ -#ifndef GST_VAAPI_DECODER_FRAME_H -#define GST_VAAPI_DECODER_FRAME_H +#ifndef GST_VAAPI_PARSER_FRAME_H +#define GST_VAAPI_PARSER_FRAME_H #include <gst/vaapi/gstvaapiminiobject.h> #include <gst/vaapi/gstvaapidecoder_unit.h> G_BEGIN_DECLS -typedef struct _GstVaapiDecoderFrame GstVaapiDecoderFrame; +typedef struct _GstVaapiParserFrame GstVaapiParserFrame; -#define GST_VAAPI_DECODER_FRAME(frame) \ - ((GstVaapiDecoderFrame *)(frame)) +#define GST_VAAPI_PARSER_FRAME(frame) \ + ((GstVaapiParserFrame *)(frame)) -#define GST_VAAPI_IS_DECODER_FRAME(frame) \ - (GST_VAAPI_DECODER_FRAME(frame) != NULL) +#define GST_VAAPI_IS_PARSER_FRAME(frame) \ + (GST_VAAPI_PARSER_FRAME(frame) != NULL) /** - * GstVaapiDecoderFrameFlags: - * - * Flags for #GstVaapiDecoderFrame. - */ -typedef enum { - GST_VAAPI_DECODER_FRAME_FLAG_LAST = (1 << 0) -} GstVaapiDecoderFrameFlags; - -#define GST_VAAPI_DECODER_FRAME_FLAGS GST_VAAPI_MINI_OBJECT_FLAGS -#define GST_VAAPI_DECODER_FRAME_FLAG_IS_SET GST_VAAPI_MINI_OBJECT_FLAG_IS_SET -#define GST_VAAPI_DECODER_FRAME_FLAG_SET GST_VAAPI_MINI_OBJECT_FLAG_SET -#define GST_VAAPI_DECODER_FRAME_FLAG_UNSET GST_VAAPI_MINI_OBJECT_FLAG_UNSET - -/** - * GstVaapiDecoderFrame: + * GstVaapiParserFrame: * @output_offset: current offset to the reconstructed #GstBuffer for * this #GstVideoCodecFrame. This is used to initialize the decoder * unit offset @@ -62,39 +48,39 @@ typedef enum { * information. Decoder frames are usually attached to codec frames as * the user_data anchor point. */ -struct _GstVaapiDecoderFrame { +struct _GstVaapiParserFrame { /*< private >*/ - GstVaapiMiniObject parent_instance; + GstVaapiMiniObject parent_instance; - guint output_offset; - GArray *units; - GArray *pre_units; - GArray *post_units; + guint output_offset; + GArray *units; + GArray *pre_units; + GArray *post_units; }; G_GNUC_INTERNAL -GstVaapiDecoderFrame * -gst_vaapi_decoder_frame_new(guint width, guint height); +GstVaapiParserFrame * +gst_vaapi_parser_frame_new(guint width, guint height); G_GNUC_INTERNAL void -gst_vaapi_decoder_frame_free(GstVaapiDecoderFrame *frame); +gst_vaapi_parser_frame_free(GstVaapiParserFrame *frame); G_GNUC_INTERNAL void -gst_vaapi_decoder_frame_append_unit(GstVaapiDecoderFrame *frame, +gst_vaapi_parser_frame_append_unit(GstVaapiParserFrame *frame, GstVaapiDecoderUnit *unit); -#define gst_vaapi_decoder_frame_ref(frame) \ +#define gst_vaapi_parser_frame_ref(frame) \ gst_vaapi_mini_object_ref(GST_VAAPI_MINI_OBJECT(frame)) -#define gst_vaapi_decoder_frame_unref(frame) \ +#define gst_vaapi_parser_frame_unref(frame) \ gst_vaapi_mini_object_unref(GST_VAAPI_MINI_OBJECT(frame)) -#define gst_vaapi_decoder_frame_replace(old_frame_p, new_frame) \ +#define gst_vaapi_parser_frame_replace(old_frame_p, new_frame) \ gst_vaapi_mini_object_replace((GstVaapiMiniObject **)(old_frame_p), \ (GstVaapiMiniObject *)(new_frame)) G_END_DECLS -#endif /* GST_VAAPI_DECODER_FRAME_H */ +#endif /* GST_VAAPI_PARSER_FRAME_H */ |