2 * Copyright (C) 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef __GST_KS_VIDEO_DEVICE_H__
21 #define __GST_KS_VIDEO_DEVICE_H__
23 #include "gstksclock.h"
32 #define GST_TYPE_KS_VIDEO_DEVICE \
33 (gst_ks_video_device_get_type ())
34 #define GST_KS_VIDEO_DEVICE(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_KS_VIDEO_DEVICE, GstKsVideoDevice))
36 #define GST_KS_VIDEO_DEVICE_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_KS_VIDEO_DEVICE, GstKsVideoDeviceClass))
38 #define GST_IS_KS_VIDEO_DEVICE(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_KS_VIDEO_DEVICE))
40 #define GST_IS_KS_VIDEO_DEVICE_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_KS_VIDEO_DEVICE))
43 typedef struct _GstKsVideoDevice GstKsVideoDevice;
44 typedef struct _GstKsVideoDeviceClass GstKsVideoDeviceClass;
45 typedef struct _GstKsVideoDevicePrivate GstKsVideoDevicePrivate;
47 typedef GstBuffer * (* GstKsAllocFunction)(guint buf_size, guint alignment, gpointer user_data);
49 struct _GstKsVideoDevice
53 GstKsAllocFunction allocfunc;
54 gpointer allocfunc_data;
56 GstKsVideoDevicePrivate *priv;
59 struct _GstKsVideoDeviceClass
61 GObjectClass parent_class;
64 GType gst_ks_video_device_get_type (void);
66 GstKsVideoDevice * gst_ks_video_device_new (const gchar * device_path, GstKsClock * clock, GstKsAllocFunction allocfunc, gpointer allocfunc_data);
67 gboolean gst_ks_video_device_open (GstKsVideoDevice * self);
68 void gst_ks_video_device_close (GstKsVideoDevice * self);
70 GstCaps * gst_ks_video_device_get_available_caps (GstKsVideoDevice * self);
71 gboolean gst_ks_video_device_has_caps (GstKsVideoDevice * self);
72 gboolean gst_ks_video_device_set_caps (GstKsVideoDevice * self, GstCaps * caps);
74 gboolean gst_ks_video_device_set_state (GstKsVideoDevice * self, KSSTATE state, gulong * error_code);
76 GstClockTime gst_ks_video_device_get_duration (GstKsVideoDevice * self);
77 gboolean gst_ks_video_device_get_latency (GstKsVideoDevice * self, GstClockTime * min_latency, GstClockTime * max_latency);
79 GstFlowReturn gst_ks_video_device_read_frame (GstKsVideoDevice * self, GstBuffer ** buf, GstClockTime * presentation_time, gulong * error_code, gchar ** error_str);
80 gboolean gst_ks_video_device_postprocess_frame (GstKsVideoDevice * self, GstBuffer **buf);
81 void gst_ks_video_device_cancel (GstKsVideoDevice * self);
82 void gst_ks_video_device_cancel_stop (GstKsVideoDevice * self);
84 gboolean gst_ks_video_device_stream_is_muxed (GstKsVideoDevice * self);
88 #endif /* __GST_KS_VIDEO_DEVICE_H__ */