00001 /* 00002 MEDIAACCESSFACADE.hpp - functions for querying media file and channels. 00003 00004 Copyright (C) Lumiera.org 00005 2008, Hermann Vosseler <Ichthyostega@web.de> 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License as 00009 published by the Free Software Foundation; either version 2 of the 00010 License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 00021 */ 00022 00023 00024 #ifndef BACKEND_INTERFACE_MEDIAACCESSFACADE_H 00025 #define BACKEND_INTERFACE_MEDIAACCESSFACADE_H 00026 00027 00028 #include "lib/singleton.hpp" 00029 #include "lib/error.hpp" 00030 00031 00032 00033 namespace backend_interface 00034 { 00035 00036 struct ChanDesc; 00037 00038 /****************************************************************** 00039 * Interface to the backend layer: 00040 * provides functions for querying (opening) a media file, 00041 * detecting the channels or streams found within this file etc. 00042 * Implemention delegating to the actual backend functions. 00043 * 00044 * convention: data passed by pointer is owned by the originator; 00045 * it should be copied if needed byond the control flow 00046 * of the invoked function. 00047 */ 00048 struct MediaAccessFacade 00049 { 00050 typedef void* FileHandle; 00051 typedef void* ChanHandle; 00052 00053 static Singleton<MediaAccessFacade> instance; 00054 00062 virtual FileHandle queryFile (const char* name) throw(lumiera::error::Invalid); 00063 00070 virtual ChanDesc queryChannel (FileHandle, uint chanNo) throw(); 00071 00072 virtual ~MediaAccessFacade () {} 00073 }; 00074 00075 00080 struct ChanDesc 00081 { 00086 const char* chanID; 00087 00094 const char* codecID; 00095 00099 MediaAccessFacade::ChanHandle handle; 00100 00101 ChanDesc (const char* chanName=0, const char* codec=0, 00102 MediaAccessFacade::ChanHandle h=0) 00103 : chanID(chanName), 00104 codecID(codec), 00105 handle(h) 00106 { } 00107 }; 00108 00109 00110 00111 } // namespace backend_interface 00112 #endif
1.5.6