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   int num_audio_streams;             
00101   bg_edl_stream_t * audio_streams; 
00102 
00103   int num_video_streams;             
00104   bg_edl_stream_t * video_streams; 
00105 
00106   int num_subtitle_text_streams;     
00107   bg_edl_stream_t * subtitle_text_streams; 
00108 
00109   int num_subtitle_overlay_streams;  
00110   bg_edl_stream_t * subtitle_overlay_streams; 
00111   
00112   } bg_edl_track_t;
00113 
00117 struct bg_edl_s
00118   {
00119   int num_tracks;             
00120   bg_edl_track_t * tracks;  
00121   char * url;                 
00122   };
00123 
00128 bg_edl_t * bg_edl_create();
00129 
00135 bg_edl_track_t * bg_edl_add_track(bg_edl_t * e);
00136 
00142 bg_edl_stream_t * bg_edl_add_audio_stream(bg_edl_track_t * t);
00143 
00149 bg_edl_stream_t * bg_edl_add_video_stream(bg_edl_track_t * t);
00150 
00156 bg_edl_stream_t * bg_edl_add_subtitle_text_stream(bg_edl_track_t * t);
00157 
00163 bg_edl_stream_t * bg_edl_add_subtitle_overlay_stream(bg_edl_track_t * t);
00164 
00170 bg_edl_segment_t * bg_edl_add_segment(bg_edl_stream_t * s);
00171 
00177 bg_edl_t * bg_edl_copy(const bg_edl_t * e);
00178 
00183 void bg_edl_destroy(bg_edl_t * e);
00184 
00191 void bg_edl_dump(const bg_edl_t * e);
00192 
00200 void bg_edl_save(const bg_edl_t * e, const char * filename);
00201 
00207 bg_edl_t * bg_edl_load(const char * filename);
00208 
00226 void bg_edl_append_track_info(bg_edl_t * e,
00227                               const bg_track_info_t * info, const char * url,
00228                               int index, int num_tracks, const char * name);
00229 
00235 #endif // __BG_EDL_H_