~ubuntu-branches/ubuntu/trusty/mp3val/trusty-proposed

« back to all changes in this revision

Viewing changes to mpegparse.h

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2006-05-13 17:00:49 UTC
  • Revision ID: james.westby@ubuntu.com-20060513170049-kvvq15cjwci4pjhf
Tags: upstream-0.1.4
ImportĀ upstreamĀ versionĀ 0.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * MP3val - a program for MPEG audio file validation
 
3
 * Copyright (C) 2005-2006 Alexey Kuznetsov (ring0) and Eugen Tikhonov (jetsys)
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 */
 
19
 
 
20
#ifndef __MPEGPARSE_H__
 
21
#define __MPEGPARSE_H__
 
22
 
 
23
#include <iostream>
 
24
 
 
25
struct MPEGINFO {
 
26
//MPEG frames counts
 
27
        int mpeg1layer1;
 
28
        int mpeg1layer2;
 
29
        int mpeg1layer3;
 
30
        int mpeg2layer1;
 
31
        int mpeg2layer2;
 
32
        int mpeg2layer3;
 
33
        int mpeg25layer1;
 
34
        int mpeg25layer2;
 
35
        int mpeg25layer3;
 
36
//Tag counts
 
37
        int id3v1;
 
38
        int id3v2;
 
39
        int apev2;
 
40
 
 
41
//VBR header info
 
42
        bool VBRHeaderPresent;
 
43
        bool IsXingHeader; //otherwise it's Fraunhofer VBRI header
 
44
        bool BytesPresent;
 
45
        int iBytes;
 
46
        bool FramesPresent;
 
47
        int iFrames;
 
48
 
 
49
//Error flags
 
50
        int riff;
 
51
        int unknown_format;
 
52
        int truncated;
 
53
        int mpeg_stream_error;
 
54
        int garbage_at_the_begin;
 
55
        int garbage_at_the_end;
 
56
 
 
57
//Misc data
 
58
        bool LastFrameStereo;
 
59
        int iLastMPEGLayer;
 
60
        int iLastMPEGVersion;
 
61
        int iTotalMPEGBytes;
 
62
        int iErrors;
 
63
        int iDeletedFrames;
 
64
        
 
65
        MPEGINFO() {
 
66
                clear();
 
67
        }
 
68
 
 
69
        void clear() {
 
70
                mpeg1layer1=0;
 
71
                mpeg1layer2=0;
 
72
                mpeg1layer3=0;
 
73
                mpeg2layer1=0;
 
74
                mpeg2layer2=0;
 
75
                mpeg2layer3=0;
 
76
                mpeg25layer1=0;
 
77
                mpeg25layer2=0;
 
78
                mpeg25layer3=0;
 
79
                id3v1=0;
 
80
                id3v2=0;
 
81
                apev2=0;
 
82
                
 
83
                VBRHeaderPresent=false;
 
84
                IsXingHeader=true;
 
85
                BytesPresent=false;
 
86
                iBytes=-1;
 
87
                FramesPresent=false;
 
88
                iFrames=-1;
 
89
 
 
90
                riff=-1;
 
91
                unknown_format=-1;
 
92
                mpeg_stream_error=-1;
 
93
                truncated=-1;
 
94
                garbage_at_the_begin=-1;
 
95
                garbage_at_the_end=-1;
 
96
                
 
97
                LastFrameStereo=false;
 
98
                iLastMPEGLayer=0;
 
99
                iLastMPEGVersion=0;
 
100
                
 
101
                iTotalMPEGBytes=0;
 
102
                iErrors=0;
 
103
                iDeletedFrames=0;
 
104
        }
 
105
};
 
106
 
 
107
int ValidateFile(unsigned char *baseptr,int iFileSize, MPEGINFO *mpginfo,std::ostream *out,char *filename,bool fix,int hFile);
 
108
 
 
109
#endif