~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/splay/mpegAudioFrame.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  converts raw mpeg audio stream data into mpeg I encoded audio frames/packets
 
3
  Copyright (C) 2001  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
 
 
15
#ifndef __MPEGAUDIOFRAME_H
 
16
#define __MPEGAUDIOFRAME_H
 
17
 
 
18
#include "mpegAudioHeader.h"
 
19
#include "../frame/framer.h"
 
20
 
 
21
 
 
22
/*
 
23
  Here we are framing from raw to mpeg audio.
 
24
*/
 
25
 
 
26
 
 
27
 
 
28
 
 
29
class MpegAudioFrame : public Framer {
 
30
 
 
31
  // max size of buffer is:
 
32
  // header:          4
 
33
  // max bitrate:   448
 
34
  // min freq:    22050
 
35
  // padding:         1
 
36
  // ------------------
 
37
  // maxsize:    4+144000*max(bitrate)/min(freq)+1 ca: 2931 byte
 
38
  // then we add a "sentinel" at the end these are 4 byte.
 
39
  // so we should be ok, with a 4KB buffer.
 
40
 
 
41
  // internal, how much data we need to read
 
42
  int framesize;
 
43
 
 
44
  // internall, for header searching
 
45
  int find_frame_state;
 
46
 
 
47
  // internal use for header parsing+validating
 
48
  MpegAudioHeader* mpegAudioHeader;
 
49
 
 
50
 public:
 
51
  MpegAudioFrame();
 
52
  ~MpegAudioFrame();
 
53
 
 
54
 
 
55
 private:
 
56
 
 
57
  int find_frame(RawDataBuffer* input,RawDataBuffer* store);
 
58
  int read_frame(RawDataBuffer* input,RawDataBuffer* store);
 
59
 
 
60
  void unsync(RawDataBuffer* store,int lReset);
 
61
  void printPrivateStates();
 
62
 
 
63
};
 
64
 
 
65
 
 
66
#endif