xref: /illumos-gate/usr/src/cmd/audio/include/AudioTypeG72X.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1992-2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _MULTIMEDIA_AUDIOTYPEG72X_H
28 #define	_MULTIMEDIA_AUDIOTYPEG72X_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <AudioTypeConvert.h>
33 #include <audio_encode.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 // This is the class for CCITT G.72X compress/decompress
40 
41 class AudioTypeG72X : public AudioTypeConvert {
42 private:
43 	struct audio_g72x_state 	g72x_state;
44 	Boolean				initialized;
45 
46 protected:
47 
48 public:
49 	AudioTypeG72X();	// Constructor
50 	~AudioTypeG72X();	// Destructor
51 
52 	// Class AudioTypeConvert methods specialized here
53 
54 	// TRUE if conversion ok
55 	virtual Boolean CanConvert(
56 	    AudioHdr h) const;			// type to check against
57 
58 	// Convert buffer to the specified type
59 	// Either the input or output type must be handled by this class
60 
61 	// Convert to new type
62 	virtual AudioError Convert(
63 	    AudioBuffer*& inbuf,		// data buffer to process
64 	    AudioHdr outhdr);			// target header
65 
66 	virtual AudioError Flush(AudioBuffer*& buf);
67 };
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* !_MULTIMEDIA_AUDIOTYPEG72X_H */
74