BltMedia.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 |
00003 |   BlueTune - Media Definitions
00004 |
00005 |   (c) 2002-2006 Gilles Boccon-Gibod
00006 |   Author: Gilles Boccon-Gibod (bok@bok.net)
00007 |
00008  ****************************************************************/
00013 #ifndef _BLT_MEDIA_H_
00014 #define _BLT_MEDIA_H_
00015 
00016 /*----------------------------------------------------------------------
00017 |   includes
00018 +---------------------------------------------------------------------*/
00019 #include "Atomix.h"
00020 #include "BltDefs.h"
00021 #include "BltTypes.h"
00022 #include "BltErrors.h"
00023 
00024 /*----------------------------------------------------------------------
00025 |   types
00026 +---------------------------------------------------------------------*/
00027 typedef unsigned int BLT_MediaTypeId;
00028 
00029 typedef struct {
00030     BLT_MediaTypeId id;
00031     BLT_Flags       flags;
00032     BLT_Size        extension_size;
00033     /* extended types are subclassed, and contain 'extension_size' */
00034     /* bytes following this                                        */
00035 } BLT_MediaType;
00036 
00037 /*----------------------------------------------------------------------
00038 |   constants
00039 +---------------------------------------------------------------------*/
00040 #define BLT_MEDIA_TYPE_ID_NONE             0
00041 #define BLT_MEDIA_TYPE_ID_UNKNOWN          1
00042 #define BLT_MEDIA_TYPE_ID_AUDIO_PCM        2
00043 
00044 /*----------------------------------------------------------------------
00045 |   error codes
00046 +---------------------------------------------------------------------*/
00047 #define BLT_ERROR_INVALID_MEDIA_FORMAT           (BLT_ERROR_BASE_MEDIA - 0)
00048 #define BLT_ERROR_UNSUPPORTED_CODEC              (BLT_ERROR_BASE_MEDIA - 1)
00049 #define BLT_ERROR_UNSUPPORTED_FORMAT             (BLT_ERROR_BASE_MEDIA - 2)
00050 
00051 #if defined(__cplusplus)
00052 extern "C" {
00053 #endif
00054 
00055 /*----------------------------------------------------------------------
00056 |   shared data
00057 +---------------------------------------------------------------------*/
00058 extern const BLT_MediaType BLT_MediaType_None;
00059 extern const BLT_MediaType BLT_MediaType_Unknown;
00060 
00061 /*----------------------------------------------------------------------
00062 |   prototypes
00063 +---------------------------------------------------------------------*/
00064 BLT_Result BLT_MediaType_Init(BLT_MediaType* type, BLT_MediaTypeId id);
00065 BLT_Result BLT_MediaType_Free(BLT_MediaType* type);
00066 BLT_Result BLT_MediaType_Clone(const BLT_MediaType* from, BLT_MediaType** to);
00067 
00068 
00069 #if defined(__cplusplus)
00070 }
00071 #endif
00072 
00073 #endif /* _BLT_MEDIA_H_ */