libvdo
vdo-stream.h
Go to the documentation of this file.
1 
124 #ifndef __VDO_STREAM_H__
125 #define __VDO_STREAM_H__
126 
127 #include "vdo-types.h"
128 #include "vdo-frame.h"
129 #include "vdo-buffer.h"
130 #include "vdo-map.h"
131 
132 #include <glib-object.h>
133 
134 G_BEGIN_DECLS
135 
136 #define VDO_GETFRAME_NONBLOCK (0)
137 
146 #define VDO_TYPE_STREAM (vdo_stream_get_type())
147 G_DECLARE_FINAL_TYPE(VdoStream, vdo_stream, VDO, STREAM, GObject)
148 
149 
180 VdoStream *vdo_stream_rgb_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error);
181 
213 VdoStream *vdo_stream_nv12_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error);
214 
246 VdoStream *vdo_stream_y800_new(const VdoMap *settings, guint32 input, VdoResolution resolution, GError **error);
247 
259 VdoStream *vdo_stream_new(VdoMap *settings, VdoBufferFinalizer fin, GError **error);
260 
272 VdoStream *vdo_stream_get(guint id, GError **error);
273 
285 GList *vdo_stream_get_all(GError **error);
286 
295 
310 gint vdo_stream_get_fd(VdoStream *self, GError **error);
311 
325 gint vdo_stream_get_event_fd(VdoStream *self, GError **error);
326 
345 VdoMap *vdo_stream_get_info(VdoStream *self, GError **error);
346 
365 VdoMap *vdo_stream_get_settings(VdoStream *self, GError **error);
366 
386 gboolean vdo_stream_set_settings(VdoStream *self, VdoMap *settings,
387  GError **error);
388 
411 gboolean vdo_stream_set_framerate(VdoStream *self, gdouble framerate,
412  GError **error);
413 
448 gboolean vdo_stream_attach(VdoStream *self, VdoMap *intent, GError **error);
449 
460 gboolean vdo_stream_start(VdoStream *self, GError **error);
461 
474 gboolean vdo_stream_play(VdoStream *self, VdoMap *settings, GError **error);
475 
484 
497 gboolean vdo_stream_force_key_frame(VdoStream *self, GError **error);
498 
499 /*
500 ** The vdo-stream allocation API:s have the following limitations:
501 ** 1. Buffer alloc/unref are fully synchronous and will BLOCK.
502 ** 2. Buffer alloc/unref does not support encoded streams (vdo_format_is_encoded).
503 ** Use the stream global setting "socket.timeout_ms" (int32_t) to control maximum blocking time.
504 */
505 
524 VdoBuffer *vdo_stream_buffer_alloc(VdoStream *self, gpointer opaque, GError **error);
525 
541 gboolean vdo_stream_buffer_unref(VdoStream *self, VdoBuffer **buffer, GError **error);
542 
555 gboolean vdo_stream_buffer_enqueue(VdoStream *self, VdoBuffer *buffer, GError **error);
556 
579 VdoBuffer *vdo_stream_get_buffer(VdoStream *self, GError **error);
580 
599 VdoStream *vdo_stream_to_fd(VdoMap *settings, int data_fd, int meta_fd, GError **error);
600 
621 VdoBuffer *vdo_stream_snapshot(VdoMap *settings, GError **error);
622 
642 gboolean vdo_stream_encode(VdoStream *self, VdoBuffer **in_buf, VdoMap *settings, GError **error);
643 
703 VdoMap *vdo_stream_get_event(VdoStream *self, GError **error);
704 
705 G_END_DECLS
706 
707 #endif
A class representing a dictionary mapping keys to values.
A video stream.
A resolution.
Definition: vdo-types.h:457
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.