1 | /* |
---|

2 | * CompressCodecUtils.c |
---|

3 | * Created by Graham Booker on 8/14/10. |
---|

4 | * This file is part of Perian. |
---|

5 | * |
---|

6 | * This library is free software; you can redistribute it and/or |
---|

7 | * modify it under the terms of the GNU Lesser General Public |
---|

8 | * License as published by the Free Software Foundation; either |
---|

9 | * version 2.1 of the License, or (at your option) any later version. |
---|

10 | * |
---|

11 | * This library is distributed in the hope that it will be useful, |
---|

12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|

13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|

14 | * Lesser General Public License for more details. |
---|

15 | * |
---|

16 | * You should have received a copy of the GNU Lesser General Public |
---|

17 | * License along with FFmpeg; if not, write to the Free Software |
---|

18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
---|

19 | */ |
---|

20 | |
---|

21 | #include "CompressCodecUtils.h" |
---|

22 | #include <QuickTime/QuickTime.h> |
---|

23 | #include "CodecIDs.h" |
---|

24 | |
---|

25 | OSType compressStreamFourCC(OSType original) |
---|

26 | { |
---|

27 | switch (original) { |
---|

28 | case kH264CodecType: |
---|

29 | return kCompressedAVC1; |
---|

30 | case kMPEG4VisualCodecType: |
---|

31 | return kCompressedMP4V; |
---|

32 | case kAudioFormatMPEGLayer3: |
---|

33 | return kCompressedMP3; |
---|

34 | case kAudioFormatMPEGLayer2: |
---|

35 | return kCompressedMP2; |
---|

36 | case kAudioFormatMPEGLayer1: |
---|

37 | return kCompressedMP1; |
---|

38 | case kAudioFormatAC3: |
---|

39 | return kCompressedAC3; |
---|

40 | case kAudioFormatDTS: |
---|

41 | return kCompressedDTS; |
---|

42 | default: |
---|

43 | break; |
---|

44 | } |
---|

45 | |
---|

46 | return 0; |
---|

47 | } |
---|

48 | |
---|

49 | OSType originalStreamFourCC(OSType compress) |
---|

50 | { |
---|

51 | switch (compress) { |
---|

52 | case kCompressedAVC1: |
---|

53 | return kH264CodecType; |
---|

54 | case kCompressedMP4V: |
---|

55 | return kMPEG4VisualCodecType; |
---|

56 | case kCompressedMP1: |
---|

57 | return kAudioFormatMPEGLayer1; |
---|

58 | case kCompressedMP2: |
---|

59 | return kAudioFormatMPEGLayer2; |
---|

60 | case kCompressedMP3: |
---|

61 | return kAudioFormatMPEGLayer3; |
---|

62 | case kCompressedAC3: |
---|

63 | return kAudioFormatAC3; |
---|

64 | case kCompressedDTS: |
---|

65 | return kAudioFormatDTS; |
---|

66 | default: |
---|

67 | break; |
---|

68 | } |
---|

69 | |
---|

70 | return 0; |
---|

71 | } |
---|