diff options
Diffstat (limited to 'xbmc/addons/include')
| -rw-r--r-- | xbmc/addons/include/NOTE | 12 | ||||
| -rw-r--r-- | xbmc/addons/include/kodi_audiodec_dll.h | 60 | ||||
| -rw-r--r-- | xbmc/addons/include/kodi_audiodec_types.h | 101 |
3 files changed, 161 insertions, 12 deletions
diff --git a/xbmc/addons/include/NOTE b/xbmc/addons/include/NOTE deleted file mode 100644 index dbcc329..0000000 --- a/xbmc/addons/include/NOTE +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | NOTE: | ||
| 2 | |||
| 3 | This directory contains independent Headers to build Add-on's | ||
| 4 | without the whole XBMC source tree. The Add-on itself can add | ||
| 5 | this headers to his source tree without dependencies to any | ||
| 6 | XBMC related classes or functions. | ||
| 7 | |||
| 8 | Also this headers are never changed without a API Version | ||
| 9 | change. | ||
| 10 | |||
| 11 | The current PVR API version can be found in xbmc_pvr_types.h: | ||
| 12 | XBMC_PVR_API_VERSION | ||
diff --git a/xbmc/addons/include/kodi_audiodec_dll.h b/xbmc/addons/include/kodi_audiodec_dll.h new file mode 100644 index 0000000..78bc3cc --- /dev/null +++ b/xbmc/addons/include/kodi_audiodec_dll.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2013 Team XBMC | ||
| 3 | * http://xbmc.org | ||
| 4 | * | ||
| 5 | * This Program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 8 | * any later version. | ||
| 9 | * | ||
| 10 | * This Program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with XBMC; see the file COPYING. If not, see | ||
| 17 | * <http://www.gnu.org/licenses/>. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #pragma once | ||
| 22 | |||
| 23 | #include <stdint.h> | ||
| 24 | #include "xbmc_addon_dll.h" | ||
| 25 | #include "kodi_audiodec_types.h" | ||
| 26 | |||
| 27 | extern "C" | ||
| 28 | { | ||
| 29 | //! \copydoc AudioDecoder::Init | ||
| 30 | void* Init(const char* file, unsigned int filecache, int* channels, | ||
| 31 | int* samplerate, int* bitspersample, int64_t* totaltime, | ||
| 32 | int* bitrate, AEDataFormat* format, const AEChannel** channelinfo); | ||
| 33 | |||
| 34 | //! \copydoc AudioDecoder::ReadPCM | ||
| 35 | int ReadPCM(void* context, uint8_t* buffer, int size, int* actualsize); | ||
| 36 | |||
| 37 | //! \copydoc AudioDecoder::Seek | ||
| 38 | int64_t Seek(void* context, int64_t time); | ||
| 39 | |||
| 40 | //! \copydoc AudioDecoder::ReadTag | ||
| 41 | bool ReadTag(const char* file, char* title, | ||
| 42 | char* artist, int* length); | ||
| 43 | |||
| 44 | //! \copydoc AudioDecoder::TrackCount | ||
| 45 | int TrackCount(const char* file); | ||
| 46 | |||
| 47 | //! \copydoc AudioDecoder::DeInit | ||
| 48 | bool DeInit(void* context); | ||
| 49 | |||
| 50 | // function to export the above structure to XBMC | ||
| 51 | void __declspec(dllexport) get_addon(struct AudioDecoder* pScr) | ||
| 52 | { | ||
| 53 | pScr->Init = Init; | ||
| 54 | pScr->ReadPCM = ReadPCM; | ||
| 55 | pScr->Seek = Seek; | ||
| 56 | pScr->ReadTag = ReadTag; | ||
| 57 | pScr->TrackCount = TrackCount; | ||
| 58 | pScr->DeInit = DeInit; | ||
| 59 | }; | ||
| 60 | }; | ||
diff --git a/xbmc/addons/include/kodi_audiodec_types.h b/xbmc/addons/include/kodi_audiodec_types.h new file mode 100644 index 0000000..50c4cc4 --- /dev/null +++ b/xbmc/addons/include/kodi_audiodec_types.h | |||
| @@ -0,0 +1,101 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2013 Team XBMC | ||
| 3 | * http://xbmc.org | ||
| 4 | * | ||
| 5 | * This Program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 8 | * any later version. | ||
| 9 | * | ||
| 10 | * This Program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with XBMC; see the file COPYING. If not, see | ||
| 17 | * <http://www.gnu.org/licenses/>. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #pragma once | ||
| 22 | |||
| 23 | #include <stdint.h> | ||
| 24 | #ifdef BUILD_KODI_ADDON | ||
| 25 | #include "kodi/AEChannelData.h" | ||
| 26 | #else | ||
| 27 | #include "cores/AudioEngine/Utils/AEChannelData.h" | ||
| 28 | #endif | ||
| 29 | |||
| 30 | extern "C" | ||
| 31 | { | ||
| 32 | struct AUDIODEC_INFO | ||
| 33 | { | ||
| 34 | int dummy; | ||
| 35 | }; | ||
| 36 | |||
| 37 | struct AUDIODEC_PROPS | ||
| 38 | { | ||
| 39 | int dummy; | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct AudioDecoder | ||
| 43 | { | ||
| 44 | //! \brief Initialize a decoder | ||
| 45 | //! \param file The file to read | ||
| 46 | //! \param filecache The file cache size | ||
| 47 | //! \param channels Number of channels in output stream | ||
| 48 | //! \param samplerate Samplerate of output stream | ||
| 49 | //! \param bitspersample Bits per sample in output stream | ||
| 50 | //! \param totaltime Total time for stream | ||
| 51 | //! \param bitrate Average bitrate of input stream | ||
| 52 | //! \param format Data format for output stream | ||
| 53 | //! \param info Channel mapping for output stream | ||
| 54 | //! \return Context of output stream | ||
| 55 | //! \sa ICodec::Init | ||
| 56 | void* (__cdecl* Init) (const char* file, unsigned int filecache, | ||
| 57 | int* channels, int* samplerate, | ||
| 58 | int* bitspersample, int64_t* totaltime, | ||
| 59 | int* bitrate, AEDataFormat* format, | ||
| 60 | const AEChannel** info); | ||
| 61 | |||
| 62 | //! \brief Produce some noise | ||
| 63 | //! \param context Context of output stream | ||
| 64 | //! \param buffer Output buffer | ||
| 65 | //! \param size Size of output buffer | ||
| 66 | //! \param actualsize Actual number of bytes written to output buffer | ||
| 67 | //! \return 0 on success, -1 on end of stream, 1 on failure | ||
| 68 | //! \sa ICodec::ReadPCM | ||
| 69 | int (__cdecl* ReadPCM) (void* context, uint8_t* buffer, int size, int* actualsize); | ||
| 70 | |||
| 71 | |||
| 72 | //! \brief Seek in output stream | ||
| 73 | //! \param context Context of output stream | ||
| 74 | //! \param time Time position to seek to in milliseconds | ||
| 75 | //! \return Time position seek ended up on | ||
| 76 | //! \sa ICodec::Seek | ||
| 77 | int64_t (__cdecl* Seek) (void* context, int64_t time); | ||
| 78 | |||
| 79 | //! \brief Read tag of a file | ||
| 80 | //! \param file File to read tag for | ||
| 81 | //! \param title Title of file | ||
| 82 | //! \param artist Artist of file | ||
| 83 | //! \param length Length of file | ||
| 84 | //! \return True on success, false on failure | ||
| 85 | //! \sa IMusicInfoTagLoader::ReadTag | ||
| 86 | bool (__cdecl* ReadTag)(const char* file, char* title, | ||
| 87 | char* artist, int* length); | ||
| 88 | |||
| 89 | //! \brief Get number of tracks in a file | ||
| 90 | //! \param file File to read tag for | ||
| 91 | //! \return Number of tracks in file | ||
| 92 | //! \sa CMusicFileDirectory | ||
| 93 | int (__cdecl* TrackCount) (const char* file); | ||
| 94 | |||
| 95 | //! \brief Close down an output stream | ||
| 96 | //! \param context Context of stream | ||
| 97 | //! \return True on success, false on failure | ||
| 98 | //! \sa ICodec::DeInit | ||
| 99 | bool (__cdecl* DeInit)(void* context); | ||
| 100 | }; | ||
| 101 | } | ||
