libextractor  1.11
About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.
  Fossies Dox: libextractor-1.11.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

riff_extractor.c File Reference

plugin to support RIFF files (ms-video) More...

#include "platform.h"
#include "extractor.h"
#include <math.h>
Include dependency graph for riff_extractor.c:

Go to the source code of this file.

Macros

#define ADD(s, t)
 

Functions

static uint32_t fread_le (const char *data)
 
static double round_double (double num)
 
void EXTRACTOR_riff_extract_method (struct EXTRACTOR_ExtractContext *ec)
 

Detailed Description

plugin to support RIFF files (ms-video)

Author
Christian Grothoff

Definition in file riff_extractor.c.

Macro Definition Documentation

◆ ADD

#define ADD (   s,
 
)
Value:
do { if (0 != ec->proc (ec->cls, "riff", t, \
"text/plain", s, strlen (s) \
+ 1)) return; \
} while (0)
@ EXTRACTOR_METAFORMAT_UTF8
Definition: extractor.h:102

Pass the given UTF-8 string to the 'proc' callback using the given type. Uses 'return' if 'proc' returns non-0.

Parameters
s0-terminated UTF8 string value with the meta data
tlibextractor type for the meta data

Definition at line 79 of file riff_extractor.c.

Function Documentation

◆ EXTRACTOR_riff_extract_method()

void EXTRACTOR_riff_extract_method ( struct EXTRACTOR_ExtractContext ec)

Main entry method for the 'video/x-msvideo' extraction plugin.

Parameters
ecextraction context provided to the plugin

Definition at line 92 of file riff_extractor.c.

References _, ADD, EXTRACTOR_ExtractContext::cls, EXTRACTOR_METATYPE_FORMAT, EXTRACTOR_METATYPE_IMAGE_DIMENSIONS, EXTRACTOR_METATYPE_MIMETYPE, fread_le(), EXTRACTOR_ExtractContext::read, round_double(), and EXTRACTOR_ExtractContext::seek.

◆ fread_le()

static uint32_t fread_le ( const char *  data)
static

Read an uint32_t as a little-endian (least significant byte first) integer from 'data'

Parameters
datainput data
Returns
integer read

Definition at line 46 of file riff_extractor.c.

Referenced by EXTRACTOR_riff_extract_method().

◆ round_double()

static double round_double ( double  num)
static

We implement our own rounding function, because the availability of C99's round(), nearbyint(), rint(), etc. seems to be spotty, whereas floor() is available in math.h on all C compilers.

Parameters
numvalue to round
Returns
rounded-to-nearest value

Definition at line 66 of file riff_extractor.c.

Referenced by EXTRACTOR_riff_extract_method().