libgpac
Documentation of the core library of GPAC
swf_parse.c File Reference
#include <gpac/nodes_mpeg4.h>
#include <gpac/internal/swf_dev.h>
#include <gpac/avparse.h>
#include <zlib.h>
+ Include dependency graph for swf_parse.c:

Data Structures

struct  SoundInfo
 

Macros

#define SWF_COLOR_SCALE   (1/256.0f)
 
#define DO_ACT(_code)   { act.type = _code; read->action(read, &act); break; }
 

Enumerations

enum  {
  SWF_END = 0 , SWF_SHOWFRAME = 1 , SWF_DEFINESHAPE = 2 , SWF_FREECHARACTER = 3 ,
  SWF_PLACEOBJECT = 4 , SWF_REMOVEOBJECT = 5 , SWF_DEFINEBITS = 6 , SWF_DEFINEBITSJPEG = 6 ,
  SWF_DEFINEBUTTON = 7 , SWF_JPEGTABLES = 8 , SWF_SETBACKGROUNDCOLOR = 9 , SWF_DEFINEFONT = 10 ,
  SWF_DEFINETEXT = 11 , SWF_DOACTION = 12 , SWF_DEFINEFONTINFO = 13 , SWF_DEFINESOUND = 14 ,
  SWF_STARTSOUND = 15 , SWF_DEFINEBUTTONSOUND = 17 , SWF_SOUNDSTREAMHEAD = 18 , SWF_SOUNDSTREAMBLOCK = 19 ,
  SWF_DEFINEBITSLOSSLESS = 20 , SWF_DEFINEBITSJPEG2 = 21 , SWF_DEFINESHAPE2 = 22 , SWF_DEFINEBUTTONCXFORM = 23 ,
  SWF_PROTECT = 24 , SWF_PLACEOBJECT2 = 26 , SWF_REMOVEOBJECT2 = 28 , SWF_DEFINESHAPE3 = 32 ,
  SWF_DEFINETEXT2 = 33 , SWF_DEFINEBUTTON2 = 34 , SWF_DEFINEBITSJPEG3 = 35 , SWF_DEFINEBITSLOSSLESS2 = 36 ,
  SWF_DEFINEEDITTEXT = 37 , SWF_DEFINEMOVIE = 38 , SWF_DEFINESPRITE = 39 , SWF_NAMECHARACTER = 40 ,
  SWF_SERIALNUMBER = 41 , SWF_GENERATORTEXT = 42 , SWF_FRAMELABEL = 43 , SWF_SOUNDSTREAMHEAD2 = 45 ,
  SWF_DEFINEMORPHSHAPE = 46 , SWF_DEFINEFONT2 = 48 , SWF_TEMPLATECOMMAND = 49 , SWF_GENERATOR3 = 51 ,
  SWF_EXTERNALFONT = 52 , SWF_EXPORTASSETS = 56 , SWF_IMPORTASSETS = 57 , SWF_ENABLEDEBUGGER = 58 ,
  SWF_MX0 = 59 , SWF_MX1 = 60 , SWF_MX2 = 61 , SWF_MX3 = 62 ,
  SWF_MX4 = 63 , SWF_REFLEX = 777
}
 

Functions

static void swf_init_decompress (SWFReader *read)
 
static GF_Err swf_seek_file_to (SWFReader *read, u32 size)
 
static u32 swf_get_file_pos (SWFReader *read)
 
static u32 swf_read_data (SWFReader *read, char *data, u32 data_size)
 
static u32 swf_read_int (SWFReader *read, u32 nbBits)
 
static s32 swf_read_sint (SWFReader *read, u32 nbBits)
 
static u32 swf_align (SWFReader *read)
 
static void swf_skip_data (SWFReader *read, u32 size)
 
static void swf_get_rec (SWFReader *read, SWFRec *rc)
 
static u32 swf_get_32 (SWFReader *read)
 
static u16 swf_get_16 (SWFReader *read)
 
static s16 swf_get_s16 (SWFReader *read)
 
static u32 swf_get_color (SWFReader *read)
 
static u32 swf_get_argb (SWFReader *read)
 
static u32 swf_get_matrix (SWFReader *read, GF_Matrix2D *mat)
 
static void swf_get_colormatrix (SWFReader *read, GF_ColorMatrix *cmat)
 
static char * swf_get_string (SWFReader *read)
 
