VLC  4.0.0-dev
Data Structures | Functions | Variables
image.c File Reference

This file contains the functions to handle the image_handler_t type. More...

Include dependency graph for image.c:

Data Structures

struct  decoder_owner
 

Functions

static struct decoder_ownerdec_get_owner (decoder_t *p_dec)
 
static picture_tImageRead (image_handler_t *, block_t *, const es_format_t *, video_format_t *)
 
static picture_tImageReadUrl (image_handler_t *, const char *, video_format_t *)
 
static block_tImageWrite (image_handler_t *p_image, picture_t *p_pic, const video_format_t *p_fmt_in, const video_format_t *p_fmt_out)
 Write an image. More...
 
static int ImageWriteUrl (image_handler_t *, picture_t *, const video_format_t *, const video_format_t *, const char *)
 
static picture_tImageConvert (image_handler_t *p_image, picture_t *p_pic, const video_format_t *p_fmt_in, video_format_t *p_fmt_out)
 Convert an image to a different format. More...
 
static decoder_tCreateDecoder (image_handler_t *, const es_format_t *)
 
static encoder_tCreateEncoder (vlc_object_t *, const video_format_t *, const video_format_t *)
 
static void DeleteEncoder (encoder_t *)
 
static filter_tCreateConverter (vlc_object_t *, const es_format_t *, struct vlc_video_context *, const video_format_t *)
 
static void DeleteConverter (filter_t *)
 
vlc_fourcc_t image_Type2Fourcc (const char *)
 
vlc_fourcc_t image_Ext2Fourcc (const char *)
 
image_handler_timage_HandlerCreate (vlc_object_t *p_this)
 Create an image_handler_t instance. More...
 
void image_HandlerDelete (image_handler_t *p_image)
 Delete the image_handler_t instance. More...
 
static void ImageQueueVideo (decoder_t *p_dec, picture_t *p_pic)
 Read an image. More...
 
static bool BitMapFormatIsSimilar (const video_format_t *f1, const video_format_t *f2)
 
vlc_fourcc_t image_Mime2Fourcc (const char *psz_mime)
 
static vlc_decoder_deviceimage_get_device (decoder_t *p_dec)
 

Variables

struct {
   vlc_fourcc_t   i_codec
 
   const char   psz_ext [7]
 
ext_table []
 Misc functions. More...
 
struct {
   vlc_fourcc_t   i_codec
 
