decoder: rename GstVaapiDecoderFrame to GstVaapiParserFrame.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 16 Apr 2013 11:23:41 +0000 (13:23 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 16 Apr 2013 17:11:02 +0000 (19:11 +0200)
Rename GstVaapiDecoderFrame to GstVaapiParserFrame because this data
structure was only useful to parsing and a proper GstvaapiDecoderFrame
instance will be created instead.

gst-libs/gst/vaapi/Makefile.am
gst-libs/gst/vaapi/gstvaapidecoder.c
gst-libs/gst/vaapi/gstvaapidecoder_priv.h
gst-libs/gst/vaapi/gstvaapiparser_frame.c [moved from gst-libs/gst/vaapi/gstvaapidecoder_frame.c with 74% similarity]
gst-libs/gst/vaapi/gstvaapiparser_frame.h [moved from gst-libs/gst/vaapi/gstvaapidecoder_frame.h with 55% similarity]

index 9d20cd6..7c021a2 100644 (file)
@@ -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                         \
index 1d3eb10..2a3dd76 100644 (file)
@@ -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:
index 4bf4afe..12af49c 100644 (file)
@@ -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
similarity index 74%
rename from gst-libs/gst/vaapi/gstvaapidecoder_frame.c
rename to gst-libs/gst/vaapi/gstvaapiparser_frame.c
index c2e659b..9c87300 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapidecoder_frame.c - VA decoder frame
+ *  gstvaapiparser_frame.c - VA parser frame
  *
  *  Copyright (C) 2012-2013 Intel Corporation
  *
  */
 
 /**
- * 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;
similarity index 55%
rename from gst-libs/gst/vaapi/gstvaapidecoder_frame.h
rename to gst-libs/gst/vaapi/gstvaapiparser_frame.h
index 84b5f6f..b9b0b0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  gstvaapidecoder_frame.h - VA decoder frame
+ *  gstvaapiparser_frame.h - VA parser frame
  *
  *  Copyright (C) 2012-2013 Intel Corporation
  *
  *  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 */