libvdo
vdo-stream.h
Go to the documentation of this file.
1 
115 #ifndef __VDO_STREAM_H__
116 #define __VDO_STREAM_H__
117 
118 #include "vdo-types.h"
119 #include "vdo-frame.h"
120 #include "vdo-buffer.h"
121 #include "vdo-map.h"
122 
123 #include <glib-object.h>
124 
125 G_BEGIN_DECLS
126 
127 #define VDO_GETFRAME_NONBLOCK (0)
128 
133 #define VDO_TYPE_STREAM (vdo_stream_get_type())
134 G_DECLARE_FINAL_TYPE(VdoStream, vdo_stream, VDO, STREAM, GObject)
135 
136 
147 VdoStream *vdo_stream_new(VdoMap *settings, VdoBufferFinalizer fin, GError **error);
148 
160 VdoStream *vdo_stream_get(guint id, GError **error);
161 
173 GList *vdo_stream_get_all(GError **error);
174 
183 
196 gint vdo_stream_get_fd(VdoStream *self, GError **error);
197 
209 gint vdo_stream_get_event_fd(VdoStream *self, GError **error);
210 
230 VdoMap *vdo_stream_get_info(VdoStream *self, GError **error);
231 
251 VdoMap *vdo_stream_get_settings(VdoStream *self, GError **error);
252 
274 gboolean vdo_stream_set_settings(VdoStream *self, VdoMap *settings,
275  GError **error);
276 
300 gboolean vdo_stream_set_framerate(VdoStream *self, gdouble framerate,
301  GError **error);
302 
337 gboolean vdo_stream_attach(VdoStream *self, VdoMap *intent, GError **error);
338 
349 gboolean vdo_stream_start(VdoStream *self, GError **error);
350 
363 gboolean vdo_stream_play(VdoStream *self, VdoMap *settings, GError **error);
364 
373 
386 gboolean vdo_stream_force_key_frame(VdoStream *self, GError **error);
387 
388 /*
389 ** The vdo-stream allocation API:s have the following limitations:
390 ** 1. Buffer alloc/unref are fully synchronous and will BLOCK.
391 ** 2. Buffer alloc/unref does not support encoded streams (vdo_format_is_encoded).
392 ** Use the stream global setting "socket.timeout_ms" (int32_t) to control maximum blocking time.
393 */
394 
413 VdoBuffer *vdo_stream_buffer_alloc(VdoStream *self, gpointer opaque, GError **error);
414 
430 gboolean vdo_stream_buffer_unref(VdoStream *self, VdoBuffer **buffer, GError **error);
431 
444 gboolean vdo_stream_buffer_enqueue(VdoStream *self, VdoBuffer *buffer, GError **error);
445 
468 VdoBuffer *vdo_stream_get_buffer(VdoStream *self, GError **error);
469 
488 VdoStream *vdo_stream_to_fd(VdoMap *settings, int data_fd, int meta_fd, GError **error);
489 
510 VdoBuffer *vdo_stream_snapshot(VdoMap *settings, GError **error);
511 
531 gboolean vdo_stream_encode(VdoStream *self, VdoBuffer **in_buf, VdoMap *settings, GError **error);
532 
592 VdoMap *vdo_stream_get_event(VdoStream *self, GError **error);
593 
594 G_END_DECLS
595 
596 #endif
A class representing a dictionary mapping keys to values.
A video stream.
A memory buffer.
A video frame.
A class representing a dictionary mapping keys to values.
VdoBuffer * vdo_stream_get_buffer(VdoStream *self, GError **error)
Fetches a VdoBuffer containing a frame.
VdoStream * vdo_stream_get(guint id, GError **error)
Get an existing video stream.
VdoBuffer * vdo_stream_buffer_alloc(VdoStream *self, gpointer opaque, GError **error)
Allocates a new buffer for this 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.
VdoBuffer * vdo_stream_snapshot(VdoMap *settings, GError **error)
Fetches 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)
Decreases 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)
Returns 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)
Gets all existing video streams.
gint vdo_stream_get_event_fd(VdoStream *self, GError **error)
Returns 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)
Fetches 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)
Returns 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.