1 /*
2     This program is free software; you can redistribute it and/or modify
3     it under the terms of the GNU General Public License as published by
4     the Free Software Foundation; either version 2 of the License, or
5     (at your option) any later version.
6 
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10     GNU General Public License for more details.
11 
12     You should have received a copy of the GNU General Public License
13     along with this program; if not, write to the Free Software
14     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15 */
16 
17 #ifndef EDITLIST_H
18 #define EDITLIST_H
19 
20 #include <lav_io.h>
21 
22 
23 /* If changing MAX_EDIT_LIST_FILES, the macros below
24    also have to be adapted. */
25 
26 #define MAX_EDIT_LIST_FILES 256
27 
28 #define N_EL_FRAME(x)  ( (x)&0xffffff )
29 #define N_EL_FILE(x)   ( ((x)>>24)&0xff )
30 #define EL_ENTRY(file,frame) ( ((file)<<24) | ((frame)&0xffffff) )
31 
32 typedef struct
33 {
34    long video_frames;
35    long video_width;
36    long video_height;
37    long video_inter;
38    long video_norm;
39    double video_fps;
40    int video_sar_width; /* sample aspect ratio */
41    int video_sar_height;
42 
43    long max_frame_size;
44    int  chroma;
45 	/* TODO: Need to flag mixed chroma model files? */
46 
47    int  has_audio;
48    long audio_rate;
49    int  audio_chans;
50    int  audio_bits;
51    int  audio_bps;
52 
53 	long num_video_files;
54 	char *(video_file_list[MAX_EDIT_LIST_FILES]);
55    lav_file_t *(lav_fd[MAX_EDIT_LIST_FILES]);
56    long num_frames[MAX_EDIT_LIST_FILES];
57    long *frame_list;
58 
59    int  last_afile;
60    long last_apos;
61 }
62 EditList;
63 
64 int el_get_video_frame(uint8_t *vbuff, long nframe, EditList *el);
65 int el_get_audio_data(uint8_t *abuff, long nframe, EditList *el, int mute);
66 void read_video_files(char **filename, int num_files, EditList *el, int preserve_pathnames);
67 int write_edit_list(char *name, long n1, long n2, EditList *el);
68 int open_video_file(char *filename, EditList *el, int preserve_pathname);
69 int el_video_frame_data_format(long nframe, EditList *el);
70 
71 #endif /* ifndef EDITLIST_H */
72