00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MPF_TERMINATION_H
00020 #define MPF_TERMINATION_H
00021
00022
00023
00024
00025
00026
00027 #include "mpf_types.h"
00028 #include "apt_timer_queue.h"
00029
00030 APT_BEGIN_EXTERN_C
00031
00032
00033 typedef apt_bool_t (*mpf_termination_event_handler_f)(mpf_termination_t *termination, int event_id, void *descriptor);
00034
00035
00036 typedef struct mpf_termination_vtable_t mpf_termination_vtable_t;
00037
00038
00039 struct mpf_termination_vtable_t {
00040
00041 apt_bool_t (*destroy)(mpf_termination_t *termination);
00042
00043
00044 apt_bool_t (*add)(mpf_termination_t *termination, void *descriptor);
00045
00046 apt_bool_t (*modify)(mpf_termination_t *termination, void *descriptor);
00047
00048 apt_bool_t (*subtract)(mpf_termination_t *termination);
00049 };
00050
00051
00052
00053 struct mpf_termination_t {
00054
00055 apr_pool_t *pool;
00056
00057 const char *name;
00058
00059 void *obj;
00060
00061 void *event_handler_obj;
00062
00063 mpf_termination_event_handler_f event_handler;
00064
00065 const mpf_codec_manager_t *codec_manager;
00066
00067 apt_timer_queue_t *timer_queue;
00068
00069 mpf_termination_factory_t *termination_factory;
00070
00071 const mpf_termination_vtable_t *vtable;
00072
00073 apr_size_t slot;
00074
00075
00076 mpf_audio_stream_t *audio_stream;
00077
00078 mpf_video_stream_t *video_stream;
00079 };
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 MPF_DECLARE(mpf_termination_t*) mpf_termination_base_create(
00091 mpf_termination_factory_t *termination_factory,
00092 void *obj,
00093 const mpf_termination_vtable_t *vtable,
00094 mpf_audio_stream_t *audio_stream,
00095 mpf_video_stream_t *video_stream,
00096 apr_pool_t *pool);
00097
00098
00099
00100
00101
00102
00103 MPF_DECLARE(apt_bool_t) mpf_termination_add(mpf_termination_t *termination, void *descriptor);
00104
00105
00106
00107
00108
00109
00110 MPF_DECLARE(apt_bool_t) mpf_termination_modify(mpf_termination_t *termination, void *descriptor);
00111
00112
00113
00114
00115
00116 MPF_DECLARE(apt_bool_t) mpf_termination_subtract(mpf_termination_t *termination);
00117
00118
00119 APT_END_EXTERN_C
00120
00121 #endif