summaryrefslogtreecommitdiff
path: root/gst/vaapi/gstcompat.h
blob: 17bd3e6e08e7112f8efc4339c6ae3511074d63d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 *  gstcompat.h - Compatibility glue for GStreamer
 *
 *  Copyright (C) 2013 Intel Corporation
 *    Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public License
 *  as published by the Free Software Foundation; either version 2.1
 *  of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free
 *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301 USA
 */

#ifndef GST_COMPAT_H
#define GST_COMPAT_H

#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 (&copy, 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 */