summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-12-03 16:11:46 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-12-04 19:14:38 +0100
commit0fb7c605080e926a4ff3a7b01337281d968148b5 (patch)
tree331f77ccba441aa2972d266e6269b3d52bdca074 /gst-libs/gst/vaapi/gstvaapiencoder_priv.h
parent7a3316543610e0728272d7b1e6cb873c0c884426 (diff)
encoder: rework GstVaapiCodedBuffer and related proxy.
Refactor the GstVaapiCodedBuffer APIs so that to more clearly separate public and private interfaces. Besides, the map/unmap APIs should not be exposed as is but appropriate accessors should be provided instead. * GstVaapiCodedBuffer: VA coded buffer abstraction - gst_vaapi_coded_buffer_get_size(): get coded buffer size. - gst_vaapi_coded_buffer_copy_into(): copy coded buffer into GstBuffer * GstVaapiCodedBufferPool: pool of VA coded buffer objects - gst_vaapi_coded_buffer_pool_new(): create a pool of coded buffers of the specified max size, and bound to the supplied encoder * GstVaapiCodedBufferProxy: pool-allocated VA coded buffer object proxy - gst_vaapi_coded_buffer_proxy_new_from_pool(): create coded buf from pool - gst_vaapi_coded_buffer_proxy_get_buffer(): get underlying coded buffer - gst_vaapi_coded_buffer_proxy_get_buffer_size(): get coded buffer size Rationale: more optimized transfer functions might be provided in the future, thus rendering the map/unmap mechanism obsolete or sub-optimal. https://bugzilla.gnome.org/show_bug.cgi?id=719775
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapiencoder_priv.h')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_priv.h41
1 files changed, 4 insertions, 37 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_priv.h b/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
index 71fff0cd..8b78ac95 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
@@ -25,6 +25,7 @@
#include <gst/vaapi/gstvaapiencoder.h>
#include <gst/vaapi/gstvaapiencoder_objects.h>
#include <gst/vaapi/gstvaapicontext.h>
+#include <gst/vaapi/gstvaapivideopool.h>
#include <gst/video/gstvideoutils.h>
G_BEGIN_DECLS
@@ -75,7 +76,6 @@ G_BEGIN_DECLS
goto end; \
}
-typedef struct _GstVaapiCodedBufferProxyClass GstVaapiCodedBufferProxyClass;
typedef struct _GstVaapiEncoderClass GstVaapiEncoderClass;
struct _GstVaapiEncoder
@@ -92,13 +92,11 @@ struct _GstVaapiEncoder
GstVideoInfo video_info;
GstVaapiRateControl rate_control;
- guint buf_count;
- guint max_buf_num;
- guint buf_size;
GMutex lock;
- GCond codedbuf_free;
GCond surface_free;
- GQueue coded_buffers;
+ GCond codedbuf_free;
+ guint codedbuf_size;
+ GstVaapiVideoPool *codedbuf_pool;
/* queue for sync */
GQueue sync_pictures;
@@ -134,21 +132,6 @@ struct _GstVaapiEncoderClass
GstBuffer ** codec_data);
};
-struct _GstVaapiCodedBufferProxy
-{
- /*< private >*/
- GstVaapiMiniObject parent_instance;
- GstVaapiEncoder *encoder;
-
- /*< public >*/
- GstVaapiCodedBuffer *buffer;
-};
-
-struct _GstVaapiCodedBufferProxyClass
-{
- GstVaapiMiniObjectClass parent_class;
-};
-
void
gst_vaapi_encoder_class_init (GstVaapiEncoderClass * klass);
@@ -167,22 +150,6 @@ void
gst_vaapi_encoder_release_surface (GstVaapiEncoder * encoder,
GstVaapiSurfaceProxy * surface);
-/* ------------------ GstVaapiCodedBufferProxy ---------------------------- */
-
-GstVaapiCodedBufferProxy *
-gst_vaapi_coded_buffer_proxy_new (GstVaapiEncoder *
- encoder);
-
-GstVaapiCodedBufferProxy *
-gst_vaapi_coded_buffer_proxy_ref (GstVaapiCodedBufferProxy * proxy);
-
-void
-gst_vaapi_coded_buffer_proxy_unref (GstVaapiCodedBufferProxy * proxy);
-
-void
-gst_vaapi_coded_buffer_proxy_replace (GstVaapiCodedBufferProxy ** old_proxy_ptr,
- GstVaapiCodedBufferProxy * new_proxy);
-
G_END_DECLS
#endif /* GST_VAAPI_ENCODER_PRIV_H */