streaminfo.h

00001 /*****************************************************************
00002  * gmerlin - a general purpose multimedia framework and applications
00003  *
00004  * Copyright (c) 2001 - 2008 Members of the Gmerlin project
00005  * gmerlin-general@lists.sourceforge.net
00006  * http://gmerlin.sourceforge.net
00007  *
00008  * This program is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  * *****************************************************************/
00021 
00022 #ifndef __BG_STREAMINFO_H_
00023 #define __BG_STREAMINFO_H_
00024 
00025 #include <gavl/gavl.h>
00026 
00027 #include <libxml/tree.h>
00028 #include <libxml/parser.h>
00029 
00037 /************************************************
00038  * Types for describing media streams
00039  ************************************************/
00040 
00041 /* Languages are ISO 639-2 (3 character code) */
00042 
00049 typedef struct
00050   {
00051   gavl_audio_format_t format; 
00052   char * description; 
00053   char   language[4]; 
00054   char * info;        
00055   int64_t duration;   
00056   } bg_audio_info_t;
00057 
00064 typedef struct
00065   {
00066   gavl_video_format_t format; 
00067   char * description; 
00068   char language[4]; 
00069   char * info;        
00070   int is_still;       
00071   int64_t duration;   
00072   } bg_video_info_t;
00073 
00080 typedef struct
00081   {
00082   char * description; 
00083   char language[4]; 
00084   char * info;        
00085 
00086   int is_text; 
00087   gavl_video_format_t format; 
00088   int64_t duration;   
00089   } bg_subtitle_info_t;
00090 
00097 typedef struct
00098   {
00099   char * artist; 
00100   char * title; 
00101   char * album; 
00102       
00103   int track; 
00104   char * date; 
00105   char * genre; 
00106   char * comment;
00107 
00108   char * author;
00109   char * copyright;
00110   } bg_metadata_t;
00111 
00117 void bg_metadata_free(bg_metadata_t * m);
00118 
00128 void bg_metadata_copy(bg_metadata_t * dst, const bg_metadata_t * src);
00129 
00152 char * bg_create_track_name(const bg_metadata_t * m, const char * format);
00153 
00161 char * bg_metadata_to_string(const bg_metadata_t * m, int use_tabs);
00162 
00172 int bg_metadata_get_year(const bg_metadata_t * m);
00173 
00174 /* XML Interface */
00175 
00186 void bg_xml_2_metadata(xmlDocPtr xml_doc, xmlNodePtr xml_metadata,
00187                        bg_metadata_t * ret);
00188 
00197 void bg_metadata_2_xml(xmlNodePtr xml_metadata,
00198                        bg_metadata_t * ret);
00199 
00213 bg_parameter_info_t * bg_metadata_get_parameters(bg_metadata_t * m);
00214 
00222 void bg_metadata_set_parameter(void * data, const char * name,
00223                                const bg_parameter_value_t * v);
00224 
00225 
00234 typedef struct
00235   {
00236   int num_chapters;       
00237   int timescale;          
00238   struct
00239     {
00240     int64_t time;        
00241     char * name;          
00242     } * chapters;         
00243   } bg_chapter_list_t;
00244 
00251 bg_chapter_list_t * bg_chapter_list_create(int num_chapters);
00252 
00258 bg_chapter_list_t * bg_chapter_list_copy(const bg_chapter_list_t * list);
00259 
00260 
00266 void bg_chapter_list_destroy(bg_chapter_list_t * list);
00275 void bg_chapter_list_insert(bg_chapter_list_t * list, int index,
00276                             int64_t time, const char * name);
00277 
00284 void bg_chapter_list_delete(bg_chapter_list_t * list, int index);
00285 
00294 void bg_chapter_list_set_default_names(bg_chapter_list_t * list);
00295 
00306 int bg_chapter_list_get_current(bg_chapter_list_t * list,
00307                                  gavl_time_t time);
00308 
00320 int bg_chapter_list_changed(bg_chapter_list_t * list,
00321                             gavl_time_t time, int * current_chapter);
00322 
00323 
00332 void bg_chapter_list_2_xml(bg_chapter_list_t * list, xmlNodePtr xml_list);
00333 
00343 bg_chapter_list_t *
00344 bg_xml_2_chapter_list(xmlDocPtr xml_doc, xmlNodePtr xml_list);
00345 
00352 void bg_chapter_list_save(bg_chapter_list_t * list, const char * filename);
00353 
00360 bg_chapter_list_t * bg_chapter_list_load(const char * filename);
00361 
00362 
00367 typedef struct
00368   {
00369   int seekable; 
00370   char * name;             
00371   char * description;      
00372   int64_t duration;        
00373   
00374   int num_audio_streams;   
00375   int num_video_streams;   
00376   int num_subtitle_streams;
00377   
00378   bg_audio_info_t *    audio_streams; 
00379   bg_video_info_t *    video_streams; 
00380   bg_subtitle_info_t * subtitle_streams; 
00381 
00382   bg_metadata_t metadata; 
00383   
00384   /* The following are only meaningful for redirectors */
00385   
00386   char * url; 
00387 
00388   bg_chapter_list_t * chapter_list; 
00389   
00390   } bg_track_info_t;
00391 
00402 void bg_track_info_free(bg_track_info_t * info);
00403 
00415 void bg_set_track_name_default(bg_track_info_t * info,
00416                                const char * location);
00417 
00429 char * bg_get_track_name_default(const char * location, int track, int num_tracks);
00430 
00431 #endif // /__BG_STREAMINFO_H_

Generated on Sat Aug 9 12:12:42 2008 for gmerlin by  doxygen 1.5.6