1 /* GStreamer base utils library codec-specific utility functions
2 * Copyright (C) 2010 Arun Raghavan <arun.raghavan@collabora.co.uk>
3 * 2010 Collabora Multimedia
4 * 2010 Nokia Corporation
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.
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.
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.
22 #ifndef __GST_PB_UTILS_CODEC_UTILS_H__
23 #define __GST_PB_UTILS_CODEC_UTILS_H__
26 #include <gst/pbutils/pbutils-prelude.h>
33 guint gst_codec_utils_aac_get_sample_rate_from_index (guint sr_idx);
36 gint gst_codec_utils_aac_get_index_from_sample_rate (guint rate);
39 const gchar * gst_codec_utils_aac_get_profile (const guint8 * audio_config, guint len);
42 const gchar * gst_codec_utils_aac_get_level (const guint8 * audio_config, guint len);
45 guint gst_codec_utils_aac_get_sample_rate (const guint8 * audio_config, guint len);
48 guint gst_codec_utils_aac_get_channels (const guint8 * audio_config, guint len);
51 gboolean gst_codec_utils_aac_caps_set_level_and_profile (GstCaps * caps,
52 const guint8 * audio_config,
58 const gchar * gst_codec_utils_h264_get_profile (const guint8 * sps, guint len);
61 const gchar * gst_codec_utils_h264_get_level (const guint8 * sps, guint len);
64 guint8 gst_codec_utils_h264_get_level_idc (const gchar * level);
67 gboolean gst_codec_utils_h264_caps_set_level_and_profile (GstCaps * caps,
72 gboolean gst_codec_utils_h264_get_profile_flags_level (const guint8 * codec_data,
81 const gchar * gst_codec_utils_h265_get_profile (const guint8 * profile_tier_level,
85 const gchar * gst_codec_utils_h265_get_tier (const guint8 * profile_tier_level,
89 const gchar * gst_codec_utils_h265_get_level (const guint8 * profile_tier_level,
93 guint8 gst_codec_utils_h265_get_level_idc (const gchar * level);
96 gboolean gst_codec_utils_h265_caps_set_level_tier_and_profile (GstCaps * caps,
97 const guint8 * profile_tier_level,
102 const gchar * gst_codec_utils_mpeg4video_get_profile (const guint8 * vis_obj_seq, guint len);
105 const gchar * gst_codec_utils_mpeg4video_get_level (const guint8 * vis_obj_seq, guint len);
108 gboolean gst_codec_utils_mpeg4video_caps_set_level_and_profile (GstCaps * caps,
109 const guint8 * vis_obj_seq,
115 gboolean gst_codec_utils_opus_parse_caps (GstCaps * caps,
118 guint8 * channel_mapping_family,
119 guint8 * stream_count,
120 guint8 * coupled_count,
121 guint8 channel_mapping[256]);
124 GstCaps * gst_codec_utils_opus_create_caps (guint32 rate,
126 guint8 channel_mapping_family,
128 guint8 coupled_count,
129 const guint8 * channel_mapping);
132 GstCaps * gst_codec_utils_opus_create_caps_from_header (GstBuffer * header, GstBuffer * comments);
135 GstBuffer * gst_codec_utils_opus_create_header (guint32 rate,
137 guint8 channel_mapping_family,
139 guint8 coupled_count,
140 const guint8 * channel_mapping,
145 gboolean gst_codec_utils_opus_parse_header (GstBuffer * header,
148 guint8 * channel_mapping_family,
149 guint8 * stream_count,
150 guint8 * coupled_count,
151 guint8 channel_mapping[256],
153 gint16 * output_gain);
157 gchar * gst_codec_utils_caps_get_mime_codec (GstCaps * caps);
162 #endif /* __GST_PB_UTILS_CODEC_UTILS_H__ */