static SWFShapeRecswf_new_shape_rec ()
 
static SWFShapeRecswf_clone_shape_rec (SWFShapeRec *old_sr)
 
static void swf_parse_styles (SWFReader *read, u32 revision, SWFShape *shape, u32 *bits_fill, u32 *bits_line)
 
static void swf_path_realloc_pts (SWFPath *path, u32 nbPts)
 
static void swf_path_add_com (SWFShapeRec *sr, SFVec2f pt, SFVec2f ctr, u32 type)
 
static void swf_referse_path (SWFPath *path)
 
static void swf_free_shape_rec (SWFShapeRec *ptr)
 
static void swf_reset_rec_list (GF_List *recs)
 
static void swf_append_path (SWFPath *a, SWFPath *b)
 
static void swf_path_add_type (SWFPath *path, u32 val)
 
static void swf_resort_path (SWFPath *a, SWFReader *read)
 
static GF_Err swf_flush_shape (SWFReader *read, SWFShape *shape, SWFFont *font, Bool last_shape)
 
static GF_Err swf_parse_shape_def (SWFReader *read, SWFFont *font, u32 revision)
 
SWFFontswf_find_font (SWFReader *read, u32 ID)
 
static DispShapeswf_get_depth_entry (SWFReader *read, u32 Depth, Bool create)
 
static GF_Err swf_func_skip (SWFReader *read)
 
static GF_Err swf_set_backcol (SWFReader *read)
 
static GF_Err swf_actions (SWFReader *read, u32 mask, u32 key)
 
static GF_Err swf_def_button (SWFReader *read, u32 revision)
 
static Bool swf_mat_is_identity (GF_Matrix2D *mat)
 
static GF_Err swf_place_obj (SWFReader *read, u32 revision)
 
static GF_Err swf_remove_obj (SWFReader *read, u32 revision)
 
static GF_Err swf_show_frame (SWFReader *read)
 
static GF_Err swf_def_font (SWFReader *read, u32 revision)
 
static GF_Err swf_def_font_info (SWFReader *read)
 
static GF_Err swf_def_text (SWFReader *read, u32 revision)
 
static GF_Err swf_def_edit_text (SWFReader *read)
 
static void swf_delete_sound_stream (SWFReader *read)
 
static GF_Err swf_def_sprite (SWFReader *read)
 
static GF_Err swf_def_sound (SWFReader *read)
 
static SoundInfo swf_skip_soundinfo (SWFReader *read)
 
static SWFSoundsndswf_get_sound (SWFReader *read, u32 ID)
 
static GF_Err swf_start_sound (SWFReader *read)
 
static GF_Err swf_soundstream_hdr (SWFReader *read)
 
static GF_Err swf_soundstream_block (SWFReader *read)
 
static GF_Err swf_def_hdr_jpeg (SWFReader *read)
 
static GF_Err swf_def_bits_jpeg (SWFReader *read, u32 version)
 
static const char * swf_get_tag_name (u32 tag)
 
static GF_Err swf_unknown_tag (SWFReader *read)
 
static GF_Err swf_process_tag (SWFReader *read)
 
GF_Err swf_parse_tag (SWFReader *read)
 
GF_Err swf_parse_sprite (SWFReader *read)
 
void swf_report (SWFReader *read, GF_Err e, char *format,...)
 
static void swf_io_error (void *par)
 
GF_Err gf_sm_load_run_swf (GF_SceneLoader *load)
 
void gf_swf_reader_del (SWFReader *read)
 
void gf_sm_load_done_swf (GF_SceneLoader *load)
 
SWFReadergf_swf_reader_new (const char *localPath, const char *inputName)
 
GF_Err gf_swf_reader_set_user_mode (SWFReader *read, void *user, GF_Err(*add_sample)(void *user, const u8 *data, u32 length, u64 timestamp, Bool isRap), GF_Err(*add_header)(void *user, const u8 *data, u32 length, Bool isHeader))
 
GF_Err gf_swf_read_header (SWFReader *read)
 
GF_Err gf_swf_get_duration (SWFReader *read, u32 *frame_rate, u32 *frame_count)
 
GF_Err gf_sm_load_init_swf (GF_SceneLoader *load)
 

Data Structure Documentation

◆ SoundInfo

struct SoundInfo
Data Fields
u32 sync_flags
u32 in_point
u32 out_point
u32 nb_loops

Macro Definition Documentation