   const char *   psz_mime
 
mime_table []
 

Detailed Description

This file contains the functions to handle the image_handler_t type.

Function Documentation

◆ BitMapFormatIsSimilar()

static bool BitMapFormatIsSimilar ( const video_format_t f1,
const video_format_t f2 
)
static

◆ CreateConverter()

static filter_t * CreateConverter ( vlc_object_t p_this,
const es_format_t p_fmt_in,
struct vlc_video_context p_vctx_in,
const video_format_t p_fmt_out 
)
static

◆ CreateDecoder()

static decoder_t * CreateDecoder ( image_handler_t p_image,
const es_format_t fmt 
)
static

◆ CreateEncoder()

static encoder_t * CreateEncoder ( vlc_object_t p_this,
const video_format_t fmt_in,
const video_format_t fmt_out 
)
static

◆ dec_get_owner()

static struct decoder_owner* dec_get_owner ( decoder_t p_dec)
inlinestatic

References container_of, and decoder_owner::dec.

Referenced by ImageQueueVideo().

◆ DeleteConverter()

static void DeleteConverter ( filter_t p_filter)
static

◆ DeleteEncoder()

static void DeleteEncoder ( encoder_t p_enc)
static

◆ image_Ext2Fourcc()

vlc_fourcc_t image_Ext2Fourcc ( const char *  psz_name)

References image_Type2Fourcc(), and psz_name.

Referenced by ImageReadUrl(), and ImageWriteUrl().

◆ image_get_device()

static vlc_decoder_device* image_get_device ( decoder_t p_dec)
static

References VLC_UNUSED.

Referenced by CreateDecoder().

◆ image_HandlerCreate()

image_handler_t* image_HandlerCreate ( vlc_object_t p_this)

◆ image_HandlerDelete()

void image_HandlerDelete ( image_handler_t p_image)

◆ image_Mime2Fourcc()

vlc_fourcc_t image_Mime2Fourcc ( const char *  psz_mime)

References mime_table, and psz_mime.

Referenced by ImageReadUrl().

◆ image_Type2Fourcc()

vlc_fourcc_t image_Type2Fourcc ( const char *  psz_type)

◆ ImageConvert()

static picture_t * ImageConvert ( image_handler_t p_image,
picture_t p_pic,
const video_format_t p_fmt_in,
video_format_t p_fmt_out 
)
static

◆ ImageQueueVideo()

static void ImageQueueVideo ( decoder_t p_dec,
picture_t p_pic 
)
static

◆ ImageRead()

static picture_t * ImageRead ( image_handler_t p_image,
block_t p_block,
const es_format_t p_es_in,
video_format_t p_fmt_out 
)
static

◆ ImageReadUrl()

static picture_t * ImageReadUrl ( image_handler_t p_image,
const char *  psz_url,
video_format_t p_fmt_out 
)
static

◆ ImageWrite()

static block_t * ImageWrite ( image_handler_t p_image,
picture_t p_pic,
const video_format_t p_fmt_in,
const video_format_t p_fmt_out 
)
static

◆ ImageWriteUrl()

static int ImageWriteUrl ( image_handler_t p_image,
picture_t p_pic,
const video_format_t p_fmt_in,
const video_format_t p_fmt_out,
const char *  psz_url 
)
static

Variable Documentation

◆ 

const { ... } ext_table[]
Initial value:
=
{
{ ( ((uint32_t) 'j' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'e' ) << 16 ) | ( ((uint32_t) 'g' ) << 24 ) ) , "jpeg" },
{ ( ((uint32_t) 'j' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'e' ) << 16 ) | ( ((uint32_t) 'g' ) << 24 ) ) , "jpg" },
{ ( ((uint32_t) 'M' ) | ( ((uint32_t) 'J' ) << 8 ) | ( ((uint32_t) 'L' ) << 16 ) | ( ((uint32_t) 'S' ) << 24 ) ) , "ljpg" },
{ ( ((uint32_t) 'B' ) | ( ((uint32_t) 'P' ) << 8 ) | ( ((uint32_t) 'G' ) << 16 ) | ( ((uint32_t) 0xFB ) << 24 ) ) , "bpg" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "png" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "pgm" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) 'y' ) << 24 ) ) , "pgmyuv" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'b' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "pbm" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'a' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "pam" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'a' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "tga" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "bmp" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "pnm" },
{ ( ((uint32_t) 'x' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "xpm" },
{ ( ((uint32_t) 'x' ) | ( ((uint32_t) 'c' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "xcf" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'c' ) << 8 ) | ( ((uint32_t) 'x' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "pcx" },
{ ( ((uint32_t) 'g' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "gif" },
{ ( ((uint32_t) 's' ) | ( ((uint32_t) 'v' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "svg" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "tif" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "tiff" },
{ ( ((uint32_t) 'l' ) | ( ((uint32_t) 'b' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "lbm" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "ppm" },
}

Misc functions.

Referenced by image_Type2Fourcc().

◆ i_codec

vlc_fourcc_t i_codec

◆ 

const { ... } mime_table[]
Initial value:
=
{
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/bmp" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-bmp" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-bitmap" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-ms-bmp" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-anymap" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-bitmap" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-graymap" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-pixmap" },
{ ( ((uint32_t) 'g' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/gif" },
{ ( ((uint32_t) 'j' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'e' ) << 16 ) | ( ((uint32_t) 'g' ) << 24 ) ) , "image/jpeg" },
{ ( ((uint32_t) 'B' ) | ( ((uint32_t) 'P' ) << 8 ) | ( ((uint32_t) 'G' ) << 16 ) | ( ((uint32_t) 0xFB ) << 24 ) ) , "image/bpg" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'c' ) << 8 ) | ( ((uint32_t) 'x' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/pcx" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/png" },
{ ( ((uint32_t) 's' ) | ( ((uint32_t) 'v' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/svg+xml" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "image/tiff" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'a' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-tga" },
{ ( ((uint32_t) 'x' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "image/x-xpixmap" },
{ 0, NULL }
}

Referenced by image_Mime2Fourcc().

◆ psz_ext

const char psz_ext[7]

◆ psz_mime

const char* psz_mime