| 1 |
/* gstreamermm - a C++ wrapper for gstreamer |
| 2 |
* |
| 3 |
* Copyright 2008-2015 The gstreamermm Development Team |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the Free |
| 17 |
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
_DEFS(gstreamermm,gst) |
| 21 |
|
| 22 |
#include <gst/video/video-frame.h> |
| 23 |
#include <gstreamermm/videoinfo.h> |
| 24 |
#include <gstreamermm/buffer.h> |
| 25 |
|
| 26 |
namespace Gst |
| 27 |
{ |
| 28 |
|
| 29 |
_WRAP_ENUM(VideoFrameFlags, GstVideoFrameFlags) |
| 30 |
_WRAP_ENUM(VideoBufferFlags, GstVideoBufferFlags) |
| 31 |
_WRAP_ENUM(VideoFrameMapFlags, GstVideoFrameMapFlags) |
| 32 |
|
| 33 |
class VideoFrame |
| 34 |
{ |
| 35 |
_CLASS_GENERIC(VideoFrame, GstVideoFrame) |
| 36 |
public: |
| 37 |
VideoFrame(); |
| 38 |
explicit VideoFrame(const GstVideoFrame* gobject); // always takes a copy |
| 39 |
///Provides access to the underlying C instance. |
| 40 |
GstVideoFrame* gobj() { return &gobject_; } |
| 41 |
///Provides access to the underlying C instance. |
| 42 |
const GstVideoFrame* gobj() const { return &gobject_; } |
| 43 |
|
| 44 |
protected: |
| 45 |
GstVideoFrame gobject_; |
| 46 |
|
| 47 |
public: |
| 48 |
_WRAP_METHOD(bool map(const Gst::VideoInfo& info, const Glib::RefPtr<Gst::Buffer>& buffer, Gst::MapFlags flags), gst_video_frame_map) |
| 49 |
_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) |
| 50 |
_WRAP_METHOD(void unmap(), gst_video_frame_unmap) |
| 51 |
_WRAP_METHOD(static bool copy(const Gst::VideoFrame& dest, const Gst::VideoFrame& src), gst_video_frame_copy) |
| 52 |
_WRAP_METHOD(static bool copy_plane(const Gst::VideoFrame& dest, const Gst::VideoFrame& src, guint plane), gst_video_frame_copy_plane) |
| 53 |
|
| 54 |
_MEMBER_SET(info, info, Gst::VideoInfo, GstVideoInfo) |
| 55 |
_MEMBER_GET(info, info, Gst::VideoInfo, GstVideoInfo) |
| 56 |
|
| 57 |
|
| 58 |
_MEMBER_SET(flags, flags, Gst::VideoFrameFlags, GstVideoFrameFlags) |
| 59 |
_MEMBER_GET(flags, flags, Gst::VideoFrameFlags, GstVideoFrameFlags) |
| 60 |
|
| 61 |
_MEMBER_SET(buffer, buffer, Glib::RefPtr<Gst::Buffer>, GstBuffer*) |
| 62 |
_MEMBER_GET(buffer, buffer, Glib::RefPtr<Gst::Buffer>, GstBuffer*) |
| 63 |
|
| 64 |
_MEMBER_SET(meta, meta, gpointer, gpointer) |
| 65 |
_MEMBER_GET(meta, meta, gpointer, gpointer) |
| 66 |
|
| 67 |
_MEMBER_SET(id, id, gint, gint) |
| 68 |
_MEMBER_GET(id, id, gint, gint) |
| 69 |
}; |
| 70 |
|
| 71 |
} |