| 1 |
/* GStreamer AAC parser |
| 2 |
* Copyright (C) 2008 Nokia Corporation. All rights reserved. |
| 3 |
* |
| 4 |
* Contact: Stefan Kost <[email protected]> |
| 5 |
* |
| 6 |
* This library is free software; you can redistribute it and/or |
| 7 |
* modify it under the terms of the GNU Library General Public |
| 8 |
* License as published by the Free Software Foundation; either |
| 9 |
* version 2 of the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This library is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
* Library General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU Library General Public |
| 17 |
* License along with this library; if not, write to the |
| 18 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 19 |
* Boston, MA 02110-1301, USA. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef __GST_AAC_PARSE_H__ |
| 23 |
#define __GST_AAC_PARSE_H__ |
| 24 |
|
| 25 |
#include <gst/gst.h> |
| 26 |
#include <gst/base/gstbaseparse.h> |
| 27 |
|
| 28 |
G_BEGIN_DECLS |
| 29 |
|
| 30 |
#define GST_TYPE_AAC_PARSE \ |
| 31 |
(gst_aac_parse_get_type()) |
| 32 |
#define GST_AAC_PARSE(obj) \ |
| 33 |
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_AAC_PARSE, GstAacParse)) |
| 34 |
#define GST_AAC_PARSE_CLASS(klass) \ |
| 35 |
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AAC_PARSE, GstAacParseClass)) |
| 36 |
#define GST_IS_AAC_PARSE(obj) \ |
| 37 |
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_AAC_PARSE)) |
| 38 |
#define GST_IS_AAC_PARSE_CLASS(klass) \ |
| 39 |
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AAC_PARSE)) |
| 40 |
|
| 41 |
|
| 42 |
/** |
| 43 |
* GstAacHeaderType: |
| 44 |
* @DSPAAC_HEADER_NOT_PARSED: Header not parsed yet. |
| 45 |
* @DSPAAC_HEADER_UNKNOWN: Unknown (not recognized) header. |
| 46 |
* @DSPAAC_HEADER_ADIF: ADIF header found. |
| 47 |
* @DSPAAC_HEADER_ADTS: ADTS header found. |
| 48 |
* @DSPAAC_HEADER_LOAS: LOAS header found. |
| 49 |
* @DSPAAC_HEADER_NONE: Raw stream, no header. |
| 50 |
* |
| 51 |
* Type header enumeration set in #header_type. |
| 52 |
*/ |
| 53 |
typedef enum { |
| 54 |
DSPAAC_HEADER_NOT_PARSED, |
| 55 |
DSPAAC_HEADER_UNKNOWN, |
| 56 |
DSPAAC_HEADER_ADIF, |
| 57 |
DSPAAC_HEADER_ADTS, |
| 58 |
DSPAAC_HEADER_LOAS, |
| 59 |
DSPAAC_HEADER_NONE |
| 60 |
} GstAacHeaderType; |
| 61 |
|
| 62 |
|
| 63 |
typedef struct _GstAacParse GstAacParse; |
| 64 |
typedef struct _GstAacParseClass GstAacParseClass; |
| 65 |
|
| 66 |
/** |
| 67 |
* GstAacParse: |
| 68 |
* |
| 69 |
* The opaque GstAacParse data structure. |
| 70 |
*/ |
| 71 |
struct _GstAacParse { |
| 72 |
GstBaseParse element; |
| 73 |
|
| 74 |
/* Stream type -related info */ |
| 75 |
gint object_type; |
| 76 |
gint bitrate; |
| 77 |
gint sample_rate; |
| 78 |
gint channels; |
| 79 |
gint mpegversion; |
| 80 |
gint frame_samples; |
| 81 |
|
| 82 |
GstAacHeaderType header_type; |
| 83 |
GstAacHeaderType output_header_type; |
| 84 |
|
| 85 |
gboolean sent_codec_tag; |
| 86 |
|
| 87 |
gint last_parsed_sample_rate; |
| 88 |
gint last_parsed_channels; |
| 89 |
}; |
| 90 |
|
| 91 |
/** |
| 92 |
* GstAacParseClass: |
| 93 |
* @parent_class: Element parent class. |
| 94 |
* |
| 95 |
* The opaque GstAacParseClass data structure. |
| 96 |
*/ |
| 97 |
struct _GstAacParseClass { |
| 98 |
GstBaseParseClass parent_class; |
| 99 |
}; |
| 100 |
|
| 101 |
GType gst_aac_parse_get_type (void); |
| 102 |
|
| 103 |
G_END_DECLS |
| 104 |
|
| 105 |
#endif /* __GST_AAC_PARSE_H__ */ |