summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/frame/frame.cpp
blob: c6a439694c9210ddc6b7f36b13ce5047f848a281 (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
/*
  base class for frames
  Copyright (C) 2001  Martin Vogt

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Library General Public License as published by
  the Free Software Foundation.

  For more information look at the file COPYRIGHT in this package

 */



#include "frame.h"


Frame::Frame() {
  type=_FRAME_UNK;
}


Frame::~Frame() {
}


const char* Frame::getMajorFrameName(int type) {
  int majorID=type >> 12;
  switch(majorID) {
  case _FRAME_UNK:
    return "_FRAME_UNK";
  case _FRAME_RAW:
    return "_FRAME_RAW";
  case _FRAME_AUDIO:
    return "_FRAME_AUDIO";
  case _FRAME_VIDEO:
    return "_FRAME_VIDEO";
  case _FRAME_PAKET:
    return "_FRAME_PAKET";
  default:
    return "unknown major frameType";
  }
  return "never happens Frame::getMajorFrameName";
}

    

const char* Frame::getFrameName(int type) {
  switch(type) {
    // Raw
  case _FRAME_RAW_BASE:
    return "_FRAME_RAW_BASE";
  case _FRAME_RAW_OGG:
    return "_FRAME_RAW_OGG";


    // Audio
  case _FRAME_AUDIO_BASE:
    return "_FRAME_AUDIO_BASE";
  case _FRAME_AUDIO_PCM:
    return "_FRAME_AUDIO_PCM";
  case _FRAME_AUDIO_FLOAT:
    return "_FRAME_AUDIO_FLOAT";



    // Rest
  default:
    return "cannot find name";
  }
  return "never happens Frame::getFrameName";
}