1 /* GStreamer 2 * Copyright (C) <2009> Collabora Ltd 3 * @author: Olivier Crete <olivier.crete@collabora.co.uk 4 * Copyright (C) <2009> Nokia Inc 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __GST_SHM_SRC_H__ 23 #define __GST_SHM_SRC_H__ 24 25 #include <gst/gst.h> 26 #include <gst/base/gstpushsrc.h> 27 #include <gst/base/gstbasesrc.h> 28 29 #include "shmpipe.h" 30 31 G_BEGIN_DECLS 32 #define GST_TYPE_SHM_SRC \ 33 (gst_shm_src_get_type()) 34 #define GST_SHM_SRC(obj) \ 35 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SHM_SRC,GstShmSrc)) 36 #define GST_SHM_SRC_CLASS(klass) \ 37 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SHM_SRC,GstShmSrcClass)) 38 #define GST_IS_SHM_SRC(obj) \ 39 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SHM_SRC)) 40 #define GST_IS_SHM_SRC_CLASS(klass) \ 41 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SHM_SRC)) 42 typedef struct _GstShmSrc GstShmSrc; 43 typedef struct _GstShmSrcClass GstShmSrcClass; 44 typedef struct _GstShmPipe GstShmPipe; 45 46 struct _GstShmSrc 47 { 48 GstPushSrc element; 49 50 gchar *socket_path; 51 52 GstShmPipe *pipe; 53 GstPoll *poll; 54 GstPollFD pollfd; 55 56 57 GstFlowReturn flow_return; 58 gboolean unlocked; 59 }; 60 61 struct _GstShmSrcClass 62 { 63 GstPushSrcClass parent_class; 64 }; 65 66 GType gst_shm_src_get_type (void); 67 68 GST_ELEMENT_REGISTER_DECLARE (shmsrc); 69 70 struct _GstShmPipe { 71 int use_count; 72 73 GstShmSrc *src; 74 ShmPipe *pipe; 75 }; 76 77 G_END_DECLS 78 #endif /* __GST_SHM_SRC_H__ */ 79