Monado OpenXR Runtime
vf_driver.c File Reference

Video file frameserver implementation. More...

#include "vf_interface.h"
#include "os/os_time.h"
#include "os/os_threading.h"
#include "util/u_trace_marker.h"
#include "util/u_var.h"
#include "util/u_misc.h"
#include "util/u_debug.h"
#include "util/u_format.h"
#include "util/u_frame.h"
#include "util/u_logging.h"
#include <stdio.h>
#include <assert.h>
#include <glib.h>
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include <gst/video/video-frame.h>
Include dependency graph for vf_driver.c:

Data Structures

struct  vf_fs
 A frame server operating on a video file. More...
 
struct  vf_frame
 Frame wrapping a GstSample/GstBuffer. More...
 

Macros

#define VF_TRACE(d, ...)   U_LOG_IFL_T(d->log_level, __VA_ARGS__)
 
#define VF_DEBUG(d, ...)   U_LOG_IFL_D(d->log_level, __VA_ARGS__)
 
#define VF_INFO(d, ...)   U_LOG_IFL_I(d->log_level, __VA_ARGS__)
 
#define VF_WARN(d, ...)   U_LOG_IFL_W(d->log_level, __VA_ARGS__)
 
#define VF_ERROR(d, ...)   U_LOG_IFL_E(d->log_level, __VA_ARGS__)
 

Functions

static struct vf_fsvf_fs (struct xrt_fs *xfs)
 Cast to derived type. More...
 
static struct vf_framevf_frame (struct xrt_frame *xf)
 Cast to derived type. More...
 
static void vf_frame_destroy (struct xrt_frame *xf)
 
static void vf_fs_frame (struct vf_fs *vid, GstSample *sample)
 
static GstFlowReturn on_new_sample_from_sink (GstElement *elt, struct vf_fs *vid)
 
static void print_gst_error (GstMessage *message)
 
static gboolean on_source_message (GstBus *bus, GstMessage *message, struct vf_fs *vid)
 
static void * vf_fs_mainloop (void *ptr)
 
static bool vf_fs_enumerate_modes (struct xrt_fs *xfs, struct xrt_fs_mode **out_modes, uint32_t *out_count)
 
static bool vf_fs_configure_capture (struct xrt_fs *xfs, struct xrt_fs_capture_parameters *cp)
 
static bool vf_fs_stream_start (struct xrt_fs *xfs, struct xrt_frame_sink *xs, enum xrt_fs_capture_type capture_type, uint32_t descriptor_index)
 
static bool vf_fs_stream_stop (struct xrt_fs *xfs)
 
static bool vf_fs_is_running (struct xrt_fs *xfs)
 
static void vf_fs_destroy (struct vf_fs *vid)
 
static void vf_fs_node_break_apart (struct xrt_frame_node *node)
 
static void vf_fs_node_destroy (struct xrt_frame_node *node)
 
static struct xrt_fsalloc_and_init_common (struct xrt_frame_context *xfctx, enum xrt_format format, enum xrt_stereo_format stereo_format, gchar *pipeline_string)
 
struct xrt_fsvf_fs_videotestsource (struct xrt_frame_context *xfctx, uint32_t width, uint32_t height)
 Create a vf frameserver that uses the videotestsource. More...
 
struct xrt_fsvf_fs_open_file (struct xrt_frame_context *xfctx, const char *path)
 Create a vf frameserver by opening a video file. More...
 

Detailed Description

Function Documentation

◆ vf_frame()

static struct vf_frame* vf_frame ( struct xrt_frame xf)
inlinestatic

Cast to derived type.

◆ vf_fs()

static struct vf_fs* vf_fs ( struct xrt_fs xfs)
inlinestatic

Cast to derived type.

◆ vf_fs_configure_capture()

static bool vf_fs_configure_capture ( struct xrt_fs xfs,
struct xrt_fs_capture_parameters cp 
)
static

◆ vf_fs_frame()

static void vf_fs_frame ( struct vf_fs vid,
GstSample *  sample 
)
static
Todo:
Proper sequence number and timestamp.