File: p_ac3.h

package info (click to toggle)
ogmtools 1%3A1.5-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,564 kB
  • sloc: cpp: 8,003; ansic: 5,865; sh: 3,167; makefile: 71
file content (62 lines) | stat: -rw-r--r-- 1,940 bytes parent folder | download | duplicates (7)
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
/*
  ogmmerge -- utility for splicing together ogg bitstreams
  from component media subtypes

  p_ac3.h
  class definition for the AC3 output module

  Written by Moritz Bunkus <moritz@bunkus.org>
  Based on Xiph.org's 'oggmerge' found in their CVS repository
  See http://www.xiph.org

  Distributed under the GPL
  see the file COPYING for details
  or visit http://www.gnu.org/copyleft/gpl.html
*/
 
#ifndef __P_AC3_H
#define __P_AC3_H

#include "ogmmerge.h"
#include "ogmstreams.h"
#include "queue.h"
#include "ac3_common.h"

class ac3_packetizer_c: public q_c {
  private:
    int                 bps, eos;
    u_int64_t           bytes_output, packetno;
    unsigned long       samples_per_sec;
    int                 channels;
    int                 bitrate;
    char               *tempbuf;
    audio_sync_t        async;
    range_t             range;
    ogg_int64_t         old_granulepos;
    char               *packet_buffer;
    int                 buffer_size;
    ogg_int64_t         disk_fileno;

  public:
    ac3_packetizer_c(unsigned long nsamples_per_sec, int nchannels,
                     int nbitrate, audio_sync_t *nasync,
                     range_t *nrange, char **ncomments) throw (error_c);
    virtual ~ac3_packetizer_c();
    
    virtual int     process(char *buf, int size, int last_frame);
    virtual stamp_t make_timestamp(ogg_int64_t granulepos);
    virtual void    produce_eos_packet();
    virtual void    produce_header_packets();
    virtual void    reset();
    
    virtual void    set_params(unsigned long nsamples_per_sec, int nchannels,
                               int nbitrate);
  private:
    virtual void    add_to_buffer(char *buf, int size);
    virtual char   *get_ac3_packet(unsigned long *header,
                                   ac3_header_t *ac3header);
    virtual int     ac3_packet_available();
    virtual void    remove_ac3_packet(int pos, int framesize);
};

#endif