1 /* 2 * frame_threads.h -- declaration of transcode multithreaded filter 3 * processing code. 4 * 5 * Copyright (C) Thomas Oestreich - June 2001 6 * 7 * This file is part of transcode, a video stream processing tool 8 * 9 * transcode is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 2, or (at your option) 12 * any later version. 13 * 14 * transcode is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with GNU Make; see the file COPYING. If not, write to 21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 22 * 23 */ 24 25 #ifndef FRAME_THREADS_H 26 #define FRAME_THREADS_H 27 28 #include "transcode.h" 29 30 /* 31 * SUMMARY: 32 * 33 * Those are the frame processing threads, implementing the threaded 34 * filter layer. There isn't direct control to those threads. They 35 * start to run after init(), and they are stopped by fini(). 36 * It is important to note that each thread is equivalent to each 37 * other, and each one will take care of one frame and applies to 38 * it the whole filter chain. 39 */ 40 41 /* 42 * tc_frame_threads_init: start the frame threads pool and implicitely 43 * and automatically starts the frame filter layer. 44 * 45 * Parameters: 46 * vob: vob structure. 47 * vworkers: number of threads in the video filter pool. 48 * aworkers: number of threads in the audio filter pool. 49 * Return Value: 50 * None. 51 */ 52 void tc_frame_threads_init(vob_t *vob, int vworkers, int aworkers); 53 54 /* 55 * tc_frame_threads_close: destroy both audio and video filter pool threads, 56 * and automatically and implicitely stop the whole filter layer. 57 * It's important to note that this function assume that all processing loops 58 * are already been terminated. 59 * This is a blocking function. 60 * 61 * Parameters: 62 * None. 63 * Return Value: 64 * None. 65 * Preconditions: 66 * processing threads are terminated for any reason 67 * (regular stop, end of stream reached, forced interruption). 68 */ 69 void tc_frame_threads_close(void); 70 71 /* 72 * tc_frame_threads_audio_{video,audio}_workers: 73 * query the number of avalaible (not active) audio,video frame 74 * worker threads. 75 * 76 * Parameters: 77 * None. 78 * Return Value: 79 * The number of avalaible audio,video frame worker threads. 80 */ 81 int tc_frame_threads_have_video_workers(void); 82 int tc_frame_threads_have_audio_workers(void); 83 84 #endif /* FRAME_THREADS_H */ 85