UniMRCP  1.7.0
mpf_termination.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 Arsen Chaloyan
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MPF_TERMINATION_H
18 #define MPF_TERMINATION_H
19 
20 /**
21  * @file mpf_termination.h
22  * @brief MPF Termination
23  */
24 
25 #include "mpf_types.h"
26 #include "apt_timer_queue.h"
27 
29 
30 /** Prototype of termination event handler */
31 typedef apt_bool_t (*mpf_termination_event_handler_f)(mpf_termination_t *termination, int event_id, void *descriptor);
32 
33 /** Termination vtable declaration */
35 
36 /** Table of termination virtual methods */
38  /** Virtual termination destroy method */
40 
41  /** Virtual termination add method */
42  apt_bool_t (*add)(mpf_termination_t *termination, void *descriptor);
43  /** Virtual termination modify method */
44  apt_bool_t (*modify)(mpf_termination_t *termination, void *descriptor);
45  /** Virtual termination subtract method */
47 };
48 
49 
50 /** MPF Termination */
52  /** Pool to allocate memory from */
53  apr_pool_t *pool;
54  /** Informative name used for debugging */
55  const char *name;
56  /** External object */
57  void *obj;
58  /** Media engine to send events to */
59  void *media_engine;
60  /** Event handler */
62  /** Codec manager */
64  /** Timer queue */
66  /** Termination factory entire termination created by */
68  /** Table of virtual methods */
70  /** Slot in context */
71  apr_size_t slot;
72 
73  /** Audio stream */
75  /** Video stream */
77 };
78 
79 /**
80  * Create MPF termination base.
81  * @param termination_factory the termination factory
82  * @param obj the external object associated with termination
83  * @param vtable the table of virtual functions of termination
84  * @param audio_stream the audio stream
85  * @param video_stream the video stream
86  * @param pool the pool to allocate memory from
87  */
89  mpf_termination_factory_t *termination_factory,
90  void *obj,
91  const mpf_termination_vtable_t *vtable,
92  mpf_audio_stream_t *audio_stream,
93  mpf_video_stream_t *video_stream,
94  apr_pool_t *pool);
95 
96 /**
97  * Add MPF termination.
98  * @param termination the termination to add
99  * @param descriptor the termination specific descriptor
100  */
101 MPF_DECLARE(apt_bool_t) mpf_termination_add(mpf_termination_t *termination, void *descriptor);
102 
103 /**
104  * Modify MPF termination.
105  * @param termination the termination to modify
106  * @param descriptor the termination specific descriptor
107  */
108 MPF_DECLARE(apt_bool_t) mpf_termination_modify(mpf_termination_t *termination, void *descriptor);
109 
110 /**
111  * Subtract MPF termination.
112  * @param termination the termination to subtract
113  */
115 
116 
118 
119 #endif /* MPF_TERMINATION_H */
Definition: mpf_stream.h:37
apt_bool_t(* destroy)(mpf_termination_t *termination)
Definition: mpf_termination.h:39
apr_size_t slot
Definition: mpf_termination.h:71
mpf_audio_stream_t * audio_stream
Definition: mpf_termination.h:74
mpf_video_stream_t * video_stream
Definition: mpf_termination.h:76
Definition: mpf_termination.h:51
mpf_termination_factory_t * termination_factory
Definition: mpf_termination.h:67
mpf_termination_t * mpf_termination_base_create(mpf_termination_factory_t *termination_factory, void *obj, const mpf_termination_vtable_t *vtable, mpf_audio_stream_t *audio_stream, mpf_video_stream_t *video_stream, apr_pool_t *pool)
APT_BEGIN_EXTERN_C typedef apt_bool_t(* mpf_termination_event_handler_f)(mpf_termination_t *termination, int event_id, void *descriptor)
Definition: mpf_termination.h:31
apt_bool_t mpf_termination_add(mpf_termination_t *termination, void *descriptor)
Timer Queue.
#define APT_END_EXTERN_C
Definition: apt.h:38
apt_bool_t(* subtract)(mpf_termination_t *termination)
Definition: mpf_termination.h:46
int apt_bool_t
Definition: apt.h:57
const char * name
Definition: mpf_termination.h:55
apt_bool_t(* modify)(mpf_termination_t *termination, void *descriptor)
Definition: mpf_termination.h:44
struct apt_timer_queue_t apt_timer_queue_t
Definition: apt_timer_queue.h:32
#define MPF_DECLARE(type)
Definition: mpf.h:40
Definition: mpf_stream.h:61
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
Definition: mpf_termination_factory.h:30
apt_bool_t mpf_termination_subtract(mpf_termination_t *termination)
apt_bool_t mpf_termination_modify(mpf_termination_t *termination, void *descriptor)
MPF Types Declarations.
apt_bool_t(* add)(mpf_termination_t *termination, void *descriptor)
Definition: mpf_termination.h:42
void * media_engine
Definition: mpf_termination.h:59
const mpf_termination_vtable_t * vtable
Definition: mpf_termination.h:69
const mpf_codec_manager_t * codec_manager
Definition: mpf_termination.h:63
Definition: mpf_termination.h:37
mpf_termination_event_handler_f event_handler
Definition: mpf_termination.h:61
apt_timer_queue_t * timer_queue
Definition: mpf_termination.h:65
apr_pool_t * pool
Definition: mpf_termination.h:53
struct mpf_codec_manager_t mpf_codec_manager_t
Definition: mpf_types.h:39
void * obj
Definition: mpf_termination.h:57