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 
00039 /************************************************
00040  * Types for describing media streams
00041  ************************************************/
00042 
00043 /* Languages are ISO 639-2 (3 character code) */
00044 
00051 typedef struct
00052   {
00053   gavl_audio_format_t format; 
00054   char * description; 
00055   char   language[4]; 
00056   char * info;        
00057   int64_t duration;   
00058   } bg_audio_info_t;
00059 
00065 typedef struct
00066   {
00067   gavl_video_format_t format; 
00068   char * description; 
00069   char language[4]; 
00070   char * info;        
00071   int64_t duration;   
00072   } bg_video_info_t;
00073 
00079 typedef struct
00080   {
00081   char * description; 
00082   char language[4]; 
00083   char * info;        
00084 
00085   int is_text; 
00086   gavl_video_format_t format; 
00087   int64_t duration;   
00088   } bg_subtitle_info_t;
00089 
00095 typedef struct
00096   {
00097   char * artist; 
00098   char * title; 
00099   char * album; 
00100       
00101   int track; 
00102   char * date; 
00103   char * genre; 
00104   char * comment;
00105 
00106   char * author;
00107   char * copyright;
00108   } bg_metadata_t;
00109 
00114 void bg_metadata_free(bg_metadata_t * m);
00115 
00124 void bg_metadata_copy(bg_metadata_t * dst, const bg_metadata_t * src);
00125 
00147 char * bg_create_track_name(const bg_metadata_t * m, const char * format);
00148 
00155 char * bg_metadata_to_string(const bg_metadata_t * m, int use_tabs);
00156 
00165 int bg_metadata_get_year(const bg_metadata_t * m);
00166 
00167 /* XML Interface */
00168 
00178 void bg_xml_2_metadata(xmlDocPtr xml_doc, xmlNodePtr xml_metadata,
00179                        bg_metadata_t * ret);
00180 
00188 void bg_metadata_2_xml(xmlNodePtr xml_metadata,
00189                        bg_metadata_t * ret);
00190 
00203 bg_parameter_info_t * bg_metadata_get_parameters(bg_metadata_t * m);
00204 
00211 void bg_metadata_set_parameter(void * data, const char * name,
00212                                const bg_parameter_value_t * v);
00213 
00214 
00222 typedef struct
00223   {
00224   int num_chapters;       
00225   int timescale;          
00226   struct
00227     {
00228     int64_t time;        
00229     char * name;          
00230     } * chapters;         
00231   } bg_chapter_list_t;
00232 
00238 bg_chapter_list_t * bg_chapter_list_create(int num_chapters);
00239 
00244 bg_chapter_list_t * bg_chapter_list_copy(const bg_chapter_list_t * list);
00245 
00246 
00251 void bg_chapter_list_destroy(bg_chapter_list_t * list);
00259 void bg_chapter_list_insert(bg_chapter_list_t * list, int index,
00260                             int64_t time, const char * name);
00261 
00267 void bg_chapter_list_delete(bg_chapter_list_t * list, int index);
00268 
00276 void bg_chapter_list_set_default_names(bg_chapter_list_t * list);
00277 
00287 int bg_chapter_list_get_current(bg_chapter_list_t * list,
00288                                  gavl_time_t time);
00289 
00300 int bg_chapter_list_changed(bg_chapter_list_t * list,
00301                             gavl_time_t time, int * current_chapter);
00302 
00303 
00311 void bg_chapter_list_2_xml(bg_chapter_list_t * list, xmlNodePtr xml_list);
00312 
00321 bg_chapter_list_t *
00322 bg_xml_2_chapter_list(xmlDocPtr xml_doc, xmlNodePtr xml_list);
00323 
00329 void bg_chapter_list_save(bg_chapter_list_t * list, const char * filename);
00330 
00336 bg_chapter_list_t * bg_chapter_list_load(const char * filename);
00337 
00338 #define BG_TRACK_SEEKABLE (1<<0) 
00339 #define BG_TRACK_PAUSABLE (1<<1) 
00340 
00341 
00344 typedef struct
00345   {
00346   int flags;             
00347   char * name;           
00348   char * description;    
00349   int64_t duration;      
00350   
00351   int num_audio_streams;   
00352   int num_video_streams;   
00353   int num_subtitle_streams;
00354   
00355   bg_audio_info_t *    audio_streams; 
00356   bg_video_info_t *    video_streams; 
00357   bg_subtitle_info_t * subtitle_streams; 
00358 
00359   bg_metadata_t metadata; 
00360   
00361   /* The following are only meaningful for redirectors */
00362   
00363   char * url; 
00364 
00365   bg_chapter_list_t * chapter_list; 
00366   
00367   } bg_track_info_t;
00368 
00378 void bg_track_info_free(bg_track_info_t * info);
00379 
00390 void bg_set_track_name_default(bg_track_info_t * info,
00391                                const char * location);
00392 
00403 char * bg_get_track_name_default(const char * location, int track, int num_tracks);
00404 
00410 #endif // /__BG_STREAMINFO_H_

Generated on Thu Dec 18 08:10:52 2008 for gmerlin by  doxygen 1.5.7.1