1 /* 2 * export_tcaud.c - generic audio export frontend module 3 * (C) 2007-2010 Francesco Romani <fromani at gmail dot com> 4 * incorporates code from former aud_aux.c, which was 5 * Copyright (C) Thomas Oestreich - June 2001 6 * Copyright (C) Nicolas LAURENT - August 2003 7 * 8 * This file is part of transcode, a video stream processing tool. 9 * transcode is free software, distributable under the terms of the GNU 10 * General Public License (version 2 or later). See the file COPYING 11 * for details. 12 */ 13 14 #define MOD_NAME "export_tcaud.so" 15 #define MOD_VERSION "v0.9.0 (2007-07-03)" 16 #define MOD_CODEC "(audio) MPEG/AC3/PCM" 17 18 #include "transcode.h" 19 #include "aud_aux.h" 20 21 static int verbose_flag = TC_DEBUG; 22 static int capability_flag = TC_CAP_PCM|TC_CAP_AC3|TC_CAP_AUD; 23 24 #define MOD_PRE tcaud 25 #include "export_def.h" 26 27 /*************************************************************************/ 28 29 MOD_init 30 { 31 if (param->flag == TC_AUDIO) { 32 return tc_audio_init(vob, verbose); 33 } 34 if (param->flag == TC_VIDEO) { 35 return TC_EXPORT_OK; 36 } 37 return TC_EXPORT_ERROR; 38 } 39 40 MOD_open 41 { 42 if (param->flag == TC_AUDIO) { 43 return tc_audio_open(vob, vob->avifile_out); 44 } 45 if (param->flag == TC_VIDEO) { 46 return TC_EXPORT_OK; 47 } 48 return TC_EXPORT_ERROR; 49 } 50 51 MOD_encode 52 { 53 if (param->flag == TC_AUDIO) { 54 vob_t *vob = tc_get_vob(); 55 return tc_audio_encode(param->buffer, param->size, vob->avifile_out); 56 } 57 if (param->flag == TC_VIDEO) { 58 return TC_EXPORT_OK; 59 } 60 return TC_EXPORT_ERROR; 61 } 62 63 MOD_close 64 { 65 if (param->flag == TC_AUDIO) { 66 return tc_audio_close(); 67 } 68 if (param->flag == TC_VIDEO) { 69 return TC_EXPORT_OK; 70 } 71 return TC_EXPORT_ERROR; 72 } 73 74 MOD_stop 75 { 76 if (param->flag == TC_AUDIO) { 77 return tc_audio_stop(); 78 } 79 if (param->flag == TC_VIDEO) { 80 return TC_EXPORT_OK; 81 } 82 return TC_EXPORT_ERROR; 83 } 84 85 86 /*************************************************************************/ 87 88 /* 89 * Local variables: 90 * c-file-style: "stroustrup" 91 * c-file-offsets: ((case-label . *) (statement-case-intro . *)) 92 * indent-tabs-mode: nil 93 * End: 94 * 95 * vim: expandtab shiftwidth=4: 96 */ 97