diff options
author | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2015-09-23 16:02:46 +0200 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2015-09-23 17:11:21 +0200 |
commit | 52b94556ed08b07354f15bd2906b59b197cbd225 (patch) | |
tree | fd084ed6cfaffd79a4457e0d1ba580af27086076 | |
parent | 5ab4c15754ab487fde03a7bc60ab311ba63e0d08 (diff) | |
download | gst-vaapi-52b94556ed08b07354f15bd2906b59b197cbd225.tar.gz |
gstcompat: add gst_buffer_copy_deep() if gst < 1.5
gst_buffer_copy_deep() was added in GStreamer 1.5. If want to use it we should
add an implementation if gstreamer-vaapi is linked to previous versions.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
-rw-r--r-- | gst/vaapi/gstcompat.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gst/vaapi/gstcompat.h b/gst/vaapi/gstcompat.h index c953783f..17bd3e6e 100644 --- a/gst/vaapi/gstcompat.h +++ b/gst/vaapi/gstcompat.h @@ -25,4 +25,27 @@ #include "gst/vaapi/sysdeps.h" +#if !GST_CHECK_VERSION (1,5,0) +static inline GstBuffer * +gst_buffer_copy_deep (const GstBuffer * buffer) +{ + GstBuffer *copy; + + g_return_val_if_fail (buffer != NULL, NULL); + + copy = gst_buffer_new (); + + if (!gst_buffer_copy_into (copy, (GstBuffer *) buffer, + GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1)) + gst_buffer_replace (©, NULL); + +#if GST_CHECK_VERSION (1,4,0) + if (copy) + GST_BUFFER_FLAG_UNSET (copy, GST_BUFFER_FLAG_TAG_MEMORY); +#endif + + return copy; +} +#endif + #endif /* GST_COMPAT_H */ |