summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
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_mpeg2.c
parent7a3316543610e0728272d7b1e6cb873c0c884426 (diff)
downloadgst-vaapi-0fb7c605080e926a4ff3a7b01337281d968148b5.tar.gz
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_mpeg2.c')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
index 4b5ae8ea..70decdb3 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
@@ -25,6 +25,7 @@
#include "gstvaapiencoder_mpeg2.h"
#include "gstvaapiencoder_mpeg2_priv.h"
#include "gstvaapiencoder_priv.h"
+#include "gstvaapicodedbufferproxy_priv.h"
#include <va/va.h>
#include <va/va_enc_mpeg2.h>
@@ -228,7 +229,7 @@ fill_picture (GstVaapiEncoderMpeg2 * encoder,
memset (pic, 0, sizeof (VAEncPictureParameterBufferMPEG2));
pic->reconstructed_picture = GST_VAAPI_SURFACE_PROXY_SURFACE_ID (surface);
- pic->coded_buf = codedbuf->buf_id;
+ pic->coded_buf = GST_VAAPI_OBJECT_ID (codedbuf);
pic->picture_type = get_va_enc_picture_type (picture->type);
pic->temporal_reference = picture->frame_num & (1024 - 1);
pic->vbv_delay = 0xFFFF;
@@ -385,11 +386,11 @@ error:
}
static gboolean
-ensure_picture (GstVaapiEncoderMpeg2 * encoder,
- GstVaapiEncPicture * picture,
- GstVaapiCodedBufferProxy * buf_proxy, GstVaapiSurfaceProxy * surface)
+ensure_picture (GstVaapiEncoderMpeg2 * encoder, GstVaapiEncPicture * picture,
+ GstVaapiCodedBufferProxy * codedbuf_proxy, GstVaapiSurfaceProxy * surface)
{
- GstVaapiCodedBuffer *codedbuf = buf_proxy->buffer;
+ GstVaapiCodedBuffer *const codedbuf =
+ GST_VAAPI_CODED_BUFFER_PROXY_BUFFER (codedbuf_proxy);
if (!fill_picture (encoder, picture, codedbuf, surface))
return FALSE;