libvdo
vdo-stream.h
Go to the documentation of this file.
1 
103 #ifndef __VDO_STREAM_H__
104 #define __VDO_STREAM_H__
105 
106 #include "vdo-types.h"
107 #include "vdo-frame.h"
108 #include "vdo-buffer.h"
109 #include "vdo-map.h"
110 
111 #include <glib-object.h>
112 
113 G_BEGIN_DECLS
114 
115 #define VDO_GETFRAME_NONBLOCK (0)
116 
121 #define VDO_TYPE_STREAM (vdo_stream_get_type())
122 G_DECLARE_FINAL_TYPE(VdoStream, vdo_stream, VDO, STREAM, GObject)
123 
124 
135 VdoStream *vdo_stream_new(VdoMap *settings, VdoBufferFinalizer fin, GError **error);
136 
148 VdoStream *vdo_stream_get(guint id, GError **error);
149 
161 GList *vdo_stream_get_all(GError **error);
162 
170 guint vdo_stream_get_id(VdoStream *self);
171 
184 gint vdo_stream_get_fd(VdoStream *self, GError **error);
185 
197 gint vdo_stream_get_event_fd(VdoStream *self, GError **error);
198 
218 VdoMap *vdo_stream_get_info(VdoStream *self, GError **error);
219 
239 VdoMap *vdo_stream_get_settings(VdoStream *self, GError **error);
240 
262 gboolean vdo_stream_set_settings(VdoStream *self, VdoMap *settings,
263  GError **error);
264 
288 gboolean vdo_stream_set_framerate(VdoStream *self, gdouble framerate,
289  GError **error);
290 
326 gboolean vdo_stream_attach(VdoStream *self, VdoMap *intent, GError **error);
327 
338 gboolean vdo_stream_start(VdoStream *self, GError **error);
339 
347 void vdo_stream_stop(VdoStream *self);
348 
361 gboolean vdo_stream_force_key_frame(VdoStream *self, GError **error);
362 
363 /*
364 ** The vdo-stream allocation API:s have the following limitations:
365 ** 1. Buffer alloc/unref are fully synchronous and will BLOCK.
366 ** 2. Buffer alloc/unref does not support encoded streams (vdo_format_is_encoded).
367 ** Use the stream global setting "socket.timeout_ms" to control maximum blocking time.
368 */
369 
388 VdoBuffer *vdo_stream_buffer_alloc(VdoStream *self, gpointer opaque, GError **error);
389 
405 gboolean vdo_stream_buffer_unref(VdoStream *self, VdoBuffer **buffer, GError **error);
406 
419 gboolean vdo_stream_buffer_enqueue(VdoStream *self, VdoBuffer *buffer, GError **error);
420 
443 VdoBuffer *vdo_stream_get_buffer(VdoStream *self, GError **error);
444 
463 VdoStream *vdo_stream_to_fd(VdoMap *settings, int data_fd, int meta_fd, GError **error);
464 
478 VdoBuffer *vdo_stream_snapshot(VdoMap *settings, GError **error);
479 
498 gboolean vdo_stream_encode(VdoStream *self, VdoBuffer **in_buf, VdoMap *settings, GError **error);
500 
560 VdoMap *vdo_stream_get_event(VdoStream *self, GError **error);
561 
563 // Deprecated (See vdo_stream_buffer_enqueue) //
565 gboolean vdo_stream_enqueue_buffer(VdoStream *self,
566  gint fd,
567  guint64 offset,
568  gsize max_size,
569  gpointer opaque,
570  GError **error);
571 
572 G_END_DECLS
573 
574 #endif
A memory buffer.
VdoMap * vdo_stream_get_info(VdoStream *self, GError **error)
Get the info for this video stream.
gboolean vdo_stream_force_key_frame(VdoStream *self, GError **error)
Forces this video stream to insert a key frame.
VdoStream * vdo_stream_new(VdoMap *settings, VdoBufferFinalizer fin, GError **error)
Create a new VdoStream.
A class representing a dictionary mapping keys to values.
Vdo common type definitions.
gboolean vdo_stream_buffer_enqueue(VdoStream *self, VdoBuffer *buffer, GError **error)
Enqueue a buffer for this video stream.
gint vdo_stream_get_fd(VdoStream *self, GError **error)
Returns a file descriptor representing the underlying socket connection.
VdoMap * vdo_stream_get_event(VdoStream *self, GError **error)
Fetches the next Event.
gboolean vdo_stream_attach(VdoStream *self, VdoMap *intent, GError **error)
Attach to a Stream.
VdoMap * vdo_stream_get_settings(VdoStream *self, GError **error)
Get the settings for this video stream.
VdoBuffer * vdo_stream_buffer_alloc(VdoStream *self, gpointer opaque, GError **error)
Allocates a new buffer for this stream.
gboolean vdo_stream_start(VdoStream *self, GError **error)
Start this video stream.
A video stream.
gboolean vdo_stream_set_framerate(VdoStream *self, gdouble framerate, GError **error)
Update the framerate for this video stream.
VdoStream * vdo_stream_get(guint id, GError **error)
Get an existing video stream.
gboolean vdo_stream_buffer_unref(VdoStream *self, VdoBuffer **buffer, GError **error)
Decreases the reference count for the specified buffer.
GList * vdo_stream_get_all(GError **error)
Gets all existing video streams.
guint vdo_stream_get_id(VdoStream *self)
Returns the id of this video stream.
A class representing a dictionary mapping keys to values.
gint vdo_stream_get_event_fd(VdoStream *self, GError **error)
Returns a file descriptor for prioritized events.
gboolean vdo_stream_set_settings(VdoStream *self, VdoMap *settings, GError **error)
Update the settings 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.
VdoBuffer * vdo_stream_snapshot(VdoMap *settings, GError **error)
Fetches a single VdoBuffer containing a frame.
A video frame.
void vdo_stream_stop(VdoStream *self)
Stop this video stream.
VdoBuffer * vdo_stream_get_buffer(VdoStream *self, GError **error)
Fetches a VdoBuffer containing a frame.