2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef __GST_FFMPEG_CODECMAP_H__
21 #define __GST_FFMPEG_CODECMAP_H__
23 #include <libavcodec/avcodec.h>
24 #include <libavformat/avformat.h>
26 #include <gst/audio/audio.h>
27 #include <gst/video/video.h>
30 * _codecid_is_image() returns TRUE for image formats
33 gst_ffmpeg_codecid_is_image (enum AVCodecID codec_id);
36 * _codecid_to_caps () gets the GstCaps that belongs to
37 * a certain CodecID for a pad with compressed data.
41 gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
42 AVCodecContext *context,
46 * _codectype_to_caps () gets the GstCaps that belongs to
47 * a certain AVMediaType for a pad with uncompressed data.
51 gst_ffmpeg_codectype_to_audio_caps (AVCodecContext *context,
52 enum AVCodecID codec_id,
56 gst_ffmpeg_codectype_to_video_caps (AVCodecContext *context,
57 enum AVCodecID codec_id,
59 const AVCodec *codec);
62 * caps_to_codecid () transforms a GstCaps that belongs to
63 * a pad for compressed data to (optionally) a filled-in
64 * context and a codecID.
68 gst_ffmpeg_caps_to_codecid (const GstCaps *caps,
69 AVCodecContext *context);
72 * caps_with_codecid () transforms a GstCaps for a known codec
73 * ID into a filled-in context.
77 gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
78 enum AVMediaType codec_type,
80 AVCodecContext *context);
83 * caps_with_codectype () transforms a GstCaps that belongs to
84 * a pad for uncompressed data to a filled-in context.
88 gst_ffmpeg_caps_with_codectype (enum AVMediaType type,
90 AVCodecContext *context);
93 gst_ffmpeg_videoinfo_to_context (GstVideoInfo *info,
94 AVCodecContext *context);
97 gst_ffmpeg_audioinfo_to_context (GstAudioInfo *info,
98 AVCodecContext *context);
100 GstVideoFormat gst_ffmpeg_pixfmt_to_videoformat (enum AVPixelFormat pixfmt);
101 enum AVPixelFormat gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format);
103 GstAudioFormat gst_ffmpeg_smpfmt_to_audioformat (enum AVSampleFormat sample_fmt,
104 GstAudioLayout * layout);
107 * _formatid_to_caps () is meant for muxers/demuxers, it
108 * transforms a name (ffmpeg way of ID'ing these, why don't
109 * they have unique numerical IDs?) to the corresponding
110 * caps belonging to that mux-format
114 gst_ffmpeg_formatid_to_caps (const gchar *format_name);
117 * _formatid_get_codecids () can be used to get the codecIDs
118 * (AV_CODEC_ID_NONE-terminated list) that fit that specific
123 gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
124 enum AVCodecID ** video_codec_list,
125 enum AVCodecID ** audio_codec_list,
126 AVOutputFormat * plugin);
130 gst_ffmpeg_channel_layout_to_gst (guint64 channel_layout, gint channels,
131 GstAudioChannelPosition * pos);
133 #endif /* __GST_FFMPEG_CODECMAP_H__ */