00001 /* 00002 Copyright (C) 2006 Adam Charrett 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License 00006 as published by the Free Software Foundation; either version 2 00007 of the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00017 00018 deliverymethod.h 00019 00020 Delivery Method management functions. 00021 00022 */ 00023 #ifndef _DELIVERYMETHOD_H 00024 #define _DELIVERYMETHOD_H 00025 #include "ts.h" 00050 typedef struct DeliveryMethodInstance_t 00051 { 00055 char *mrl; 00061 void(*SendPacket)(struct DeliveryMethodInstance_t *this, TSPacket_t *packet); 00068 void(*SendBlock)(struct DeliveryMethodInstance_t *this, void *block, unsigned long blockLen); 00073 void(*DestroyInstance)(struct DeliveryMethodInstance_t *this); 00085 void (*ReserveHeaderSpace)(struct DeliveryMethodInstance_t *this, int packets); 00086 00094 void (*SetHeader)(struct DeliveryMethodInstance_t *this, 00095 TSPacket_t *packets, int count); 00096 00097 } 00098 DeliveryMethodInstance_t; 00099 00109 typedef struct DeliveryMethodHandler_t 00110 { 00111 bool (*CanHandle)(char *mrl); 00112 DeliveryMethodInstance_t* (*CreateInstance)(char *mrl); 00113 }DeliveryMethodHandler_t; 00114 00120 int DeliveryMethodManagerInit(void); 00121 00126 void DeliveryMethodManagerDeInit(void); 00127 00132 void DeliveryMethodManagerRegister(DeliveryMethodHandler_t *handler); 00133 00138 void DeliveryMethodManagerUnRegister(DeliveryMethodHandler_t *handler); 00139 00146 bool DeliveryMethodManagerFind(char *mrl, PIDFilter_t *filter); 00147 00152 void DeliveryMethodManagerFree(PIDFilter_t *filter); 00153 00159 char* DeliveryMethodGetMRL(PIDFilter_t *filter); 00160 00166 DeliveryMethodInstance_t *DeliveryMethodCreate(char *mrl); 00167 00173 void DeliveryMethodDestroy(DeliveryMethodInstance_t *instance); 00174 00183 void DeliveryMethodDestroyAll(); 00184 00193 void DeliveryMethodOutputPacket(PIDFilter_t *pidfilter, void *userarg, TSPacket_t* packet); 00195 #endif