gmerlin
edl.h
00001 /*****************************************************************
00002  * gmerlin - a general purpose multimedia framework and applications
00003  *
00004  * Copyright (c) 2001 - 2011 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_EDL_H_
00023 #define __BG_EDL_H_
00024 
00025 #include <gmerlin/parameter.h>
00026 #include <gmerlin/streaminfo.h>
00027 
00057 typedef struct bg_edl_s bg_edl_t;
00058 
00059 
00063 typedef struct
00064   {
00065   char * url;   
00066 
00067   int track;        
00068   int stream;       
00069   int timescale;    
00070     
00071   int64_t src_time; 
00072   
00073   /* Time and duration within the destination in destination
00074      timescale */
00075   int64_t dst_time;  
00076   int64_t dst_duration; 
00077 
00078   /*  */
00079   int32_t speed_num; 
00080   int32_t speed_den; 
00081   } bg_edl_segment_t;
00082 
00086 typedef struct
00087   {
00088   bg_edl_segment_t * segments; 
00089   int num_segments;              
00090   int timescale;                 
00091   } bg_edl_stream_t;
00092 
00096 typedef struct
00097   {
00098   char * name; 
00099 
00100   gavl_metadata_t metadata; 
00101   
00102   int num_audio_streams;             
00103   bg_edl_stream_t * audio_streams; 
00104 
00105   int num_video_streams;             
00106   bg_edl_stream_t * video_streams; 
00107 
00108   int num_subtitle_text_streams;     
00109   bg_edl_stream_t * subtitle_text_streams; 
00110 
00111   int num_subtitle_overlay_streams;  
00112   bg_edl_stream_t * subtitle_overlay_streams; 
00113   
00114   } bg_edl_track_t;
00115 
00119 struct bg_edl_s
00120   {
00121   int num_tracks;             
00122   bg_edl_track_t * tracks;  
00123   char * url;                 
00124   };
00125 
00130 bg_edl_t * bg_edl_create();
00131 
00137 bg_edl_track_t * bg_edl_add_track(bg_edl_t * e);
00138 
00144 bg_edl_stream_t * bg_edl_add_audio_stream(bg_edl_track_t * t);
00145 
00151 bg_edl_stream_t * bg_edl_add_video_stream(bg_edl_track_t * t);
00152 
00158 bg_edl_stream_t * bg_edl_add_subtitle_text_stream(bg_edl_track_t * t);
00159 
00165 bg_edl_stream_t * bg_edl_add_subtitle_overlay_stream(bg_edl_track_t * t);
00166 
00172 bg_edl_segment_t * bg_edl_add_segment(bg_edl_stream_t * s);
00173 
00179 bg_edl_t * bg_edl_copy(const bg_edl_t * e);
00180 
00185 void bg_edl_destroy(bg_edl_t * e);
00186 
00193 void bg_edl_dump(const bg_edl_t * e);
00194 
00202 void bg_edl_save(const bg_edl_t * e, const char * filename);
00203 
00209 bg_edl_t * bg_edl_load(const char * filename);
00210 
00228 void bg_edl_append_track_info(bg_edl_t * e,
00229                               const bg_track_info_t * info, const char * url,
00230                               int index, int num_tracks, const char * name);
00231 
00237 #endif // __BG_EDL_H_