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   } bg_audio_info_t;
00056 
00063 typedef struct
00064   {
00065   gavl_video_format_t format; 
00066   char * description; 
00067   char language[4]; 
00068   char * info;        
00069   int is_still;       
00070   } bg_video_info_t;
00071 
00078 typedef struct
00079   {
00080   char * description; 
00081   char language[4]; 
00082   char * info;        
00083 
00084   int is_text; 
00085   gavl_video_format_t format; 
00086   } bg_subtitle_info_t;
00087 
00094 typedef struct
00095   {
00096   char * artist; 
00097   char * title; 
00098   char * album; 
00099       
00100   int track; 
00101   char * date; 
00102   char * genre; 
00103   char * comment;
00104 
00105   char * author;
00106   char * copyright;
00107   } bg_metadata_t;
00108 
00114 void bg_metadata_free(bg_metadata_t * m);
00115 
00125 void bg_metadata_copy(bg_metadata_t * dst, const bg_metadata_t * src);
00126 
00149 char * bg_create_track_name(const bg_metadata_t * m, const char * format);
00150 
00158 char * bg_metadata_to_string(const bg_metadata_t * m, int use_tabs);
00159 
00169 int bg_metadata_get_year(const bg_metadata_t * m);
00170 
00171 /* XML Interface */
00172 
00183 void bg_xml_2_metadata(xmlDocPtr xml_doc, xmlNodePtr xml_metadata,
00184                        bg_metadata_t * ret);
00185 
00194 void bg_metadata_2_xml(xmlNodePtr xml_metadata,
00195                        bg_metadata_t * ret);
00196 
00210 bg_parameter_info_t * bg_metadata_get_parameters(bg_metadata_t * m);
00211 
00219 void bg_metadata_set_parameter(void * data, const char * name,
00220                                const bg_parameter_value_t * v);
00221 
00222 
00231 typedef struct
00232   {
00233   int num_chapters;       
00234   struct
00235     {
00236     gavl_time_t time;     
00237     char * name;          
00238     } * chapters;         
00239   } bg_chapter_list_t;
00240 
00247 bg_chapter_list_t * bg_chapter_list_create(int num_chapters);
00248 
00254 bg_chapter_list_t * bg_chapter_list_copy(const bg_chapter_list_t * list);
00255 
00256 
00262 void bg_chapter_list_destroy(bg_chapter_list_t * list);
00271 void bg_chapter_list_insert(bg_chapter_list_t * list, int index,
00272                             int64_t time, const char * name);
00273 
00280 void bg_chapter_list_delete(bg_chapter_list_t * list, int index);
00281 
00290 void bg_chapter_list_set_default_names(bg_chapter_list_t * list);
00291 
00302 int bg_chapter_list_get_current(bg_chapter_list_t * list,
00303                                  gavl_time_t time);
00304 
00316 int bg_chapter_list_changed(bg_chapter_list_t * list,
00317                             gavl_time_t time, int * current_chapter);
00318 
00319 
00328 void bg_chapter_list_2_xml(bg_chapter_list_t * list, xmlNodePtr xml_list);
00329 
00339 bg_chapter_list_t *
00340 bg_xml_2_chapter_list(xmlDocPtr xml_doc, xmlNodePtr xml_list);
00341 
00348 void bg_chapter_list_save(bg_chapter_list_t * list, const char * filename);
00349 
00356 bg_chapter_list_t * bg_chapter_list_load(const char * filename);
00357 
00358 
00363 typedef struct
00364   {
00365   int seekable; 
00366   //  int redirector; //!< 1 if we are a redirector, the url field must be valid then
00367   char * name;             
00368   char * description;      
00369   int64_t duration;        
00370   
00371   int num_audio_streams;   
00372   int num_video_streams;   
00373   int num_subtitle_streams;
00374   
00375   bg_audio_info_t *    audio_streams; 
00376   bg_video_info_t *    video_streams; 
00377   bg_subtitle_info_t * subtitle_streams; 
00378 
00379   bg_metadata_t metadata; 
00380   
00381   /* The following are only meaningful for redirectors */
00382   
00383   char * url; 
00384 
00385   bg_chapter_list_t * chapter_list; 
00386   
00387   } bg_track_info_t;
00388 
00399 void bg_track_info_free(bg_track_info_t * info);
00400 
00412 void bg_set_track_name_default(bg_track_info_t * info,
00413                                const char * location);
00414 
00424 char * bg_get_track_name_default(const char * location);
00425 
00426 #endif // /__BG_STREAMINFO_H_

Generated on Wed Jan 9 19:32:52 2008 for gmerlin by  doxygen 1.5.3