◆ SWF_COLOR_SCALE

#define SWF_COLOR_SCALE   (1/256.0f)

◆ DO_ACT

#define DO_ACT (   _code)    { act.type = _code; read->action(read, &act); break; }

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SWF_END 
SWF_SHOWFRAME 
SWF_DEFINESHAPE 
SWF_FREECHARACTER 
SWF_PLACEOBJECT 
SWF_REMOVEOBJECT 
SWF_DEFINEBITS 
SWF_DEFINEBITSJPEG 
SWF_DEFINEBUTTON 
SWF_JPEGTABLES 
SWF_SETBACKGROUNDCOLOR 
SWF_DEFINEFONT 
SWF_DEFINETEXT 
SWF_DOACTION 
SWF_DEFINEFONTINFO 
SWF_DEFINESOUND 
SWF_STARTSOUND 
SWF_DEFINEBUTTONSOUND 
SWF_SOUNDSTREAMHEAD 
SWF_SOUNDSTREAMBLOCK 
SWF_DEFINEBITSLOSSLESS 
SWF_DEFINEBITSJPEG2 
SWF_DEFINESHAPE2 
SWF_DEFINEBUTTONCXFORM 
SWF_PROTECT 
SWF_PLACEOBJECT2 
SWF_REMOVEOBJECT2 
SWF_DEFINESHAPE3 
SWF_DEFINETEXT2 
SWF_DEFINEBUTTON2 
SWF_DEFINEBITSJPEG3 
SWF_DEFINEBITSLOSSLESS2 
SWF_DEFINEEDITTEXT 
SWF_DEFINEMOVIE 
SWF_DEFINESPRITE 
SWF_NAMECHARACTER 
SWF_SERIALNUMBER 
SWF_GENERATORTEXT 
SWF_FRAMELABEL 
SWF_SOUNDSTREAMHEAD2 
SWF_DEFINEMORPHSHAPE 
SWF_DEFINEFONT2 
SWF_TEMPLATECOMMAND 
SWF_GENERATOR3 
SWF_EXTERNALFONT 
SWF_EXPORTASSETS 
SWF_IMPORTASSETS 
SWF_ENABLEDEBUGGER 
SWF_MX0 
SWF_MX1 
SWF_MX2 
SWF_MX3 
SWF_MX4 
SWF_REFLEX 

Function Documentation

◆ swf_init_decompress()

static void swf_init_decompress ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_seek_file_to()

