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_message.h 1474 2010-02-07 20:51:47Z achaloyan $ 00017 */ 00018 00019 #ifndef MPF_MESSAGE_H 00020 #define MPF_MESSAGE_H 00021 00022 /** 00023 * @file mpf_message.h 00024 * @brief Media Processing Framework Message Definitions 00025 */ 00026 00027 #include "mpf_types.h" 00028 00029 APT_BEGIN_EXTERN_C 00030 00031 /** Max number of messages grouped in a container */ 00032 #define MAX_MPF_MESSAGE_COUNT 5 00033 00034 /** Enumeration of MPF message types */ 00035 typedef enum { 00036 MPF_MESSAGE_TYPE_REQUEST, /**< request message */ 00037 MPF_MESSAGE_TYPE_RESPONSE, /**< response message */ 00038 MPF_MESSAGE_TYPE_EVENT /**< event message */ 00039 } mpf_message_type_e; 00040 00041 /** Enumeration of MPF status codes */ 00042 typedef enum { 00043 MPF_STATUS_CODE_SUCCESS, /**< indicates success */ 00044 MPF_STATUS_CODE_FAILURE /**< indicates failure */ 00045 } mpf_status_code_e; 00046 00047 00048 /** Enumeration of MPF commands */ 00049 typedef enum { 00050 MPF_ADD_TERMINATION, /**< add termination to context */ 00051 MPF_MODIFY_TERMINATION, /**< modify termination properties */ 00052 MPF_SUBTRACT_TERMINATION,/**< subtract termination from context */ 00053 MPF_ADD_ASSOCIATION, /**< add association between terminations */ 00054 MPF_REMOVE_ASSOCIATION, /**< remove association between terminations */ 00055 MPF_RESET_ASSOCIATIONS, /**< reset associations among terminations (also destroy topology) */ 00056 MPF_APPLY_TOPOLOGY, /**< apply topology based on assigned associations */ 00057 MPF_DESTROY_TOPOLOGY /**< destroy applied topology */ 00058 } mpf_command_type_e; 00059 00060 /** MPF message declaration */ 00061 typedef struct mpf_message_t mpf_message_t; 00062 /** MPF message container declaration */ 00063 typedef struct mpf_message_container_t mpf_message_container_t; 00064 00065 /** MPF message definition */ 00066 struct mpf_message_t { 00067 /** Message type (request/response/event) */ 00068 mpf_message_type_e message_type; 00069 /** Command identifier (add, modify, subtract, ...) */ 00070 mpf_command_type_e command_id; 00071 /** Status code used in responses */ 00072 mpf_status_code_e status_code; 00073 00074 /** Context */ 00075 mpf_context_t *context; 00076 /** Termination */ 00077 mpf_termination_t *termination; 00078 /** Associated termination */ 00079 mpf_termination_t *assoc_termination; 00080 /** Termination type dependent descriptor */ 00081 void *descriptor; 00082 }; 00083 00084 /** MPF message container definition */ 00085 struct mpf_message_container_t { 00086 /** Number of actual messages */ 00087 apr_size_t count; 00088 /** Array of messages */ 00089 mpf_message_t messages[MAX_MPF_MESSAGE_COUNT]; 00090 }; 00091 00092 APT_END_EXTERN_C 00093 00094 #endif /* MPF_MESSAGE_H */