NetSurf
Data Structures | Typedefs | Functions | Variables
video.c File Reference
#include <gst/gst.h>
#include "content/content_factory.h"
#include "content/content_protected.h"
#include "image/video.h"
Include dependency graph for video.c:

Go to the source code of this file.

Data Structures

struct  nsvideo_content
 

Typedefs

typedef struct nsvideo_content nsvideo_content
 

Functions

static gboolean nsvideo_bus_call (GstBus *bus, GstMessage *msg, nsvideo_content *video)
 
static void nsvideo_need_data_event (GstElement *playbin, guint size, nsvideo_content *video)
 
static void nsvideo_enough_data_event (GstElement *playbin, nsvideo_content *video)
 
static void nsvideo_source_event (GObject *object, GObject *orig, GParamSpec *pspec, nsvideo_content *video)
 
static nserror nsvideo_create (const content_handler *handler, lwc_string *imime_type, const http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
 
static bool nsvideo_process_data (struct content *c, const char *data, unsigned int size)
 
static bool nsvideo_convert (struct content *c)
 
static void nsvideo_destroy (struct content *c)
 
static bool nsvideo_redraw (struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
 
static nserror nsvideo_clone (const struct content *old, struct content **newc)
 
static content_type nsvideo_type (void)
 
static void * nsvideo_get_internal (const struct content *c, void *context)
 
 CONTENT_FACTORY_REGISTER_TYPES (nsvideo, nsvideo_types, nsvideo_content_handler)
 

Variables

static const content_handler nsvideo_content_handler
 
static const char * nsvideo_types []
 

Typedef Documentation

◆ nsvideo_content

Function Documentation

◆ CONTENT_FACTORY_REGISTER_TYPES()

CONTENT_FACTORY_REGISTER_TYPES ( nsvideo  ,
nsvideo_types  ,
nsvideo_content_handler   
)

◆ nsvideo_bus_call()

static gboolean nsvideo_bus_call ( GstBus *  bus,
GstMessage *  msg,
nsvideo_content video 
)
static

Definition at line 33 of file video.c.

Referenced by nsvideo_create().

Here is the caller graph for this function:

◆ nsvideo_clone()

static nserror nsvideo_clone ( const struct content old,
struct content **  newc 
)
static
Todo:
Implement

Definition at line 164 of file video.c.

References NSERROR_CLONE_FAILED.

◆ nsvideo_convert()

static bool nsvideo_convert ( struct content c)
static

Definition at line 136 of file video.c.

References nsvideo_content::appsrc.

◆ nsvideo_create()

static nserror nsvideo_create ( const content_handler handler,
lwc_string *  imime_type,
const http_parameter params,
llcache_handle llcache,
const char *  fallback_charset,
bool  quirks,
struct content **  c 
)
static
Todo:
Create appsink & register with playbin

Definition at line 69 of file video.c.

References nsvideo_content::base, content__init(), content::fallback_charset, content::handler, llcache, llcache_handle_force_stream(), NSERROR_NOMEM, NSERROR_OK, nsvideo_bus_call(), nsvideo_source_event(), nsvideo_content::playbin, and content::quirks.

Here is the call graph for this function:

◆ nsvideo_destroy()

static void nsvideo_destroy ( struct content c)
static

Definition at line 149 of file video.c.

References nsvideo_content::playbin.

◆ nsvideo_enough_data_event()

static void nsvideo_enough_data_event ( GstElement *  playbin,
nsvideo_content video 
)
static

Definition at line 53 of file video.c.

Referenced by nsvideo_source_event().

Here is the caller graph for this function:

◆ nsvideo_get_internal()

static void * nsvideo_get_internal ( const struct content c,
void *  context 
)
static
Todo:
Return pointer to bitmap containing current frame, if any?

Definition at line 176 of file video.c.

◆ nsvideo_need_data_event()

static void nsvideo_need_data_event ( GstElement *  playbin,
guint  size,
nsvideo_content video 
)
static

Definition at line 48 of file video.c.

Referenced by nsvideo_source_event().

Here is the caller graph for this function:

◆ nsvideo_process_data()

static bool nsvideo_process_data ( struct content c,
const char *  data,
unsigned int  size 
)
static

Definition at line 119 of file video.c.

References nsvideo_content::appsrc, buffer, and content::size.

◆ nsvideo_redraw()

static bool nsvideo_redraw ( struct content c,
struct content_redraw_data data,
const struct rect clip,
const struct redraw_context ctx 
)
static
Todo:
Implement

Definition at line 157 of file video.c.

◆ nsvideo_source_event()

static void nsvideo_source_event ( GObject *  object,
GObject *  orig,
GParamSpec *  pspec,
nsvideo_content video 
)
static

Definition at line 58 of file video.c.

References nsvideo_content::appsrc, nsvideo_enough_data_event(), and nsvideo_need_data_event().

Referenced by nsvideo_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsvideo_type()

static content_type nsvideo_type ( void  )
static
Todo:
Lies

Definition at line 170 of file video.c.

References CONTENT_IMAGE.

Variable Documentation

◆ nsvideo_content_handler

const content_handler nsvideo_content_handler
static
Initial value:
= {
.create = nsvideo_create,
.process_data = nsvideo_process_data,
.data_complete = nsvideo_convert,
.destroy = nsvideo_destroy,
.redraw = nsvideo_redraw,
.clone = nsvideo_clone,
.type = nsvideo_type,
.get_internal = nsvideo_get_internal,
.no_share = true
}
static void * nsvideo_get_internal(const struct content *c, void *context)
Definition: video.c:176
static bool nsvideo_redraw(struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
Definition: video.c:157
static void nsvideo_destroy(struct content *c)
Definition: video.c:149
static content_type nsvideo_type(void)
Definition: video.c:170
static nserror nsvideo_create(const content_handler *handler, lwc_string *imime_type, const http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
Definition: video.c:69
static nserror nsvideo_clone(const struct content *old, struct content **newc)
Definition: video.c:164
static bool nsvideo_process_data(struct content *c, const char *data, unsigned int size)
Definition: video.c:119
static bool nsvideo_convert(struct content *c)
Definition: video.c:136

Definition at line 182 of file video.c.

◆ nsvideo_types

const char* nsvideo_types[]
static
Initial value:
= {
"video/mp4",
"video/webm"
}

Definition at line 195 of file video.c.