gmp-entrypoints.h (3287B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* Copyright (c) 2011, The WebRTC project authors. All rights reserved. 3 * Copyright (c) 2014, Mozilla 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: 8 * 9 ** Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 12 ** Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in 14 * the documentation and/or other materials provided with the 15 * distribution. 16 * 17 ** Neither the name of Google nor the names of its contributors may 18 * be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 #ifndef GMP_ENTRYPOINTS_h_ 35 #define GMP_ENTRYPOINTS_h_ 36 37 #include "gmp-errors.h" 38 #include "gmp-platform.h" 39 40 /* C functions exposed by Gecko Media Plugin shared library. */ 41 42 // GMPInit 43 // - Called once after plugin library is loaded, before GMPGetAPI or GMPShutdown 44 // are called. 45 // - Called on main thread. 46 // - 'aPlatformAPI' is a structure containing platform-provided APIs. It is 47 // valid until 48 // 'GMPShutdown' is called. Owned and must be deleted by plugin. 49 typedef GMPErr (*GMPInitFunc)(const GMPPlatformAPI* aPlatformAPI); 50 51 // GMPGetAPI 52 // - Called when host wants to use an API. 53 // - Called on main thread. 54 // - 'aAPIName' is a string indicating the API being requested. This should 55 // match one of the GMP_API_* macros. Subsequent iterations of the GMP_APIs 56 // may change the value of the GMP_API_* macros when ABI changes occur. So 57 // make sure you compare aAPIName against the corresponding GMP_API_* macro! 58 // - 'aHostAPI' is the host API which is specific to the API being requested 59 // from the plugin. It is valid so long as the API object requested from the 60 // plugin is valid. It is owned by the host, plugin should not attempt to 61 // delete. May be null. 62 // - 'aPluginAPI' is for returning the requested API. Destruction of the 63 // requsted 64 // API object is defined by the API. 65 typedef GMPErr (*GMPGetAPIFunc)(const char* aAPIName, void* aHostAPI, 66 void** aPluginAPI); 67 68 // GMPShutdown 69 // - Called once before exiting process (unloading library). 70 // - Called on main thread. 71 typedef void (*GMPShutdownFunc)(void); 72 73 #endif // GMP_ENTRYPOINTS_h_