1 /* 2 * ioaux.h 3 * 4 * Copyright (C) Thomas Oestreich - June 2001 5 * 6 * This file is part of transcode, a video stream processing tool 7 * 8 * transcode is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2, or (at your option) 11 * any later version. 12 * 13 * transcode is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with GNU Make; see the file COPYING. If not, write to 20 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 21 * 22 */ 23 24 #ifndef _IOAUX_H 25 #define _IOAUX_H 26 27 #include "transcode.h" 28 #include "tcinfo.h" 29 #include "magic.h" 30 31 32 /* this exit is provided by the import module or frontend */ 33 extern void import_exit(int ret); 34 35 /* fileinfo.c */ 36 long fileinfo(int fd, int skipy); 37 long streaminfo(int fd); 38 const char *filetype(uint32_t magic); 39 40 /* scan_pes.c */ 41 void scan_pes(int verbose, FILE *fd); 42 void probe_pes(info_t *ipipe); 43 44 /* ioaux.c */ 45 unsigned int stream_read_int16(const unsigned char *s); 46 unsigned int stream_read_int32(const unsigned char *s); 47 double read_time_stamp(const unsigned char *s); 48 long read_time_stamp_long(const unsigned char *s); 49 50 /* ts_reader.c */ 51 void probe_ts(info_t *ipipe); 52 int ts_read(int fd_in, int fd_out, int demux_pid); 53 54 #define VOB_PACKET_SIZE 0x800 55 #define VOB_PACKET_OFFSET 22 56 57 //packet type 58 #define P_ID_AC3 0xbd 59 #define P_ID_MP3 0xbc 60 #define P_ID_MPEG 0xe0 61 #define P_ID_PROG 0xbb 62 #define P_ID_PADD 0xbe 63 64 //stream type 65 #define TC_STYPE_ERROR 0xFFFFFFFF 66 #define TC_STYPE_UNKNOWN 0x00000000 67 #define TC_STYPE_FILE 0x00000001 68 #define TC_STYPE_STDIN 0x00000002 69 #define TC_STYPE_X11 0x00000004 70 71 #define ERROR_END_OF_STREAM 1 72 #define ERROR_INVALID_FRAME 2 73 #define ERROR_INVALID_FRAME_SIZE 3 74 #define ERROR_INVALID_HEADER 4 75 #endif /* _IOAUX_H */ 76