static GF_Err swf_seek_file_to ( SWFReader read,
u32  size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_file_pos()

static u32 swf_get_file_pos ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_read_data()

static u32 swf_read_data ( SWFReader read,
char *  data,
u32  data_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_read_int()

static u32 swf_read_int ( SWFReader read,
u32  nbBits 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_read_sint()

static s32 swf_read_sint ( SWFReader read,
u32  nbBits 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_align()

static u32 swf_align ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_skip_data()

static void swf_skip_data ( SWFReader read,
u32  size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_rec()

static void swf_get_rec ( SWFReader read,
SWFRec rc 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_32()

static u32 swf_get_32 ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_16()

static u16 swf_get_16 ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_s16()

static s16 swf_get_s16 ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_color()

static u32 swf_get_color ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_argb()

static u32 swf_get_argb ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_matrix()

static u32 swf_get_matrix ( SWFReader read,
GF_Matrix2D mat 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_colormatrix()

static void swf_get_colormatrix ( SWFReader read,
GF_ColorMatrix cmat 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_string()

static char* swf_get_string ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_new_shape_rec()

static SWFShapeRec* swf_new_shape_rec ( )
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_clone_shape_rec()

static SWFShapeRec* swf_clone_shape_rec ( SWFShapeRec old_sr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_parse_styles()

static void swf_parse_styles ( SWFReader read,
u32  revision,
SWFShape shape,
u32 bits_fill,
u32 bits_line 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_path_realloc_pts()

static void swf_path_realloc_pts ( SWFPath path,
u32  nbPts 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_path_add_com()

static void swf_path_add_com ( SWFShapeRec sr,
SFVec2f  pt,
SFVec2f  ctr,
u32  type 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_referse_path()

static void swf_referse_path ( SWFPath path)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_free_shape_rec()

static void swf_free_shape_rec ( SWFShapeRec ptr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_reset_rec_list()

static void swf_reset_rec_list ( GF_List *  recs)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_append_path()

static void swf_append_path ( SWFPath a,
SWFPath b 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_path_add_type()

static void swf_path_add_type ( SWFPath path,
u32  val 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_resort_path()

static void swf_resort_path ( SWFPath a,
SWFReader read 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_flush_shape()

static GF_Err swf_flush_shape ( SWFReader read,
SWFShape shape,
SWFFont font,
Bool  last_shape 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_parse_shape_def()

static GF_Err swf_parse_shape_def ( SWFReader read,
SWFFont font,
u32  revision 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_find_font()

SWFFont* swf_find_font ( SWFReader read,
u32  ID 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_depth_entry()

static DispShape* swf_get_depth_entry ( SWFReader read,
u32  Depth,
Bool  create 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_func_skip()

static GF_Err swf_func_skip ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_set_backcol()

static GF_Err swf_set_backcol ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_actions()

static GF_Err swf_actions ( SWFReader read,
u32  mask,
u32  key 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_button()

static GF_Err swf_def_button ( SWFReader read,
u32  revision 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_mat_is_identity()

static Bool swf_mat_is_identity ( GF_Matrix2D mat)
static
+ Here is the caller graph for this function:

◆ swf_place_obj()

static GF_Err swf_place_obj ( SWFReader read,
u32  revision 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_remove_obj()

static GF_Err swf_remove_obj ( SWFReader read,
u32  revision 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_show_frame()

static GF_Err swf_show_frame ( SWFReader read)
static
+ Here is the caller graph for this function:

◆ swf_def_font()

static GF_Err swf_def_font ( SWFReader read,
u32  revision 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_font_info()

static GF_Err swf_def_font_info ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_text()

static GF_Err swf_def_text ( SWFReader read,
u32  revision 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_edit_text()

static GF_Err swf_def_edit_text ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_delete_sound_stream()

static void swf_delete_sound_stream ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_sprite()

static GF_Err swf_def_sprite ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_sound()

static GF_Err swf_def_sound ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_skip_soundinfo()

static SoundInfo swf_skip_soundinfo ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sndswf_get_sound()

static SWFSound* sndswf_get_sound ( SWFReader read,
u32  ID 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_start_sound()

static GF_Err swf_start_sound ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_soundstream_hdr()

static GF_Err swf_soundstream_hdr ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_soundstream_block()

static GF_Err swf_soundstream_block ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_hdr_jpeg()

static GF_Err swf_def_hdr_jpeg ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_def_bits_jpeg()

static GF_Err swf_def_bits_jpeg ( SWFReader read,
u32  version 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_get_tag_name()

static const char* swf_get_tag_name ( u32  tag)
static
+ Here is the caller graph for this function:

◆ swf_unknown_tag()

static GF_Err swf_unknown_tag ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_process_tag()

static GF_Err swf_process_tag ( SWFReader read)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_parse_tag()

GF_Err swf_parse_tag ( SWFReader read)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_parse_sprite()

GF_Err swf_parse_sprite ( SWFReader read)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_report()

void swf_report ( SWFReader read,
GF_Err  e,
char *  format,
  ... 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swf_io_error()

static void swf_io_error ( void *  par)
static
+ Here is the caller graph for this function:

◆ gf_sm_load_run_swf()

GF_Err gf_sm_load_run_swf ( GF_SceneLoader load)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_swf_reader_del()

void gf_swf_reader_del ( SWFReader read)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sm_load_done_swf()

void gf_sm_load_done_swf ( GF_SceneLoader load)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_swf_reader_new()

SWFReader* gf_swf_reader_new ( const char *  localPath,
const char *  inputName 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_swf_reader_set_user_mode()

GF_Err gf_swf_reader_set_user_mode ( SWFReader read,
void *  user,
GF_Err(*)(void *user, const u8 *data, u32 length, u64 timestamp, Bool isRap)  add_sample,
GF_Err(*)(void *user, const u8 *data, u32 length, Bool isHeader)  add_header 
)
+ Here is the caller graph for this function:

◆ gf_swf_read_header()

GF_Err gf_swf_read_header ( SWFReader read)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_swf_get_duration()

GF_Err gf_swf_get_duration ( SWFReader read,
u32 frame_rate,
u32 frame_count 
)
+ Here is the caller graph for this function:

◆ gf_sm_load_init_swf()

GF_Err gf_sm_load_init_swf ( GF_SceneLoader load)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: