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

« back to all changes in this revision

Viewing changes to mpeglib/lib/oggvorbis/ovFramer.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
  frames raw data into Ogg/Vorbis frames.
 
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
#ifndef __OVFRAMER_H
 
15
#define __OVFRAMER_H
 
16
 
 
17
 
 
18
#ifdef HAVE_CONFIG_H
 
19
#include <config.h>
 
20
#endif
 
21
 
 
22
#ifdef OGG_VORBIS
 
23
 
 
24
#include <vorbis/codec.h>
 
25
#include "../frame/framer.h"
 
26
#include "oggFrame.h"
 
27
 
 
28
/**
 
29
 
 
30
   This framer works directly on the raw ogg_packet as output
 
31
   Note: the internal setup makes sure, that we initalize
 
32
   the ogg stream to the first found logical bitstream.
 
33
   (For now this should mean: we found vorbis)
 
34
   When the frame goes into the "HAS" state, you have the ogg
 
35
   packet in the in the dest struct from the constructor.
 
36
*/
 
37
 
 
38
class OVFramer : public Framer {
 
39
 
 
40
  int vorbis_state;
 
41
 
 
42
  ogg_sync_state   oy; /* sync and verify incoming physical bitstream */
 
43
  ogg_stream_state os; /* take physical pages, weld into a logical
 
44
                          stream of packets */
 
45
  ogg_page         og; /* one Ogg bitstream page.  Vorbis packets are inside */
 
46
 
 
47
  char *buffer;        /* sync buffer from ogg */
 
48
 
 
49
  OGGFrame*      dest; /* one raw packet of data for decode */
 
50
 
 
51
 public:
 
52
  // IMPORTANT: because we use this ptr internally the 
 
53
  //            data to op cannot be on the stack!
 
54
  OVFramer(OGGFrame* dest);
 
55
  ~OVFramer();
 
56
 
 
57
 
 
58
 private:
 
59
 
 
60
  int find_frame(RawDataBuffer* input,RawDataBuffer* store);
 
61
  int read_frame(RawDataBuffer* input,RawDataBuffer* store);
 
62
 
 
63
  void unsync(RawDataBuffer* store,int lReset);
 
64
  void printPrivateStates();
 
65
 
 
66
};
 
67
#endif
 
68
 
 
69
#endif