/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008-2015 The gstreamermm Development Team
 *
 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

_DEFS(gstreamermm,gst)

#include <gst/video/video-frame.h>
#include <gstreamermm/videoinfo.h>
#include <gstreamermm/buffer.h>

namespace Gst
{

  _WRAP_ENUM(VideoFrameFlags, GstVideoFrameFlags)
  _WRAP_ENUM(VideoBufferFlags, GstVideoBufferFlags)
  _WRAP_ENUM(VideoFrameMapFlags, GstVideoFrameMapFlags)

class VideoFrame
{
  _CLASS_GENERIC(VideoFrame, GstVideoFrame)
public:
  VideoFrame();
  explicit VideoFrame(const GstVideoFrame* gobject); // always takes a copy
  ///Provides access to the underlying C instance.
  GstVideoFrame*       gobj()       { return &gobject_; }
  ///Provides access to the underlying C instance.
  const GstVideoFrame* gobj() const { return &gobject_; }

protected:
  GstVideoFrame gobject_;

public:
  _WRAP_METHOD(bool map(const Gst::VideoInfo& info, const Glib::RefPtr<Gst::Buffer>& buffer, Gst::MapFlags flags), gst_video_frame_map)
  _WRAP_METHOD(bool map_id(const Gst::VideoInfo& info, const Glib::RefPtr<Gst::Buffer>& buffer, gint id, Gst::MapFlags flags), gst_video_frame_map_id)
  _WRAP_METHOD(void unmap(), gst_video_frame_unmap)
  _WRAP_METHOD(static bool copy(const Gst::VideoFrame& dest, const Gst::VideoFrame& src), gst_video_frame_copy)
  _WRAP_METHOD(static bool copy_plane(const Gst::VideoFrame& dest, const Gst::VideoFrame& src, guint plane), gst_video_frame_copy_plane)

  _MEMBER_SET(info, info, Gst::VideoInfo, GstVideoInfo)
  _MEMBER_GET(info, info, Gst::VideoInfo, GstVideoInfo)
  

  _MEMBER_SET(flags, flags, Gst::VideoFrameFlags, GstVideoFrameFlags)
  _MEMBER_GET(flags, flags, Gst::VideoFrameFlags, GstVideoFrameFlags)

  _MEMBER_SET(buffer, buffer, Glib::RefPtr<Gst::Buffer>, GstBuffer*)
  _MEMBER_GET(buffer, buffer, Glib::RefPtr<Gst::Buffer>, GstBuffer*)

  _MEMBER_SET(meta, meta, gpointer, gpointer)
  _MEMBER_GET(meta, meta, gpointer, gpointer)

  _MEMBER_SET(id, id, gint, gint)
  _MEMBER_GET(id, id, gint, gint)
};

}
