libvdo
vdo-stream.h
Go to the documentation of this file.
1 
102 #ifndef __VDO_STREAM_H__
103 #define __VDO_STREAM_H__
104 
105 #include "vdo-types.h"
106 #include "vdo-frame.h"
107 #include "vdo-buffer.h"
108 #include "vdo-map.h"
109 
110 #include <glib-object.h>
111 
112 G_BEGIN_DECLS
113 
114 #define VDO_GETFRAME_NONBLOCK (0)
115 
124 #define VDO_TYPE_STREAM (vdo_stream_get_type())
125 G_DECLARE_FINAL_TYPE(VdoStream, vdo_stream, VDO, STREAM, GObject)
126 
127 
158 VdoStream *vdo_stream_rgb_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error);
159 
191 VdoStream *vdo_stream_nv12_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error);
192 
224 VdoStream *vdo_stream_y800_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error);
225 
237 VdoStream *vdo_stream_new(VdoMap *settings, VdoBufferFinalizer fin, GError **error);
238 
250 VdoStream *vdo_stream_get(guint id, GError **error);
251 
263 GList *vdo_stream_get_all(GError **error);
264 
273 
288 gint vdo_stream_get_fd(VdoStream *self, GError **error);
289 
303 gint vdo_stream_get_event_fd(VdoStream *self, GError **error);
304 
323 VdoMap *vdo_stream_get_info(VdoStream *self, GError **error);
324 
343 VdoMap *vdo_stream_get_settings(VdoStream *self, GError **error);
344 
364 gboolean vdo_stream_set_settings(VdoStream *self, VdoMap *settings,
365  GError **error);
366 
389 gboolean vdo_stream_set_framerate(VdoStream *self, gdouble framerate,
390  GError **error);
391 
426 gboolean vdo_stream_attach(VdoStream *self, VdoMap *intent, GError **error);
427 
438 gboolean vdo_stream_start(VdoStream *self, GError **error);
439 
452 gboolean vdo_stream_play(VdoStream *self, VdoMap *settings, GError **error);
453 
462 
475 gboolean vdo_stream_force_key_frame(VdoStream *self, GError **error);
476 
477 /*
478 ** The vdo-stream allocation API:s have the following limitations:
479 ** 1. Buffer alloc/unref are fully synchronous and will BLOCK.
480 ** 2. Buffer alloc/unref does not support encoded streams (vdo_format_is_encoded).
481 ** Use the stream global setting "socket.timeout_ms" (int32_t) to control maximum blocking time.
482 */
483 
502 VdoBuffer *vdo_stream_buffer_alloc(VdoStream *self, gpointer opaque, GError **error);
503 
519 gboolean vdo_stream_buffer_unref(VdoStream *self, VdoBuffer **buffer, GError **error);
520 
533 gboolean vdo_stream_buffer_enqueue(VdoStream *self, VdoBuffer *buffer, GError **error);
534 
557 VdoBuffer *vdo_stream_get_buffer(VdoStream *self, GError **error);
558 
577 VdoStream *vdo_stream_to_fd(VdoMap *settings, int data_fd, int meta_fd, GError **error);
578 
599 VdoBuffer *vdo_stream_snapshot(VdoMap *settings, GError **error);
600 
620 gboolean vdo_stream_encode(VdoStream *self, VdoBuffer **in_buf, VdoMap *settings, GError **error);
621 
681 VdoMap *vdo_stream_get_event(VdoStream *self, GError **error);
682 
683 G_END_DECLS
684 
685 #endif
A class representing a dictionary mapping keys to values.
A video stream.
A resolution.
Definition: vdo-types.h:423
A memory buffer.
A video frame.
A class representing a dictionary mapping keys to values.
VdoBuffer * vdo_stream_get_buffer(VdoStream *self, GError **error)
Fetch a VdoBuffer containing a frame.
VdoStream * vdo_stream_nv12_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error)
Create a new NV12 VdoStream (AXIS OS 12.8+).
VdoStream * vdo_stream_get(guint id, GError **error)
Get an existing video stream.
VdoStream * vdo_stream_y800_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error)
Create a new Y800 VdoStream (AXIS OS 12.8+).
VdoBuffer * vdo_stream_buffer_alloc(VdoStream *self, gpointer opaque, GError **error)
Allocate a new buffer for this stream.
gboolean vdo_stream_force_key_frame(VdoStream *self, GError **error)
Force this video stream to insert a key frame.
VdoStream * vdo_stream_new(VdoMap *settings, VdoBufferFinalizer fin, GError **error)
Create a new VdoStream.
VdoBuffer * vdo_stream_snapshot(VdoMap *settings, GError **error)
Fetch a single VdoBuffer containing a frame.
gboolean vdo_stream_start(VdoStream *self, GError **error)
Start this video stream.
gboolean vdo_stream_buffer_unref(VdoStream *self, VdoBuffer **buffer, GError **error)
Decrease the reference count for the specified buffer.
void vdo_stream_stop(VdoStream *self)
Stop this video stream.
VdoMap * vdo_stream_get_info(VdoStream *self, GError **error)
Get the info for this video stream.
gint vdo_stream_get_fd(VdoStream *self, GError **error)
Return a file descriptor representing the underlying socket connection.
gboolean vdo_stream_buffer_enqueue(VdoStream *self, VdoBuffer *buffer, GError **error)
Enqueue a buffer for this video stream.
VdoStream * vdo_stream_to_fd(VdoMap *settings, int data_fd, int meta_fd, GError **error)
Create and start a new stream to already existing file descriptors.
gboolean vdo_stream_attach(VdoStream *self, VdoMap *intent, GError **error)
Attach to a Stream.
GList * vdo_stream_get_all(GError **error)
Get a list of all existing video streams.
VdoStream * vdo_stream_rgb_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error)
Create a new RGB24(RGB888) VdoStream (AXIS OS 12.8+).
gint vdo_stream_get_event_fd(VdoStream *self, GError **error)
Return a file descriptor for prioritized events.
VdoMap * vdo_stream_get_settings(VdoStream *self, GError **error)
Get the settings for this video stream.
gboolean vdo_stream_play(VdoStream *self, VdoMap *settings, GError **error)
Play all buffered video and continue streaming live.
VdoMap * vdo_stream_get_event(VdoStream *self, GError **error)
Fetch the next Event.
gboolean vdo_stream_set_framerate(VdoStream *self, gdouble framerate, GError **error)
Update the framerate for this video stream.
guint vdo_stream_get_id(VdoStream *self)
Return the id of this video stream.
gboolean vdo_stream_set_settings(VdoStream *self, VdoMap *settings, GError **error)
Update the settings for this video stream.
VDO common type definitions.