00001 /* 00002 * Copyright 2008-2010 Arsen Chaloyan 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 * $Id: mpf_termination_factory.h 1693 2010-05-16 18:33:07Z achaloyan $ 00017 */ 00018 00019 #ifndef MPF_TERMINATION_FACTORY_H 00020 #define MPF_TERMINATION_FACTORY_H 00021 00022 /** 00023 * @file mpf_termination_factory.h 00024 * @brief MPF Termination Factory 00025 */ 00026 00027 #include "mpf_types.h" 00028 00029 APT_BEGIN_EXTERN_C 00030 00031 /** MPF termination factory */ 00032 struct mpf_termination_factory_t { 00033 /** Virtual create */ 00034 mpf_termination_t* (*create_termination)(mpf_termination_factory_t *factory, void *obj, apr_pool_t *pool); 00035 }; 00036 00037 00038 00039 /** 00040 * Create MPF termination from termination factory. 00041 * @param termination_factory the termination factory to create termination from 00042 * @param obj the external object associated with termination 00043 * @param pool the pool to allocate memory from 00044 */ 00045 MPF_DECLARE(mpf_termination_t*) mpf_termination_create( 00046 mpf_termination_factory_t *termination_factory, 00047 void *obj, 00048 apr_pool_t *pool); 00049 00050 /** 00051 * Create raw MPF termination. 00052 * @param obj the external object associated with termination 00053 * @param audio_stream the audio stream of the termination 00054 * @param video_stream the video stream of the termination 00055 * @param pool the pool to allocate memory from 00056 */ 00057 MPF_DECLARE(mpf_termination_t*) mpf_raw_termination_create( 00058 void *obj, 00059 mpf_audio_stream_t *audio_stream, 00060 mpf_video_stream_t *video_stream, 00061 apr_pool_t *pool); 00062 00063 /** 00064 * Destroy MPF termination. 00065 * @param termination the termination to destroy 00066 */ 00067 MPF_DECLARE(apt_bool_t) mpf_termination_destroy(mpf_termination_t *termination); 00068 00069 /** 00070 * Get termination name. 00071 * @param termination the termination to get name of 00072 */ 00073 MPF_DECLARE(const char*) mpf_termination_name_get(const mpf_termination_t *termination); 00074 00075 /** 00076 * Get associated object. 00077 * @param termination the termination to get object from 00078 */ 00079 MPF_DECLARE(void*) mpf_termination_object_get(const mpf_termination_t *termination); 00080 00081 /** 00082 * Get audio stream. 00083 * @param termination the termination to get audio stream from 00084 */ 00085 MPF_DECLARE(mpf_audio_stream_t*) mpf_termination_audio_stream_get(const mpf_termination_t *termination); 00086 00087 /** 00088 * Get video stream. 00089 * @param termination the termination to get video stream from 00090 */ 00091 MPF_DECLARE(mpf_video_stream_t*) mpf_termination_video_stream_get(const mpf_termination_t *termination); 00092 00093 00094 APT_END_EXTERN_C 00095 00096 #endif /* MPF_TERMINATION_FACTORY_H */