summaryrefslogtreecommitdiff
path: root/src/kitutils.c
blob: 8cf72611977feae1fb1cb4e14092d066c5609de9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <SDL.h>

#include "kitchensink/kitutils.h"
#include "kitchensink/kitsource.h"

const char* Kit_GetSDLAudioFormatString(unsigned int type) {
    switch(type) {
        case AUDIO_S8: return "AUDIO_S8";
        case AUDIO_U8: return "AUDIO_U8";
        case AUDIO_S16: return "AUDIO_S16";
        case AUDIO_U16: return "AUDIO_U16";
        case AUDIO_S32: return "AUDIO_S32";
        case AUDIO_F32: return "AUDIO_F32";
        default:
            return NULL;
    }
}

const char* Kit_GetSDLPixelFormatString(unsigned int type) {
    switch(type) {
        case SDL_PIXELFORMAT_UNKNOWN: return "SDL_PIXELFORMAT_UNKNOWN";
        case SDL_PIXELFORMAT_INDEX1LSB: return "SDL_PIXELFORMAT_INDEX1LSB";
        case SDL_PIXELFORMAT_INDEX1MSB: return "SDL_PIXELFORMAT_INDEX1MSB";
        case SDL_PIXELFORMAT_INDEX4LSB: return "SDL_PIXELFORMAT_INDEX4LSB";
        case SDL_PIXELFORMAT_INDEX4MSB: return "SDL_PIXELFORMAT_INDEX4MSB";
        case SDL_PIXELFORMAT_INDEX8: return "SDL_PIXELFORMAT_INDEX8";
        case SDL_PIXELFORMAT_RGB332: return "SDL_PIXELFORMAT_RGB332";
        case SDL_PIXELFORMAT_RGB444: return "SDL_PIXELFORMAT_RGB444";
        case SDL_PIXELFORMAT_RGB555: return "SDL_PIXELFORMAT_RGB555";
        case SDL_PIXELFORMAT_BGR555: return "SDL_PIXELFORMAT_BGR555";
        case SDL_PIXELFORMAT_ARGB4444: return "SDL_PIXELFORMAT_ARGB4444";
        case SDL_PIXELFORMAT_RGBA4444: return "SDL_PIXELFORMAT_RGBA4444";
        case SDL_PIXELFORMAT_ABGR4444: return "SDL_PIXELFORMAT_ABGR4444";
        case SDL_PIXELFORMAT_BGRA4444: return "SDL_PIXELFORMAT_BGRA4444";
        case SDL_PIXELFORMAT_ARGB1555: return "SDL_PIXELFORMAT_ARGB1555";
        case SDL_PIXELFORMAT_RGBA5551: return "SDL_PIXELFORMAT_RGBA5551";
        case SDL_PIXELFORMAT_ABGR1555: return "SDL_PIXELFORMAT_ABGR1555";
        case SDL_PIXELFORMAT_BGRA5551: return "SDL_PIXELFORMAT_BGRA5551";
        case SDL_PIXELFORMAT_RGB565: return "SDL_PIXELFORMAT_RGB565";
        case SDL_PIXELFORMAT_BGR565: return "SDL_PIXELFORMAT_BGR565";
        case SDL_PIXELFORMAT_RGB24: return "SDL_PIXELFORMAT_RGB24";
        case SDL_PIXELFORMAT_BGR24: return "SDL_PIXELFORMAT_BGR24";
        case SDL_PIXELFORMAT_RGB888: return "SDL_PIXELFORMAT_RGB888";
        case SDL_PIXELFORMAT_RGBX8888: return "SDL_PIXELFORMAT_RGBX8888";
        case SDL_PIXELFORMAT_BGR888: return "SDL_PIXELFORMAT_BGR888";
        case SDL_PIXELFORMAT_BGRX8888: return "SDL_PIXELFORMAT_BGRX8888";
        case SDL_PIXELFORMAT_ARGB8888: return "SDL_PIXELFORMAT_ARGB8888";
        case SDL_PIXELFORMAT_RGBA8888: return "SDL_PIXELFORMAT_RGBA8888";
        case SDL_PIXELFORMAT_ABGR8888: return "SDL_PIXELFORMAT_ABGR8888";
        case SDL_PIXELFORMAT_BGRA8888: return "SDL_PIXELFORMAT_BGRA8888";
        case SDL_PIXELFORMAT_ARGB2101010: return "SDL_PIXELFORMAT_ARGB2101010";
        case SDL_PIXELFORMAT_YV12: return "SDL_PIXELFORMAT_YV12";
        case SDL_PIXELFORMAT_IYUV: return "SDL_PIXELFORMAT_IYUV";
        case SDL_PIXELFORMAT_YUY2: return "SDL_PIXELFORMAT_YUY2";
        case SDL_PIXELFORMAT_UYVY: return "SDL_PIXELFORMAT_UYVY";
        case SDL_PIXELFORMAT_YVYU: return "SDL_PIXELFORMAT_YVYU";
        default:
            return NULL;
    }
}

const char* Kit_GetKitStreamTypeString(unsigned int type) {
    switch(type) {
        case KIT_STREAMTYPE_UNKNOWN: return "KIT_STREAMTYPE_UNKNOWN";
        case KIT_STREAMTYPE_VIDEO: return "KIT_STREAMTYPE_VIDEO";
        case KIT_STREAMTYPE_AUDIO: return "KIT_STREAMTYPE_AUDIO";
        case KIT_STREAMTYPE_DATA: return "KIT_STREAMTYPE_DATA";
        case KIT_STREAMTYPE_SUBTITLE: return "KIT_STREAMTYPE_SUBTITLE";
        case KIT_STREAMTYPE_ATTACHMENT: return "KIT_STREAMTYPE_ATTACHMENT";
        default:
            return NULL;
    }
}