Changeset 4645717fb801db8957ff93832d3a927edb451edb

Show
Ignore:
Timestamp:
21/08/08 00:08:45 (3 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1219270125 +0200
git-parent:

[390c4286ec9492f55f6eb9c639c3bf96534da32c]

git-author:
Laurent Aimar <fenrir@videolan.org> 1219268827 +0200
Message:

Uninlined es_format_t functions and added video_format_FixRgb helper.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_es.h

    rc0f4bfc r4645717  
    212212 
    213213/* ES Categories */ 
    214 #define UNKNOWN_ES      0x00 
    215 #define VIDEO_ES        0x01 
    216 #define AUDIO_ES        0x02 
    217 #define SPU_ES          0x03 
    218 #define NAV_ES          0x04 
    219  
    220 static inline void es_format_Init( es_format_t *fmt, 
    221                                    int i_cat, vlc_fourcc_t i_codec ) 
    222 
    223     fmt->i_cat                  = i_cat; 
    224     fmt->i_codec                = i_codec; 
    225     fmt->i_id                   = -1; 
    226     fmt->i_group                = 0; 
    227     fmt->i_priority             = 0; 
    228     fmt->psz_language           = NULL; 
    229     fmt->psz_description        = NULL; 
    230  
    231     fmt->i_extra_languages      = 0; 
    232     fmt->p_extra_languages      = NULL; 
    233  
    234     memset( &fmt->audio, 0, sizeof(audio_format_t) ); 
    235     memset( &fmt->audio_replay_gain, 0, sizeof(audio_replay_gain_t) ); 
    236     memset( &fmt->video, 0, sizeof(video_format_t) ); 
    237     memset( &fmt->subs, 0, sizeof(subs_format_t) ); 
    238  
    239     fmt->b_packetized           = true; 
    240     fmt->i_bitrate              = 0; 
    241     fmt->i_extra                = 0; 
    242     fmt->p_extra                = NULL; 
    243 
    244  
    245 static inline int es_format_Copy( es_format_t *dst, const es_format_t *src ) 
    246 
    247     int i; 
    248     memcpy( dst, src, sizeof( es_format_t ) ); 
    249     if( src->psz_language ) 
    250          dst->psz_language = strdup( src->psz_language ); 
    251     if( src->psz_description ) 
    252         dst->psz_description = strdup( src->psz_description ); 
    253     if( src->i_extra > 0 ) 
    254     { 
    255         dst->i_extra = src->i_extra; 
    256         dst->p_extra = malloc( src->i_extra ); 
    257         memcpy( dst->p_extra, src->p_extra, src->i_extra ); 
    258     } 
    259     else 
    260     { 
    261         dst->i_extra = 0; 
    262         dst->p_extra = NULL; 
    263     } 
    264  
    265     if( src->subs.psz_encoding ) 
    266         dst->subs.psz_encoding = strdup( src->subs.psz_encoding ); 
    267  
    268     if( src->video.p_palette ) 
    269     { 
    270         dst->video.p_palette = 
    271             (video_palette_t*)malloc( sizeof( video_palette_t ) ); 
    272         memcpy( dst->video.p_palette, src->video.p_palette, 
    273                 sizeof( video_palette_t ) ); 
    274     } 
    275  
    276     dst->i_extra_languages = src->i_extra_languages; 
    277     if( dst->i_extra_languages ) 
    278         dst->p_extra_languages = (extra_languages_t*) 
    279             malloc(dst->i_extra_languages * sizeof(*dst->p_extra_languages )); 
    280     for( i = 0; i < dst->i_extra_languages; i++ ) { 
    281         if( src->p_extra_languages[i].psz_language ) 
    282             dst->p_extra_languages[i].psz_language = strdup( src->p_extra_languages[i].psz_language ); 
    283         else 
    284             dst->p_extra_languages[i].psz_language = NULL; 
    285         if( src->p_extra_languages[i].psz_description ) 
    286             dst->p_extra_languages[i].psz_description = strdup( src->p_extra_languages[i].psz_description ); 
    287         else 
    288             dst->p_extra_languages[i].psz_description = NULL; 
    289     } 
    290     return VLC_SUCCESS; 
    291 
    292  
    293 static inline void es_format_Clean( es_format_t *fmt ) 
    294 
    295     free( fmt->psz_language ); 
    296     free( fmt->psz_description ); 
    297  
    298     if( fmt->i_extra > 0 ) free( fmt->p_extra ); 
    299  
    300     free( fmt->video.p_palette ); 
    301     free( fmt->subs.psz_encoding ); 
    302  
    303     if( fmt->i_extra_languages > 0 && fmt->p_extra_languages ) 
    304     { 
    305         int i; 
    306         for( i = 0; i < fmt->i_extra_languages; i++ ) 
    307         { 
    308             free( fmt->p_extra_languages[i].psz_language ); 
    309             free( fmt->p_extra_languages[i].psz_description ); 
    310         } 
    311         free( fmt->p_extra_languages ); 
    312     } 
    313  
    314     /* es_format_Clean can be called multiple times */ 
    315     memset( fmt, 0, sizeof(*fmt) ); 
    316 
     214enum es_format_category_e 
     215
     216    UNKNOWN_ES = 0x00, 
     217    VIDEO_ES   = 0x01, 
     218    AUDIO_ES   = 0x02, 
     219    SPU_ES     = 0x03, 
     220    NAV_ES     = 0x04, 
     221}; 
     222 
     223/** 
     224 * This function will fill all RGB shift from RGB masks. 
     225 */ 
     226VLC_EXPORT( void, video_format_FixRgb, ( video_format_t * ) ); 
     227 
     228/** 
     229 * This funtion will initialize a es_format_t structure. 
     230 */ 
     231VLC_EXPORT( void, es_format_Init, ( es_format_t *, int i_cat, vlc_fourcc_t i_codec ) ); 
     232 
     233/** 
     234 * This functions will copy a es_format_t. 
     235 */ 
     236VLC_EXPORT( int, es_format_Copy, ( es_format_t *p_dst, const es_format_t *p_src ) ); 
     237 
     238/** 
     239 * This function will clean up a es_format_t and relasing all associated 
     240 * resources. 
     241 * You can call it multiple times on the same structure. 
     242 */ 
     243VLC_EXPORT( void, es_format_Clean, ( es_format_t *fmt ) ); 
     244 
    317245#endif 
     246 
  • src/Makefile.am

    r20a8956 r4645717  
    346346    misc/mtime.c \ 
    347347    misc/block.c \ 
     348    misc/es_format.c \ 
    348349    modules/modules.h \ 
    349350    modules/modules.c \ 
  • src/libvlccore.sym

    r7b3f256 r4645717  
    9494EndMD5 
    9595EnsureUTF8 
     96es_format_Init 
     97es_format_Copy 
     98es_format_Clean 
    9699filename_sanitize 
    97100filter_chain_AppendFilter 
     
    405408__var_TriggerCallback 
    406409__var_Type 
     410video_format_FixRgb 
    407411vlc_b64_decode 
    408412vlc_b64_decode_binary