2002-11-06 23:53:46 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
2003-06-07 00:41:32 +00:00
|
|
|
* This file:
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
* Copyright (c) 2002-2004 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
2002-11-06 23:53:46 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-04 00:22:16 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2002-11-06 23:53:46 +00:00
|
|
|
*/
|
|
|
|
|
2004-01-12 04:15:46 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2002-11-26 14:50:05 +00:00
|
|
|
#include "config.h"
|
2004-01-12 04:15:46 +00:00
|
|
|
#endif
|
2012-09-10 15:08:00 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2003-10-26 11:30:18 +00:00
|
|
|
#include <gst/gst.h>
|
2008-10-30 12:05:45 +00:00
|
|
|
#include <libavcodec/avcodec.h>
|
2012-12-04 16:56:40 +00:00
|
|
|
#include <libavutil/channel_layout.h>
|
2002-11-06 23:53:46 +00:00
|
|
|
|
2012-09-10 15:53:54 +00:00
|
|
|
#include "gstav.h"
|
|
|
|
#include "gstavcodecmap.h"
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2011-06-20 09:57:29 +00:00
|
|
|
#include <gst/video/video.h>
|
2011-08-19 16:33:11 +00:00
|
|
|
#include <gst/audio/audio.h>
|
2023-02-05 10:15:44 +00:00
|
|
|
#include <gst/audio/gstdsd.h>
|
2011-05-27 08:54:12 +00:00
|
|
|
#include <gst/pbutils/codec-utils.h>
|
|
|
|
|
2008-12-13 07:55:40 +00:00
|
|
|
/* IMPORTANT: Keep this sorted by the ffmpeg channel masks */
|
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
guint64 ff;
|
|
|
|
GstAudioChannelPosition gst;
|
|
|
|
} _ff_to_gst_layout[] = {
|
|
|
|
{
|
2012-12-04 16:56:40 +00:00
|
|
|
AV_CH_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT}, {
|
|
|
|
AV_CH_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}, {
|
|
|
|
AV_CH_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER}, {
|
|
|
|
AV_CH_LOW_FREQUENCY, GST_AUDIO_CHANNEL_POSITION_LFE1}, {
|
|
|
|
AV_CH_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_REAR_LEFT}, {
|
|
|
|
AV_CH_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT}, {
|
|
|
|
AV_CH_FRONT_LEFT_OF_CENTER,
|
|
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER}, {
|
|
|
|
AV_CH_FRONT_RIGHT_OF_CENTER,
|
|
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER}, {
|
|
|
|
AV_CH_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER}, {
|
|
|
|
AV_CH_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT}, {
|
|
|
|
AV_CH_SIDE_RIGHT, GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT}, {
|
|
|
|
AV_CH_TOP_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_CENTER}, {
|
|
|
|
AV_CH_TOP_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT}, {
|
|
|
|
AV_CH_TOP_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER}, {
|
|
|
|
AV_CH_TOP_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT}, {
|
|
|
|
AV_CH_TOP_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT}, {
|
|
|
|
AV_CH_TOP_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER}, {
|
|
|
|
AV_CH_TOP_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT}, {
|
|
|
|
AV_CH_STEREO_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT}, {
|
2024-03-12 11:18:50 +00:00
|
|
|
AV_CH_STEREO_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}, {
|
|
|
|
AV_CH_WIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_WIDE_LEFT}, {
|
|
|
|
AV_CH_WIDE_RIGHT, GST_AUDIO_CHANNEL_POSITION_WIDE_RIGHT},
|
2008-12-13 07:55:40 +00:00
|
|
|
};
|
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
static void
|
|
|
|
gst_ffmpeg_channel_positions_to_layout (const GstAudioChannelPosition *
|
|
|
|
const pos, gint channels, AVChannelLayout * layout)
|
|
|
|
#else
|
2012-12-11 18:07:34 +00:00
|
|
|
static guint64
|
2023-08-15 01:28:00 +00:00
|
|
|
gst_ffmpeg_channel_positions_to_layout (const GstAudioChannelPosition *
|
|
|
|
const pos, gint channels)
|
|
|
|
#endif
|
2012-12-11 18:07:34 +00:00
|
|
|
{
|
|
|
|
gint i, j;
|
|
|
|
guint64 ret = 0;
|
|
|
|
gint channels_found = 0;
|
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
g_assert (layout);
|
|
|
|
|
|
|
|
if (!pos) {
|
|
|
|
memset (layout, 0, sizeof (AVChannelLayout));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (channels == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_MONO) {
|
|
|
|
*layout = (AVChannelLayout) AV_CHANNEL_LAYOUT_MONO;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#else
|
2012-12-11 18:07:34 +00:00
|
|
|
if (!pos)
|
|
|
|
return 0;
|
|
|
|
|
2015-12-24 12:06:13 +00:00
|
|
|
if (channels == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_MONO)
|
|
|
|
return AV_CH_LAYOUT_MONO;
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2015-12-24 12:06:13 +00:00
|
|
|
|
2012-12-11 18:07:34 +00:00
|
|
|
for (i = 0; i < channels; i++) {
|
|
|
|
for (j = 0; j < G_N_ELEMENTS (_ff_to_gst_layout); j++) {
|
|
|
|
if (_ff_to_gst_layout[j].gst == pos[i]) {
|
2012-12-17 12:41:42 +00:00
|
|
|
ret |= _ff_to_gst_layout[j].ff;
|
2012-12-11 18:07:34 +00:00
|
|
|
channels_found++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
if (channels_found != channels && av_channel_layout_check (layout)) {
|
|
|
|
memset (layout, 0, sizeof (AVChannelLayout));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
layout->u.mask = ret;
|
|
|
|
layout->nb_channels = channels_found;
|
|
|
|
layout->order = AV_CHANNEL_ORDER_NATIVE;
|
|
|
|
#else
|
2012-12-11 18:07:34 +00:00
|
|
|
if (channels_found != channels)
|
|
|
|
return 0;
|
|
|
|
return ret;
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-12-11 18:07:34 +00:00
|
|
|
}
|
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
gboolean
|
|
|
|
gst_ffmpeg_channel_layout_to_gst (const AVChannelLayout * channel_layout,
|
|
|
|
gint channels, GstAudioChannelPosition * pos)
|
|
|
|
#else
|
2012-01-10 09:37:50 +00:00
|
|
|
gboolean
|
2012-12-11 17:25:41 +00:00
|
|
|
gst_ffmpeg_channel_layout_to_gst (guint64 channel_layout, gint channels,
|
2012-01-10 09:01:26 +00:00
|
|
|
GstAudioChannelPosition * pos)
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2008-12-13 07:55:40 +00:00
|
|
|
{
|
2012-12-11 17:25:41 +00:00
|
|
|
guint nchannels = 0;
|
2008-12-13 07:55:40 +00:00
|
|
|
gboolean none_layout = FALSE;
|
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
g_assert (channel_layout);
|
|
|
|
|
|
|
|
if (channel_layout->nb_channels == 0 || channels > 64) {
|
|
|
|
#else
|
2021-03-03 08:51:04 +00:00
|
|
|
if (channel_layout == 0 || channels > 64) {
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2008-12-13 07:55:40 +00:00
|
|
|
nchannels = channels;
|
|
|
|
none_layout = TRUE;
|
2012-01-10 09:37:50 +00:00
|
|
|
} else {
|
|
|
|
guint i, j;
|
2008-12-13 07:55:40 +00:00
|
|
|
|
2015-12-24 12:06:13 +00:00
|
|
|
/* Special path for mono, as AV_CH_LAYOUT_MONO is the same
|
|
|
|
* as FRONT_CENTER but we distinguish between the two in
|
|
|
|
* GStreamer
|
|
|
|
*/
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
static const AVChannelLayout mono = AV_CHANNEL_LAYOUT_MONO;
|
|
|
|
if (channels == 1
|
|
|
|
&& (av_channel_layout_compare (channel_layout, &mono) == 0)) {
|
|
|
|
#else
|
2015-12-24 12:06:13 +00:00
|
|
|
if (channels == 1 && channel_layout == AV_CH_LAYOUT_MONO) {
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2015-12-24 12:06:13 +00:00
|
|
|
pos[0] = GST_AUDIO_CHANNEL_POSITION_MONO;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
nchannels = channel_layout->nb_channels;
|
|
|
|
#else
|
2012-01-10 09:37:50 +00:00
|
|
|
for (i = 0; i < 64; i++) {
|
|
|
|
if ((channel_layout & (G_GUINT64_CONSTANT (1) << i)) != 0) {
|
|
|
|
nchannels++;
|
|
|
|
}
|
|
|
|
}
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-01-10 09:37:50 +00:00
|
|
|
|
|
|
|
if (nchannels != channels) {
|
|
|
|
GST_ERROR ("Number of channels is different (%u != %u)", channels,
|
|
|
|
nchannels);
|
|
|
|
nchannels = channels;
|
|
|
|
none_layout = TRUE;
|
|
|
|
} else {
|
2008-12-13 07:55:40 +00:00
|
|
|
|
2012-01-10 09:37:50 +00:00
|
|
|
for (i = 0, j = 0; i < G_N_ELEMENTS (_ff_to_gst_layout); i++) {
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
if (channel_layout->order == AV_CHANNEL_ORDER_NATIVE) {
|
|
|
|
if ((channel_layout->u.mask & _ff_to_gst_layout[i].ff) != 0) {
|
|
|
|
pos[j++] = _ff_to_gst_layout[i].gst;
|
|
|
|
|
|
|
|
if (_ff_to_gst_layout[i].gst == GST_AUDIO_CHANNEL_POSITION_NONE)
|
|
|
|
none_layout = TRUE;
|
|
|
|
}
|
|
|
|
} else if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM) {
|
|
|
|
if (_ff_to_gst_layout[i].ff == (1ULL << channel_layout->u.map[i].id)) {
|
|
|
|
pos[j++] = _ff_to_gst_layout[i].gst;
|
|
|
|
|
|
|
|
if (_ff_to_gst_layout[i].gst == GST_AUDIO_CHANNEL_POSITION_NONE)
|
|
|
|
none_layout = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
2012-01-10 09:37:50 +00:00
|
|
|
if ((channel_layout & _ff_to_gst_layout[i].ff) != 0) {
|
|
|
|
pos[j++] = _ff_to_gst_layout[i].gst;
|
2008-12-13 07:55:40 +00:00
|
|
|
|
2012-01-10 09:37:50 +00:00
|
|
|
if (_ff_to_gst_layout[i].gst == GST_AUDIO_CHANNEL_POSITION_NONE)
|
|
|
|
none_layout = TRUE;
|
|
|
|
}
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-01-10 09:37:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (j != nchannels) {
|
|
|
|
GST_WARNING
|
|
|
|
("Unknown channels in channel layout - assuming NONE layout");
|
2008-12-13 07:55:40 +00:00
|
|
|
none_layout = TRUE;
|
2012-01-10 09:37:50 +00:00
|
|
|
}
|
2008-12-13 07:55:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-05 13:06:33 +00:00
|
|
|
if (!none_layout
|
2012-01-10 09:37:50 +00:00
|
|
|
&& !gst_audio_check_valid_channel_positions (pos, nchannels, FALSE)) {
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
GST_ERROR ("Invalid channel layout %" G_GUINT64_FORMAT
|
|
|
|
" - assuming NONE layout", channel_layout->u.mask);
|
|
|
|
#else
|
2008-12-13 08:01:45 +00:00
|
|
|
GST_ERROR ("Invalid channel layout %" G_GUINT64_FORMAT
|
|
|
|
" - assuming NONE layout", channel_layout);
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2008-12-13 07:55:40 +00:00
|
|
|
none_layout = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (none_layout) {
|
|
|
|
if (nchannels == 1) {
|
2012-01-05 13:06:33 +00:00
|
|
|
pos[0] = GST_AUDIO_CHANNEL_POSITION_MONO;
|
2008-12-13 07:55:40 +00:00
|
|
|
} else if (nchannels == 2) {
|
|
|
|
pos[0] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
|
|
|
|
pos[1] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
|
|
|
} else {
|
2012-01-10 09:37:50 +00:00
|
|
|
guint i;
|
|
|
|
|
2021-03-03 08:51:04 +00:00
|
|
|
for (i = 0; i < nchannels && i < 64; i++)
|
2008-12-13 07:55:40 +00:00
|
|
|
pos[i] = GST_AUDIO_CHANNEL_POSITION_NONE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-10 09:01:26 +00:00
|
|
|
return TRUE;
|
2008-12-13 07:55:40 +00:00
|
|
|
}
|
|
|
|
|
2013-10-02 11:59:04 +00:00
|
|
|
static gboolean
|
|
|
|
_gst_value_list_contains (const GValue * list, const GValue * value)
|
|
|
|
{
|
|
|
|
guint i, n;
|
|
|
|
const GValue *tmp;
|
|
|
|
|
|
|
|
n = gst_value_list_get_size (list);
|
|
|
|
for (i = 0; i < n; i++) {
|
|
|
|
tmp = gst_value_list_get_value (list, i);
|
|
|
|
if (gst_value_compare (value, tmp) == GST_VALUE_EQUAL)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2012-12-17 10:11:12 +00:00
|
|
|
static void
|
|
|
|
gst_ffmpeg_video_set_pix_fmts (GstCaps * caps, const enum AVPixelFormat *fmts)
|
|
|
|
{
|
|
|
|
GValue va = { 0, };
|
|
|
|
GValue v = { 0, };
|
|
|
|
GstVideoFormat format;
|
|
|
|
|
|
|
|
if (!fmts || fmts[0] == -1) {
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_value_init (&va, GST_TYPE_LIST);
|
|
|
|
g_value_init (&v, G_TYPE_STRING);
|
2015-03-10 09:17:45 +00:00
|
|
|
for (i = 0; i <= AV_PIX_FMT_NB; i++) {
|
2012-12-17 10:11:12 +00:00
|
|
|
format = gst_ffmpeg_pixfmt_to_videoformat (i);
|
|
|
|
if (format == GST_VIDEO_FORMAT_UNKNOWN)
|
|
|
|
continue;
|
|
|
|
g_value_set_string (&v, gst_video_format_to_string (format));
|
|
|
|
gst_value_list_append_value (&va, &v);
|
|
|
|
}
|
|
|
|
gst_caps_set_value (caps, "format", &va);
|
|
|
|
g_value_unset (&v);
|
|
|
|
g_value_unset (&va);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Only a single format */
|
|
|
|
g_value_init (&va, GST_TYPE_LIST);
|
|
|
|
g_value_init (&v, G_TYPE_STRING);
|
|
|
|
while (*fmts != -1) {
|
|
|
|
format = gst_ffmpeg_pixfmt_to_videoformat (*fmts);
|
|
|
|
if (format != GST_VIDEO_FORMAT_UNKNOWN) {
|
|
|
|
g_value_set_string (&v, gst_video_format_to_string (format));
|
2013-10-02 10:57:36 +00:00
|
|
|
/* Only append values we don't have yet */
|
2013-10-02 11:59:04 +00:00
|
|
|
if (!_gst_value_list_contains (&va, &v))
|
2013-10-02 10:57:36 +00:00
|
|
|
gst_value_list_append_value (&va, &v);
|
2012-12-17 10:11:12 +00:00
|
|
|
}
|
|
|
|
fmts++;
|
|
|
|
}
|
|
|
|
if (gst_value_list_get_size (&va) == 1) {
|
|
|
|
/* The single value is still in v */
|
|
|
|
gst_caps_set_value (caps, "format", &v);
|
|
|
|
} else if (gst_value_list_get_size (&va) > 1) {
|
|
|
|
gst_caps_set_value (caps, "format", &va);
|
|
|
|
}
|
|
|
|
g_value_unset (&v);
|
|
|
|
g_value_unset (&va);
|
|
|
|
}
|
|
|
|
|
2003-06-07 00:41:32 +00:00
|
|
|
/* this macro makes a caps width fixed or unfixed width/height
|
|
|
|
* properties depending on whether we've got a context.
|
|
|
|
*
|
|
|
|
* See below for why we use this.
|
2004-03-15 00:01:03 +00:00
|
|
|
*
|
|
|
|
* We should actually do this stuff at the end, like in riff-media.c,
|
|
|
|
* but I'm too lazy today. Maybe later.
|
2003-06-07 00:41:32 +00:00
|
|
|
*/
|
2006-09-06 15:15:05 +00:00
|
|
|
static GstCaps *
|
2022-11-01 15:13:23 +00:00
|
|
|
gst_ff_vid_caps_new (AVCodecContext * context, const AVCodec * codec,
|
2014-01-03 15:28:44 +00:00
|
|
|
enum AVCodecID codec_id, gboolean encode, const char *mimetype,
|
2012-12-11 18:48:34 +00:00
|
|
|
const char *fieldname, ...)
|
2006-09-06 15:15:05 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
va_list var_args;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
gint i;
|
2006-09-06 15:15:05 +00:00
|
|
|
|
2009-04-15 20:33:16 +00:00
|
|
|
GST_LOG ("context:%p, codec_id:%d, mimetype:%s", context, codec_id, mimetype);
|
|
|
|
|
2008-10-08 14:20:37 +00:00
|
|
|
/* fixed, non probing context */
|
|
|
|
if (context != NULL && context->width != -1) {
|
2010-10-06 14:43:27 +00:00
|
|
|
gint num, denom;
|
|
|
|
|
2006-09-06 15:15:05 +00:00
|
|
|
caps = gst_caps_new_simple (mimetype,
|
|
|
|
"width", G_TYPE_INT, context->width,
|
2010-10-06 14:43:27 +00:00
|
|
|
"height", G_TYPE_INT, context->height, NULL);
|
|
|
|
|
2020-05-27 14:29:27 +00:00
|
|
|
num = context->framerate.num;
|
|
|
|
denom = context->framerate.den;
|
2010-10-06 14:43:27 +00:00
|
|
|
|
2011-02-08 10:17:53 +00:00
|
|
|
if (!denom) {
|
|
|
|
GST_LOG ("invalid framerate: %d/0, -> %d/1", num, num);
|
|
|
|
denom = 1;
|
|
|
|
}
|
2010-10-06 14:43:27 +00:00
|
|
|
if (gst_util_fraction_compare (num, denom, 1000, 1) > 0) {
|
|
|
|
GST_LOG ("excessive framerate: %d/%d, -> 0/1", num, denom);
|
|
|
|
num = 0;
|
|
|
|
denom = 1;
|
|
|
|
}
|
|
|
|
GST_LOG ("setting framerate: %d/%d", num, denom);
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"framerate", GST_TYPE_FRACTION, num, denom, NULL);
|
2012-07-10 13:47:01 +00:00
|
|
|
} else if (encode) {
|
2008-10-08 14:20:37 +00:00
|
|
|
/* so we are after restricted caps in this case */
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H261:
|
2008-10-08 14:20:37 +00:00
|
|
|
{
|
|
|
|
caps = gst_caps_new_simple (mimetype,
|
|
|
|
"width", G_TYPE_INT, 352,
|
|
|
|
"height", G_TYPE_INT, 288,
|
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
|
|
|
gst_caps_append (caps, gst_caps_new_simple (mimetype,
|
|
|
|
"width", G_TYPE_INT, 176,
|
|
|
|
"height", G_TYPE_INT, 144,
|
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL));
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H263:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
|
|
|
/* 128x96, 176x144, 352x288, 704x576, and 1408x1152. slightly reordered
|
|
|
|
* because we want automatic negotiation to go as close to 320x240 as
|
|
|
|
* possible. */
|
|
|
|
const static gint widths[] = { 352, 704, 176, 1408, 128 };
|
|
|
|
const static gint heights[] = { 288, 576, 144, 1152, 96 };
|
|
|
|
GstCaps *temp;
|
|
|
|
gint n_sizes = G_N_ELEMENTS (widths);
|
2006-09-06 15:15:05 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
caps = gst_caps_new_empty ();
|
|
|
|
for (i = 0; i < n_sizes; i++) {
|
|
|
|
temp = gst_caps_new_simple (mimetype,
|
|
|
|
"width", G_TYPE_INT, widths[i],
|
|
|
|
"height", G_TYPE_INT, heights[i],
|
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
2006-09-06 15:15:05 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
gst_caps_append (caps, temp);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DVVIDEO:
|
2008-05-26 09:19:53 +00:00
|
|
|
{
|
2009-04-15 20:33:16 +00:00
|
|
|
static struct
|
|
|
|
{
|
2012-12-17 10:11:12 +00:00
|
|
|
const gchar *csp;
|
2009-04-15 20:33:16 +00:00
|
|
|
gint width, height;
|
|
|
|
gint par_n, par_d;
|
|
|
|
gint framerate_n, framerate_d;
|
|
|
|
} profiles[] = {
|
|
|
|
{
|
2012-12-17 10:11:12 +00:00
|
|
|
"Y41B", 720, 480, 8, 9, 30000, 1001}, {
|
|
|
|
"Y41B", 720, 480, 32, 27, 30000, 1001}, {
|
|
|
|
"Y42B", 720, 480, 8, 9, 30000, 1001}, {
|
|
|
|
"Y42B", 720, 480, 32, 27, 30000, 1001}, {
|
|
|
|
"I420", 720, 576, 16, 15, 25, 1}, {
|
|
|
|
"I420", 720, 576, 64, 45, 25, 1}, {
|
|
|
|
"Y41B", 720, 576, 16, 15, 25, 1}, {
|
|
|
|
"Y41B", 720, 576, 64, 45, 25, 1}, {
|
|
|
|
"Y42B", 720, 576, 16, 15, 25, 1}, {
|
|
|
|
"Y42B", 720, 576, 64, 45, 25, 1}, {
|
|
|
|
"Y42B", 1280, 1080, 1, 1, 30000, 1001}, {
|
|
|
|
"Y42B", 1280, 1080, 3, 2, 30000, 1001}, {
|
|
|
|
"Y42B", 1440, 1080, 1, 1, 25, 1}, {
|
|
|
|
"Y42B", 1440, 1080, 4, 3, 25, 1}, {
|
|
|
|
"Y42B", 960, 720, 1, 1, 60000, 1001}, {
|
|
|
|
"Y42B", 960, 720, 4, 3, 60000, 1001}, {
|
|
|
|
"Y42B", 960, 720, 1, 1, 50, 1}, {
|
|
|
|
"Y42B", 960, 720, 4, 3, 50, 1},
|
|
|
|
};
|
2008-05-26 09:19:53 +00:00
|
|
|
GstCaps *temp;
|
2009-04-15 20:33:16 +00:00
|
|
|
gint n_sizes = G_N_ELEMENTS (profiles);
|
2008-05-26 09:19:53 +00:00
|
|
|
|
2012-12-17 10:11:12 +00:00
|
|
|
if (strcmp (mimetype, "video/x-raw") == 0) {
|
|
|
|
caps = gst_caps_new_empty ();
|
|
|
|
for (i = 0; i < n_sizes; i++) {
|
|
|
|
temp = gst_caps_new_simple (mimetype,
|
|
|
|
"format", G_TYPE_STRING, profiles[i].csp,
|
|
|
|
"width", G_TYPE_INT, profiles[i].width,
|
|
|
|
"height", G_TYPE_INT, profiles[i].height,
|
|
|
|
"framerate", GST_TYPE_FRACTION, profiles[i].framerate_n,
|
|
|
|
profiles[i].framerate_d, "pixel-aspect-ratio",
|
|
|
|
GST_TYPE_FRACTION, profiles[i].par_n, profiles[i].par_d, NULL);
|
|
|
|
|
|
|
|
gst_caps_append (caps, temp);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
caps = gst_caps_new_empty ();
|
|
|
|
for (i = 0; i < n_sizes; i++) {
|
|
|
|
temp = gst_caps_new_simple (mimetype,
|
|
|
|
"width", G_TYPE_INT, profiles[i].width,
|
|
|
|
"height", G_TYPE_INT, profiles[i].height,
|
|
|
|
"framerate", GST_TYPE_FRACTION, profiles[i].framerate_n,
|
|
|
|
profiles[i].framerate_d, "pixel-aspect-ratio",
|
|
|
|
GST_TYPE_FRACTION, profiles[i].par_n, profiles[i].par_d, NULL);
|
|
|
|
|
|
|
|
gst_caps_append (caps, temp);
|
|
|
|
}
|
2008-10-08 14:20:37 +00:00
|
|
|
}
|
2008-05-26 09:19:53 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DNXHD:
|
2008-10-08 14:20:37 +00:00
|
|
|
{
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
caps = gst_caps_new_simple (mimetype,
|
2008-10-08 14:20:37 +00:00
|
|
|
"width", G_TYPE_INT, 1920,
|
|
|
|
"height", G_TYPE_INT, 1080,
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
2008-10-08 14:20:37 +00:00
|
|
|
gst_caps_append (caps, gst_caps_new_simple (mimetype,
|
|
|
|
"width", G_TYPE_INT, 1280,
|
|
|
|
"height", G_TYPE_INT, 720,
|
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2012-12-11 18:56:24 +00:00
|
|
|
{
|
|
|
|
if (codec && codec->supported_framerates
|
|
|
|
&& codec->supported_framerates[0].num != 0
|
|
|
|
&& codec->supported_framerates[0].den != 0) {
|
|
|
|
GValue va = { 0, };
|
|
|
|
GValue v = { 0, };
|
|
|
|
const AVRational *rates = codec->supported_framerates;
|
|
|
|
|
|
|
|
if (rates[1].num == 0 && rates[1].den == 0) {
|
|
|
|
caps =
|
|
|
|
gst_caps_new_simple (mimetype, "framerate", GST_TYPE_FRACTION,
|
|
|
|
rates[0].num, rates[0].den, NULL);
|
|
|
|
} else {
|
|
|
|
g_value_init (&va, GST_TYPE_LIST);
|
|
|
|
g_value_init (&v, GST_TYPE_FRACTION);
|
|
|
|
|
|
|
|
while (rates->num != 0 && rates->den != 0) {
|
|
|
|
gst_value_set_fraction (&v, rates->num, rates->den);
|
|
|
|
gst_value_list_append_value (&va, &v);
|
|
|
|
rates++;
|
|
|
|
}
|
|
|
|
|
|
|
|
caps = gst_caps_new_simple (mimetype, NULL, NULL, NULL);
|
|
|
|
gst_caps_set_value (caps, "framerate", &va);
|
|
|
|
g_value_unset (&va);
|
|
|
|
g_value_unset (&v);
|
|
|
|
}
|
2012-12-17 10:11:12 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
caps = gst_caps_new_empty_simple (mimetype);
|
2012-12-11 18:56:24 +00:00
|
|
|
}
|
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2012-12-11 18:56:24 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-08 14:20:37 +00:00
|
|
|
/* no fixed caps or special restrictions applied;
|
|
|
|
* default unfixed setting */
|
2009-04-15 20:33:16 +00:00
|
|
|
if (!caps) {
|
|
|
|
GST_DEBUG ("Creating default caps");
|
2012-12-17 10:11:12 +00:00
|
|
|
caps = gst_caps_new_empty_simple (mimetype);
|
2009-04-15 20:33:16 +00:00
|
|
|
}
|
2008-10-08 14:20:37 +00:00
|
|
|
|
2012-12-11 18:56:24 +00:00
|
|
|
va_start (var_args, fieldname);
|
|
|
|
gst_caps_set_simple_valist (caps, fieldname, var_args);
|
|
|
|
va_end (var_args);
|
2006-09-06 15:15:05 +00:00
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
|
2012-12-11 17:25:41 +00:00
|
|
|
static gint
|
|
|
|
get_nbits_set (guint64 n)
|
|
|
|
{
|
|
|
|
gint i, x;
|
|
|
|
|
|
|
|
x = 0;
|
|
|
|
for (i = 0; i < 64; i++) {
|
|
|
|
if ((n & (G_GUINT64_CONSTANT (1) << i)))
|
|
|
|
x++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return x;
|
|
|
|
}
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-12-11 17:25:41 +00:00
|
|
|
|
2012-12-17 10:11:12 +00:00
|
|
|
static void
|
|
|
|
gst_ffmpeg_audio_set_sample_fmts (GstCaps * caps,
|
2018-07-23 13:16:10 +00:00
|
|
|
const enum AVSampleFormat *fmts, gboolean always_interleaved)
|
2012-12-17 10:11:12 +00:00
|
|
|
{
|
|
|
|
GValue va = { 0, };
|
2018-07-23 13:16:10 +00:00
|
|
|
GValue vap = { 0, };
|
2012-12-17 10:11:12 +00:00
|
|
|
GValue v = { 0, };
|
|
|
|
GstAudioFormat format;
|
2018-07-23 13:16:10 +00:00
|
|
|
GstAudioLayout layout;
|
|
|
|
GstCaps *caps_copy = NULL;
|
2012-12-17 10:11:12 +00:00
|
|
|
|
|
|
|
if (!fmts || fmts[0] == -1) {
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_value_init (&va, GST_TYPE_LIST);
|
|
|
|
g_value_init (&v, G_TYPE_STRING);
|
|
|
|
for (i = 0; i <= AV_SAMPLE_FMT_DBL; i++) {
|
2018-07-23 13:16:10 +00:00
|
|
|
format = gst_ffmpeg_smpfmt_to_audioformat (i, NULL);
|
2012-12-17 10:11:12 +00:00
|
|
|
if (format == GST_AUDIO_FORMAT_UNKNOWN)
|
|
|
|
continue;
|
|
|
|
g_value_set_string (&v, gst_audio_format_to_string (format));
|
|
|
|
gst_value_list_append_value (&va, &v);
|
|
|
|
}
|
|
|
|
gst_caps_set_value (caps, "format", &va);
|
2018-07-23 13:16:10 +00:00
|
|
|
if (!always_interleaved) {
|
|
|
|
g_value_init (&vap, GST_TYPE_LIST);
|
|
|
|
g_value_set_string (&v, "interleaved");
|
|
|
|
gst_value_list_append_value (&vap, &v);
|
|
|
|
g_value_set_string (&v, "non-interleaved");
|
|
|
|
gst_value_list_append_value (&vap, &v);
|
|
|
|
gst_caps_set_value (caps, "layout", &vap);
|
|
|
|
g_value_unset (&vap);
|
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "layout", G_TYPE_STRING, "interleaved", NULL);
|
|
|
|
}
|
2012-12-17 10:11:12 +00:00
|
|
|
g_value_unset (&v);
|
|
|
|
g_value_unset (&va);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_init (&va, GST_TYPE_LIST);
|
2018-07-23 13:16:10 +00:00
|
|
|
g_value_init (&vap, GST_TYPE_LIST);
|
2012-12-17 10:11:12 +00:00
|
|
|
g_value_init (&v, G_TYPE_STRING);
|
|
|
|
while (*fmts != -1) {
|
2018-07-23 13:16:10 +00:00
|
|
|
format = gst_ffmpeg_smpfmt_to_audioformat (*fmts, &layout);
|
2012-12-17 10:11:12 +00:00
|
|
|
if (format != GST_AUDIO_FORMAT_UNKNOWN) {
|
|
|
|
g_value_set_string (&v, gst_audio_format_to_string (format));
|
2013-10-02 10:57:36 +00:00
|
|
|
/* Only append values we don't have yet */
|
2018-07-23 13:16:10 +00:00
|
|
|
if (layout == GST_AUDIO_LAYOUT_INTERLEAVED || always_interleaved) {
|
|
|
|
if (!_gst_value_list_contains (&va, &v))
|
|
|
|
gst_value_list_append_value (&va, &v);
|
|
|
|
} else {
|
|
|
|
if (!_gst_value_list_contains (&vap, &v))
|
|
|
|
gst_value_list_append_value (&vap, &v);
|
|
|
|
}
|
2012-12-17 10:11:12 +00:00
|
|
|
}
|
|
|
|
fmts++;
|
|
|
|
}
|
2018-07-23 13:16:10 +00:00
|
|
|
if (gst_value_list_get_size (&va) >= 1 && gst_value_list_get_size (&vap) >= 1) {
|
|
|
|
caps_copy = gst_caps_copy (caps);
|
|
|
|
}
|
2012-12-17 10:11:12 +00:00
|
|
|
if (gst_value_list_get_size (&va) == 1) {
|
2018-07-23 13:16:10 +00:00
|
|
|
gst_caps_set_value (caps, "format", gst_value_list_get_value (&va, 0));
|
|
|
|
gst_caps_set_simple (caps, "layout", G_TYPE_STRING, "interleaved", NULL);
|
2012-12-17 10:11:12 +00:00
|
|
|
} else if (gst_value_list_get_size (&va) > 1) {
|
|
|
|
gst_caps_set_value (caps, "format", &va);
|
2018-07-23 13:16:10 +00:00
|
|
|
gst_caps_set_simple (caps, "layout", G_TYPE_STRING, "interleaved", NULL);
|
|
|
|
}
|
|
|
|
if (gst_value_list_get_size (&vap) == 1) {
|
|
|
|
gst_caps_set_value (caps_copy ? caps_copy : caps, "format",
|
|
|
|
gst_value_list_get_value (&vap, 0));
|
|
|
|
gst_caps_set_simple (caps_copy ? caps_copy : caps, "layout", G_TYPE_STRING,
|
|
|
|
"non-interleaved", NULL);
|
|
|
|
} else if (gst_value_list_get_size (&vap) > 1) {
|
|
|
|
gst_caps_set_value (caps_copy ? caps_copy : caps, "format", &vap);
|
|
|
|
gst_caps_set_simple (caps_copy ? caps_copy : caps, "layout", G_TYPE_STRING,
|
|
|
|
"non-interleaved", NULL);
|
|
|
|
}
|
|
|
|
if (caps_copy) {
|
|
|
|
gst_caps_append (caps, caps_copy);
|
2012-12-17 10:11:12 +00:00
|
|
|
}
|
|
|
|
g_value_unset (&v);
|
|
|
|
g_value_unset (&va);
|
2018-07-23 13:16:10 +00:00
|
|
|
g_value_unset (&vap);
|
2012-12-17 10:11:12 +00:00
|
|
|
}
|
|
|
|
|
2003-06-07 00:41:32 +00:00
|
|
|
/* same for audio - now with channels/sample rate
|
|
|
|
*/
|
2006-09-06 15:15:05 +00:00
|
|
|
static GstCaps *
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (AVCodecContext * context, AVCodec * codec,
|
2014-01-03 15:28:44 +00:00
|
|
|
enum AVCodecID codec_id, gboolean encode, const char *mimetype,
|
2012-12-11 16:54:09 +00:00
|
|
|
const char *fieldname, ...)
|
2006-09-06 15:15:05 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps = NULL;
|
2008-10-08 14:20:37 +00:00
|
|
|
gint i;
|
2006-09-06 15:15:05 +00:00
|
|
|
va_list var_args;
|
|
|
|
|
2008-10-08 14:20:37 +00:00
|
|
|
/* fixed, non-probing context */
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
if (context != NULL && context->ch_layout.nb_channels > 0) {
|
|
|
|
#else
|
2008-10-08 14:20:37 +00:00
|
|
|
if (context != NULL && context->channels != -1) {
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-01-10 09:01:26 +00:00
|
|
|
GstAudioChannelPosition pos[64];
|
2013-11-04 23:20:17 +00:00
|
|
|
guint64 mask;
|
2012-01-05 13:06:33 +00:00
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
caps = gst_caps_new_simple (mimetype,
|
|
|
|
"rate", G_TYPE_INT, context->sample_rate,
|
|
|
|
"channels", G_TYPE_INT, context->ch_layout.nb_channels, NULL);
|
|
|
|
|
|
|
|
static const AVChannelLayout mono = AV_CHANNEL_LAYOUT_MONO;
|
|
|
|
const gboolean needs_mask = (context->ch_layout.nb_channels == 1 &&
|
|
|
|
av_channel_layout_compare (&context->ch_layout, &mono) != 0)
|
|
|
|
|| (context->ch_layout.nb_channels > 1
|
|
|
|
&& gst_ffmpeg_channel_layout_to_gst (&context->ch_layout,
|
|
|
|
context->ch_layout.nb_channels, pos));
|
|
|
|
|
|
|
|
if (needs_mask &&
|
|
|
|
gst_audio_channel_positions_to_mask (pos,
|
|
|
|
context->ch_layout.nb_channels, FALSE, &mask)) {
|
|
|
|
gst_caps_set_simple (caps, "channel-mask", GST_TYPE_BITMASK, mask, NULL);
|
|
|
|
}
|
|
|
|
#else
|
2006-09-06 15:15:05 +00:00
|
|
|
caps = gst_caps_new_simple (mimetype,
|
|
|
|
"rate", G_TYPE_INT, context->sample_rate,
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"channels", G_TYPE_INT, context->channels, NULL);
|
2008-12-13 07:55:40 +00:00
|
|
|
|
2013-11-04 23:20:17 +00:00
|
|
|
if (context->channels > 1 &&
|
|
|
|
gst_ffmpeg_channel_layout_to_gst (context->channel_layout,
|
|
|
|
context->channels, pos) &&
|
|
|
|
gst_audio_channel_positions_to_mask (pos, context->channels, FALSE,
|
|
|
|
&mask)) {
|
|
|
|
gst_caps_set_simple (caps, "channel-mask", GST_TYPE_BITMASK, mask, NULL);
|
2008-12-13 07:55:40 +00:00
|
|
|
}
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-07-10 13:47:01 +00:00
|
|
|
} else if (encode) {
|
2008-10-08 14:20:37 +00:00
|
|
|
gint maxchannels = 2;
|
|
|
|
const gint *rates = NULL;
|
|
|
|
gint n_rates = 0;
|
2008-08-29 09:53:29 +00:00
|
|
|
|
2011-10-10 13:50:09 +00:00
|
|
|
/* so we must be after restricted caps in this case */
|
2008-11-04 18:53:01 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DTS:
|
2008-11-04 18:53:01 +00:00
|
|
|
maxchannels = 6;
|
|
|
|
break;
|
2024-03-12 11:18:50 +00:00
|
|
|
case AV_CODEC_ID_AAC:
|
|
|
|
case AV_CODEC_ID_AAC_LATM:
|
|
|
|
maxchannels = 16;
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MP2:
|
2011-10-10 13:50:09 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] =
|
|
|
|
{ 48000, 44100, 32000, 24000, 22050, 16000 };
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
break;
|
2008-10-08 14:20:37 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_EAC3:
|
|
|
|
case AV_CODEC_ID_AC3:
|
2011-10-10 13:50:09 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] = { 48000, 44100, 32000 };
|
|
|
|
maxchannels = 6;
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_G722:
|
2011-10-10 21:04:48 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] = { 16000 };
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
maxchannels = 1;
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_G726:
|
2011-10-10 21:04:48 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] = { 8000 };
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
2011-10-10 13:50:09 +00:00
|
|
|
maxchannels = 1;
|
|
|
|
break;
|
2011-10-10 21:04:48 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_SWF:
|
2011-10-10 13:50:09 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] = { 11025, 22050, 44100 };
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ROQ_DPCM:
|
2011-10-10 13:50:09 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] = { 22050 };
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AMR_NB:
|
2011-10-10 13:50:09 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] = { 8000 };
|
|
|
|
maxchannels = 1;
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AMR_WB:
|
2011-10-10 13:50:09 +00:00
|
|
|
{
|
|
|
|
const static gint l_rates[] = { 16000 };
|
|
|
|
maxchannels = 1;
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
break;
|
|
|
|
}
|
2023-02-05 10:15:44 +00:00
|
|
|
case AV_CODEC_ID_DSD_LSBF:
|
|
|
|
case AV_CODEC_ID_DSD_MSBF:
|
|
|
|
case AV_CODEC_ID_DSD_LSBF_PLANAR:
|
|
|
|
case AV_CODEC_ID_DSD_MSBF_PLANAR:
|
|
|
|
{
|
|
|
|
const static gint l_rates[] = {
|
|
|
|
GST_DSD_MAKE_DSD_RATE_44x (64),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_48x (64),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_44x (128),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_48x (128),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_44x (256),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_48x (256),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_44x (512),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_48x (512),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_44x (1024),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_48x (1024),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_44x (2048),
|
|
|
|
GST_DSD_MAKE_DSD_RATE_48x (2048),
|
|
|
|
};
|
|
|
|
/* There is no clearly defined maximum number of channels in DSD.
|
|
|
|
* The DSF spec mentions a maximum of 6 channels, while the DSDIFF
|
|
|
|
* spec mentions up to 65535 channels. DSDIFF stores DSD in an
|
|
|
|
* interleaved, DSF in a planar fashion. But there is no reason
|
|
|
|
* why some other format couldn't have more than 6 interleaved
|
|
|
|
* channels for example. */
|
|
|
|
maxchannels = 65535;
|
|
|
|
n_rates = G_N_ELEMENTS (l_rates);
|
|
|
|
rates = l_rates;
|
|
|
|
break;
|
|
|
|
}
|
2011-10-10 13:50:09 +00:00
|
|
|
default:
|
|
|
|
break;
|
2008-11-04 18:53:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* regardless of encode/decode, open up channels if applicable */
|
|
|
|
/* Until decoders/encoders expose the maximum number of channels
|
|
|
|
* they support, we whitelist them here. */
|
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_WMAPRO:
|
|
|
|
case AV_CODEC_ID_TRUEHD:
|
2010-01-06 10:53:23 +00:00
|
|
|
maxchannels = 8;
|
|
|
|
break;
|
2008-11-04 18:53:01 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-09-06 15:15:05 +00:00
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
if (codec && codec->ch_layouts) {
|
|
|
|
const AVChannelLayout *layouts = codec->ch_layouts;
|
|
|
|
#else
|
2012-12-11 17:25:41 +00:00
|
|
|
if (codec && codec->channel_layouts) {
|
|
|
|
const uint64_t *layouts = codec->channel_layouts;
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-12-11 17:25:41 +00:00
|
|
|
GstAudioChannelPosition pos[64];
|
|
|
|
|
|
|
|
caps = gst_caps_new_empty ();
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
// Layout array is terminated with a zeroed layout.
|
|
|
|
AVChannelLayout zero;
|
|
|
|
memset (&zero, 0, sizeof (AVChannelLayout));
|
|
|
|
while (av_channel_layout_compare (layouts, &zero) != 0) {
|
|
|
|
const gint nbits_set = layouts->nb_channels;
|
|
|
|
|
|
|
|
if (gst_ffmpeg_channel_layout_to_gst (layouts, nbits_set, pos)) {
|
|
|
|
#else
|
2012-12-11 17:25:41 +00:00
|
|
|
while (*layouts) {
|
|
|
|
gint nbits_set = get_nbits_set (*layouts);
|
|
|
|
|
|
|
|
if (gst_ffmpeg_channel_layout_to_gst (*layouts, nbits_set, pos)) {
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-12-11 17:25:41 +00:00
|
|
|
guint64 mask;
|
|
|
|
|
|
|
|
if (gst_audio_channel_positions_to_mask (pos, nbits_set, FALSE,
|
|
|
|
&mask)) {
|
2017-08-17 12:28:22 +00:00
|
|
|
GstStructure *s =
|
|
|
|
gst_structure_new (mimetype, "channels", G_TYPE_INT, nbits_set,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* No need to require a channel mask for mono or stereo */
|
|
|
|
if (!(nbits_set == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_MONO)
|
|
|
|
&& !(nbits_set == 2
|
|
|
|
&& pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT
|
|
|
|
&& pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT))
|
|
|
|
gst_structure_set (s, "channel-mask", GST_TYPE_BITMASK, mask,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gst_caps_append_structure (caps, s);
|
2012-12-11 17:25:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
layouts++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (maxchannels == 1)
|
|
|
|
caps = gst_caps_new_simple (mimetype,
|
|
|
|
"channels", G_TYPE_INT, maxchannels, NULL);
|
|
|
|
else
|
|
|
|
caps = gst_caps_new_simple (mimetype,
|
|
|
|
"channels", GST_TYPE_INT_RANGE, 1, maxchannels, NULL);
|
|
|
|
}
|
|
|
|
|
2008-10-08 14:20:37 +00:00
|
|
|
if (n_rates) {
|
|
|
|
GValue list = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&list, GST_TYPE_LIST);
|
|
|
|
for (i = 0; i < n_rates; i++) {
|
|
|
|
GValue v = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&v, G_TYPE_INT);
|
|
|
|
g_value_set_int (&v, rates[i]);
|
|
|
|
gst_value_list_append_value (&list, &v);
|
|
|
|
g_value_unset (&v);
|
|
|
|
}
|
2012-12-11 17:25:41 +00:00
|
|
|
gst_caps_set_value (caps, "rate", &list);
|
2008-10-08 14:20:37 +00:00
|
|
|
g_value_unset (&list);
|
2012-12-11 16:54:09 +00:00
|
|
|
} else if (codec && codec->supported_samplerates
|
|
|
|
&& codec->supported_samplerates[0]) {
|
|
|
|
GValue va = { 0, };
|
|
|
|
GValue v = { 0, };
|
|
|
|
|
|
|
|
if (!codec->supported_samplerates[1]) {
|
|
|
|
gst_caps_set_simple (caps, "rate", G_TYPE_INT,
|
|
|
|
codec->supported_samplerates[0], NULL);
|
|
|
|
} else {
|
|
|
|
const int *rates = codec->supported_samplerates;
|
|
|
|
|
|
|
|
g_value_init (&va, GST_TYPE_LIST);
|
|
|
|
g_value_init (&v, G_TYPE_INT);
|
|
|
|
|
|
|
|
while (*rates) {
|
|
|
|
g_value_set_int (&v, *rates);
|
|
|
|
gst_value_list_append_value (&va, &v);
|
|
|
|
rates++;
|
|
|
|
}
|
|
|
|
gst_caps_set_value (caps, "rate", &va);
|
|
|
|
g_value_unset (&va);
|
|
|
|
g_value_unset (&v);
|
|
|
|
}
|
|
|
|
} else {
|
2009-08-14 15:07:07 +00:00
|
|
|
gst_caps_set_simple (caps, "rate", GST_TYPE_INT_RANGE, 4000, 96000, NULL);
|
2012-12-11 16:54:09 +00:00
|
|
|
}
|
2012-07-10 13:47:01 +00:00
|
|
|
} else {
|
|
|
|
caps = gst_caps_new_empty_simple (mimetype);
|
2006-09-06 15:15:05 +00:00
|
|
|
}
|
|
|
|
|
2012-12-11 17:25:41 +00:00
|
|
|
va_start (var_args, fieldname);
|
|
|
|
gst_caps_set_simple_valist (caps, fieldname, var_args);
|
|
|
|
va_end (var_args);
|
2006-09-06 15:15:05 +00:00
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2017-03-20 16:49:47 +00:00
|
|
|
/* Check if the given codec ID is an image format -- for now this is just
|
|
|
|
* anything whose caps is image/... */
|
|
|
|
gboolean
|
|
|
|
gst_ffmpeg_codecid_is_image (enum AVCodecID codec_id)
|
|
|
|
{
|
|
|
|
switch (codec_id) {
|
|
|
|
case AV_CODEC_ID_MJPEG:
|
|
|
|
case AV_CODEC_ID_LJPEG:
|
|
|
|
case AV_CODEC_ID_GIF:
|
|
|
|
case AV_CODEC_ID_PPM:
|
|
|
|
case AV_CODEC_ID_PBM:
|
|
|
|
case AV_CODEC_ID_PCX:
|
|
|
|
case AV_CODEC_ID_SGI:
|
|
|
|
case AV_CODEC_ID_TARGA:
|
|
|
|
case AV_CODEC_ID_TIFF:
|
|
|
|
case AV_CODEC_ID_SUNRAST:
|
|
|
|
case AV_CODEC_ID_BMP:
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-06-07 00:41:32 +00:00
|
|
|
/* Convert a FFMPEG codec ID and optional AVCodecContext
|
|
|
|
* to a GstCaps. If the context is ommitted, no fixed values
|
|
|
|
* for video/audio size will be included in the GstCaps
|
|
|
|
*
|
|
|
|
* CodecID is primarily meant for compressed data GstCaps!
|
2004-03-15 00:01:03 +00:00
|
|
|
*
|
|
|
|
* encode is a special parameter. gstffmpegdec will say
|
|
|
|
* FALSE, gstffmpegenc will say TRUE. The output caps
|
|
|
|
* depends on this, in such a way that it will be very
|
|
|
|
* specific, defined, fixed and correct caps for encoders,
|
|
|
|
* yet very wide, "forgiving" caps for decoders. Example
|
|
|
|
* for mp3: decode: audio/mpeg,mpegversion=1,layer=[1-3]
|
|
|
|
* but encode: audio/mpeg,mpegversion=1,layer=3,bitrate=x,
|
|
|
|
* rate=x,channels=x.
|
2003-06-07 00:41:32 +00:00
|
|
|
*/
|
|
|
|
|
2002-11-06 23:53:46 +00:00
|
|
|
GstCaps *
|
2014-01-03 15:28:44 +00:00
|
|
|
gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
|
2004-03-29 16:39:18 +00:00
|
|
|
AVCodecContext * context, gboolean encode)
|
2002-11-06 23:53:46 +00:00
|
|
|
{
|
2003-06-07 00:41:32 +00:00
|
|
|
GstCaps *caps = NULL;
|
2004-03-15 00:01:03 +00:00
|
|
|
gboolean buildcaps = FALSE;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2009-04-15 20:33:16 +00:00
|
|
|
GST_LOG ("codec_id:%d, context:%p, encode:%d", codec_id, context, encode);
|
|
|
|
|
2002-11-25 21:37:26 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MPEG1VIDEO:
|
2007-12-17 12:43:06 +00:00
|
|
|
/* FIXME: bitrate */
|
2012-12-11 18:48:34 +00:00
|
|
|
caps = gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/mpeg",
|
2007-12-17 12:43:06 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 1,
|
|
|
|
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MPEG2VIDEO:
|
2004-03-15 00:01:03 +00:00
|
|
|
if (encode) {
|
|
|
|
/* FIXME: bitrate */
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/mpeg",
|
|
|
|
"mpegversion", G_TYPE_INT, 2, "systemstream", G_TYPE_BOOLEAN, FALSE,
|
|
|
|
NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
} else {
|
|
|
|
/* decode both MPEG-1 and MPEG-2; width/height/fps are all in
|
|
|
|
* the MPEG video stream headers, so may be omitted from caps. */
|
|
|
|
caps = gst_caps_new_simple ("video/mpeg",
|
2004-03-29 16:39:18 +00:00
|
|
|
"mpegversion", GST_TYPE_INT_RANGE, 1, 2,
|
|
|
|
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H263:
|
2006-11-16 07:28:28 +00:00
|
|
|
if (encode) {
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-h263", "variant", G_TYPE_STRING, "itu", "h263version",
|
|
|
|
G_TYPE_STRING, "h263", NULL);
|
2006-11-16 07:28:28 +00:00
|
|
|
} else {
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
/* don't pass codec_id, we can decode other variants with the H263
|
|
|
|
* decoder that don't have specific size requirements
|
|
|
|
*/
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2013-05-06 22:56:22 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, AV_CODEC_ID_NONE, encode,
|
2012-12-11 18:48:34 +00:00
|
|
|
"video/x-h263", "variant", G_TYPE_STRING, "itu", NULL);
|
2006-11-16 07:28:28 +00:00
|
|
|
}
|
2006-05-16 20:03:00 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H263P:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-h263",
|
|
|
|
"variant", G_TYPE_STRING, "itu", "h263version", G_TYPE_STRING,
|
|
|
|
"h263p", NULL);
|
2009-03-06 02:35:46 +00:00
|
|
|
if (encode && context) {
|
|
|
|
|
|
|
|
gst_caps_set_simple (caps,
|
2018-04-30 19:54:44 +00:00
|
|
|
"annex-f", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_4MV,
|
|
|
|
"annex-j", G_TYPE_BOOLEAN,
|
|
|
|
context->flags & AV_CODEC_FLAG_LOOP_FILTER,
|
|
|
|
"annex-i", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
|
|
|
|
"annex-t", G_TYPE_BOOLEAN, context->flags & AV_CODEC_FLAG_AC_PRED,
|
2009-03-06 02:35:46 +00:00
|
|
|
NULL);
|
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H263I:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-intel-h263", "variant", G_TYPE_STRING, "intel", NULL);
|
2005-01-19 12:41:34 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H261:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-h261",
|
|
|
|
NULL);
|
2004-12-16 18:14:19 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RV10:
|
|
|
|
case AV_CODEC_ID_RV20:
|
|
|
|
case AV_CODEC_ID_RV30:
|
|
|
|
case AV_CODEC_ID_RV40:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
|
|
|
gint version;
|
2006-05-07 01:18:46 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RV40:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
version = 4;
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RV30:
|
2007-10-01 17:27:42 +00:00
|
|
|
version = 3;
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RV20:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
version = 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
version = 1;
|
|
|
|
break;
|
|
|
|
}
|
2004-03-15 00:01:03 +00:00
|
|
|
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
2013-06-25 12:03:07 +00:00
|
|
|
"video/x-pn-realvideo", "rmversion", G_TYPE_INT, version, NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
if (context) {
|
2007-10-01 17:27:42 +00:00
|
|
|
if (context->extradata_size >= 8) {
|
|
|
|
gst_caps_set_simple (caps,
|
ext/ffmpeg/: gst-indent cleanup.
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (gst_ffmpeg_avcodec_open),
(gst_ffmpeg_avcodec_close), (gst_ffmpeg_av_find_stream_info),
(gst_ffmpeg_log_callback), (plugin_init):
* ext/ffmpeg/gstffmpegcfg.c: (gst_ffmpeg_mb_decision_get_type),
(gst_ffmpeg_flags_get_type), (gst_ffmpeg_cfg_init),
(gst_ffmpeg_cfg_codec_has_pspec),
(gst_ffmpeg_cfg_install_property), (gst_ffmpeg_cfg_set_property),
(gst_ffmpeg_cfg_get_property), (gst_ffmpeg_cfg_set_defaults),
(gst_ffmpeg_cfg_fill_context), (gst_ffmpeg_cfg_finalize):
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_save_incoming_values),
(gst_ffmpegdec_get_best_values), (gst_ffmpegdec_video_frame):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init),
(gst_ffmpegdemux_src_query):
* ext/ffmpeg/gstffmpegenc.c: (ffmpegenc_setup_working_buf),
(gst_ffmpegenc_chain_video), (gst_ffmpegenc_flush_buffers):
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_read),
(gst_ffmpegdata_write), (gst_ffmpegdata_seek),
(gst_ffmpegdata_close):
gst-indent cleanup.
2007-11-03 16:14:53 +00:00
|
|
|
"subformat", G_TYPE_INT, GST_READ_UINT32_BE (context->extradata),
|
|
|
|
NULL);
|
|
|
|
}
|
2005-09-30 09:29:22 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MP1:
|
2009-01-24 16:59:11 +00:00
|
|
|
/* FIXME: bitrate */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps = gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/mpeg",
|
2009-01-24 16:59:11 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 1, NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MP2:
|
2007-12-17 12:43:06 +00:00
|
|
|
/* FIXME: bitrate */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps = gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/mpeg",
|
2007-12-17 12:43:06 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 2, NULL);
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MP3:
|
2004-03-15 00:01:03 +00:00
|
|
|
if (encode) {
|
|
|
|
/* FIXME: bitrate */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/mpeg",
|
2004-03-29 16:39:18 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
} else {
|
|
|
|
/* Decodes MPEG-1 layer 1/2/3. Samplerate, channels et al are
|
|
|
|
* in the MPEG audio header, so may be omitted from caps. */
|
|
|
|
caps = gst_caps_new_simple ("audio/mpeg",
|
2004-03-29 16:39:18 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 1,
|
|
|
|
"layer", GST_TYPE_INT_RANGE, 1, 3, NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MUSEPACK7:
|
2008-04-19 20:27:25 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
2008-04-19 20:27:25 +00:00
|
|
|
"audio/x-ffmpeg-parsed-musepack", "streamversion", G_TYPE_INT, 7,
|
|
|
|
NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MUSEPACK8:
|
2008-06-13 17:06:55 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
2008-06-13 17:06:55 +00:00
|
|
|
"audio/x-ffmpeg-parsed-musepack", "streamversion", G_TYPE_INT, 8,
|
|
|
|
NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AC3:
|
2007-12-17 12:43:06 +00:00
|
|
|
/* FIXME: bitrate */
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-ac3",
|
|
|
|
NULL);
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_EAC3:
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
/* FIXME: bitrate */
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-eac3",
|
|
|
|
NULL);
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TRUEHD:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"audio/x-true-hd", NULL);
|
2010-01-06 10:53:23 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ATRAC1:
|
2009-03-10 20:14:21 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"audio/x-vnd.sony.atrac1", NULL);
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2007-12-17 12:43:06 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ATRAC3:
|
2010-01-06 10:53:23 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"audio/x-vnd.sony.atrac3", NULL);
|
2010-01-06 10:53:23 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DTS:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-dts",
|
|
|
|
NULL);
|
2006-05-07 01:18:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_APE:
|
2008-04-19 19:43:54 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"audio/x-ffmpeg-parsed-ape", NULL);
|
2008-04-19 19:43:54 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
2008-10-30 12:05:45 +00:00
|
|
|
"depth", G_TYPE_INT, context->bits_per_coded_sample, NULL);
|
2008-04-19 19:43:54 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MLP:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-mlp",
|
|
|
|
NULL);
|
2009-01-24 16:59:11 +00:00
|
|
|
break;
|
2008-12-30 15:59:58 +00:00
|
|
|
|
2018-11-08 15:33:57 +00:00
|
|
|
case AV_CODEC_ID_METASOUND:
|
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"audio/x-voxware", NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_IMC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-imc",
|
|
|
|
NULL);
|
2009-01-24 16:59:11 +00:00
|
|
|
break;
|
2008-12-30 15:59:58 +00:00
|
|
|
|
2004-03-29 16:39:18 +00:00
|
|
|
/* MJPEG is normal JPEG, Motion-JPEG and Quicktime MJPEG-A. MJPEGB
|
|
|
|
* is Quicktime's MJPEG-B. LJPEG is lossless JPEG. I don't know what
|
|
|
|
* sp5x is, but it's apparently something JPEG... We don't separate
|
|
|
|
* between those in GStreamer. Should we (at least between MJPEG,
|
|
|
|
* MJPEG-B and sp5x decoding...)? */
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MJPEG:
|
|
|
|
case AV_CODEC_ID_LJPEG:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/jpeg",
|
2013-10-26 08:09:28 +00:00
|
|
|
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
|
2003-01-07 20:42:56 +00:00
|
|
|
break;
|
2023-09-20 20:43:19 +00:00
|
|
|
|
|
|
|
case AV_CODEC_ID_MXPEG:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-mxpeg",
|
|
|
|
NULL);
|
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2015-10-10 00:22:12 +00:00
|
|
|
case AV_CODEC_ID_JPEG2000:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/x-j2c",
|
|
|
|
NULL);
|
|
|
|
if (!encode) {
|
|
|
|
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
|
|
|
encode, "image/x-jpc", NULL));
|
|
|
|
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
|
|
|
encode, "image/jp2", NULL));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SP5X:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/sp5x",
|
|
|
|
NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MJPEGB:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-mjpeg-b", NULL);
|
2005-02-03 11:12:34 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MPEG4:
|
2004-10-25 11:56:52 +00:00
|
|
|
if (encode && context != NULL) {
|
2004-03-15 00:01:03 +00:00
|
|
|
/* I'm not exactly sure what ffmpeg outputs... ffmpeg itself uses
|
|
|
|
* the AVI fourcc 'DIVX', but 'mp4v' for Quicktime... */
|
2004-10-25 11:56:52 +00:00
|
|
|
switch (context->codec_tag) {
|
2004-04-23 00:49:10 +00:00
|
|
|
case GST_MAKE_FOURCC ('D', 'I', 'V', 'X'):
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-divx", "divxversion", G_TYPE_INT, 5, NULL);
|
2004-04-23 00:49:10 +00:00
|
|
|
break;
|
|
|
|
case GST_MAKE_FOURCC ('m', 'p', '4', 'v'):
|
|
|
|
default:
|
2014-06-06 14:52:28 +00:00
|
|
|
/* FIXME: bitrate. libav doesn't expose the used profile and level */
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/mpeg", "systemstream", G_TYPE_BOOLEAN, FALSE,
|
2004-04-23 00:49:10 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 4, NULL);
|
|
|
|
break;
|
|
|
|
}
|
2004-03-15 00:01:03 +00:00
|
|
|
} else {
|
|
|
|
/* The trick here is to separate xvid, divx, mpeg4, 3ivx et al */
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/mpeg",
|
|
|
|
"mpegversion", G_TYPE_INT, 4, "systemstream", G_TYPE_BOOLEAN, FALSE,
|
|
|
|
NULL);
|
2014-06-06 14:52:28 +00:00
|
|
|
|
2004-10-25 11:56:52 +00:00
|
|
|
if (encode) {
|
2014-06-06 14:52:28 +00:00
|
|
|
GValue arr = { 0, };
|
|
|
|
GValue item = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&arr, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, G_TYPE_STRING);
|
|
|
|
g_value_set_string (&item, "simple");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "advanced-simple");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_unset (&item);
|
|
|
|
|
|
|
|
gst_caps_set_value (caps, "profile", &arr);
|
|
|
|
g_value_unset (&arr);
|
|
|
|
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
|
|
|
encode, "video/x-divx", "divxversion", G_TYPE_INT, 5, NULL));
|
2004-10-25 11:56:52 +00:00
|
|
|
} else {
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
|
|
|
encode, "video/x-divx", "divxversion", GST_TYPE_INT_RANGE, 4,
|
|
|
|
5, NULL));
|
2004-10-25 11:56:52 +00:00
|
|
|
}
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RAWVIDEO:
|
2011-04-19 17:29:57 +00:00
|
|
|
caps =
|
2012-12-12 15:53:34 +00:00
|
|
|
gst_ffmpeg_codectype_to_video_caps (context, codec_id, encode, NULL);
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MSMPEG4V1:
|
|
|
|
case AV_CODEC_ID_MSMPEG4V2:
|
|
|
|
case AV_CODEC_ID_MSMPEG4V3:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
2013-05-06 22:56:22 +00:00
|
|
|
gint version = 41 + codec_id - AV_CODEC_ID_MSMPEG4V1;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
|
|
|
/* encode-FIXME: bitrate */
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-msmpeg", "msmpegversion", G_TYPE_INT, version, NULL);
|
2013-05-06 22:56:22 +00:00
|
|
|
if (!encode && codec_id == AV_CODEC_ID_MSMPEG4V3) {
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
|
|
|
encode, "video/x-divx", "divxversion", G_TYPE_INT, 3, NULL));
|
2005-09-30 09:29:22 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_WMV1:
|
|
|
|
case AV_CODEC_ID_WMV2:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
2013-05-06 22:56:22 +00:00
|
|
|
gint version = (codec_id == AV_CODEC_ID_WMV1) ? 1 : 2;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-wmv",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"wmvversion", G_TYPE_INT, version, NULL);
|
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_FLV1:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-flash-video", "flvversion", G_TYPE_INT, 1, NULL);
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SVQ1:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-svq",
|
2004-03-29 16:39:18 +00:00
|
|
|
"svqversion", G_TYPE_INT, 1, NULL);
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SVQ3:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-svq",
|
2005-06-09 09:39:38 +00:00
|
|
|
"svqversion", G_TYPE_INT, 3, NULL);
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DVAUDIO:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-dv",
|
|
|
|
NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DVVIDEO:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
|
|
|
if (encode && context) {
|
2011-08-22 11:33:31 +00:00
|
|
|
const gchar *format;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
|
|
|
switch (context->pix_fmt) {
|
2015-03-10 09:17:45 +00:00
|
|
|
case AV_PIX_FMT_YUYV422:
|
2011-08-22 11:33:31 +00:00
|
|
|
format = "YUY2";
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2015-03-10 09:17:45 +00:00
|
|
|
case AV_PIX_FMT_YUV420P:
|
2011-08-22 11:33:31 +00:00
|
|
|
format = "I420";
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2015-03-10 09:17:45 +00:00
|
|
|
case AV_PIX_FMT_YUVA420P:
|
2011-08-22 11:33:31 +00:00
|
|
|
format = "A420";
|
2010-10-13 18:48:19 +00:00
|
|
|
break;
|
2015-03-10 09:17:45 +00:00
|
|
|
case AV_PIX_FMT_YUV411P:
|
2011-08-22 11:33:31 +00:00
|
|
|
format = "Y41B";
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2015-03-10 09:17:45 +00:00
|
|
|
case AV_PIX_FMT_YUV422P:
|
2011-08-22 11:33:31 +00:00
|
|
|
format = "Y42B";
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2015-03-10 09:17:45 +00:00
|
|
|
case AV_PIX_FMT_YUV410P:
|
2011-08-22 11:33:31 +00:00
|
|
|
format = "YUV9";
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GST_WARNING
|
2011-08-22 11:33:31 +00:00
|
|
|
("Couldnt' find format for pixfmt %d, defaulting to I420",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
context->pix_fmt);
|
2011-08-22 11:33:31 +00:00
|
|
|
format = "I420";
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-dv",
|
|
|
|
"systemstream", G_TYPE_BOOLEAN, FALSE, "format", G_TYPE_STRING,
|
|
|
|
format, NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
} else {
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-dv",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
|
2006-10-24 09:27:16 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_WMAV1:
|
|
|
|
case AV_CODEC_ID_WMAV2:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
2013-05-06 22:56:22 +00:00
|
|
|
gint version = (codec_id == AV_CODEC_ID_WMAV1) ? 1 : 2;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
if (context) {
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-wma",
|
|
|
|
"wmaversion", G_TYPE_INT, version, "block_align", G_TYPE_INT,
|
2016-09-14 09:20:48 +00:00
|
|
|
context->block_align, "bitrate", G_TYPE_INT,
|
|
|
|
(guint) context->bit_rate, NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
} else {
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-wma",
|
|
|
|
"wmaversion", G_TYPE_INT, version, "block_align",
|
|
|
|
GST_TYPE_INT_RANGE, 0, G_MAXINT, "bitrate", GST_TYPE_INT_RANGE, 0,
|
|
|
|
G_MAXINT, NULL);
|
2005-09-30 09:29:22 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_WMAPRO:
|
2010-01-06 10:53:23 +00:00
|
|
|
{
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-wma",
|
2010-01-06 10:53:23 +00:00
|
|
|
"wmaversion", G_TYPE_INT, 3, NULL);
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:53:01 +00:00
|
|
|
case AV_CODEC_ID_WMALOSSLESS:
|
|
|
|
{
|
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-wma",
|
2016-09-27 00:06:54 +00:00
|
|
|
"wmaversion", G_TYPE_INT, 4, NULL);
|
2013-05-06 22:53:01 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_WMAVOICE:
|
2010-02-18 12:24:39 +00:00
|
|
|
{
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-wms",
|
|
|
|
NULL);
|
2010-02-18 12:24:39 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:35:35 +00:00
|
|
|
case AV_CODEC_ID_XMA1:
|
|
|
|
{
|
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-xma",
|
|
|
|
"xmaversion", G_TYPE_INT, 1, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case AV_CODEC_ID_XMA2:
|
|
|
|
{
|
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-xma",
|
|
|
|
"xmaversion", G_TYPE_INT, 2, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MACE3:
|
|
|
|
case AV_CODEC_ID_MACE6:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
2013-05-06 22:56:22 +00:00
|
|
|
gint version = (codec_id == AV_CODEC_ID_MACE3) ? 3 : 6;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-mace",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"maceversion", G_TYPE_INT, version, NULL);
|
|
|
|
}
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_HUFFYUV:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-huffyuv", NULL);
|
2005-01-25 15:17:44 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
2008-10-30 12:05:45 +00:00
|
|
|
"bpp", G_TYPE_INT, context->bits_per_coded_sample, NULL);
|
2005-01-25 15:17:44 +00:00
|
|
|
}
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2023-03-22 14:48:18 +00:00
|
|
|
case AV_CODEC_ID_FFVHUFF:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-ffvhuff", NULL);
|
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"bpp", G_TYPE_INT, context->bits_per_coded_sample, NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_CYUV:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"video/x-compressed-yuv", NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H264:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-h264",
|
2012-07-25 09:55:21 +00:00
|
|
|
"alignment", G_TYPE_STRING, "au", NULL);
|
2013-08-30 10:48:51 +00:00
|
|
|
if (!encode) {
|
|
|
|
GValue arr = { 0, };
|
|
|
|
GValue item = { 0, };
|
|
|
|
g_value_init (&arr, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, G_TYPE_STRING);
|
|
|
|
g_value_set_string (&item, "avc");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "byte-stream");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_unset (&item);
|
|
|
|
gst_caps_set_value (caps, "stream-format", &arr);
|
|
|
|
g_value_unset (&arr);
|
2020-01-22 17:41:27 +00:00
|
|
|
|
|
|
|
gst_caps_append (caps, gst_ff_vid_caps_new (context, NULL, codec_id,
|
|
|
|
encode, "video/x-h264", "alignment", G_TYPE_STRING, "nal",
|
|
|
|
"stream-format", G_TYPE_STRING, "byte-stream", NULL));
|
|
|
|
|
2020-01-24 11:04:46 +00:00
|
|
|
} else if (context) {
|
2020-01-24 14:14:28 +00:00
|
|
|
/* FIXME: ffmpeg currently assumes AVC if there is extradata and
|
|
|
|
* byte-stream otherwise. See for example the MOV or MPEG-TS code.
|
|
|
|
* ffmpeg does not distinguish the different types of AVC. */
|
2020-01-24 11:04:46 +00:00
|
|
|
if (context->extradata_size > 0) {
|
2020-01-23 08:03:40 +00:00
|
|
|
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "avc",
|
|
|
|
NULL);
|
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING,
|
|
|
|
"byte-stream", NULL);
|
|
|
|
}
|
2013-08-30 10:48:51 +00:00
|
|
|
}
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2014-01-06 12:36:39 +00:00
|
|
|
case AV_CODEC_ID_HEVC:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-h265",
|
|
|
|
"alignment", G_TYPE_STRING, "au", NULL);
|
|
|
|
if (!encode) {
|
|
|
|
GValue arr = { 0, };
|
|
|
|
GValue item = { 0, };
|
|
|
|
g_value_init (&arr, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, G_TYPE_STRING);
|
|
|
|
g_value_set_string (&item, "hvc1");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "hev1");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "byte-stream");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_unset (&item);
|
|
|
|
gst_caps_set_value (caps, "stream-format", &arr);
|
|
|
|
g_value_unset (&arr);
|
2020-01-24 11:04:46 +00:00
|
|
|
} else if (context) {
|
2020-01-24 14:14:28 +00:00
|
|
|
/* FIXME: ffmpeg currently assumes HVC1 if there is extradata and
|
|
|
|
* byte-stream otherwise. See for example the MOV or MPEG-TS code.
|
|
|
|
* ffmpeg does not distinguish the different types: HVC1/HEV1/etc. */
|
2020-01-24 11:04:46 +00:00
|
|
|
if (context->extradata_size > 0) {
|
2020-01-23 08:03:40 +00:00
|
|
|
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "hvc1",
|
|
|
|
NULL);
|
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING,
|
|
|
|
"byte-stream", NULL);
|
|
|
|
}
|
2014-01-06 12:36:39 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_INDEO5:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-indeo",
|
2010-02-18 12:27:15 +00:00
|
|
|
"indeoversion", G_TYPE_INT, 5, NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_INDEO4:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-indeo",
|
2012-02-22 11:14:21 +00:00
|
|
|
"indeoversion", G_TYPE_INT, 4, NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_INDEO3:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-indeo",
|
2004-03-29 16:39:18 +00:00
|
|
|
"indeoversion", G_TYPE_INT, 3, NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_INDEO2:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-indeo",
|
2005-04-21 19:01:36 +00:00
|
|
|
"indeoversion", G_TYPE_INT, 2, NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_FLASHSV:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"video/x-flash-screen", NULL);
|
2006-09-23 12:00:15 +00:00
|
|
|
break;
|
|
|
|
|
2016-12-04 21:39:00 +00:00
|
|
|
case AV_CODEC_ID_FLASHSV2:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-flash-screen2", NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VP3:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-vp3",
|
|
|
|
NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VP5:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-vp5",
|
|
|
|
NULL);
|
2006-09-20 20:02:16 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VP6:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-vp6",
|
|
|
|
NULL);
|
2006-09-20 20:02:16 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VP6F:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-vp6-flash", NULL);
|
2006-09-20 20:02:16 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VP6A:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-vp6-alpha", NULL);
|
2007-12-17 12:43:06 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VP8:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-vp8",
|
|
|
|
NULL);
|
2011-01-24 16:20:56 +00:00
|
|
|
break;
|
|
|
|
|
2015-06-26 15:30:25 +00:00
|
|
|
case AV_CODEC_ID_VP9:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-vp9",
|
|
|
|
NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_THEORA:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-theora", NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2017-03-14 13:01:41 +00:00
|
|
|
case AV_CODEC_ID_CFHD:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-cineform", NULL);
|
|
|
|
break;
|
|
|
|
|
2020-06-26 10:11:56 +00:00
|
|
|
case AV_CODEC_ID_SPEEDHQ:
|
|
|
|
if (context && context->codec_tag) {
|
|
|
|
gchar *variant = g_strdup_printf ("%" GST_FOURCC_FORMAT,
|
|
|
|
GST_FOURCC_ARGS (context->codec_tag));
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-speedhq", "variant", G_TYPE_STRING, variant, NULL);
|
|
|
|
g_free (variant);
|
|
|
|
} else {
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-speedhq", NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AAC:
|
2011-05-25 08:08:06 +00:00
|
|
|
{
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/mpeg",
|
|
|
|
NULL);
|
2011-05-25 08:08:06 +00:00
|
|
|
|
|
|
|
if (!encode) {
|
|
|
|
GValue arr = { 0, };
|
|
|
|
GValue item = { 0, };
|
|
|
|
|
2011-05-30 10:14:09 +00:00
|
|
|
g_value_init (&arr, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, G_TYPE_INT);
|
|
|
|
g_value_set_int (&item, 2);
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_int (&item, 4);
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_unset (&item);
|
|
|
|
|
|
|
|
gst_caps_set_value (caps, "mpegversion", &arr);
|
|
|
|
g_value_unset (&arr);
|
|
|
|
|
2011-05-25 08:08:06 +00:00
|
|
|
g_value_init (&arr, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, G_TYPE_STRING);
|
|
|
|
g_value_set_string (&item, "raw");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "adts");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "adif");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_unset (&item);
|
|
|
|
|
|
|
|
gst_caps_set_value (caps, "stream-format", &arr);
|
|
|
|
g_value_unset (&arr);
|
|
|
|
} else {
|
2011-05-30 10:14:09 +00:00
|
|
|
gst_caps_set_simple (caps, "mpegversion", G_TYPE_INT, 4,
|
2011-05-27 08:54:12 +00:00
|
|
|
"base-profile", G_TYPE_STRING, "lc", NULL);
|
|
|
|
|
2020-01-24 14:14:28 +00:00
|
|
|
/* FIXME: ffmpeg currently assumes raw if there is extradata and
|
|
|
|
* ADTS otherwise. See for example the FDK AAC encoder. */
|
2020-01-23 08:03:40 +00:00
|
|
|
if (context && context->extradata_size > 0) {
|
|
|
|
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "raw",
|
|
|
|
NULL);
|
2011-05-27 08:54:12 +00:00
|
|
|
gst_codec_utils_aac_caps_set_level_and_profile (caps,
|
|
|
|
context->extradata, context->extradata_size);
|
2020-01-24 11:04:46 +00:00
|
|
|
} else if (context) {
|
2020-01-23 08:03:40 +00:00
|
|
|
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "adts",
|
|
|
|
NULL);
|
|
|
|
}
|
2011-05-25 08:08:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AAC_LATM: /* LATM/LOAS AAC syntax */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps = gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/mpeg",
|
2011-05-25 08:08:06 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 4, "stream-format", G_TYPE_STRING, "loas",
|
|
|
|
NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ASV1:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-asus",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"asusversion", G_TYPE_INT, 1, NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ASV2:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-asus",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"asusversion", G_TYPE_INT, 2, NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_FFV1:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-ffv",
|
2004-03-29 16:39:18 +00:00
|
|
|
"ffvversion", G_TYPE_INT, 1, NULL);
|
2003-06-17 11:44:11 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_4XM:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-4xm",
|
|
|
|
NULL);
|
2003-06-17 11:44:11 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_XAN_WC3:
|
|
|
|
case AV_CODEC_ID_XAN_WC4:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-xan",
|
2013-05-06 22:56:22 +00:00
|
|
|
"wcversion", G_TYPE_INT, 3 - AV_CODEC_ID_XAN_WC3 + codec_id, NULL);
|
2004-10-02 20:26:10 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_CLJR:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"video/x-cirrus-logic-accupak", NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_FRAPS:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-fraps",
|
2012-07-10 13:47:01 +00:00
|
|
|
NULL);
|
2009-03-09 09:05:04 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MDEC:
|
|
|
|
case AV_CODEC_ID_ROQ:
|
|
|
|
case AV_CODEC_ID_INTERPLAY_VIDEO:
|
2004-03-15 00:01:03 +00:00
|
|
|
buildcaps = TRUE;
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VCR1:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-ati-vcr", "vcrversion", G_TYPE_INT, 1, NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RPZA:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-apple-video", NULL);
|
2004-04-09 06:20:31 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_CINEPAK:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-cinepak", NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
break;
|
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
/* WS_VQA belogns here (order) */
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MSRLE:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-rle",
|
2005-12-06 19:57:08 +00:00
|
|
|
"layout", G_TYPE_STRING, "microsoft", NULL);
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
2008-10-30 12:05:45 +00:00
|
|
|
"depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL);
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 1, 64, NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_QTRLE:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-rle",
|
2005-08-15 13:46:16 +00:00
|
|
|
"layout", G_TYPE_STRING, "quicktime", NULL);
|
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
2008-10-30 12:05:45 +00:00
|
|
|
"depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL);
|
2005-08-15 13:46:16 +00:00
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 1, 64, NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MSVIDEO1:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"video/x-msvideocodec", "msvideoversion", G_TYPE_INT, 1, NULL);
|
2004-04-11 21:40:01 +00:00
|
|
|
break;
|
|
|
|
|
2013-08-30 11:58:14 +00:00
|
|
|
case AV_CODEC_ID_MSS1:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-wmv",
|
|
|
|
"wmvversion", G_TYPE_INT, 1, "format", G_TYPE_STRING, "MSS1", NULL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AV_CODEC_ID_MSS2:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-wmv",
|
|
|
|
"wmvversion", G_TYPE_INT, 3, "format", G_TYPE_STRING, "MSS2", NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_WMV3:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-wmv",
|
2013-04-09 20:13:42 +00:00
|
|
|
"wmvversion", G_TYPE_INT, 3, "format", G_TYPE_STRING, "WMV3", NULL);
|
2005-04-21 19:01:36 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VC1:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-wmv",
|
2014-01-03 15:58:26 +00:00
|
|
|
"wmvversion", G_TYPE_INT, 3, NULL);
|
|
|
|
if (!context && !encode) {
|
|
|
|
GValue arr = { 0, };
|
|
|
|
GValue item = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&arr, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, G_TYPE_STRING);
|
|
|
|
g_value_set_string (&item, "WVC1");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "WMVA");
|
|
|
|
gst_value_list_append_and_take_value (&arr, &item);
|
|
|
|
gst_caps_set_value (caps, "format", &arr);
|
|
|
|
g_value_unset (&arr);
|
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "format", G_TYPE_STRING, "WVC1", NULL);
|
|
|
|
}
|
2007-12-17 12:43:06 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_QDM2:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-qdm2",
|
|
|
|
NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2005-04-21 19:01:36 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MSZH:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-mszh",
|
|
|
|
NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ZLIB:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-zlib",
|
|
|
|
NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TRUEMOTION1:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-truemotion", "trueversion", G_TYPE_INT, 1, NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TRUEMOTION2:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-truemotion", "trueversion", G_TYPE_INT, 2, NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ULTI:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-ultimotion", NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TSCC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-camtasia", NULL);
|
2007-01-22 10:26:04 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
2008-10-30 12:05:45 +00:00
|
|
|
"depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL);
|
2007-01-22 10:26:04 +00:00
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 8, 32, NULL);
|
|
|
|
}
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-09-10 19:47:55 +00:00
|
|
|
case AV_CODEC_ID_TSCC2:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-tscc", "tsccversion", G_TYPE_INT, 2, NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_KMVC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-kmvc",
|
|
|
|
NULL);
|
2007-12-17 12:43:06 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_NUV:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-nuv",
|
|
|
|
NULL);
|
2007-12-17 12:43:06 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_GIF:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
2017-06-13 16:50:50 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"image/gst-libav-gif", "parsed", G_TYPE_BOOLEAN, TRUE, NULL);
|
2007-12-17 20:31:35 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PNG:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/png",
|
|
|
|
NULL);
|
2005-12-19 15:47:13 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PPM:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/ppm",
|
|
|
|
NULL);
|
2006-09-30 14:42:16 +00:00
|
|
|
break;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PBM:
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/pbm",
|
|
|
|
NULL);
|
2006-09-30 14:42:16 +00:00
|
|
|
break;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PAM:
|
2010-05-31 16:53:12 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"image/x-portable-anymap", NULL);
|
2010-05-31 16:53:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PGM:
|
2010-05-31 16:53:12 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"image/x-portable-graymap", NULL);
|
2010-05-31 16:53:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCX:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/x-pcx",
|
|
|
|
NULL);
|
2010-05-31 16:53:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SGI:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/x-sgi",
|
|
|
|
NULL);
|
2010-05-31 16:53:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TARGA:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/x-tga",
|
|
|
|
NULL);
|
2010-05-31 16:53:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TIFF:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/tiff",
|
|
|
|
NULL);
|
2010-05-31 16:53:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SUNRAST:
|
2010-05-31 16:53:12 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"image/x-sun-raster", NULL);
|
2010-05-31 16:53:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SMC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-smc",
|
|
|
|
NULL);
|
2006-01-23 15:13:29 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_QDRAW:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-qdrw",
|
|
|
|
NULL);
|
2006-04-19 15:35:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DNXHD:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-dnxhd",
|
2012-07-10 13:47:01 +00:00
|
|
|
NULL);
|
2008-10-30 12:05:45 +00:00
|
|
|
break;
|
2008-06-13 17:06:55 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PRORES:
|
2012-09-12 08:25:24 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-prores", NULL);
|
2016-09-30 15:56:07 +00:00
|
|
|
if (context) {
|
|
|
|
switch (context->codec_tag) {
|
|
|
|
case GST_MAKE_FOURCC ('a', 'p', 'c', 'o'):
|
|
|
|
gst_caps_set_simple (caps, "variant", G_TYPE_STRING, "proxy", NULL);
|
|
|
|
break;
|
|
|
|
case GST_MAKE_FOURCC ('a', 'p', 'c', 's'):
|
|
|
|
gst_caps_set_simple (caps, "variant", G_TYPE_STRING, "lt", NULL);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case GST_MAKE_FOURCC ('a', 'p', 'c', 'n'):
|
|
|
|
gst_caps_set_simple (caps, "variant", G_TYPE_STRING, "standard",
|
|
|
|
NULL);
|
|
|
|
break;
|
|
|
|
case GST_MAKE_FOURCC ('a', 'p', 'c', 'h'):
|
|
|
|
gst_caps_set_simple (caps, "variant", G_TYPE_STRING, "hq", NULL);
|
|
|
|
break;
|
|
|
|
case GST_MAKE_FOURCC ('a', 'p', '4', 'h'):
|
|
|
|
gst_caps_set_simple (caps, "variant", G_TYPE_STRING, "4444", NULL);
|
|
|
|
break;
|
|
|
|
case GST_MAKE_FOURCC ('a', 'p', '4', 'x'):
|
|
|
|
gst_caps_set_simple (caps, "variant", G_TYPE_STRING, "4444xq",
|
|
|
|
NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-09-12 08:25:24 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MIMIC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-mimic",
|
2012-07-10 13:47:01 +00:00
|
|
|
NULL);
|
2008-10-30 12:05:45 +00:00
|
|
|
break;
|
2008-06-13 17:06:55 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_VMNC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-vmnc",
|
|
|
|
NULL);
|
2008-10-30 12:05:45 +00:00
|
|
|
break;
|
2008-06-13 17:06:55 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TRUESPEECH:
|
2008-10-30 12:05:45 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"audio/x-truespeech", NULL);
|
2008-10-30 12:05:45 +00:00
|
|
|
break;
|
2008-09-03 14:06:45 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_QCELP:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/qcelp",
|
|
|
|
NULL);
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AMV:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-amv",
|
|
|
|
NULL);
|
2009-02-18 18:06:52 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AASC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-aasc",
|
|
|
|
NULL);
|
2010-01-23 12:51:24 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_LOCO:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-loco",
|
|
|
|
NULL);
|
2010-01-23 13:41:49 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ZMBV:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-zmbv",
|
|
|
|
NULL);
|
2010-01-23 14:34:28 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_LAGARITH:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-lagarith", NULL);
|
2011-01-24 16:20:56 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_CSCD:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 18:48:34 +00:00
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-camstudio", NULL);
|
2011-01-24 17:29:24 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL);
|
|
|
|
} else {
|
|
|
|
gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 8, 32, NULL);
|
|
|
|
}
|
|
|
|
break;
|
2010-01-23 14:34:28 +00:00
|
|
|
|
2014-04-06 07:02:46 +00:00
|
|
|
case AV_CODEC_ID_AIC:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-apple-intermediate-codec", NULL);
|
|
|
|
break;
|
|
|
|
|
2014-09-12 07:44:16 +00:00
|
|
|
case AV_CODEC_ID_CAVS:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"video/x-cavs", NULL);
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_WS_VQA:
|
|
|
|
case AV_CODEC_ID_IDCIN:
|
|
|
|
case AV_CODEC_ID_8BPS:
|
|
|
|
case AV_CODEC_ID_FLIC:
|
|
|
|
case AV_CODEC_ID_VMDVIDEO:
|
|
|
|
case AV_CODEC_ID_VMDAUDIO:
|
|
|
|
case AV_CODEC_ID_VIXL:
|
|
|
|
case AV_CODEC_ID_QPEG:
|
|
|
|
case AV_CODEC_ID_PGMYUV:
|
|
|
|
case AV_CODEC_ID_WNV1:
|
|
|
|
case AV_CODEC_ID_MP3ADU:
|
|
|
|
case AV_CODEC_ID_MP3ON4:
|
|
|
|
case AV_CODEC_ID_WESTWOOD_SND1:
|
|
|
|
case AV_CODEC_ID_MMVIDEO:
|
|
|
|
case AV_CODEC_ID_AVS:
|
2004-03-15 00:01:03 +00:00
|
|
|
buildcaps = TRUE;
|
|
|
|
break;
|
|
|
|
|
2004-03-29 16:39:18 +00:00
|
|
|
/* weird quasi-codecs for the demuxers only */
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_S16LE:
|
|
|
|
case AV_CODEC_ID_PCM_S16BE:
|
|
|
|
case AV_CODEC_ID_PCM_U16LE:
|
|
|
|
case AV_CODEC_ID_PCM_U16BE:
|
|
|
|
case AV_CODEC_ID_PCM_S8:
|
|
|
|
case AV_CODEC_ID_PCM_U8:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
2011-08-19 16:33:11 +00:00
|
|
|
GstAudioFormat format;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_S16LE:
|
2011-09-06 13:29:26 +00:00
|
|
|
format = GST_AUDIO_FORMAT_S16LE;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_S16BE:
|
2011-09-06 13:29:26 +00:00
|
|
|
format = GST_AUDIO_FORMAT_S16BE;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_U16LE:
|
2011-09-06 13:29:26 +00:00
|
|
|
format = GST_AUDIO_FORMAT_U16LE;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_U16BE:
|
2011-09-06 13:29:26 +00:00
|
|
|
format = GST_AUDIO_FORMAT_U16BE;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_S8:
|
2011-08-19 16:33:11 +00:00
|
|
|
format = GST_AUDIO_FORMAT_S8;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_U8:
|
2011-08-19 16:33:11 +00:00
|
|
|
format = GST_AUDIO_FORMAT_U8;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
2013-12-16 05:17:26 +00:00
|
|
|
format = 0;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
g_assert (0); /* don't worry, we never get here */
|
|
|
|
break;
|
2005-09-30 09:29:22 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-raw",
|
2012-01-09 12:40:05 +00:00
|
|
|
"format", G_TYPE_STRING, gst_audio_format_to_string (format),
|
|
|
|
"layout", G_TYPE_STRING, "interleaved", NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2003-06-17 11:44:11 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_MULAW:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-mulaw",
|
2012-07-10 13:47:01 +00:00
|
|
|
NULL);
|
2003-07-06 20:49:15 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_PCM_ALAW:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-alaw",
|
|
|
|
NULL);
|
2003-07-06 20:49:15 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_G722:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/G722",
|
|
|
|
NULL);
|
2011-01-25 15:34:04 +00:00
|
|
|
if (context)
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"block_align", G_TYPE_INT, context->block_align,
|
2016-09-14 09:20:48 +00:00
|
|
|
"bitrate", G_TYPE_INT, (guint) context->bit_rate, NULL);
|
2011-01-25 15:34:04 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_G726:
|
2009-09-09 11:33:53 +00:00
|
|
|
{
|
|
|
|
/* the G726 decoder can also handle G721 */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-adpcm",
|
2009-09-09 11:33:53 +00:00
|
|
|
"layout", G_TYPE_STRING, "g726", NULL);
|
|
|
|
if (context)
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"block_align", G_TYPE_INT, context->block_align,
|
2016-09-14 09:20:48 +00:00
|
|
|
"bitrate", G_TYPE_INT, (guint) context->bit_rate, NULL);
|
2009-09-09 11:33:53 +00:00
|
|
|
|
|
|
|
if (!encode) {
|
|
|
|
gst_caps_append (caps, gst_caps_new_simple ("audio/x-adpcm",
|
|
|
|
"layout", G_TYPE_STRING, "g721",
|
|
|
|
"channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_QT:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_WAV:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_DK3:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_DK4:
|
2020-12-14 04:33:16 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_OKI:
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_WS:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_SMJPEG:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_AMV:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_ISS:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_EA_EACS:
|
|
|
|
case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
|
|
|
|
case AV_CODEC_ID_ADPCM_MS:
|
|
|
|
case AV_CODEC_ID_ADPCM_4XM:
|
|
|
|
case AV_CODEC_ID_ADPCM_XA:
|
|
|
|
case AV_CODEC_ID_ADPCM_ADX:
|
|
|
|
case AV_CODEC_ID_ADPCM_EA:
|
|
|
|
case AV_CODEC_ID_ADPCM_CT:
|
|
|
|
case AV_CODEC_ID_ADPCM_SWF:
|
|
|
|
case AV_CODEC_ID_ADPCM_YAMAHA:
|
|
|
|
case AV_CODEC_ID_ADPCM_SBPRO_2:
|
|
|
|
case AV_CODEC_ID_ADPCM_SBPRO_3:
|
|
|
|
case AV_CODEC_ID_ADPCM_SBPRO_4:
|
|
|
|
case AV_CODEC_ID_ADPCM_EA_R1:
|
|
|
|
case AV_CODEC_ID_ADPCM_EA_R2:
|
|
|
|
case AV_CODEC_ID_ADPCM_EA_R3:
|
|
|
|
case AV_CODEC_ID_ADPCM_EA_MAXIS_XA:
|
|
|
|
case AV_CODEC_ID_ADPCM_EA_XAS:
|
|
|
|
case AV_CODEC_ID_ADPCM_THP:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
2010-03-24 11:07:28 +00:00
|
|
|
const gchar *layout = NULL;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_QT:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "quicktime";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_WAV:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "dvi";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_DK3:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "dk3";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_DK4:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "dk4";
|
|
|
|
break;
|
2020-12-14 04:33:16 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_OKI:
|
|
|
|
layout = "oki";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_WS:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "westwood";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_SMJPEG:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "smjpeg";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_AMV:
|
2007-12-17 12:43:06 +00:00
|
|
|
layout = "amv";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_ISS:
|
2009-01-24 16:59:11 +00:00
|
|
|
layout = "iss";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_EA_EACS:
|
2009-02-18 18:06:52 +00:00
|
|
|
layout = "ea-eacs";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
|
2009-02-18 18:06:52 +00:00
|
|
|
layout = "ea-sead";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_MS:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "microsoft";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_4XM:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "4xm";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_XA:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "xa";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_ADX:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "adx";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_EA:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "ea";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_CT:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "ct";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_SWF:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "swf";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_YAMAHA:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "yamaha";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_SBPRO_2:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "sbpro2";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_SBPRO_3:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "sbpro3";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_SBPRO_4:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "sbpro4";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_EA_R1:
|
2007-12-17 12:43:06 +00:00
|
|
|
layout = "ea-r1";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_EA_R2:
|
2007-12-17 12:43:06 +00:00
|
|
|
layout = "ea-r3";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_EA_R3:
|
2007-12-17 12:43:06 +00:00
|
|
|
layout = "ea-r3";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_EA_MAXIS_XA:
|
2009-02-18 18:06:52 +00:00
|
|
|
layout = "ea-maxis-xa";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_EA_XAS:
|
2009-02-18 18:06:52 +00:00
|
|
|
layout = "ea-xas";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_THP:
|
2007-12-17 12:43:06 +00:00
|
|
|
layout = "thp";
|
|
|
|
break;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
default:
|
|
|
|
g_assert (0); /* don't worry, we never get here */
|
|
|
|
break;
|
2005-09-30 09:29:22 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
|
|
|
/* FIXME: someone please check whether we need additional properties
|
|
|
|
* in this caps definition. */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-adpcm",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"layout", G_TYPE_STRING, layout, NULL);
|
|
|
|
if (context)
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"block_align", G_TYPE_INT, context->block_align,
|
2016-09-14 09:20:48 +00:00
|
|
|
"bitrate", G_TYPE_INT, (guint) context->bit_rate, NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AMR_NB:
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/AMR",
|
|
|
|
NULL);
|
2005-01-28 10:45:37 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_AMR_WB:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/AMR-WB",
|
|
|
|
NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_GSM:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-gsm",
|
|
|
|
NULL);
|
2011-01-24 16:20:56 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_GSM_MS:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/ms-gsm",
|
|
|
|
NULL);
|
2011-01-24 16:20:56 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_NELLYMOSER:
|
2007-12-17 12:43:06 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"audio/x-nellymoser", NULL);
|
2007-12-17 12:43:06 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SIPR:
|
2010-05-08 11:24:47 +00:00
|
|
|
{
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-sipro",
|
2012-07-10 13:47:01 +00:00
|
|
|
NULL);
|
2010-05-08 11:24:47 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"leaf_size", G_TYPE_INT, context->block_align,
|
2016-09-14 09:20:48 +00:00
|
|
|
"bitrate", G_TYPE_INT, (guint) context->bit_rate, NULL);
|
2010-05-08 11:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RA_144:
|
|
|
|
case AV_CODEC_ID_RA_288:
|
|
|
|
case AV_CODEC_ID_COOK:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
|
|
|
gint version = 0;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RA_144:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
version = 1;
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_RA_288:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
version = 2;
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_COOK:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
version = 8;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: properties? */
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
2012-07-10 13:47:01 +00:00
|
|
|
"audio/x-pn-realaudio", "raversion", G_TYPE_INT, version, NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"leaf_size", G_TYPE_INT, context->block_align,
|
2016-09-14 09:20:48 +00:00
|
|
|
"bitrate", G_TYPE_INT, (guint) context->bit_rate, NULL);
|
2005-09-30 09:29:22 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2003-10-26 12:10:01 +00:00
|
|
|
break;
|
2003-07-06 20:49:15 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ROQ_DPCM:
|
|
|
|
case AV_CODEC_ID_INTERPLAY_DPCM:
|
|
|
|
case AV_CODEC_ID_XAN_DPCM:
|
|
|
|
case AV_CODEC_ID_SOL_DPCM:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
2010-03-24 11:07:28 +00:00
|
|
|
const gchar *layout = NULL;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ROQ_DPCM:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "roq";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_INTERPLAY_DPCM:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "interplay";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_XAN_DPCM:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "xan";
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SOL_DPCM:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
layout = "sol";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert (0); /* don't worry, we never get here */
|
|
|
|
break;
|
2005-09-30 09:29:22 +00:00
|
|
|
}
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
|
|
|
/* FIXME: someone please check whether we need additional properties
|
|
|
|
* in this caps definition. */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-dpcm",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"layout", G_TYPE_STRING, layout, NULL);
|
|
|
|
if (context)
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"block_align", G_TYPE_INT, context->block_align,
|
2016-09-14 09:20:48 +00:00
|
|
|
"bitrate", G_TYPE_INT, (guint) context->bit_rate, NULL);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
2004-03-15 00:01:03 +00:00
|
|
|
break;
|
2004-03-29 16:39:18 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SHORTEN:
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("audio/x-shorten");
|
2005-04-21 19:01:36 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ALAC:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-alac",
|
|
|
|
NULL);
|
2005-04-21 19:01:36 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
2008-10-30 12:05:45 +00:00
|
|
|
"samplesize", G_TYPE_INT, context->bits_per_coded_sample, NULL);
|
2005-04-21 19:01:36 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_FLAC:
|
2004-03-15 00:01:03 +00:00
|
|
|
/* Note that ffmpeg has no encoder yet, but just for safety. In the
|
|
|
|
* encoder case, we want to add things like samplerate, channels... */
|
|
|
|
if (!encode) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("audio/x-flac");
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2004-03-07 22:02:15 +00:00
|
|
|
break;
|
|
|
|
|
2016-10-29 14:38:01 +00:00
|
|
|
case AV_CODEC_ID_OPUS:
|
|
|
|
/* Note that ffmpeg has no encoder yet, but just for safety. In the
|
|
|
|
* encoder case, we want to add things like samplerate, channels... */
|
|
|
|
if (!encode) {
|
|
|
|
/* FIXME: can ffmpeg handle multichannel Opus? */
|
|
|
|
caps = gst_caps_new_simple ("audio/x-opus",
|
|
|
|
"channel-mapping-family", G_TYPE_INT, 0, NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_S302M:
|
2013-02-05 02:10:42 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("audio/x-smpte-302m");
|
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DVD_SUBTITLE:
|
|
|
|
case AV_CODEC_ID_DVB_SUBTITLE:
|
ext/: Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly some added codecs, some API changes, etc. Also add...
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.h:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_formatid_get_codecids),
(gst_ffmpeg_caps_to_codecid), (gst_ffmpeg_get_codecid_longname),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_negotiate),
(gst_ffmpegdec_frame), (gst_ffmpegdec_chain),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdeinterlace.c:
(gst_ffmpegdeinterlace_getcaps), (gst_ffmpegdeinterlace_pad_link):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_event),
(gst_ffmpegdemux_src_format_list), (gst_ffmpegdemux_src_query),
(gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_add),
(gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_link), (gst_ffmpegenc_chain_video),
(gst_ffmpegenc_chain_audio):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_request_new_pad),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_register):
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_write):
* ext/ffmpeg/gstffmpegscale.c: (gst_ffmpegscale_pad_link):
* ext/libpostproc/gstpostproc.c: (gst_postproc_chain):
Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly
some added codecs, some API changes, etc. Also adds a VOB muxer
for MPEG-2 video and adds h264 to .mp4 muxing.
2005-07-20 15:40:57 +00:00
|
|
|
caps = NULL;
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_BMP:
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("image/bmp");
|
2006-02-19 16:54:51 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TTA:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-tta",
|
|
|
|
NULL);
|
2006-02-19 16:54:51 +00:00
|
|
|
if (context) {
|
|
|
|
gst_caps_set_simple (caps,
|
2008-10-30 12:05:45 +00:00
|
|
|
"samplesize", G_TYPE_INT, context->bits_per_coded_sample, NULL);
|
2006-02-19 16:54:51 +00:00
|
|
|
}
|
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_TWINVQ:
|
2012-07-10 13:47:01 +00:00
|
|
|
caps =
|
2012-12-11 16:54:09 +00:00
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode,
|
|
|
|
"audio/x-twin-vq", NULL);
|
2010-01-06 10:53:23 +00:00
|
|
|
break;
|
2016-05-13 07:27:38 +00:00
|
|
|
case AV_CODEC_ID_G729:
|
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/G729",
|
|
|
|
NULL);
|
|
|
|
break;
|
2018-05-05 16:00:06 +00:00
|
|
|
case AV_CODEC_ID_DSD_LSBF:
|
|
|
|
case AV_CODEC_ID_DSD_MSBF:
|
|
|
|
case AV_CODEC_ID_DSD_LSBF_PLANAR:
|
|
|
|
case AV_CODEC_ID_DSD_MSBF_PLANAR:
|
2023-02-05 10:15:44 +00:00
|
|
|
{
|
|
|
|
gboolean reversed_bytes;
|
|
|
|
gboolean interleaved;
|
|
|
|
|
|
|
|
switch (codec_id) {
|
|
|
|
case AV_CODEC_ID_DSD_LSBF:
|
|
|
|
reversed_bytes = TRUE;
|
|
|
|
interleaved = TRUE;
|
|
|
|
break;
|
|
|
|
case AV_CODEC_ID_DSD_MSBF:
|
|
|
|
reversed_bytes = FALSE;
|
|
|
|
interleaved = TRUE;
|
|
|
|
break;
|
|
|
|
case AV_CODEC_ID_DSD_LSBF_PLANAR:
|
|
|
|
reversed_bytes = TRUE;
|
|
|
|
interleaved = FALSE;
|
|
|
|
break;
|
|
|
|
case AV_CODEC_ID_DSD_MSBF_PLANAR:
|
|
|
|
reversed_bytes = FALSE;
|
|
|
|
interleaved = FALSE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reversed_bytes = FALSE;
|
|
|
|
interleaved = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-05-05 16:00:06 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-dsd",
|
2023-02-05 10:15:44 +00:00
|
|
|
"format", G_TYPE_STRING, "DSDU8",
|
|
|
|
"reversed-bytes", G_TYPE_BOOLEAN, reversed_bytes,
|
|
|
|
"layout", G_TYPE_STRING,
|
|
|
|
(interleaved) ? "interleaved" : "non-interleaved", NULL);
|
|
|
|
|
2018-05-05 16:00:06 +00:00
|
|
|
break;
|
2023-02-05 10:15:44 +00:00
|
|
|
}
|
2019-05-24 09:47:58 +00:00
|
|
|
case AV_CODEC_ID_APTX:
|
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/aptx",
|
|
|
|
NULL);
|
|
|
|
break;
|
|
|
|
case AV_CODEC_ID_APTX_HD:
|
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/aptx-hd",
|
|
|
|
NULL);
|
|
|
|
break;
|
2020-01-15 06:36:19 +00:00
|
|
|
case AV_CODEC_ID_AV1:
|
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-av1",
|
2023-03-22 11:52:08 +00:00
|
|
|
"stream-format", G_TYPE_STRING, "obu-stream", NULL);
|
|
|
|
if (encode) {
|
|
|
|
GValue arr = { 0, };
|
|
|
|
GValue item = { 0, };
|
|
|
|
g_value_init (&arr, GST_TYPE_LIST);
|
|
|
|
g_value_init (&item, G_TYPE_STRING);
|
|
|
|
g_value_set_string (&item, "tu");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_set_string (&item, "frame");
|
|
|
|
gst_value_list_append_value (&arr, &item);
|
|
|
|
g_value_unset (&item);
|
|
|
|
|
|
|
|
gst_caps_set_value (caps, "alignment", &arr);
|
|
|
|
g_value_unset (&arr);
|
|
|
|
}
|
2020-01-15 06:36:19 +00:00
|
|
|
break;
|
2003-06-07 00:41:32 +00:00
|
|
|
default:
|
2008-06-13 17:06:55 +00:00
|
|
|
GST_DEBUG ("Unknown codec ID %d, please add mapping here", codec_id);
|
2003-06-07 00:41:32 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-03-15 00:01:03 +00:00
|
|
|
if (buildcaps) {
|
2022-01-16 17:33:47 +00:00
|
|
|
const AVCodec *codec;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
|
|
|
if ((codec = avcodec_find_decoder (codec_id)) ||
|
|
|
|
(codec = avcodec_find_encoder (codec_id))) {
|
|
|
|
gchar *mime = NULL;
|
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
GST_LOG ("Could not create stream format caps for %s", codec->name);
|
|
|
|
|
2004-03-15 00:01:03 +00:00
|
|
|
switch (codec->type) {
|
2011-04-19 17:29:57 +00:00
|
|
|
case AVMEDIA_TYPE_VIDEO:
|
2012-08-07 08:19:16 +00:00
|
|
|
mime = g_strdup_printf ("video/x-gst-av-%s", codec->name);
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, NULL, codec_id, encode, mime, NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
g_free (mime);
|
|
|
|
break;
|
2011-04-19 17:29:57 +00:00
|
|
|
case AVMEDIA_TYPE_AUDIO:
|
2012-08-07 08:19:16 +00:00
|
|
|
mime = g_strdup_printf ("audio/x-gst-av-%s", codec->name);
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_aud_caps_new (context, NULL, codec_id, encode, mime, NULL);
|
2004-06-14 01:21:01 +00:00
|
|
|
if (context)
|
2004-06-14 01:26:15 +00:00
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"block_align", G_TYPE_INT, context->block_align,
|
2016-09-14 09:20:48 +00:00
|
|
|
"bitrate", G_TYPE_INT, (guint) context->bit_rate, NULL);
|
2004-03-15 00:01:03 +00:00
|
|
|
g_free (mime);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-06-07 00:41:32 +00:00
|
|
|
if (caps != NULL) {
|
2004-10-01 10:50:58 +00:00
|
|
|
|
|
|
|
/* set private data */
|
|
|
|
if (context && context->extradata_size > 0) {
|
|
|
|
GstBuffer *data = gst_buffer_new_and_alloc (context->extradata_size);
|
2004-03-29 16:39:18 +00:00
|
|
|
|
2011-04-04 10:23:05 +00:00
|
|
|
gst_buffer_fill (data, 0, context->extradata, context->extradata_size);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, data, NULL);
|
2004-10-01 10:50:58 +00:00
|
|
|
gst_buffer_unref (data);
|
|
|
|
}
|
|
|
|
|
2006-02-06 17:51:41 +00:00
|
|
|
GST_LOG ("caps for codec_id=%d: %" GST_PTR_FORMAT, codec_id, caps);
|
2004-10-01 10:50:58 +00:00
|
|
|
|
2003-07-06 20:49:15 +00:00
|
|
|
} else {
|
2006-05-26 12:42:06 +00:00
|
|
|
GST_LOG ("No caps found for codec_id=%d", codec_id);
|
2003-06-07 00:41:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
2011-07-29 08:25:03 +00:00
|
|
|
/* Convert a FFMPEG Pixel Format and optional AVCodecContext
|
|
|
|
* to a GstCaps. If the context is ommitted, no fixed values
|
|
|
|
* for video/audio size will be included in the GstCaps
|
|
|
|
*
|
|
|
|
* See below for usefullness
|
|
|
|
*/
|
|
|
|
|
2012-12-12 15:53:34 +00:00
|
|
|
static GstCaps *
|
2015-11-04 20:18:56 +00:00
|
|
|
gst_ffmpeg_pixfmt_to_caps (enum AVPixelFormat pix_fmt, AVCodecContext * context,
|
2014-01-03 15:28:44 +00:00
|
|
|
enum AVCodecID codec_id)
|
2011-07-29 08:25:03 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
GstVideoFormat format;
|
|
|
|
|
2012-10-29 13:12:03 +00:00
|
|
|
format = gst_ffmpeg_pixfmt_to_videoformat (pix_fmt);
|
2011-07-29 08:25:03 +00:00
|
|
|
|
|
|
|
if (format != GST_VIDEO_FORMAT_UNKNOWN) {
|
2012-12-11 18:48:34 +00:00
|
|
|
caps = gst_ff_vid_caps_new (context, NULL, codec_id, TRUE, "video/x-raw",
|
2011-07-29 08:25:03 +00:00
|
|
|
"format", G_TYPE_STRING, gst_video_format_to_string (format), NULL);
|
2003-06-07 00:41:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (caps != NULL) {
|
2008-12-13 07:55:40 +00:00
|
|
|
GST_DEBUG ("caps for pix_fmt=%d: %" GST_PTR_FORMAT, pix_fmt, caps);
|
2003-07-06 20:49:15 +00:00
|
|
|
} else {
|
2006-05-26 12:42:06 +00:00
|
|
|
GST_LOG ("No caps found for pix_fmt=%d", pix_fmt);
|
2003-06-07 00:41:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
2012-11-19 11:57:19 +00:00
|
|
|
GstAudioFormat
|
2018-07-23 13:16:10 +00:00
|
|
|
gst_ffmpeg_smpfmt_to_audioformat (enum AVSampleFormat sample_fmt,
|
|
|
|
GstAudioLayout * layout)
|
2003-06-07 00:41:32 +00:00
|
|
|
{
|
2018-07-23 13:16:10 +00:00
|
|
|
if (layout)
|
|
|
|
*layout = GST_AUDIO_LAYOUT_NON_INTERLEAVED;
|
|
|
|
|
2003-06-07 00:41:32 +00:00
|
|
|
switch (sample_fmt) {
|
2012-12-05 18:28:33 +00:00
|
|
|
case AV_SAMPLE_FMT_U8:
|
2018-07-23 13:16:10 +00:00
|
|
|
if (layout)
|
|
|
|
*layout = GST_AUDIO_LAYOUT_INTERLEAVED;
|
2012-12-05 18:28:33 +00:00
|
|
|
case AV_SAMPLE_FMT_U8P:
|
|
|
|
return GST_AUDIO_FORMAT_U8;
|
|
|
|
break;
|
2018-07-23 13:16:10 +00:00
|
|
|
|
2012-09-12 13:30:05 +00:00
|
|
|
case AV_SAMPLE_FMT_S16:
|
2018-07-23 13:16:10 +00:00
|
|
|
if (layout)
|
|
|
|
*layout = GST_AUDIO_LAYOUT_INTERLEAVED;
|
2012-12-05 18:28:33 +00:00
|
|
|
case AV_SAMPLE_FMT_S16P:
|
2012-11-19 11:57:19 +00:00
|
|
|
return GST_AUDIO_FORMAT_S16;
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
2018-07-23 13:16:10 +00:00
|
|
|
|
2012-09-12 13:30:05 +00:00
|
|
|
case AV_SAMPLE_FMT_S32:
|
2018-07-23 13:16:10 +00:00
|
|
|
if (layout)
|
|
|
|
*layout = GST_AUDIO_LAYOUT_INTERLEAVED;
|
2012-12-05 18:28:33 +00:00
|
|
|
case AV_SAMPLE_FMT_S32P:
|
2012-11-19 11:57:19 +00:00
|
|
|
return GST_AUDIO_FORMAT_S32;
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
break;
|
2012-09-12 13:30:05 +00:00
|
|
|
case AV_SAMPLE_FMT_FLT:
|
2018-07-23 13:16:10 +00:00
|
|
|
if (layout)
|
|
|
|
*layout = GST_AUDIO_LAYOUT_INTERLEAVED;
|
2012-12-05 18:28:33 +00:00
|
|
|
case AV_SAMPLE_FMT_FLTP:
|
2012-11-19 11:57:19 +00:00
|
|
|
return GST_AUDIO_FORMAT_F32;
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
break;
|
2018-07-23 13:16:10 +00:00
|
|
|
|
2012-09-12 13:30:05 +00:00
|
|
|
case AV_SAMPLE_FMT_DBL:
|
2018-07-23 13:16:10 +00:00
|
|
|
if (layout)
|
|
|
|
*layout = GST_AUDIO_LAYOUT_INTERLEAVED;
|
2012-12-05 18:28:33 +00:00
|
|
|
case AV_SAMPLE_FMT_DBLP:
|
2012-11-19 11:57:19 +00:00
|
|
|
return GST_AUDIO_FORMAT_F64;
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
break;
|
2018-07-23 13:16:10 +00:00
|
|
|
|
2002-11-06 23:53:46 +00:00
|
|
|
default:
|
2003-06-07 00:41:32 +00:00
|
|
|
/* .. */
|
2012-11-19 11:57:19 +00:00
|
|
|
return GST_AUDIO_FORMAT_UNKNOWN;
|
2002-11-06 23:53:46 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-11-19 11:57:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Convert a FFMPEG Sample Format and optional AVCodecContext
|
|
|
|
* to a GstCaps. If the context is ommitted, no fixed values
|
|
|
|
* for video/audio size will be included in the GstCaps
|
|
|
|
*
|
|
|
|
* See below for usefullness
|
|
|
|
*/
|
|
|
|
|
|
|
|
static GstCaps *
|
|
|
|
gst_ffmpeg_smpfmt_to_caps (enum AVSampleFormat sample_fmt,
|
2014-01-03 15:28:44 +00:00
|
|
|
AVCodecContext * context, AVCodec * codec, enum AVCodecID codec_id)
|
2012-11-19 11:57:19 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
GstAudioFormat format;
|
2018-07-23 13:16:10 +00:00
|
|
|
GstAudioLayout layout;
|
2012-11-19 11:57:19 +00:00
|
|
|
|
2018-07-23 13:16:10 +00:00
|
|
|
format = gst_ffmpeg_smpfmt_to_audioformat (sample_fmt, &layout);
|
2002-11-06 23:53:46 +00:00
|
|
|
|
2011-08-19 16:33:11 +00:00
|
|
|
if (format != GST_AUDIO_FORMAT_UNKNOWN) {
|
2012-12-11 16:54:09 +00:00
|
|
|
caps = gst_ff_aud_caps_new (context, codec, codec_id, TRUE, "audio/x-raw",
|
2012-01-09 12:40:05 +00:00
|
|
|
"format", G_TYPE_STRING, gst_audio_format_to_string (format),
|
2018-07-23 13:16:10 +00:00
|
|
|
"layout", G_TYPE_STRING,
|
|
|
|
(layout == GST_AUDIO_LAYOUT_INTERLEAVED) ?
|
|
|
|
"interleaved" : "non-interleaved", NULL);
|
2008-12-13 07:55:40 +00:00
|
|
|
GST_LOG ("caps for sample_fmt=%d: %" GST_PTR_FORMAT, sample_fmt, caps);
|
2003-07-06 20:49:15 +00:00
|
|
|
} else {
|
2006-05-26 12:42:06 +00:00
|
|
|
GST_LOG ("No caps found for sample_fmt=%d", sample_fmt);
|
2003-06-07 00:41:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
2012-12-17 12:42:13 +00:00
|
|
|
static gboolean
|
|
|
|
caps_has_field (GstCaps * caps, const gchar * field)
|
|
|
|
{
|
|
|
|
guint i, n;
|
|
|
|
|
|
|
|
n = gst_caps_get_size (caps);
|
|
|
|
for (i = 0; i < n; i++) {
|
|
|
|
GstStructure *s = gst_caps_get_structure (caps, i);
|
|
|
|
|
|
|
|
if (gst_structure_has_field (s, field))
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2009-01-29 06:48:19 +00:00
|
|
|
GstCaps *
|
|
|
|
gst_ffmpeg_codectype_to_audio_caps (AVCodecContext * context,
|
2014-01-03 15:28:44 +00:00
|
|
|
enum AVCodecID codec_id, gboolean encode, AVCodec * codec)
|
2009-01-29 06:48:19 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
|
|
|
|
GST_DEBUG ("context:%p, codec_id:%d, encode:%d, codec:%p",
|
|
|
|
context, codec_id, encode, codec);
|
|
|
|
if (codec)
|
|
|
|
GST_DEBUG ("sample_fmts:%p, samplerates:%p",
|
|
|
|
codec->sample_fmts, codec->supported_samplerates);
|
|
|
|
|
|
|
|
if (context) {
|
|
|
|
/* Specific codec context */
|
2012-12-11 16:54:09 +00:00
|
|
|
caps =
|
|
|
|
gst_ffmpeg_smpfmt_to_caps (context->sample_fmt, context, codec,
|
|
|
|
codec_id);
|
2009-01-29 06:48:19 +00:00
|
|
|
} else {
|
2012-12-11 18:48:34 +00:00
|
|
|
caps = gst_ff_aud_caps_new (context, codec, codec_id, encode, "audio/x-raw",
|
2018-07-23 13:16:10 +00:00
|
|
|
NULL);
|
2012-12-17 12:42:13 +00:00
|
|
|
if (!caps_has_field (caps, "format"))
|
|
|
|
gst_ffmpeg_audio_set_sample_fmts (caps,
|
2018-07-23 13:16:10 +00:00
|
|
|
codec ? codec->sample_fmts : NULL, encode);
|
2009-01-29 06:48:19 +00:00
|
|
|
}
|
2012-12-11 16:46:43 +00:00
|
|
|
|
2009-01-29 06:48:19 +00:00
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstCaps *
|
|
|
|
gst_ffmpeg_codectype_to_video_caps (AVCodecContext * context,
|
2022-11-01 15:13:23 +00:00
|
|
|
enum AVCodecID codec_id, gboolean encode, const AVCodec * codec)
|
2009-01-29 06:48:19 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps;
|
|
|
|
|
2009-04-15 20:33:16 +00:00
|
|
|
GST_LOG ("context:%p, codec_id:%d, encode:%d, codec:%p",
|
|
|
|
context, codec_id, encode, codec);
|
|
|
|
|
2009-01-29 06:48:19 +00:00
|
|
|
if (context) {
|
|
|
|
caps = gst_ffmpeg_pixfmt_to_caps (context->pix_fmt, context, codec_id);
|
|
|
|
} else {
|
2012-12-11 18:48:34 +00:00
|
|
|
caps =
|
|
|
|
gst_ff_vid_caps_new (context, codec, codec_id, encode, "video/x-raw",
|
|
|
|
NULL);
|
2012-12-17 12:42:13 +00:00
|
|
|
if (!caps_has_field (caps, "format"))
|
|
|
|
gst_ffmpeg_video_set_pix_fmts (caps, codec ? codec->pix_fmts : NULL);
|
2009-01-29 06:48:19 +00:00
|
|
|
}
|
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
2003-06-07 20:45:56 +00:00
|
|
|
/* Convert a GstCaps (audio/raw) to a FFMPEG SampleFmt
|
|
|
|
* and other audio properties in a AVCodecContext.
|
|
|
|
*
|
|
|
|
* For usefullness, see below
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps,
|
|
|
|
AVCodecContext * context, gboolean raw)
|
2003-06-07 20:45:56 +00:00
|
|
|
{
|
2003-12-22 01:46:58 +00:00
|
|
|
GstStructure *structure;
|
2011-08-19 16:33:11 +00:00
|
|
|
const gchar *fmt;
|
|
|
|
GstAudioFormat format = GST_AUDIO_FORMAT_UNKNOWN;
|
2016-01-16 14:40:52 +00:00
|
|
|
gint bitrate;
|
2018-07-23 13:16:10 +00:00
|
|
|
const gchar *layout;
|
|
|
|
gboolean interleaved;
|
2003-12-22 01:46:58 +00:00
|
|
|
|
|
|
|
g_return_if_fail (gst_caps_get_size (caps) == 1);
|
2011-08-19 16:33:11 +00:00
|
|
|
|
2003-12-22 01:46:58 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-03-29 16:39:18 +00:00
|
|
|
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
gst_structure_get_int (structure, "channels",
|
|
|
|
&context->ch_layout.nb_channels);
|
|
|
|
#else
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_structure_get_int (structure, "channels", &context->channels);
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_structure_get_int (structure, "rate", &context->sample_rate);
|
|
|
|
gst_structure_get_int (structure, "block_align", &context->block_align);
|
2016-03-11 13:44:16 +00:00
|
|
|
if (gst_structure_get_int (structure, "bitrate", &bitrate))
|
|
|
|
context->bit_rate = bitrate;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
|
|
|
|
if (!raw)
|
|
|
|
return;
|
|
|
|
|
2011-08-19 16:33:11 +00:00
|
|
|
if (gst_structure_has_name (structure, "audio/x-raw")) {
|
|
|
|
if ((fmt = gst_structure_get_string (structure, "format"))) {
|
|
|
|
format = gst_audio_format_from_string (fmt);
|
2003-06-07 20:45:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-23 13:16:10 +00:00
|
|
|
layout = gst_structure_get_string (structure, "layout");
|
|
|
|
interleaved = !!g_strcmp0 (layout, "non-interleaved");
|
|
|
|
|
2011-08-19 16:33:11 +00:00
|
|
|
switch (format) {
|
|
|
|
case GST_AUDIO_FORMAT_F32:
|
2018-07-23 13:16:10 +00:00
|
|
|
context->sample_fmt =
|
|
|
|
interleaved ? AV_SAMPLE_FMT_FLT : AV_SAMPLE_FMT_FLTP;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_F64:
|
2018-07-23 13:16:10 +00:00
|
|
|
context->sample_fmt =
|
|
|
|
interleaved ? AV_SAMPLE_FMT_DBL : AV_SAMPLE_FMT_DBLP;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_S32:
|
2018-07-23 13:16:10 +00:00
|
|
|
context->sample_fmt =
|
|
|
|
interleaved ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S32P;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_S16:
|
2018-07-23 13:16:10 +00:00
|
|
|
context->sample_fmt =
|
|
|
|
interleaved ? AV_SAMPLE_FMT_S16 : AV_SAMPLE_FMT_S16P;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-11-05 23:19:38 +00:00
|
|
|
|
2003-06-07 20:45:56 +00:00
|
|
|
/* Convert a GstCaps (video/raw) to a FFMPEG PixFmt
|
|
|
|
* and other video properties in a AVCodecContext.
|
|
|
|
*
|
|
|
|
* For usefullness, see below
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
|
|
|
|
AVCodecContext * context, gboolean raw)
|
2003-06-07 20:45:56 +00:00
|
|
|
{
|
2003-12-22 01:46:58 +00:00
|
|
|
GstStructure *structure;
|
2005-11-22 23:12:51 +00:00
|
|
|
const GValue *fps;
|
2006-02-12 21:03:53 +00:00
|
|
|
const GValue *par = NULL;
|
2011-06-20 09:57:29 +00:00
|
|
|
const gchar *fmt;
|
|
|
|
GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN;
|
2016-09-29 12:18:46 +00:00
|
|
|
const gchar *s;
|
2004-03-29 16:39:18 +00:00
|
|
|
|
2006-02-12 19:54:16 +00:00
|
|
|
GST_DEBUG ("converting caps %" GST_PTR_FORMAT, caps);
|
2003-12-22 01:46:58 +00:00
|
|
|
g_return_if_fail (gst_caps_get_size (caps) == 1);
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-03-29 16:39:18 +00:00
|
|
|
|
2003-12-22 01:46:58 +00:00
|
|
|
gst_structure_get_int (structure, "width", &context->width);
|
|
|
|
gst_structure_get_int (structure, "height", &context->height);
|
2008-10-30 12:05:45 +00:00
|
|
|
gst_structure_get_int (structure, "bpp", &context->bits_per_coded_sample);
|
2003-06-07 20:45:56 +00:00
|
|
|
|
2005-11-22 23:12:51 +00:00
|
|
|
fps = gst_structure_get_value (structure, "framerate");
|
2005-11-22 23:33:41 +00:00
|
|
|
if (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps)) {
|
2005-09-19 12:01:27 +00:00
|
|
|
|
2014-04-30 15:14:50 +00:00
|
|
|
int num = gst_value_get_fraction_numerator (fps);
|
|
|
|
int den = gst_value_get_fraction_denominator (fps);
|
|
|
|
|
|
|
|
if (num > 0 && den > 0) {
|
|
|
|
/* somehow these seem mixed up.. */
|
|
|
|
/* they're fine, this is because it does period=1/frequency */
|
|
|
|
context->time_base.den = gst_value_get_fraction_numerator (fps);
|
|
|
|
context->time_base.num = gst_value_get_fraction_denominator (fps);
|
2024-01-14 18:46:17 +00:00
|
|
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 100)
|
2014-04-30 15:14:50 +00:00
|
|
|
context->ticks_per_frame = 1;
|
2024-01-14 18:46:17 +00:00
|
|
|
#endif
|
2014-04-30 15:14:50 +00:00
|
|
|
|
|
|
|
GST_DEBUG ("setting framerate %d/%d = %lf",
|
|
|
|
context->time_base.den, context->time_base.num,
|
|
|
|
1. * context->time_base.den / context->time_base.num);
|
|
|
|
} else {
|
2016-08-20 09:53:07 +00:00
|
|
|
GST_INFO ("ignoring framerate %d/%d (probably variable framerate)",
|
|
|
|
context->time_base.num, context->time_base.den);
|
2014-04-30 15:14:50 +00:00
|
|
|
}
|
2005-11-22 23:33:41 +00:00
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
|
2006-02-12 19:54:16 +00:00
|
|
|
par = gst_structure_get_value (structure, "pixel-aspect-ratio");
|
2006-02-12 21:03:53 +00:00
|
|
|
if (par && GST_VALUE_HOLDS_FRACTION (par)) {
|
2006-02-12 19:54:16 +00:00
|
|
|
|
2014-04-30 15:14:50 +00:00
|
|
|
int num = gst_value_get_fraction_numerator (par);
|
|
|
|
int den = gst_value_get_fraction_denominator (par);
|
|
|
|
|
|
|
|
if (num > 0 && den > 0) {
|
|
|
|
context->sample_aspect_ratio.num = num;
|
|
|
|
context->sample_aspect_ratio.den = den;
|
2006-02-12 19:54:16 +00:00
|
|
|
|
2014-04-30 15:14:50 +00:00
|
|
|
GST_DEBUG ("setting pixel-aspect-ratio %d/%d = %lf",
|
|
|
|
context->sample_aspect_ratio.num, context->sample_aspect_ratio.den,
|
|
|
|
1. * context->sample_aspect_ratio.num /
|
|
|
|
context->sample_aspect_ratio.den);
|
|
|
|
} else {
|
|
|
|
GST_WARNING ("ignoring insane pixel-aspect-ratio %d/%d",
|
|
|
|
context->sample_aspect_ratio.num, context->sample_aspect_ratio.den);
|
|
|
|
}
|
2006-02-12 19:54:16 +00:00
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (!raw)
|
|
|
|
return;
|
|
|
|
|
2006-02-12 19:54:16 +00:00
|
|
|
g_return_if_fail (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps));
|
2005-11-22 23:33:41 +00:00
|
|
|
|
2011-06-20 09:57:29 +00:00
|
|
|
if (gst_structure_has_name (structure, "video/x-raw")) {
|
|
|
|
if ((fmt = gst_structure_get_string (structure, "format"))) {
|
|
|
|
format = gst_video_format_from_string (fmt);
|
2003-11-25 04:48:31 +00:00
|
|
|
}
|
2011-06-20 09:57:29 +00:00
|
|
|
}
|
2004-03-29 16:39:18 +00:00
|
|
|
|
2011-06-20 09:57:29 +00:00
|
|
|
switch (format) {
|
|
|
|
case GST_VIDEO_FORMAT_YUY2:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUYV422;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_I420:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV420P;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_A420:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUVA420P;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_Y41B:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV411P;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_Y42B:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV422P;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_YUV9:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV410P;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_Y444:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV444P;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_GRAY8:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_GRAY8;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_xRGB:
|
2003-11-28 20:06:18 +00:00
|
|
|
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_RGB32;
|
2003-11-28 20:06:18 +00:00
|
|
|
#endif
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_BGRx:
|
|
|
|
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_RGB32;
|
2011-06-20 09:57:29 +00:00
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_RGB:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_RGB24;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_BGR:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_BGR24;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_RGB16:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_RGB565;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_RGB15:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_RGB555;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
2012-05-31 11:43:48 +00:00
|
|
|
case GST_VIDEO_FORMAT_RGB8P:
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_PAL8;
|
2011-06-20 09:57:29 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2003-06-07 20:45:56 +00:00
|
|
|
}
|
2016-09-29 12:18:46 +00:00
|
|
|
|
2016-11-04 14:22:07 +00:00
|
|
|
s = gst_structure_get_string (structure, "interlace-mode");
|
2016-09-29 12:18:46 +00:00
|
|
|
if (s) {
|
|
|
|
if (strcmp (s, "progressive") == 0) {
|
|
|
|
context->field_order = AV_FIELD_PROGRESSIVE;
|
|
|
|
} else if (strcmp (s, "interleaved") == 0) {
|
|
|
|
s = gst_structure_get_string (structure, "field-order");
|
|
|
|
if (s) {
|
|
|
|
if (strcmp (s, "top-field-first") == 0) {
|
|
|
|
context->field_order = AV_FIELD_TT;
|
|
|
|
} else if (strcmp (s, "bottom-field-first") == 0) {
|
|
|
|
context->field_order = AV_FIELD_TB;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-06-07 20:45:56 +00:00
|
|
|
}
|
|
|
|
|
2012-04-24 09:31:44 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GstVideoFormat format;
|
2015-11-04 20:18:56 +00:00
|
|
|
enum AVPixelFormat pixfmt;
|
2012-04-24 09:31:44 +00:00
|
|
|
} PixToFmt;
|
|
|
|
|
|
|
|
/* FIXME : FILLME */
|
|
|
|
static const PixToFmt pixtofmttable[] = {
|
|
|
|
/* GST_VIDEO_FORMAT_I420, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_I420, AV_PIX_FMT_YUV420P},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* Note : this should use a different chroma placement */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_I420, AV_PIX_FMT_YUVJ420P},
|
2012-04-24 09:31:44 +00:00
|
|
|
|
|
|
|
/* GST_VIDEO_FORMAT_YV12, */
|
|
|
|
/* GST_VIDEO_FORMAT_YUY2, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_YUY2, AV_PIX_FMT_YUYV422},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_UYVY, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_UYVY, AV_PIX_FMT_UYVY422},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_AYUV, */
|
|
|
|
/* GST_VIDEO_FORMAT_RGBx, */
|
2016-11-24 16:15:14 +00:00
|
|
|
{GST_VIDEO_FORMAT_RGBx, AV_PIX_FMT_RGB0},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_BGRx, */
|
2016-11-24 16:15:14 +00:00
|
|
|
{GST_VIDEO_FORMAT_BGRx, AV_PIX_FMT_BGR0},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_xRGB, */
|
2016-11-24 16:15:14 +00:00
|
|
|
{GST_VIDEO_FORMAT_xRGB, AV_PIX_FMT_0RGB},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_xBGR, */
|
2016-11-24 16:15:14 +00:00
|
|
|
{GST_VIDEO_FORMAT_xBGR, AV_PIX_FMT_0BGR},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_RGBA, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_RGBA, AV_PIX_FMT_RGBA},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_BGRA, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_BGRA, AV_PIX_FMT_BGRA},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_ARGB, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_ARGB, AV_PIX_FMT_ARGB},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_ABGR, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_ABGR, AV_PIX_FMT_ABGR},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_RGB, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_RGB, AV_PIX_FMT_RGB24},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_BGR, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_BGR, AV_PIX_FMT_BGR24},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_Y41B, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_Y41B, AV_PIX_FMT_YUV411P},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_Y42B, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_Y42B, AV_PIX_FMT_YUV422P},
|
|
|
|
{GST_VIDEO_FORMAT_Y42B, AV_PIX_FMT_YUVJ422P},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_YVYU, */
|
|
|
|
/* GST_VIDEO_FORMAT_Y444, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_Y444, AV_PIX_FMT_YUV444P},
|
|
|
|
{GST_VIDEO_FORMAT_Y444, AV_PIX_FMT_YUVJ444P},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_v210, */
|
|
|
|
/* GST_VIDEO_FORMAT_v216, */
|
|
|
|
/* GST_VIDEO_FORMAT_NV12, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_NV12, AV_PIX_FMT_NV12},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_NV21, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_NV21, AV_PIX_FMT_NV21},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_GRAY8, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_GRAY8, AV_PIX_FMT_GRAY8},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_GRAY16_BE, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_GRAY16_BE, AV_PIX_FMT_GRAY16BE},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_GRAY16_LE, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_GRAY16_LE, AV_PIX_FMT_GRAY16LE},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_v308, */
|
|
|
|
/* GST_VIDEO_FORMAT_Y800, */
|
|
|
|
/* GST_VIDEO_FORMAT_Y16, */
|
|
|
|
/* GST_VIDEO_FORMAT_RGB16, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_RGB16, AV_PIX_FMT_RGB565},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_BGR16, */
|
|
|
|
/* GST_VIDEO_FORMAT_RGB15, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_RGB15, AV_PIX_FMT_RGB555},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_BGR15, */
|
|
|
|
/* GST_VIDEO_FORMAT_UYVP, */
|
|
|
|
/* GST_VIDEO_FORMAT_A420, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_A420, AV_PIX_FMT_YUVA420P},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_RGB8_PALETTED, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_RGB8P, AV_PIX_FMT_PAL8},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_YUV9, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_YUV9, AV_PIX_FMT_YUV410P},
|
2012-04-24 09:31:44 +00:00
|
|
|
/* GST_VIDEO_FORMAT_YVU9, */
|
|
|
|
/* GST_VIDEO_FORMAT_IYU1, */
|
|
|
|
/* GST_VIDEO_FORMAT_ARGB64, */
|
|
|
|
/* GST_VIDEO_FORMAT_AYUV64, */
|
|
|
|
/* GST_VIDEO_FORMAT_r210, */
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_I420_10LE, AV_PIX_FMT_YUV420P10LE},
|
|
|
|
{GST_VIDEO_FORMAT_I420_10BE, AV_PIX_FMT_YUV420P10BE},
|
|
|
|
{GST_VIDEO_FORMAT_I422_10LE, AV_PIX_FMT_YUV422P10LE},
|
|
|
|
{GST_VIDEO_FORMAT_I422_10BE, AV_PIX_FMT_YUV422P10BE},
|
|
|
|
{GST_VIDEO_FORMAT_Y444_10LE, AV_PIX_FMT_YUV444P10LE},
|
|
|
|
{GST_VIDEO_FORMAT_Y444_10BE, AV_PIX_FMT_YUV444P10BE},
|
|
|
|
{GST_VIDEO_FORMAT_GBR, AV_PIX_FMT_GBRP},
|
2017-03-16 15:14:21 +00:00
|
|
|
{GST_VIDEO_FORMAT_GBRA, AV_PIX_FMT_GBRAP},
|
2015-03-10 09:17:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_GBR_10LE, AV_PIX_FMT_GBRP10LE},
|
|
|
|
{GST_VIDEO_FORMAT_GBR_10BE, AV_PIX_FMT_GBRP10BE},
|
2021-09-18 08:51:03 +00:00
|
|
|
{GST_VIDEO_FORMAT_GBRA_10LE, AV_PIX_FMT_GBRAP10LE},
|
|
|
|
{GST_VIDEO_FORMAT_GBRA_10BE, AV_PIX_FMT_GBRAP10BE},
|
2017-03-15 14:37:29 +00:00
|
|
|
{GST_VIDEO_FORMAT_GBR_12LE, AV_PIX_FMT_GBRP12LE},
|
|
|
|
{GST_VIDEO_FORMAT_GBR_12BE, AV_PIX_FMT_GBRP12BE},
|
|
|
|
{GST_VIDEO_FORMAT_GBRA_12LE, AV_PIX_FMT_GBRAP12LE},
|
|
|
|
{GST_VIDEO_FORMAT_GBRA_12BE, AV_PIX_FMT_GBRAP12BE},
|
2015-03-10 09:18:53 +00:00
|
|
|
{GST_VIDEO_FORMAT_A420_10LE, AV_PIX_FMT_YUVA420P10LE},
|
|
|
|
{GST_VIDEO_FORMAT_A420_10BE, AV_PIX_FMT_YUVA420P10BE},
|
|
|
|
{GST_VIDEO_FORMAT_A422_10LE, AV_PIX_FMT_YUVA422P10LE},
|
|
|
|
{GST_VIDEO_FORMAT_A422_10BE, AV_PIX_FMT_YUVA422P10BE},
|
|
|
|
{GST_VIDEO_FORMAT_A444_10LE, AV_PIX_FMT_YUVA444P10LE},
|
|
|
|
{GST_VIDEO_FORMAT_A444_10BE, AV_PIX_FMT_YUVA444P10BE},
|
2017-03-16 15:14:21 +00:00
|
|
|
{GST_VIDEO_FORMAT_I420_12LE, AV_PIX_FMT_YUV420P12LE},
|
|
|
|
{GST_VIDEO_FORMAT_I420_12BE, AV_PIX_FMT_YUV420P12BE},
|
|
|
|
{GST_VIDEO_FORMAT_I422_12LE, AV_PIX_FMT_YUV422P12LE},
|
|
|
|
{GST_VIDEO_FORMAT_I422_12BE, AV_PIX_FMT_YUV422P12BE},
|
|
|
|
{GST_VIDEO_FORMAT_Y444_12LE, AV_PIX_FMT_YUV444P12LE},
|
|
|
|
{GST_VIDEO_FORMAT_Y444_12BE, AV_PIX_FMT_YUV444P12BE},
|
2023-04-19 16:54:45 +00:00
|
|
|
{GST_VIDEO_FORMAT_P010_10LE, AV_PIX_FMT_P010LE},
|
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57,34,100)
|
|
|
|
{GST_VIDEO_FORMAT_VUYA, AV_PIX_FMT_VUYX},
|
|
|
|
#endif
|
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57,36,100)
|
|
|
|
{GST_VIDEO_FORMAT_Y410, AV_PIX_FMT_XV30LE},
|
|
|
|
{GST_VIDEO_FORMAT_P012_LE, AV_PIX_FMT_P012LE},
|
|
|
|
{GST_VIDEO_FORMAT_Y212_LE, AV_PIX_FMT_Y212LE},
|
|
|
|
{GST_VIDEO_FORMAT_Y412_LE, AV_PIX_FMT_XV36LE},
|
|
|
|
#endif
|
2012-04-24 09:31:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GstVideoFormat
|
2015-11-04 20:18:56 +00:00
|
|
|
gst_ffmpeg_pixfmt_to_videoformat (enum AVPixelFormat pixfmt)
|
2012-04-24 09:31:44 +00:00
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (pixtofmttable); i++)
|
|
|
|
if (pixtofmttable[i].pixfmt == pixfmt)
|
|
|
|
return pixtofmttable[i].format;
|
|
|
|
|
2013-07-24 10:22:04 +00:00
|
|
|
GST_DEBUG ("Unknown pixel format %d", pixfmt);
|
2012-04-24 09:31:44 +00:00
|
|
|
return GST_VIDEO_FORMAT_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
2015-11-04 20:18:56 +00:00
|
|
|
static enum AVPixelFormat
|
2015-06-04 23:11:02 +00:00
|
|
|
gst_ffmpeg_videoformat_to_pixfmt_for_codec (GstVideoFormat format,
|
|
|
|
const AVCodec * codec)
|
2012-04-24 09:31:44 +00:00
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
|
2015-06-04 23:11:02 +00:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (pixtofmttable); i++) {
|
|
|
|
if (pixtofmttable[i].format == format) {
|
|
|
|
gint j;
|
|
|
|
|
|
|
|
if (codec && codec->pix_fmts) {
|
|
|
|
for (j = 0; codec->pix_fmts[j] != -1; j++) {
|
|
|
|
if (pixtofmttable[i].pixfmt == codec->pix_fmts[j])
|
|
|
|
return pixtofmttable[i].pixfmt;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return pixtofmttable[i].pixfmt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-10 09:17:45 +00:00
|
|
|
return AV_PIX_FMT_NONE;
|
2012-04-24 09:31:44 +00:00
|
|
|
}
|
|
|
|
|
2015-11-04 20:18:56 +00:00
|
|
|
enum AVPixelFormat
|
2015-06-04 23:11:02 +00:00
|
|
|
gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format)
|
|
|
|
{
|
|
|
|
return gst_ffmpeg_videoformat_to_pixfmt_for_codec (format, NULL);
|
|
|
|
}
|
|
|
|
|
2012-04-24 09:31:44 +00:00
|
|
|
void
|
|
|
|
gst_ffmpeg_videoinfo_to_context (GstVideoInfo * info, AVCodecContext * context)
|
|
|
|
{
|
|
|
|
gint i, bpp = 0;
|
|
|
|
|
|
|
|
context->width = GST_VIDEO_INFO_WIDTH (info);
|
2012-04-26 19:31:41 +00:00
|
|
|
context->height = GST_VIDEO_INFO_HEIGHT (info);
|
2012-04-24 09:31:44 +00:00
|
|
|
for (i = 0; i < GST_VIDEO_INFO_N_COMPONENTS (info); i++)
|
|
|
|
bpp += GST_VIDEO_INFO_COMP_DEPTH (info, i);
|
|
|
|
context->bits_per_coded_sample = bpp;
|
2024-01-14 18:46:17 +00:00
|
|
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 100)
|
2012-04-24 09:31:44 +00:00
|
|
|
context->ticks_per_frame = 1;
|
2024-01-14 18:46:17 +00:00
|
|
|
#endif
|
2023-01-24 13:28:17 +00:00
|
|
|
if (GST_VIDEO_INFO_FPS_N (info) == 0) {
|
|
|
|
GST_DEBUG ("Using 25/1 framerate");
|
|
|
|
context->time_base.den = 25;
|
|
|
|
context->time_base.num = 1;
|
|
|
|
} else {
|
|
|
|
context->time_base.den = GST_VIDEO_INFO_FPS_N (info);
|
|
|
|
context->time_base.num = GST_VIDEO_INFO_FPS_D (info);
|
2013-10-01 20:38:32 +00:00
|
|
|
}
|
2012-04-24 09:31:44 +00:00
|
|
|
|
|
|
|
context->sample_aspect_ratio.num = GST_VIDEO_INFO_PAR_N (info);
|
|
|
|
context->sample_aspect_ratio.den = GST_VIDEO_INFO_PAR_D (info);
|
|
|
|
|
|
|
|
context->pix_fmt =
|
2015-06-04 23:11:02 +00:00
|
|
|
gst_ffmpeg_videoformat_to_pixfmt_for_codec (GST_VIDEO_INFO_FORMAT (info),
|
|
|
|
context->codec);
|
2016-09-29 10:26:34 +00:00
|
|
|
|
|
|
|
switch (info->chroma_site) {
|
|
|
|
case GST_VIDEO_CHROMA_SITE_MPEG2:
|
|
|
|
context->chroma_sample_location = AVCHROMA_LOC_LEFT;
|
|
|
|
break;
|
|
|
|
case GST_VIDEO_CHROMA_SITE_JPEG:
|
|
|
|
context->chroma_sample_location = AVCHROMA_LOC_CENTER;
|
|
|
|
break;
|
|
|
|
case GST_VIDEO_CHROMA_SITE_DV:
|
|
|
|
context->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
|
|
|
|
break;
|
|
|
|
case GST_VIDEO_CHROMA_SITE_V_COSITED:
|
|
|
|
context->chroma_sample_location = AVCHROMA_LOC_TOP;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-09-24 14:51:33 +00:00
|
|
|
context->color_primaries =
|
|
|
|
gst_video_color_primaries_to_iso (info->colorimetry.primaries);
|
|
|
|
context->color_trc =
|
2020-09-07 09:15:17 +00:00
|
|
|
gst_video_transfer_function_to_iso (info->colorimetry.transfer);
|
2019-09-24 14:51:33 +00:00
|
|
|
context->colorspace =
|
|
|
|
gst_video_color_matrix_to_iso (info->colorimetry.matrix);
|
2016-09-29 10:26:34 +00:00
|
|
|
|
|
|
|
if (info->colorimetry.range == GST_VIDEO_COLOR_RANGE_0_255) {
|
|
|
|
context->color_range = AVCOL_RANGE_JPEG;
|
|
|
|
} else {
|
|
|
|
context->color_range = AVCOL_RANGE_MPEG;
|
2022-01-16 17:33:47 +00:00
|
|
|
context->strict_std_compliance = FF_COMPLIANCE_UNOFFICIAL;
|
2016-09-29 10:26:34 +00:00
|
|
|
}
|
2012-04-24 09:31:44 +00:00
|
|
|
}
|
|
|
|
|
2012-11-20 09:36:29 +00:00
|
|
|
void
|
|
|
|
gst_ffmpeg_audioinfo_to_context (GstAudioInfo * info, AVCodecContext * context)
|
|
|
|
{
|
2012-12-05 18:28:33 +00:00
|
|
|
const AVCodec *codec;
|
|
|
|
const enum AVSampleFormat *smpl_fmts;
|
|
|
|
enum AVSampleFormat smpl_fmt = -1;
|
|
|
|
|
2012-11-20 09:36:29 +00:00
|
|
|
context->sample_rate = info->rate;
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
gst_ffmpeg_channel_positions_to_layout (info->position, info->channels,
|
|
|
|
&context->ch_layout);
|
|
|
|
#else
|
|
|
|
context->channels = info->channels;
|
2012-12-11 18:07:34 +00:00
|
|
|
context->channel_layout =
|
|
|
|
gst_ffmpeg_channel_positions_to_layout (info->position, info->channels);
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2012-11-20 09:36:29 +00:00
|
|
|
|
2012-12-05 18:28:33 +00:00
|
|
|
codec = context->codec;
|
|
|
|
|
|
|
|
smpl_fmts = codec->sample_fmts;
|
|
|
|
|
2012-11-20 09:36:29 +00:00
|
|
|
switch (info->finfo->format) {
|
|
|
|
case GST_AUDIO_FORMAT_F32:
|
2012-12-05 18:28:33 +00:00
|
|
|
if (smpl_fmts) {
|
|
|
|
while (*smpl_fmts != -1) {
|
|
|
|
if (*smpl_fmts == AV_SAMPLE_FMT_FLT) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
break;
|
|
|
|
} else if (*smpl_fmts == AV_SAMPLE_FMT_FLTP) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
}
|
|
|
|
|
|
|
|
smpl_fmts++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
smpl_fmt = AV_SAMPLE_FMT_FLT;
|
|
|
|
}
|
2012-11-20 09:36:29 +00:00
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_F64:
|
2012-12-05 18:28:33 +00:00
|
|
|
if (smpl_fmts) {
|
|
|
|
while (*smpl_fmts != -1) {
|
|
|
|
if (*smpl_fmts == AV_SAMPLE_FMT_DBL) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
break;
|
|
|
|
} else if (*smpl_fmts == AV_SAMPLE_FMT_DBLP) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
}
|
|
|
|
|
|
|
|
smpl_fmts++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
smpl_fmt = AV_SAMPLE_FMT_DBL;
|
|
|
|
}
|
2012-11-20 09:36:29 +00:00
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_S32:
|
2012-12-05 18:28:33 +00:00
|
|
|
if (smpl_fmts) {
|
|
|
|
while (*smpl_fmts != -1) {
|
|
|
|
if (*smpl_fmts == AV_SAMPLE_FMT_S32) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
break;
|
|
|
|
} else if (*smpl_fmts == AV_SAMPLE_FMT_S32P) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
}
|
|
|
|
|
|
|
|
smpl_fmts++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
smpl_fmt = AV_SAMPLE_FMT_S32;
|
|
|
|
}
|
2012-11-20 09:36:29 +00:00
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_S16:
|
2012-12-05 18:28:33 +00:00
|
|
|
if (smpl_fmts) {
|
|
|
|
while (*smpl_fmts != -1) {
|
|
|
|
if (*smpl_fmts == AV_SAMPLE_FMT_S16) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
break;
|
|
|
|
} else if (*smpl_fmts == AV_SAMPLE_FMT_S16P) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
}
|
|
|
|
|
|
|
|
smpl_fmts++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
smpl_fmt = AV_SAMPLE_FMT_S16;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_U8:
|
|
|
|
if (smpl_fmts) {
|
|
|
|
while (*smpl_fmts != -1) {
|
|
|
|
if (*smpl_fmts == AV_SAMPLE_FMT_U8) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
break;
|
|
|
|
} else if (*smpl_fmts == AV_SAMPLE_FMT_U8P) {
|
|
|
|
smpl_fmt = *smpl_fmts;
|
|
|
|
}
|
|
|
|
|
|
|
|
smpl_fmts++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
smpl_fmt = AV_SAMPLE_FMT_U8;
|
|
|
|
}
|
2012-11-20 09:36:29 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2012-12-05 18:28:33 +00:00
|
|
|
|
|
|
|
g_assert (smpl_fmt != -1);
|
|
|
|
|
|
|
|
context->sample_fmt = smpl_fmt;
|
2012-11-20 09:36:29 +00:00
|
|
|
}
|
|
|
|
|
2003-06-07 20:45:56 +00:00
|
|
|
/* Convert a GstCaps and a FFMPEG codec Type to a
|
|
|
|
* AVCodecContext. If the context is ommitted, no fixed values
|
|
|
|
* for video/audio size will be included in the context
|
|
|
|
*
|
2011-04-19 17:29:57 +00:00
|
|
|
* AVMediaType is primarily meant for uncompressed data GstCaps!
|
2003-06-07 20:45:56 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
2011-04-19 17:29:57 +00:00
|
|
|
gst_ffmpeg_caps_with_codectype (enum AVMediaType type,
|
2004-03-29 16:39:18 +00:00
|
|
|
const GstCaps * caps, AVCodecContext * context)
|
2003-06-07 20:45:56 +00:00
|
|
|
{
|
|
|
|
if (context == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (type) {
|
2011-04-19 17:29:57 +00:00
|
|
|
case AVMEDIA_TYPE_VIDEO:
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_ffmpeg_caps_to_pixfmt (caps, context, TRUE);
|
2003-06-07 20:45:56 +00:00
|
|
|
break;
|
|
|
|
|
2011-04-19 17:29:57 +00:00
|
|
|
case AVMEDIA_TYPE_AUDIO:
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_ffmpeg_caps_to_smpfmt (caps, context, TRUE);
|
2003-06-07 20:45:56 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* unknown */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-06-08 13:30:10 +00:00
|
|
|
|
2010-01-29 12:58:20 +00:00
|
|
|
#if 0
|
2008-09-04 13:54:58 +00:00
|
|
|
static void
|
2008-10-30 12:05:45 +00:00
|
|
|
nal_escape (guint8 * dst, guint8 * src, guint size, guint * destsize)
|
2008-09-04 13:54:58 +00:00
|
|
|
{
|
|
|
|
guint8 *dstp = dst;
|
|
|
|
guint8 *srcp = src;
|
|
|
|
guint8 *end = src + size;
|
|
|
|
gint count = 0;
|
|
|
|
|
|
|
|
while (srcp < end) {
|
2008-10-30 12:05:45 +00:00
|
|
|
if (count == 2 && *srcp <= 0x03) {
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("added escape code");
|
2008-09-04 13:54:58 +00:00
|
|
|
*dstp++ = 0x03;
|
|
|
|
count = 0;
|
|
|
|
}
|
|
|
|
if (*srcp == 0)
|
|
|
|
count++;
|
|
|
|
else
|
|
|
|
count = 0;
|
|
|
|
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("copy %02x, count %d", *srcp, count);
|
2008-09-04 13:54:58 +00:00
|
|
|
*dstp++ = *srcp++;
|
|
|
|
}
|
|
|
|
*destsize = dstp - dst;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* copy the config, escaping NAL units as we iterate them, if something fails we
|
|
|
|
* copy everything and hope for the best. */
|
|
|
|
static void
|
2008-10-30 12:05:45 +00:00
|
|
|
copy_config (guint8 * dst, guint8 * src, guint size, guint * destsize)
|
2008-09-04 13:54:58 +00:00
|
|
|
{
|
|
|
|
guint8 *dstp = dst;
|
|
|
|
guint8 *srcp = src;
|
|
|
|
gint cnt, i;
|
|
|
|
guint nalsize, esize;
|
|
|
|
|
|
|
|
/* check size */
|
|
|
|
if (size < 7)
|
|
|
|
goto full_copy;
|
|
|
|
|
2008-10-30 12:05:45 +00:00
|
|
|
/* check version */
|
2008-09-04 13:54:58 +00:00
|
|
|
if (*srcp != 1)
|
|
|
|
goto full_copy;
|
|
|
|
|
2008-10-30 12:05:45 +00:00
|
|
|
cnt = *(srcp + 5) & 0x1f; /* Number of sps */
|
2008-09-04 13:54:58 +00:00
|
|
|
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("num SPS %d", cnt);
|
|
|
|
|
2008-09-04 13:54:58 +00:00
|
|
|
memcpy (dstp, srcp, 6);
|
|
|
|
srcp += 6;
|
|
|
|
dstp += 6;
|
|
|
|
|
|
|
|
for (i = 0; i < cnt; i++) {
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("copy SPS %d", i);
|
2008-09-04 13:54:58 +00:00
|
|
|
nalsize = (srcp[0] << 8) | srcp[1];
|
|
|
|
nal_escape (dstp + 2, srcp + 2, nalsize, &esize);
|
|
|
|
dstp[0] = esize >> 8;
|
|
|
|
dstp[1] = esize & 0xff;
|
|
|
|
dstp += esize + 2;
|
|
|
|
srcp += nalsize + 2;
|
|
|
|
}
|
|
|
|
|
2008-10-30 12:05:45 +00:00
|
|
|
cnt = *(dstp++) = *(srcp++); /* Number of pps */
|
2008-09-04 13:54:58 +00:00
|
|
|
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("num PPS %d", cnt);
|
|
|
|
|
2008-09-04 13:54:58 +00:00
|
|
|
for (i = 0; i < cnt; i++) {
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("copy PPS %d", i);
|
2008-09-04 13:54:58 +00:00
|
|
|
nalsize = (srcp[0] << 8) | srcp[1];
|
|
|
|
nal_escape (dstp + 2, srcp + 2, nalsize, &esize);
|
|
|
|
dstp[0] = esize >> 8;
|
|
|
|
dstp[1] = esize & 0xff;
|
|
|
|
dstp += esize + 2;
|
|
|
|
srcp += nalsize + 2;
|
|
|
|
}
|
|
|
|
*destsize = dstp - dst;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
full_copy:
|
|
|
|
{
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("something unexpected, doing full copy");
|
2008-09-04 13:54:58 +00:00
|
|
|
memcpy (dst, src, size);
|
|
|
|
*destsize = size;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2010-01-29 12:58:20 +00:00
|
|
|
#endif
|
2008-09-04 13:54:58 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
/*
|
|
|
|
* caps_with_codecid () transforms a GstCaps for a known codec
|
|
|
|
* ID into a filled-in context.
|
2007-04-12 11:06:46 +00:00
|
|
|
* codec_data from caps will override possible extradata already in the context
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
*/
|
2005-09-30 09:29:22 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
void
|
2014-01-03 15:28:44 +00:00
|
|
|
gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
|
2011-04-19 17:29:57 +00:00
|
|
|
enum AVMediaType codec_type, const GstCaps * caps, AVCodecContext * context)
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
{
|
2008-07-11 17:54:26 +00:00
|
|
|
GstStructure *str;
|
2004-10-01 10:50:58 +00:00
|
|
|
const GValue *value;
|
2011-04-04 10:23:05 +00:00
|
|
|
GstBuffer *buf;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
|
2009-04-15 20:33:16 +00:00
|
|
|
GST_LOG ("codec_id:%d, codec_type:%d, caps:%" GST_PTR_FORMAT " context:%p",
|
|
|
|
codec_id, codec_type, caps, context);
|
|
|
|
|
2008-07-11 17:54:26 +00:00
|
|
|
if (!context || !gst_caps_get_size (caps))
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
return;
|
|
|
|
|
2008-07-11 17:54:26 +00:00
|
|
|
str = gst_caps_get_structure (caps, 0);
|
|
|
|
|
2004-10-01 10:50:58 +00:00
|
|
|
/* extradata parsing (esds [mpeg4], wma/wmv, msmpeg4v1/2/3, etc.) */
|
|
|
|
if ((value = gst_structure_get_value (str, "codec_data"))) {
|
2012-01-24 13:40:37 +00:00
|
|
|
GstMapInfo map;
|
2006-08-21 16:33:15 +00:00
|
|
|
|
2011-02-26 14:09:43 +00:00
|
|
|
buf = gst_value_get_buffer (value);
|
2012-01-24 13:40:37 +00:00
|
|
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
2006-08-21 16:33:15 +00:00
|
|
|
|
2007-04-12 11:06:46 +00:00
|
|
|
/* free the old one if it is there */
|
|
|
|
if (context->extradata)
|
|
|
|
av_free (context->extradata);
|
|
|
|
|
2010-01-29 12:58:20 +00:00
|
|
|
#if 0
|
2013-05-06 22:56:22 +00:00
|
|
|
if (codec_id == AV_CODEC_ID_H264) {
|
2008-09-04 13:54:58 +00:00
|
|
|
guint extrasize;
|
|
|
|
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("copy, escaping codec_data %d", size);
|
2008-09-04 13:54:58 +00:00
|
|
|
/* ffmpeg h264 expects the codec_data to be escaped, there is no real
|
|
|
|
* reason for this but let's just escape it for now. Start by allocating
|
2010-01-29 12:58:20 +00:00
|
|
|
* enough space, x2 is more than enough.
|
|
|
|
*
|
|
|
|
* FIXME, we disabled escaping because some file already contain escaped
|
|
|
|
* codec_data and then we escape twice and fail. It's better to leave it
|
|
|
|
* as is, as that is what most players do. */
|
2008-09-04 13:54:58 +00:00
|
|
|
context->extradata =
|
2008-10-30 12:05:45 +00:00
|
|
|
av_mallocz (GST_ROUND_UP_16 (size * 2 +
|
2018-04-30 19:41:40 +00:00
|
|
|
AV_INPUT_BUFFER_PADDING_SIZE));
|
2008-09-04 13:54:58 +00:00
|
|
|
copy_config (context->extradata, data, size, &extrasize);
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("escaped size: %d", extrasize);
|
2008-09-04 13:54:58 +00:00
|
|
|
context->extradata_size = extrasize;
|
2010-01-29 12:58:20 +00:00
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
2008-09-04 13:54:58 +00:00
|
|
|
/* allocate with enough padding */
|
2008-09-04 15:50:03 +00:00
|
|
|
GST_DEBUG ("copy codec_data");
|
2008-09-04 13:54:58 +00:00
|
|
|
context->extradata =
|
2012-01-24 13:40:37 +00:00
|
|
|
av_mallocz (GST_ROUND_UP_16 (map.size +
|
2018-04-30 19:41:40 +00:00
|
|
|
AV_INPUT_BUFFER_PADDING_SIZE));
|
2012-01-24 13:40:37 +00:00
|
|
|
memcpy (context->extradata, map.data, map.size);
|
|
|
|
context->extradata_size = map.size;
|
2008-09-04 13:54:58 +00:00
|
|
|
}
|
|
|
|
|
2009-10-01 01:48:35 +00:00
|
|
|
/* Hack for VC1. Sometimes the first (length) byte is 0 for some files */
|
2013-05-06 22:56:22 +00:00
|
|
|
if (codec_id == AV_CODEC_ID_VC1 && map.size > 0 && map.data[0] == 0) {
|
2012-01-24 13:40:37 +00:00
|
|
|
context->extradata[0] = (guint8) map.size;
|
2009-10-01 01:48:35 +00:00
|
|
|
}
|
|
|
|
|
2012-02-27 05:26:02 +00:00
|
|
|
GST_DEBUG ("have codec data of size %" G_GSIZE_FORMAT, map.size);
|
2011-04-04 10:23:05 +00:00
|
|
|
|
2012-01-24 13:40:37 +00:00
|
|
|
gst_buffer_unmap (buf, &map);
|
2015-10-03 17:25:35 +00:00
|
|
|
} else {
|
|
|
|
context->extradata = NULL;
|
2006-08-21 16:33:15 +00:00
|
|
|
context->extradata_size = 0;
|
2007-08-07 10:21:19 +00:00
|
|
|
GST_DEBUG ("no codec data");
|
2004-10-01 10:50:58 +00:00
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MPEG4:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
|
|
|
const gchar *mime = gst_structure_get_name (str);
|
|
|
|
|
2018-04-30 19:54:44 +00:00
|
|
|
context->flags |= AV_CODEC_FLAG_4MV;
|
2014-05-29 16:24:20 +00:00
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
if (!strcmp (mime, "video/x-divx"))
|
|
|
|
context->codec_tag = GST_MAKE_FOURCC ('D', 'I', 'V', 'X');
|
2014-05-29 16:24:20 +00:00
|
|
|
else if (!strcmp (mime, "video/mpeg")) {
|
|
|
|
const gchar *profile;
|
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
context->codec_tag = GST_MAKE_FOURCC ('m', 'p', '4', 'v');
|
2014-05-29 16:24:20 +00:00
|
|
|
|
|
|
|
profile = gst_structure_get_string (str, "profile");
|
|
|
|
if (profile) {
|
|
|
|
if (g_strcmp0 (profile, "advanced-simple") == 0)
|
2018-06-27 18:41:37 +00:00
|
|
|
context->flags |= AV_CODEC_FLAG_QPEL;
|
2014-05-29 16:24:20 +00:00
|
|
|
}
|
|
|
|
}
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
2014-05-29 16:24:20 +00:00
|
|
|
}
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_SVQ3:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
/* FIXME: this is a workaround for older gst-plugins releases
|
|
|
|
* (<= 0.8.9). This should be removed at some point, because
|
|
|
|
* it causes wrong decoded frame order. */
|
|
|
|
if (!context->extradata) {
|
|
|
|
gint halfpel_flag, thirdpel_flag, low_delay, unknown_svq3_flag;
|
|
|
|
guint16 flags;
|
|
|
|
|
2013-09-23 13:19:51 +00:00
|
|
|
if (gst_structure_get_int (str, "halfpel_flag", &halfpel_flag) &&
|
|
|
|
gst_structure_get_int (str, "thirdpel_flag", &thirdpel_flag) &&
|
|
|
|
gst_structure_get_int (str, "low_delay", &low_delay) &&
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
gst_structure_get_int (str, "unknown_svq3_flag",
|
|
|
|
&unknown_svq3_flag)) {
|
|
|
|
context->extradata = (guint8 *) av_mallocz (0x64);
|
2007-12-17 12:43:06 +00:00
|
|
|
g_stpcpy ((gchar *) context->extradata, "SVQ3");
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
flags = 1 << 3;
|
|
|
|
flags |= low_delay;
|
|
|
|
flags = flags << 2;
|
|
|
|
flags |= unknown_svq3_flag;
|
|
|
|
flags = flags << 6;
|
|
|
|
flags |= halfpel_flag;
|
|
|
|
flags = flags << 1;
|
|
|
|
flags |= thirdpel_flag;
|
|
|
|
flags = flags << 3;
|
|
|
|
|
|
|
|
flags = GUINT16_FROM_LE (flags);
|
|
|
|
|
2007-11-08 14:44:36 +00:00
|
|
|
memcpy ((gchar *) context->extradata + 0x62, &flags, 2);
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
context->extradata_size = 0x64;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2005-06-10 23:55:38 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_MSRLE:
|
|
|
|
case AV_CODEC_ID_QTRLE:
|
|
|
|
case AV_CODEC_ID_TSCC:
|
|
|
|
case AV_CODEC_ID_CSCD:
|
|
|
|
case AV_CODEC_ID_APE:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
|
|
|
gint depth;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
|
2007-01-22 10:26:04 +00:00
|
|
|
if (gst_structure_get_int (str, "depth", &depth)) {
|
2008-10-30 12:05:45 +00:00
|
|
|
context->bits_per_coded_sample = depth;
|
2007-01-22 10:26:04 +00:00
|
|
|
} else {
|
|
|
|
GST_WARNING ("No depth field in caps %" GST_PTR_FORMAT, caps);
|
|
|
|
}
|
|
|
|
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
}
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
2004-04-23 00:49:10 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_COOK:
|
|
|
|
case AV_CODEC_ID_RA_288:
|
|
|
|
case AV_CODEC_ID_RA_144:
|
|
|
|
case AV_CODEC_ID_SIPR:
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
{
|
|
|
|
gint leaf_size;
|
|
|
|
gint bitrate;
|
|
|
|
|
|
|
|
if (gst_structure_get_int (str, "leaf_size", &leaf_size))
|
|
|
|
context->block_align = leaf_size;
|
|
|
|
if (gst_structure_get_int (str, "bitrate", &bitrate))
|
|
|
|
context->bit_rate = bitrate;
|
|
|
|
}
|
2014-04-08 06:00:55 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ALAC:
|
2008-10-30 12:05:45 +00:00
|
|
|
gst_structure_get_int (str, "samplesize",
|
|
|
|
&context->bits_per_coded_sample);
|
2005-04-21 19:01:36 +00:00
|
|
|
break;
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_DVVIDEO:
|
2006-10-24 09:27:16 +00:00
|
|
|
{
|
2011-08-22 11:33:31 +00:00
|
|
|
const gchar *format;
|
|
|
|
|
2011-10-11 12:02:53 +00:00
|
|
|
if ((format = gst_structure_get_string (str, "format"))) {
|
|
|
|
|
|
|
|
if (g_str_equal (format, "YUY2"))
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUYV422;
|
2011-10-11 12:02:53 +00:00
|
|
|
else if (g_str_equal (format, "I420"))
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV420P;
|
2011-10-11 12:02:53 +00:00
|
|
|
else if (g_str_equal (format, "A420"))
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUVA420P;
|
2011-10-11 12:02:53 +00:00
|
|
|
else if (g_str_equal (format, "Y41B"))
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV411P;
|
2011-10-11 12:02:53 +00:00
|
|
|
else if (g_str_equal (format, "Y42B"))
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV422P;
|
2011-10-11 12:02:53 +00:00
|
|
|
else if (g_str_equal (format, "YUV9"))
|
2015-03-10 09:17:45 +00:00
|
|
|
context->pix_fmt = AV_PIX_FMT_YUV410P;
|
2011-10-11 12:02:53 +00:00
|
|
|
else {
|
|
|
|
GST_WARNING ("couldn't convert format %s" " to a pixel format",
|
|
|
|
format);
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
GST_WARNING ("No specified format");
|
2009-03-06 02:35:46 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_H263P:
|
2009-03-06 02:35:46 +00:00
|
|
|
{
|
|
|
|
gboolean val;
|
|
|
|
|
|
|
|
if (!gst_structure_get_boolean (str, "annex-f", &val) || val)
|
2018-04-30 19:54:44 +00:00
|
|
|
context->flags |= AV_CODEC_FLAG_4MV;
|
2009-03-06 02:35:46 +00:00
|
|
|
else
|
2018-04-30 19:54:44 +00:00
|
|
|
context->flags &= ~AV_CODEC_FLAG_4MV;
|
2009-03-06 02:35:46 +00:00
|
|
|
if ((!gst_structure_get_boolean (str, "annex-i", &val) || val) &&
|
|
|
|
(!gst_structure_get_boolean (str, "annex-t", &val) || val))
|
2018-04-30 19:54:44 +00:00
|
|
|
context->flags |= AV_CODEC_FLAG_AC_PRED;
|
2009-03-06 02:35:46 +00:00
|
|
|
else
|
2018-04-30 19:54:44 +00:00
|
|
|
context->flags &= ~AV_CODEC_FLAG_AC_PRED;
|
2009-03-06 02:35:46 +00:00
|
|
|
if (!gst_structure_get_boolean (str, "annex-j", &val) || val)
|
2018-04-30 19:54:44 +00:00
|
|
|
context->flags |= AV_CODEC_FLAG_LOOP_FILTER;
|
2009-03-06 02:35:46 +00:00
|
|
|
else
|
2018-04-30 19:54:44 +00:00
|
|
|
context->flags &= ~AV_CODEC_FLAG_LOOP_FILTER;
|
2009-03-06 02:35:46 +00:00
|
|
|
break;
|
2006-10-24 09:27:16 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_G726:
|
2009-09-09 11:33:53 +00:00
|
|
|
{
|
|
|
|
const gchar *layout;
|
|
|
|
|
|
|
|
if ((layout = gst_structure_get_string (str, "layout"))) {
|
|
|
|
if (!strcmp (layout, "g721")) {
|
|
|
|
context->sample_rate = 8000;
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
context->ch_layout = (AVChannelLayout) AV_CHANNEL_LAYOUT_MONO;
|
|
|
|
#else
|
2009-09-09 11:33:53 +00:00
|
|
|
context->channels = 1;
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2009-09-09 11:33:53 +00:00
|
|
|
context->bit_rate = 32000;
|
|
|
|
}
|
|
|
|
}
|
2009-04-17 14:25:12 +00:00
|
|
|
break;
|
2009-09-09 11:33:53 +00:00
|
|
|
}
|
2020-06-26 10:11:56 +00:00
|
|
|
case AV_CODEC_ID_SPEEDHQ:
|
|
|
|
{
|
|
|
|
const gchar *variant;
|
|
|
|
|
|
|
|
if (context && (variant = gst_structure_get_string (str, "variant"))
|
|
|
|
&& strlen (variant) == 4) {
|
|
|
|
|
|
|
|
context->codec_tag =
|
|
|
|
GST_MAKE_FOURCC (variant[0], variant[1], variant[2], variant[3]);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2004-04-23 00:49:10 +00:00
|
|
|
default:
|
|
|
|
break;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
}
|
|
|
|
|
2004-10-25 11:56:52 +00:00
|
|
|
if (!gst_caps_is_fixed (caps))
|
|
|
|
return;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
/* common properties (width, height, fps) */
|
|
|
|
switch (codec_type) {
|
2011-04-19 17:29:57 +00:00
|
|
|
case AVMEDIA_TYPE_VIDEO:
|
2013-05-06 22:56:22 +00:00
|
|
|
gst_ffmpeg_caps_to_pixfmt (caps, context,
|
|
|
|
codec_id == AV_CODEC_ID_RAWVIDEO);
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
2011-04-19 17:29:57 +00:00
|
|
|
case AVMEDIA_TYPE_AUDIO:
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_ffmpeg_caps_to_smpfmt (caps, context, FALSE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2010-02-04 16:08:41 +00:00
|
|
|
|
|
|
|
/* fixup of default settings */
|
|
|
|
switch (codec_id) {
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_QCELP:
|
2010-02-04 16:08:41 +00:00
|
|
|
/* QCELP is always mono, no matter what the caps say */
|
2023-08-15 01:28:00 +00:00
|
|
|
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
|
|
|
|
context->ch_layout = (AVChannelLayout) AV_CHANNEL_LAYOUT_MONO;
|
|
|
|
#else
|
2010-02-04 16:08:41 +00:00
|
|
|
context->channels = 1;
|
2023-08-15 01:28:00 +00:00
|
|
|
#endif
|
2010-02-04 16:08:41 +00:00
|
|
|
break;
|
2013-05-06 22:56:22 +00:00
|
|
|
case AV_CODEC_ID_ADPCM_G726:
|
2012-12-12 16:01:28 +00:00
|
|
|
if (context->sample_rate && context->bit_rate)
|
|
|
|
context->bits_per_coded_sample =
|
|
|
|
context->bit_rate / context->sample_rate;
|
|
|
|
break;
|
2010-02-04 16:08:41 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
}
|
|
|
|
|
2003-06-08 13:30:10 +00:00
|
|
|
/* _formatid_to_caps () is meant for muxers/demuxers, it
|
|
|
|
* transforms a name (ffmpeg way of ID'ing these, why don't
|
|
|
|
* they have unique numerical IDs?) to the corresponding
|
|
|
|
* caps belonging to that mux-format
|
|
|
|
*
|
|
|
|
* Note: we don't need any additional info because the caps
|
|
|
|
* isn't supposed to contain any useful info besides the
|
|
|
|
* media type anyway
|
|
|
|
*/
|
|
|
|
|
|
|
|
GstCaps *
|
2004-03-29 16:39:18 +00:00
|
|
|
gst_ffmpeg_formatid_to_caps (const gchar * format_name)
|
2003-06-08 13:30:10 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
|
|
|
|
if (!strcmp (format_name, "mpeg")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
caps = gst_caps_new_simple ("video/mpeg",
|
2004-03-29 16:39:18 +00:00
|
|
|
"systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "mpegts")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
caps = gst_caps_new_simple ("video/mpegts",
|
2004-03-29 16:39:18 +00:00
|
|
|
"systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "rm")) {
|
HACKING: Add some basic documentation on how our wrapping works.
Original commit message from CVS:
* HACKING:
Add some basic documentation on how our wrapping works.
* TODO:
Add a list of things that could be worked on or that need doing.
* configure.ac:
Update snapshot.
* ext/ffmpeg/Makefile.am:
Changne .la links. See below (autotools patch).
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable demuxers. See below (gstffmpegdemux.c).
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_formatid_to_caps):
Realmedia caused a crash - fix that.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_averror),
(gst_ffmpegdemux_base_init), (gst_ffmpegdemux_init),
(gst_ffmpegdemux_close), (gst_ffmpegdemux_dispose),
(gst_ffmpegdemux_stream_from_pad),
(gst_ffmpegdemux_src_event_mask), (gst_ffmpegdemux_src_event),
(gst_ffmpegdemux_src_format_list),
(gst_ffmpegdemux_src_query_list), (gst_ffmpegdemux_src_query),
(gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_add),
(gst_ffmpegdemux_open), (gst_ffmpegdemux_loop),
(gst_ffmpegdemux_change_state), (gst_ffmpegdemux_register):
Right. OK, so I fixed up the demuxing and have it basically-working,
and the best way to get some more people to test it is to actually
enable it. I'm not sure if we want this for 0.8.0, but we can at
least give it a try. I've tested avi, matroska and mpeg, all appear
to work. The cool thing is that this gives us instant support for
several exotic formats that we'd never care about ourselves. Again,
this needs more testing for it to still be enabled in 0.8.0, but I
want to give it a try...
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_base_init),
(gst_ffmpegmux_init), (gst_ffmpegmux_request_new_pad),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_register):
Add some fixups that I use locally. Make it work in the case of
MPEG encoding, but the muxer is still not in shape to be enabled.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_read), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Some small fixups that crept into it while it was disabled for the
last few years. Basically works.
* gst-libs/ext/ffmpeg/Makefile.am:
Instead of having our local-autotoolized version, I patch the ffmpeg
source to be fully autotoolized. That means a simple SUBDIRS here
is now enough.
* gst-libs/ext/ffmpeg/Tag:
Version update.
* gst-libs/ext/ffmpeg/patch/autotools.diff:
Autotoolize ffmpeg. Needs to be sent to ffmpeg-devel@...
* gst-libs/ext/ffmpeg/patch/disableinstalllibs.diff:
Don't install their libs.
* gst-libs/ext/ffmpeg/patch/disablemmx.diff:
Don't use MMX. It cannot ocmpile using PIC.
* gst-libs/ext/ffmpeg/patch/disabletools.diff:
Don't compile/install their tools, we don't use them.
* gst-libs/ext/ffmpeg/patch/functions.diff:
Prevent symbol conflicts.
* gst-libs/ext/ffmpeg/patch/matroska.diff:
Add a matroska demuxer. Needs to be sent to ffmpeg-devel@...
2004-03-01 04:59:17 +00:00
|
|
|
caps = gst_caps_new_simple ("application/x-pn-realmedia",
|
2004-03-29 16:39:18 +00:00
|
|
|
"systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "asf")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("video/x-ms-asf");
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "avi")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("video/x-msvideo");
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "wav")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("audio/x-wav");
|
2008-04-19 19:43:54 +00:00
|
|
|
} else if (!strcmp (format_name, "ape")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("application/x-ape");
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "swf")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("application/x-shockwave-flash");
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "au")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("audio/x-au");
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "dv")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
caps = gst_caps_new_simple ("video/x-dv",
|
2004-03-29 16:39:18 +00:00
|
|
|
"systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
|
2003-06-08 13:30:10 +00:00
|
|
|
} else if (!strcmp (format_name, "4xm")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("video/x-4xm");
|
2004-03-05 02:40:34 +00:00
|
|
|
} else if (!strcmp (format_name, "matroska")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("video/x-matroska");
|
2016-11-16 15:06:54 +00:00
|
|
|
} else if (!strcmp (format_name, "ivf")) {
|
|
|
|
caps = gst_caps_new_empty_simple ("video/x-ivf");
|
2004-12-18 20:27:05 +00:00
|
|
|
} else if (!strcmp (format_name, "mp3")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("application/x-id3");
|
2005-01-19 17:25:29 +00:00
|
|
|
} else if (!strcmp (format_name, "flic")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("video/x-fli");
|
2005-06-27 20:41:55 +00:00
|
|
|
} else if (!strcmp (format_name, "flv")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("video/x-flv");
|
2006-02-19 16:54:51 +00:00
|
|
|
} else if (!strcmp (format_name, "tta")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("audio/x-ttafile");
|
2006-02-19 16:54:51 +00:00
|
|
|
} else if (!strcmp (format_name, "aiff")) {
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple ("audio/x-aiff");
|
2006-02-19 16:54:51 +00:00
|
|
|
} else if (!strcmp (format_name, "mov_mp4_m4a_3gp_3g2")) {
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
caps =
|
|
|
|
gst_caps_from_string
|
|
|
|
("application/x-3gp; video/quicktime; audio/x-m4a");
|
2006-04-19 15:35:12 +00:00
|
|
|
} else if (!strcmp (format_name, "mov")) {
|
2010-07-02 10:40:03 +00:00
|
|
|
caps = gst_caps_from_string ("video/quicktime,variant=(string)apple");
|
2006-04-19 15:35:12 +00:00
|
|
|
} else if (!strcmp (format_name, "mp4")) {
|
2010-07-02 10:40:03 +00:00
|
|
|
caps = gst_caps_from_string ("video/quicktime,variant=(string)iso");
|
2010-07-06 10:03:25 +00:00
|
|
|
} else if (!strcmp (format_name, "3gp")) {
|
|
|
|
caps = gst_caps_from_string ("video/quicktime,variant=(string)3gpp");
|
|
|
|
} else if (!strcmp (format_name, "3g2")) {
|
|
|
|
caps = gst_caps_from_string ("video/quicktime,variant=(string)3g2");
|
|
|
|
} else if (!strcmp (format_name, "psp")) {
|
|
|
|
caps = gst_caps_from_string ("video/quicktime,variant=(string)psp");
|
|
|
|
} else if (!strcmp (format_name, "ipod")) {
|
|
|
|
caps = gst_caps_from_string ("video/quicktime,variant=(string)ipod");
|
2006-02-21 14:14:39 +00:00
|
|
|
} else if (!strcmp (format_name, "aac")) {
|
|
|
|
caps = gst_caps_new_simple ("audio/mpeg",
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
"mpegversion", G_TYPE_INT, 4, NULL);
|
2006-02-21 14:14:39 +00:00
|
|
|
} else if (!strcmp (format_name, "gif")) {
|
|
|
|
caps = gst_caps_from_string ("image/gif");
|
|
|
|
} else if (!strcmp (format_name, "ogg")) {
|
|
|
|
caps = gst_caps_from_string ("application/ogg");
|
2009-03-04 11:24:47 +00:00
|
|
|
} else if (!strcmp (format_name, "mxf") || !strcmp (format_name, "mxf_d10")) {
|
2006-10-09 13:31:55 +00:00
|
|
|
caps = gst_caps_from_string ("application/mxf");
|
|
|
|
} else if (!strcmp (format_name, "gxf")) {
|
|
|
|
caps = gst_caps_from_string ("application/gxf");
|
2006-02-21 14:14:39 +00:00
|
|
|
} else if (!strcmp (format_name, "yuv4mpegpipe")) {
|
|
|
|
caps = gst_caps_new_simple ("application/x-yuv4mpeg",
|
2007-01-11 10:02:40 +00:00
|
|
|
"y4mversion", G_TYPE_INT, 2, NULL);
|
2008-04-19 20:27:25 +00:00
|
|
|
} else if (!strcmp (format_name, "mpc")) {
|
|
|
|
caps = gst_caps_from_string ("audio/x-musepack, streamversion = (int) 7");
|
2015-07-22 08:44:27 +00:00
|
|
|
} else if (!strcmp (format_name, "mpc8")) {
|
|
|
|
caps = gst_caps_from_string ("audio/x-musepack, streamversion = (int) 8");
|
2009-05-13 14:21:36 +00:00
|
|
|
} else if (!strcmp (format_name, "vqf")) {
|
2010-01-06 10:53:23 +00:00
|
|
|
caps = gst_caps_from_string ("audio/x-vqf");
|
2010-03-23 17:53:24 +00:00
|
|
|
} else if (!strcmp (format_name, "nsv")) {
|
|
|
|
caps = gst_caps_from_string ("video/x-nsv");
|
2010-07-06 10:03:25 +00:00
|
|
|
} else if (!strcmp (format_name, "amr")) {
|
|
|
|
caps = gst_caps_from_string ("audio/x-amr-nb-sh");
|
|
|
|
} else if (!strcmp (format_name, "webm")) {
|
|
|
|
caps = gst_caps_from_string ("video/webm");
|
2012-03-13 12:24:39 +00:00
|
|
|
} else if (!strcmp (format_name, "voc")) {
|
|
|
|
caps = gst_caps_from_string ("audio/x-voc");
|
2013-08-22 12:23:12 +00:00
|
|
|
} else if (!strcmp (format_name, "pva")) {
|
|
|
|
caps = gst_caps_from_string ("video/x-pva");
|
2017-10-19 14:15:26 +00:00
|
|
|
} else if (!strcmp (format_name, "brstm")) {
|
|
|
|
caps = gst_caps_from_string ("audio/x-brstm");
|
|
|
|
} else if (!strcmp (format_name, "bfstm")) {
|
|
|
|
caps = gst_caps_from_string ("audio/x-bfstm");
|
2003-06-08 13:30:10 +00:00
|
|
|
} else {
|
HACKING: Add some basic documentation on how our wrapping works.
Original commit message from CVS:
* HACKING:
Add some basic documentation on how our wrapping works.
* TODO:
Add a list of things that could be worked on or that need doing.
* configure.ac:
Update snapshot.
* ext/ffmpeg/Makefile.am:
Changne .la links. See below (autotools patch).
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable demuxers. See below (gstffmpegdemux.c).
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_formatid_to_caps):
Realmedia caused a crash - fix that.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_averror),
(gst_ffmpegdemux_base_init), (gst_ffmpegdemux_init),
(gst_ffmpegdemux_close), (gst_ffmpegdemux_dispose),
(gst_ffmpegdemux_stream_from_pad),
(gst_ffmpegdemux_src_event_mask), (gst_ffmpegdemux_src_event),
(gst_ffmpegdemux_src_format_list),
(gst_ffmpegdemux_src_query_list), (gst_ffmpegdemux_src_query),
(gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_add),
(gst_ffmpegdemux_open), (gst_ffmpegdemux_loop),
(gst_ffmpegdemux_change_state), (gst_ffmpegdemux_register):
Right. OK, so I fixed up the demuxing and have it basically-working,
and the best way to get some more people to test it is to actually
enable it. I'm not sure if we want this for 0.8.0, but we can at
least give it a try. I've tested avi, matroska and mpeg, all appear
to work. The cool thing is that this gives us instant support for
several exotic formats that we'd never care about ourselves. Again,
this needs more testing for it to still be enabled in 0.8.0, but I
want to give it a try...
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_base_init),
(gst_ffmpegmux_init), (gst_ffmpegmux_request_new_pad),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_register):
Add some fixups that I use locally. Make it work in the case of
MPEG encoding, but the muxer is still not in shape to be enabled.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_read), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Some small fixups that crept into it while it was disabled for the
last few years. Basically works.
* gst-libs/ext/ffmpeg/Makefile.am:
Instead of having our local-autotoolized version, I patch the ffmpeg
source to be fully autotoolized. That means a simple SUBDIRS here
is now enough.
* gst-libs/ext/ffmpeg/Tag:
Version update.
* gst-libs/ext/ffmpeg/patch/autotools.diff:
Autotoolize ffmpeg. Needs to be sent to ffmpeg-devel@...
* gst-libs/ext/ffmpeg/patch/disableinstalllibs.diff:
Don't install their libs.
* gst-libs/ext/ffmpeg/patch/disablemmx.diff:
Don't use MMX. It cannot ocmpile using PIC.
* gst-libs/ext/ffmpeg/patch/disabletools.diff:
Don't compile/install their tools, we don't use them.
* gst-libs/ext/ffmpeg/patch/functions.diff:
Prevent symbol conflicts.
* gst-libs/ext/ffmpeg/patch/matroska.diff:
Add a matroska demuxer. Needs to be sent to ffmpeg-devel@...
2004-03-01 04:59:17 +00:00
|
|
|
gchar *name;
|
|
|
|
|
2006-05-26 12:42:06 +00:00
|
|
|
GST_LOG ("Could not create stream format caps for %s", format_name);
|
2012-08-07 08:19:16 +00:00
|
|
|
name = g_strdup_printf ("application/x-gst-av-%s", format_name);
|
2011-10-28 14:35:54 +00:00
|
|
|
caps = gst_caps_new_empty_simple (name);
|
HACKING: Add some basic documentation on how our wrapping works.
Original commit message from CVS:
* HACKING:
Add some basic documentation on how our wrapping works.
* TODO:
Add a list of things that could be worked on or that need doing.
* configure.ac:
Update snapshot.
* ext/ffmpeg/Makefile.am:
Changne .la links. See below (autotools patch).
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable demuxers. See below (gstffmpegdemux.c).
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_formatid_to_caps):
Realmedia caused a crash - fix that.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_averror),
(gst_ffmpegdemux_base_init), (gst_ffmpegdemux_init),
(gst_ffmpegdemux_close), (gst_ffmpegdemux_dispose),
(gst_ffmpegdemux_stream_from_pad),
(gst_ffmpegdemux_src_event_mask), (gst_ffmpegdemux_src_event),
(gst_ffmpegdemux_src_format_list),
(gst_ffmpegdemux_src_query_list), (gst_ffmpegdemux_src_query),
(gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_add),
(gst_ffmpegdemux_open), (gst_ffmpegdemux_loop),
(gst_ffmpegdemux_change_state), (gst_ffmpegdemux_register):
Right. OK, so I fixed up the demuxing and have it basically-working,
and the best way to get some more people to test it is to actually
enable it. I'm not sure if we want this for 0.8.0, but we can at
least give it a try. I've tested avi, matroska and mpeg, all appear
to work. The cool thing is that this gives us instant support for
several exotic formats that we'd never care about ourselves. Again,
this needs more testing for it to still be enabled in 0.8.0, but I
want to give it a try...
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_base_init),
(gst_ffmpegmux_init), (gst_ffmpegmux_request_new_pad),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_register):
Add some fixups that I use locally. Make it work in the case of
MPEG encoding, but the muxer is still not in shape to be enabled.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_read), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Some small fixups that crept into it while it was disabled for the
last few years. Basically works.
* gst-libs/ext/ffmpeg/Makefile.am:
Instead of having our local-autotoolized version, I patch the ffmpeg
source to be fully autotoolized. That means a simple SUBDIRS here
is now enough.
* gst-libs/ext/ffmpeg/Tag:
Version update.
* gst-libs/ext/ffmpeg/patch/autotools.diff:
Autotoolize ffmpeg. Needs to be sent to ffmpeg-devel@...
* gst-libs/ext/ffmpeg/patch/disableinstalllibs.diff:
Don't install their libs.
* gst-libs/ext/ffmpeg/patch/disablemmx.diff:
Don't use MMX. It cannot ocmpile using PIC.
* gst-libs/ext/ffmpeg/patch/disabletools.diff:
Don't compile/install their tools, we don't use them.
* gst-libs/ext/ffmpeg/patch/functions.diff:
Prevent symbol conflicts.
* gst-libs/ext/ffmpeg/patch/matroska.diff:
Add a matroska demuxer. Needs to be sent to ffmpeg-devel@...
2004-03-01 04:59:17 +00:00
|
|
|
g_free (name);
|
2003-06-08 13:30:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
|
ext/ffmpeg/gstffmpeg.c: Enable muxers (only mp4 muxer for now).
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable muxers (only mp4 muxer for now).
* ext/ffmpeg/gstffmpegcodecmap.c:
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Fix a bunch of typos in codec-id lookup (false/true return value
mixup), add a codec-id list retrieval function (because ffmpeg
does not provide one). With that, we can make valid pad templates.
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_init),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_change_state), (gst_ffmpegmux_get_id_caps),
(gst_ffmpegmux_register):
Fix for whatever changed since I last tried this. Works for MP4
muxing.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Update obviously-untested write code...
2005-03-14 15:27:43 +00:00
|
|
|
gboolean
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
|
2014-01-03 15:28:44 +00:00
|
|
|
enum AVCodecID **video_codec_list, enum AVCodecID **audio_codec_list,
|
2009-02-27 08:40:03 +00:00
|
|
|
AVOutputFormat * plugin)
|
ext/ffmpeg/gstffmpeg.c: Enable muxers (only mp4 muxer for now).
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable muxers (only mp4 muxer for now).
* ext/ffmpeg/gstffmpegcodecmap.c:
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Fix a bunch of typos in codec-id lookup (false/true return value
mixup), add a codec-id list retrieval function (because ffmpeg
does not provide one). With that, we can make valid pad templates.
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_init),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_change_state), (gst_ffmpegmux_get_id_caps),
(gst_ffmpegmux_register):
Fix for whatever changed since I last tried this. Works for MP4
muxing.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Update obviously-untested write code...
2005-03-14 15:27:43 +00:00
|
|
|
{
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID tmp_vlist[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_NONE,
|
|
|
|
AV_CODEC_ID_NONE
|
2009-02-27 08:40:03 +00:00
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID tmp_alist[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_NONE,
|
|
|
|
AV_CODEC_ID_NONE
|
2009-02-27 08:40:03 +00:00
|
|
|
};
|
2006-04-19 15:35:12 +00:00
|
|
|
|
|
|
|
GST_LOG ("format_name : %s", format_name);
|
|
|
|
|
ext/ffmpeg/gstffmpeg.c: Enable muxers (only mp4 muxer for now).
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable muxers (only mp4 muxer for now).
* ext/ffmpeg/gstffmpegcodecmap.c:
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Fix a bunch of typos in codec-id lookup (false/true return value
mixup), add a codec-id list retrieval function (because ffmpeg
does not provide one). With that, we can make valid pad templates.
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_init),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_change_state), (gst_ffmpegmux_get_id_caps),
(gst_ffmpegmux_register):
Fix for whatever changed since I last tried this. Works for MP4
muxing.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Update obviously-untested write code...
2005-03-14 15:27:43 +00:00
|
|
|
if (!strcmp (format_name, "mp4")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mp4_video_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_MPEG4, AV_CODEC_ID_H264,
|
|
|
|
AV_CODEC_ID_MJPEG,
|
|
|
|
AV_CODEC_ID_NONE
|
2006-12-07 18:07:32 +00:00
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mp4_audio_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_AAC, AV_CODEC_ID_MP3,
|
|
|
|
AV_CODEC_ID_NONE
|
2006-12-07 18:07:32 +00:00
|
|
|
};
|
ext/ffmpeg/gstffmpeg.c: Enable muxers (only mp4 muxer for now).
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable muxers (only mp4 muxer for now).
* ext/ffmpeg/gstffmpegcodecmap.c:
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Fix a bunch of typos in codec-id lookup (false/true return value
mixup), add a codec-id list retrieval function (because ffmpeg
does not provide one). With that, we can make valid pad templates.
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_init),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_change_state), (gst_ffmpegmux_get_id_caps),
(gst_ffmpegmux_register):
Fix for whatever changed since I last tried this. Works for MP4
muxing.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Update obviously-untested write code...
2005-03-14 15:27:43 +00:00
|
|
|
|
|
|
|
*video_codec_list = mp4_video_list;
|
|
|
|
*audio_codec_list = mp4_audio_list;
|
2005-04-21 14:19:21 +00:00
|
|
|
} else if (!strcmp (format_name, "mpeg")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mpeg_video_list[] = { AV_CODEC_ID_MPEG1VIDEO,
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_MPEG2VIDEO,
|
|
|
|
AV_CODEC_ID_H264,
|
|
|
|
AV_CODEC_ID_NONE
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mpeg_audio_list[] = { AV_CODEC_ID_MP1,
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_MP2,
|
|
|
|
AV_CODEC_ID_MP3,
|
|
|
|
AV_CODEC_ID_NONE
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
};
|
2005-04-21 14:19:21 +00:00
|
|
|
|
2009-03-05 07:52:11 +00:00
|
|
|
*video_codec_list = mpeg_video_list;
|
|
|
|
*audio_codec_list = mpeg_audio_list;
|
|
|
|
} else if (!strcmp (format_name, "dvd")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mpeg_video_list[] = { AV_CODEC_ID_MPEG2VIDEO,
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_NONE
|
2009-03-05 07:52:11 +00:00
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mpeg_audio_list[] = { AV_CODEC_ID_MP2,
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_AC3,
|
|
|
|
AV_CODEC_ID_DTS,
|
|
|
|
AV_CODEC_ID_PCM_S16BE,
|
|
|
|
AV_CODEC_ID_NONE
|
2009-03-05 07:52:11 +00:00
|
|
|
};
|
|
|
|
|
2005-04-21 14:19:21 +00:00
|
|
|
*video_codec_list = mpeg_video_list;
|
|
|
|
*audio_codec_list = mpeg_audio_list;
|
2006-04-19 15:35:12 +00:00
|
|
|
} else if (!strcmp (format_name, "mpegts")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mpegts_video_list[] = { AV_CODEC_ID_MPEG1VIDEO,
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_MPEG2VIDEO,
|
|
|
|
AV_CODEC_ID_H264,
|
|
|
|
AV_CODEC_ID_NONE
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mpegts_audio_list[] = { AV_CODEC_ID_MP2,
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_MP3,
|
|
|
|
AV_CODEC_ID_AC3,
|
|
|
|
AV_CODEC_ID_DTS,
|
|
|
|
AV_CODEC_ID_AAC,
|
|
|
|
AV_CODEC_ID_NONE
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
};
|
2006-04-19 15:35:12 +00:00
|
|
|
|
|
|
|
*video_codec_list = mpegts_video_list;
|
|
|
|
*audio_codec_list = mpegts_audio_list;
|
ext/: Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly some added codecs, some API changes, etc. Also add...
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.h:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_formatid_get_codecids),
(gst_ffmpeg_caps_to_codecid), (gst_ffmpeg_get_codecid_longname),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_negotiate),
(gst_ffmpegdec_frame), (gst_ffmpegdec_chain),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdeinterlace.c:
(gst_ffmpegdeinterlace_getcaps), (gst_ffmpegdeinterlace_pad_link):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_event),
(gst_ffmpegdemux_src_format_list), (gst_ffmpegdemux_src_query),
(gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_add),
(gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_link), (gst_ffmpegenc_chain_video),
(gst_ffmpegenc_chain_audio):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_request_new_pad),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_register):
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_write):
* ext/ffmpeg/gstffmpegscale.c: (gst_ffmpegscale_pad_link):
* ext/libpostproc/gstpostproc.c: (gst_postproc_chain):
Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly
some added codecs, some API changes, etc. Also adds a VOB muxer
for MPEG-2 video and adds h264 to .mp4 muxing.
2005-07-20 15:40:57 +00:00
|
|
|
} else if (!strcmp (format_name, "vob")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID vob_video_list[] =
|
2013-05-06 22:56:22 +00:00
|
|
|
{ AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_NONE };
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID vob_audio_list[] = { AV_CODEC_ID_MP2, AV_CODEC_ID_AC3,
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_DTS, AV_CODEC_ID_NONE
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
};
|
ext/: Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly some added codecs, some API changes, etc. Also add...
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.h:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_formatid_get_codecids),
(gst_ffmpeg_caps_to_codecid), (gst_ffmpeg_get_codecid_longname),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_negotiate),
(gst_ffmpegdec_frame), (gst_ffmpegdec_chain),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdeinterlace.c:
(gst_ffmpegdeinterlace_getcaps), (gst_ffmpegdeinterlace_pad_link):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_event),
(gst_ffmpegdemux_src_format_list), (gst_ffmpegdemux_src_query),
(gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_add),
(gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_link), (gst_ffmpegenc_chain_video),
(gst_ffmpegenc_chain_audio):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_request_new_pad),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_register):
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_write):
* ext/ffmpeg/gstffmpegscale.c: (gst_ffmpegscale_pad_link):
* ext/libpostproc/gstpostproc.c: (gst_postproc_chain):
Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly
some added codecs, some API changes, etc. Also adds a VOB muxer
for MPEG-2 video and adds h264 to .mp4 muxing.
2005-07-20 15:40:57 +00:00
|
|
|
|
|
|
|
*video_codec_list = vob_video_list;
|
|
|
|
*audio_codec_list = vob_audio_list;
|
2005-06-27 20:41:55 +00:00
|
|
|
} else if (!strcmp (format_name, "flv")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID flv_video_list[] =
|
2013-05-06 22:56:22 +00:00
|
|
|
{ AV_CODEC_ID_FLV1, AV_CODEC_ID_NONE };
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID flv_audio_list[] =
|
2013-05-06 22:56:22 +00:00
|
|
|
{ AV_CODEC_ID_MP3, AV_CODEC_ID_NONE };
|
2005-06-27 20:41:55 +00:00
|
|
|
|
|
|
|
*video_codec_list = flv_video_list;
|
|
|
|
*audio_codec_list = flv_audio_list;
|
2006-10-09 13:31:55 +00:00
|
|
|
} else if (!strcmp (format_name, "asf")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID asf_video_list[] =
|
2013-05-06 22:56:22 +00:00
|
|
|
{ AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2, AV_CODEC_ID_MSMPEG4V3,
|
|
|
|
AV_CODEC_ID_NONE
|
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID asf_audio_list[] =
|
2013-05-06 22:56:22 +00:00
|
|
|
{ AV_CODEC_ID_WMAV1, AV_CODEC_ID_WMAV2, AV_CODEC_ID_MP3,
|
|
|
|
AV_CODEC_ID_NONE
|
|
|
|
};
|
2006-10-09 13:31:55 +00:00
|
|
|
|
|
|
|
*video_codec_list = asf_video_list;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
*audio_codec_list = asf_audio_list;
|
2006-10-13 13:13:08 +00:00
|
|
|
} else if (!strcmp (format_name, "dv")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID dv_video_list[] =
|
2013-05-06 22:56:22 +00:00
|
|
|
{ AV_CODEC_ID_DVVIDEO, AV_CODEC_ID_NONE };
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID dv_audio_list[] =
|
2013-05-06 22:56:22 +00:00
|
|
|
{ AV_CODEC_ID_PCM_S16LE, AV_CODEC_ID_NONE };
|
2006-10-13 13:13:08 +00:00
|
|
|
|
|
|
|
*video_codec_list = dv_video_list;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
*audio_codec_list = dv_audio_list;
|
2006-10-13 13:13:08 +00:00
|
|
|
} else if (!strcmp (format_name, "mov")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mov_video_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_SVQ1, AV_CODEC_ID_SVQ3, AV_CODEC_ID_MPEG4,
|
|
|
|
AV_CODEC_ID_H263, AV_CODEC_ID_H263P,
|
|
|
|
AV_CODEC_ID_H264, AV_CODEC_ID_DVVIDEO,
|
|
|
|
AV_CODEC_ID_MJPEG,
|
|
|
|
AV_CODEC_ID_NONE
|
2006-10-13 13:13:08 +00:00
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mov_audio_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_ADPCM_IMA_QT,
|
|
|
|
AV_CODEC_ID_MACE3, AV_CODEC_ID_MACE6, AV_CODEC_ID_AAC,
|
|
|
|
AV_CODEC_ID_AMR_NB, AV_CODEC_ID_AMR_WB,
|
|
|
|
AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE,
|
|
|
|
AV_CODEC_ID_MP3, AV_CODEC_ID_NONE
|
2006-10-13 13:13:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
*video_codec_list = mov_video_list;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
*audio_codec_list = mov_audio_list;
|
|
|
|
} else if ((!strcmp (format_name, "3gp") || !strcmp (format_name, "3g2"))) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID tgp_video_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_MPEG4, AV_CODEC_ID_H263, AV_CODEC_ID_H263P, AV_CODEC_ID_H264,
|
|
|
|
AV_CODEC_ID_NONE
|
2006-12-07 18:07:32 +00:00
|
|
|
};
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID tgp_audio_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_AMR_NB, AV_CODEC_ID_AMR_WB,
|
|
|
|
AV_CODEC_ID_AAC,
|
|
|
|
AV_CODEC_ID_NONE
|
2006-12-07 18:07:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
*video_codec_list = tgp_video_list;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
*audio_codec_list = tgp_audio_list;
|
2006-11-14 12:34:20 +00:00
|
|
|
} else if (!strcmp (format_name, "mmf")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID mmf_audio_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_ADPCM_YAMAHA, AV_CODEC_ID_NONE
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
};
|
2006-11-14 12:34:20 +00:00
|
|
|
*video_codec_list = NULL;
|
|
|
|
*audio_codec_list = mmf_audio_list;
|
2006-12-07 18:07:32 +00:00
|
|
|
} else if (!strcmp (format_name, "amr")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID amr_audio_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_AMR_NB, AV_CODEC_ID_AMR_WB,
|
|
|
|
AV_CODEC_ID_NONE
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
};
|
2006-12-07 18:07:32 +00:00
|
|
|
*video_codec_list = NULL;
|
|
|
|
*audio_codec_list = amr_audio_list;
|
2007-12-17 20:31:35 +00:00
|
|
|
} else if (!strcmp (format_name, "gif")) {
|
2014-01-03 15:28:44 +00:00
|
|
|
static enum AVCodecID gif_image_list[] = {
|
2013-05-06 22:56:22 +00:00
|
|
|
AV_CODEC_ID_RAWVIDEO, AV_CODEC_ID_NONE
|
2007-12-17 20:31:35 +00:00
|
|
|
};
|
|
|
|
*video_codec_list = gif_image_list;
|
|
|
|
*audio_codec_list = NULL;
|
2013-08-22 12:23:12 +00:00
|
|
|
} else if ((!strcmp (format_name, "pva"))) {
|
2018-07-03 11:15:54 +00:00
|
|
|
static enum AVCodecID pga_video_list[] = {
|
2013-08-22 12:23:12 +00:00
|
|
|
AV_CODEC_ID_MPEG2VIDEO,
|
|
|
|
AV_CODEC_ID_NONE
|
|
|
|
};
|
2018-07-03 11:15:54 +00:00
|
|
|
static enum AVCodecID pga_audio_list[] = {
|
2013-08-22 12:23:12 +00:00
|
|
|
AV_CODEC_ID_MP2,
|
|
|
|
AV_CODEC_ID_NONE
|
|
|
|
};
|
|
|
|
|
2018-07-03 11:15:54 +00:00
|
|
|
*video_codec_list = pga_video_list;
|
|
|
|
*audio_codec_list = pga_audio_list;
|
2020-01-15 06:36:19 +00:00
|
|
|
} else if ((!strcmp (format_name, "ivf"))) {
|
|
|
|
static enum AVCodecID ivf_video_list[] = {
|
|
|
|
AV_CODEC_ID_VP8,
|
|
|
|
AV_CODEC_ID_VP9,
|
|
|
|
AV_CODEC_ID_AV1,
|
|
|
|
AV_CODEC_ID_NONE
|
|
|
|
};
|
|
|
|
static enum AVCodecID ivf_audio_list[] = {
|
|
|
|
AV_CODEC_ID_NONE
|
|
|
|
};
|
|
|
|
|
|
|
|
*video_codec_list = ivf_video_list;
|
|
|
|
*audio_codec_list = ivf_audio_list;
|
2018-07-03 11:15:54 +00:00
|
|
|
} else if ((plugin->audio_codec != AV_CODEC_ID_NONE) ||
|
|
|
|
(plugin->video_codec != AV_CODEC_ID_NONE)) {
|
|
|
|
tmp_vlist[0] = plugin->video_codec;
|
|
|
|
tmp_alist[0] = plugin->audio_codec;
|
|
|
|
|
|
|
|
*video_codec_list = tmp_vlist;
|
|
|
|
*audio_codec_list = tmp_alist;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
} else {
|
2006-05-26 12:42:06 +00:00
|
|
|
GST_LOG ("Format %s not found", format_name);
|
ext/ffmpeg/gstffmpeg.c: Enable muxers (only mp4 muxer for now).
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable muxers (only mp4 muxer for now).
* ext/ffmpeg/gstffmpegcodecmap.c:
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Fix a bunch of typos in codec-id lookup (false/true return value
mixup), add a codec-id list retrieval function (because ffmpeg
does not provide one). With that, we can make valid pad templates.
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_init),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_change_state), (gst_ffmpegmux_get_id_caps),
(gst_ffmpegmux_register):
Fix for whatever changed since I last tried this. Works for MP4
muxing.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Update obviously-untested write code...
2005-03-14 15:27:43 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-07-06 20:49:15 +00:00
|
|
|
/* Convert a GstCaps to a FFMPEG codec ID. Size et all
|
|
|
|
* are omitted, that can be queried by the user itself,
|
|
|
|
* we're not eating the GstCaps or anything
|
|
|
|
* A pointer to an allocated context is also needed for
|
2004-03-15 00:01:03 +00:00
|
|
|
* optional extra info
|
2003-07-06 20:49:15 +00:00
|
|
|
*/
|
|
|
|
|
2014-01-03 15:28:44 +00:00
|
|
|
enum AVCodecID
|
2004-03-29 16:39:18 +00:00
|
|
|
gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
|
2003-07-06 20:49:15 +00:00
|
|
|
{
|
2014-01-03 15:28:44 +00:00
|
|
|
enum AVCodecID id = AV_CODEC_ID_NONE;
|
2003-07-06 20:49:15 +00:00
|
|
|
const gchar *mimetype;
|
2003-12-22 01:46:58 +00:00
|
|
|
const GstStructure *structure;
|
2004-03-29 16:39:18 +00:00
|
|
|
gboolean video = FALSE, audio = FALSE; /* we want to be sure! */
|
2003-07-06 20:49:15 +00:00
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
g_return_val_if_fail (caps != NULL, AV_CODEC_ID_NONE);
|
|
|
|
g_return_val_if_fail (gst_caps_get_size (caps) == 1, AV_CODEC_ID_NONE);
|
2003-12-22 01:46:58 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-03-29 16:39:18 +00:00
|
|
|
|
2003-12-22 01:46:58 +00:00
|
|
|
mimetype = gst_structure_get_name (structure);
|
2003-07-06 20:49:15 +00:00
|
|
|
|
2011-06-20 09:57:29 +00:00
|
|
|
if (!strcmp (mimetype, "video/x-raw")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_RAWVIDEO;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
video = TRUE;
|
2011-08-19 16:33:11 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-raw")) {
|
|
|
|
GstAudioInfo info;
|
|
|
|
|
|
|
|
if (gst_audio_info_from_caps (&info, caps)) {
|
|
|
|
switch (GST_AUDIO_INFO_FORMAT (&info)) {
|
|
|
|
case GST_AUDIO_FORMAT_S8:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_S8;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
|
|
|
case GST_AUDIO_FORMAT_U8:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_U8;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
2011-09-06 13:29:26 +00:00
|
|
|
case GST_AUDIO_FORMAT_S16LE:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_S16LE;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
2011-09-06 13:29:26 +00:00
|
|
|
case GST_AUDIO_FORMAT_S16BE:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_S16BE;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
2011-09-06 13:29:26 +00:00
|
|
|
case GST_AUDIO_FORMAT_U16LE:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_U16LE;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
2011-09-06 13:29:26 +00:00
|
|
|
case GST_AUDIO_FORMAT_U16BE:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_U16BE;
|
2011-08-19 16:33:11 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-03-29 16:39:18 +00:00
|
|
|
break;
|
2003-12-22 01:46:58 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2004-03-29 16:39:18 +00:00
|
|
|
audio = TRUE;
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-mulaw")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_MULAW;
|
2003-07-06 20:49:15 +00:00
|
|
|
audio = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-alaw")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_PCM_ALAW;
|
2003-07-06 20:49:15 +00:00
|
|
|
audio = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-dv")) {
|
2005-01-06 10:28:18 +00:00
|
|
|
gboolean sys_strm;
|
|
|
|
|
ext/ffmpeg/gstffmpeg.c: Enable muxers (only mp4 muxer for now).
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable muxers (only mp4 muxer for now).
* ext/ffmpeg/gstffmpegcodecmap.c:
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Fix a bunch of typos in codec-id lookup (false/true return value
mixup), add a codec-id list retrieval function (because ffmpeg
does not provide one). With that, we can make valid pad templates.
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_init),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_change_state), (gst_ffmpegmux_get_id_caps),
(gst_ffmpegmux_register):
Fix for whatever changed since I last tried this. Works for MP4
muxing.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Update obviously-untested write code...
2005-03-14 15:27:43 +00:00
|
|
|
if (gst_structure_get_boolean (structure, "systemstream", &sys_strm) &&
|
2005-01-06 10:28:18 +00:00
|
|
|
!sys_strm) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_DVVIDEO;
|
2005-01-06 10:28:18 +00:00
|
|
|
video = TRUE;
|
|
|
|
}
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-dv")) { /* ??? */
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_DVAUDIO;
|
2003-07-06 20:49:15 +00:00
|
|
|
audio = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-h263")) {
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
const gchar *h263version =
|
|
|
|
gst_structure_get_string (structure, "h263version");
|
2006-11-16 07:28:28 +00:00
|
|
|
if (h263version && !strcmp (h263version, "h263p"))
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_H263P;
|
2006-11-16 07:28:28 +00:00
|
|
|
else
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_H263;
|
2005-01-19 12:41:34 +00:00
|
|
|
video = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-intel-h263")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_H263I;
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
2004-12-16 18:14:19 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-h261")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_H261;
|
2004-12-16 18:14:19 +00:00
|
|
|
video = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/mpeg")) {
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gboolean sys_strm;
|
|
|
|
gint mpegversion;
|
2003-07-06 20:49:15 +00:00
|
|
|
|
ext/ffmpeg/gstffmpeg.c: Enable muxers (only mp4 muxer for now).
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (plugin_init):
Enable muxers (only mp4 muxer for now).
* ext/ffmpeg/gstffmpegcodecmap.c:
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Fix a bunch of typos in codec-id lookup (false/true return value
mixup), add a codec-id list retrieval function (because ffmpeg
does not provide one). With that, we can make valid pad templates.
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_init),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_change_state), (gst_ffmpegmux_get_id_caps),
(gst_ffmpegmux_register):
Fix for whatever changed since I last tried this. Works for MP4
muxing.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
(gst_ffmpegdata_peek), (gst_ffmpegdata_write),
(gst_ffmpegdata_seek), (gst_ffmpegdata_close):
Update obviously-untested write code...
2005-03-14 15:27:43 +00:00
|
|
|
if (gst_structure_get_boolean (structure, "systemstream", &sys_strm) &&
|
|
|
|
gst_structure_get_int (structure, "mpegversion", &mpegversion) &&
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
!sys_strm) {
|
2003-07-06 20:49:15 +00:00
|
|
|
switch (mpegversion) {
|
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MPEG1VIDEO;
|
2003-07-06 20:49:15 +00:00
|
|
|
break;
|
2004-03-15 00:01:03 +00:00
|
|
|
case 2:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MPEG2VIDEO;
|
2004-03-15 00:01:03 +00:00
|
|
|
break;
|
2003-07-06 20:49:15 +00:00
|
|
|
case 4:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MPEG4;
|
2003-07-06 20:49:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
2004-12-16 18:14:19 +00:00
|
|
|
} else if (!strcmp (mimetype, "image/jpeg")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MJPEG; /* A... B... */
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
2005-02-03 11:12:34 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-jpeg-b")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MJPEGB;
|
2005-02-03 11:12:34 +00:00
|
|
|
video = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-wmv")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint wmvversion = 0;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "wmvversion", &wmvversion)) {
|
|
|
|
switch (wmvversion) {
|
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_WMV1;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_WMV2;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
2005-04-21 19:01:36 +00:00
|
|
|
case 3:
|
2007-12-17 20:31:35 +00:00
|
|
|
{
|
2011-08-22 11:33:31 +00:00
|
|
|
const gchar *format;
|
2007-12-17 20:31:35 +00:00
|
|
|
|
2009-10-01 01:48:35 +00:00
|
|
|
/* WMV3 unless the fourcc exists and says otherwise */
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_WMV3;
|
2009-10-01 01:48:35 +00:00
|
|
|
|
2011-10-11 12:02:53 +00:00
|
|
|
if ((format = gst_structure_get_string (structure, "format")) &&
|
|
|
|
(g_str_equal (format, "WVC1") || g_str_equal (format, "WMVA")))
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VC1;
|
2011-10-11 12:02:53 +00:00
|
|
|
|
2005-04-21 19:01:36 +00:00
|
|
|
break;
|
2011-08-22 11:33:31 +00:00
|
|
|
}
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
}
|
2003-12-22 01:46:58 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-12-22 01:46:58 +00:00
|
|
|
video = TRUE;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-vorbis")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VORBIS;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
audio = TRUE;
|
2005-10-23 16:07:46 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-qdm2")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_QDM2;
|
2005-10-23 16:07:46 +00:00
|
|
|
audio = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/mpeg")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint layer = 0;
|
|
|
|
gint mpegversion = 0;
|
2003-07-06 20:49:15 +00:00
|
|
|
|
2003-12-22 01:46:58 +00:00
|
|
|
if (gst_structure_get_int (structure, "mpegversion", &mpegversion)) {
|
2003-12-18 09:31:48 +00:00
|
|
|
switch (mpegversion) {
|
2004-03-29 16:39:18 +00:00
|
|
|
case 2: /* ffmpeg uses faad for both... */
|
2003-12-18 09:31:48 +00:00
|
|
|
case 4:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_AAC;
|
2003-07-06 20:49:15 +00:00
|
|
|
break;
|
2003-12-18 09:31:48 +00:00
|
|
|
case 1:
|
2003-12-22 01:46:58 +00:00
|
|
|
if (gst_structure_get_int (structure, "layer", &layer)) {
|
2003-12-18 09:31:48 +00:00
|
|
|
switch (layer) {
|
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MP1;
|
2009-01-24 16:59:11 +00:00
|
|
|
break;
|
2003-12-18 09:31:48 +00:00
|
|
|
case 2:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MP2;
|
2003-12-18 09:31:48 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MP3;
|
2003-12-18 09:31:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
audio = TRUE;
|
2008-04-19 20:27:25 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-musepack")) {
|
|
|
|
gint streamversion = -1;
|
|
|
|
|
|
|
|
if (gst_structure_get_int (structure, "streamversion", &streamversion)) {
|
|
|
|
if (streamversion == 7)
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MUSEPACK7;
|
2008-04-19 20:27:25 +00:00
|
|
|
} else {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MUSEPACK7;
|
2008-04-19 20:27:25 +00:00
|
|
|
}
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-wma")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint wmaversion = 0;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "wmaversion", &wmaversion)) {
|
|
|
|
switch (wmaversion) {
|
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_WMAV1;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_WMAV2;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
2010-01-06 10:53:23 +00:00
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_WMAPRO;
|
2010-01-06 10:53:23 +00:00
|
|
|
break;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
audio = TRUE;
|
2021-03-15 19:35:35 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-xma")) {
|
|
|
|
gint xmaversion = 0;
|
|
|
|
|
|
|
|
if (gst_structure_get_int (structure, "xmaversion", &xmaversion)) {
|
|
|
|
switch (xmaversion) {
|
|
|
|
case 1:
|
|
|
|
id = AV_CODEC_ID_XMA1;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
id = AV_CODEC_ID_XMA2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (id != AV_CODEC_ID_NONE)
|
|
|
|
audio = TRUE;
|
2010-02-18 12:24:39 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-wms")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_WMAVOICE;
|
2010-02-18 12:24:39 +00:00
|
|
|
audio = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-ac3")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_AC3;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
audio = TRUE;
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-eac3")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_EAC3;
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
audio = TRUE;
|
2009-03-10 20:14:21 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-vnd.sony.atrac3") ||
|
|
|
|
!strcmp (mimetype, "audio/atrac3")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ATRAC3;
|
2007-12-17 12:43:06 +00:00
|
|
|
audio = TRUE;
|
2006-05-07 01:18:46 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-dts")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_DTS;
|
2006-05-07 01:18:46 +00:00
|
|
|
audio = TRUE;
|
2008-04-19 19:43:54 +00:00
|
|
|
} else if (!strcmp (mimetype, "application/x-ape")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_APE;
|
2008-04-19 19:43:54 +00:00
|
|
|
audio = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-msmpeg")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint msmpegversion = 0;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "msmpegversion", &msmpegversion)) {
|
|
|
|
switch (msmpegversion) {
|
|
|
|
case 41:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MSMPEG4V1;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 42:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MSMPEG4V2;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 43:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MSMPEG4V3;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
2004-03-29 16:39:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-svq")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint svqversion = 0;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "svqversion", &svqversion)) {
|
|
|
|
switch (svqversion) {
|
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_SVQ1;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_SVQ3;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-huffyuv")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_HUFFYUV;
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
2023-03-22 14:48:18 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-ffvhuff")) {
|
|
|
|
id = AV_CODEC_ID_FFVHUFF;
|
|
|
|
video = TRUE;
|
2003-07-06 20:49:15 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-mace")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint maceversion = 0;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "maceversion", &maceversion)) {
|
|
|
|
switch (maceversion) {
|
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MACE3;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 6:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MACE6;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
audio = TRUE;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-theora")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_THEORA;
|
2004-03-15 00:01:03 +00:00
|
|
|
video = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-vp3")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VP3;
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
2006-09-20 20:02:16 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-vp5")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VP5;
|
2006-09-20 20:02:16 +00:00
|
|
|
video = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-vp6")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VP6;
|
2006-09-20 20:02:16 +00:00
|
|
|
video = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-vp6-flash")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VP6F;
|
2006-09-20 20:02:16 +00:00
|
|
|
video = TRUE;
|
2007-12-17 12:43:06 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-vp6-alpha")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VP6A;
|
2007-12-17 12:43:06 +00:00
|
|
|
video = TRUE;
|
2011-01-24 16:20:56 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-vp8")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_VP8;
|
2011-01-24 16:20:56 +00:00
|
|
|
video = TRUE;
|
2015-06-26 15:30:25 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-vp9")) {
|
|
|
|
id = AV_CODEC_ID_VP9;
|
|
|
|
video = TRUE;
|
2023-03-22 11:52:08 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-av1")) {
|
|
|
|
id = AV_CODEC_ID_AV1;
|
|
|
|
video = TRUE;
|
2006-09-23 12:00:15 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-flash-screen")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_FLASHSV;
|
2006-09-23 12:00:15 +00:00
|
|
|
video = TRUE;
|
2016-12-04 21:39:00 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-flash-screen2")) {
|
|
|
|
id = AV_CODEC_ID_FLASHSV2;
|
|
|
|
video = TRUE;
|
2017-03-14 13:01:41 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-cineform")) {
|
|
|
|
id = AV_CODEC_ID_CFHD;
|
|
|
|
video = TRUE;
|
2020-06-26 10:11:56 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-speedhq")) {
|
|
|
|
id = AV_CODEC_ID_SPEEDHQ;
|
|
|
|
video = TRUE;
|
2003-07-06 20:49:15 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-indeo")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint indeoversion = 0;
|
|
|
|
|
2005-04-21 19:01:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "indeoversion", &indeoversion)) {
|
|
|
|
switch (indeoversion) {
|
2010-02-18 12:27:15 +00:00
|
|
|
case 5:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_INDEO5;
|
2010-02-18 12:27:15 +00:00
|
|
|
break;
|
2012-02-22 11:14:21 +00:00
|
|
|
case 4:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_INDEO4;
|
2012-02-22 11:14:21 +00:00
|
|
|
break;
|
2005-04-21 19:01:36 +00:00
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_INDEO3;
|
2005-04-21 19:01:36 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_INDEO2;
|
2005-04-21 19:01:36 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2005-04-21 19:01:36 +00:00
|
|
|
video = TRUE;
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
|
|
|
} else if (!strcmp (mimetype, "video/x-divx")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint divxversion = 0;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "divxversion", &divxversion)) {
|
|
|
|
switch (divxversion) {
|
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MSMPEG4V3;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 5:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MPEG4;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
}
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-ffv")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
gint ffvversion = 0;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "ffvversion", &ffvversion) &&
|
|
|
|
ffvversion == 1) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_FFV1;
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
|
|
|
}
|
2014-04-06 07:02:46 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-apple-intermediate-codec")) {
|
|
|
|
id = AV_CODEC_ID_AIC;
|
|
|
|
video = TRUE;
|
2006-11-14 12:34:20 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-adpcm")) {
|
2003-12-22 01:46:58 +00:00
|
|
|
const gchar *layout;
|
|
|
|
|
|
|
|
layout = gst_structure_get_string (structure, "layout");
|
|
|
|
if (layout == NULL) {
|
|
|
|
/* break */
|
|
|
|
} else if (!strcmp (layout, "quicktime")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_QT;
|
2003-12-22 01:46:58 +00:00
|
|
|
} else if (!strcmp (layout, "microsoft")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_MS;
|
2004-04-23 00:49:10 +00:00
|
|
|
} else if (!strcmp (layout, "dvi")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_WAV;
|
2003-12-22 01:46:58 +00:00
|
|
|
} else if (!strcmp (layout, "4xm")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_4XM;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "smjpeg")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_SMJPEG;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "dk3")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_DK3;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "dk4")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_DK4;
|
2020-12-14 04:33:16 +00:00
|
|
|
} else if (!strcmp (layout, "oki")) {
|
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_OKI;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "westwood")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_WS;
|
2009-01-24 16:59:11 +00:00
|
|
|
} else if (!strcmp (layout, "iss")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_IMA_ISS;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "xa")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_XA;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "adx")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_ADX;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "ea")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_EA;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "g726")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_G726;
|
2009-09-09 11:33:53 +00:00
|
|
|
} else if (!strcmp (layout, "g721")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_G726;
|
2004-12-16 18:14:19 +00:00
|
|
|
} else if (!strcmp (layout, "ct")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_CT;
|
2005-04-21 19:01:36 +00:00
|
|
|
} else if (!strcmp (layout, "swf")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_SWF;
|
ext/: Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly some added codecs, some API changes, etc. Also add...
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.h:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_formatid_get_codecids),
(gst_ffmpeg_caps_to_codecid), (gst_ffmpeg_get_codecid_longname),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_negotiate),
(gst_ffmpegdec_frame), (gst_ffmpegdec_chain),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdeinterlace.c:
(gst_ffmpegdeinterlace_getcaps), (gst_ffmpegdeinterlace_pad_link):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_event),
(gst_ffmpegdemux_src_format_list), (gst_ffmpegdemux_src_query),
(gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_add),
(gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_link), (gst_ffmpegenc_chain_video),
(gst_ffmpegenc_chain_audio):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_request_new_pad),
(gst_ffmpegmux_connect), (gst_ffmpegmux_loop),
(gst_ffmpegmux_register):
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_write):
* ext/ffmpeg/gstffmpegscale.c: (gst_ffmpegscale_pad_link):
* ext/libpostproc/gstpostproc.c: (gst_postproc_chain):
Update to ffmpeg snapshot of Jul 20 2005 4:00 PM GMT. Mostly
some added codecs, some API changes, etc. Also adds a VOB muxer
for MPEG-2 video and adds h264 to .mp4 muxing.
2005-07-20 15:40:57 +00:00
|
|
|
} else if (!strcmp (layout, "yamaha")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_YAMAHA;
|
2006-02-18 23:12:14 +00:00
|
|
|
} else if (!strcmp (layout, "sbpro2")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_SBPRO_2;
|
2006-02-18 23:12:14 +00:00
|
|
|
} else if (!strcmp (layout, "sbpro3")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_SBPRO_3;
|
2006-02-18 23:12:14 +00:00
|
|
|
} else if (!strcmp (layout, "sbpro4")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ADPCM_SBPRO_4;
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2003-07-06 20:49:15 +00:00
|
|
|
audio = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-4xm")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_4XM;
|
2003-07-06 20:49:15 +00:00
|
|
|
video = TRUE;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-dpcm")) {
|
|
|
|
const gchar *layout;
|
|
|
|
|
|
|
|
layout = gst_structure_get_string (structure, "layout");
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (!layout) {
|
|
|
|
/* .. */
|
|
|
|
} else if (!strcmp (layout, "roq")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ROQ_DPCM;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "interplay")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_INTERPLAY_DPCM;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (layout, "xan")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_XAN_DPCM;
|
2004-12-16 18:14:19 +00:00
|
|
|
} else if (!strcmp (layout, "sol")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_SOL_DPCM;
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2004-03-15 00:01:03 +00:00
|
|
|
audio = TRUE;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-flac")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_FLAC;
|
2004-03-15 00:01:03 +00:00
|
|
|
audio = TRUE;
|
2005-04-21 19:01:36 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-shorten")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_SHORTEN;
|
2005-04-21 19:01:36 +00:00
|
|
|
audio = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "audio/x-alac")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_ALAC;
|
2005-04-21 19:01:36 +00:00
|
|
|
audio = TRUE;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-cinepak")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_CINEPAK;
|
2004-03-15 00:01:03 +00:00
|
|
|
video = TRUE;
|
|
|
|
} else if (!strcmp (mimetype, "video/x-pn-realvideo")) {
|
|
|
|
gint rmversion;
|
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "rmversion", &rmversion)) {
|
|
|
|
switch (rmversion) {
|
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_RV10;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_RV20;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
2008-12-24 08:09:53 +00:00
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_RV30;
|
2008-12-24 08:09:53 +00:00
|
|
|
break;
|
2006-05-07 01:18:46 +00:00
|
|
|
case 4:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_RV40;
|
2006-05-07 01:18:46 +00:00
|
|
|
break;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
}
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2004-03-15 00:01:03 +00:00
|
|
|
video = TRUE;
|
2010-05-08 11:24:47 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-sipro")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_SIPR;
|
2010-05-08 11:24:47 +00:00
|
|
|
audio = TRUE;
|
2004-03-15 00:01:03 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-pn-realaudio")) {
|
|
|
|
gint raversion;
|
2004-03-29 16:39:18 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if (gst_structure_get_int (structure, "raversion", &raversion)) {
|
|
|
|
switch (raversion) {
|
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_RA_144;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_RA_288;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
break;
|
2006-02-19 14:28:59 +00:00
|
|
|
case 8:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_COOK;
|
2006-02-19 14:28:59 +00:00
|
|
|
break;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
}
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE)
|
2004-03-15 00:01:03 +00:00
|
|
|
audio = TRUE;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-rle")) {
|
|
|
|
const gchar *layout;
|
2004-03-15 00:01:03 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
if ((layout = gst_structure_get_string (structure, "layout"))) {
|
|
|
|
if (!strcmp (layout, "microsoft")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_MSRLE;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
video = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2004-10-02 20:26:10 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-xan")) {
|
|
|
|
gint wcversion = 0;
|
|
|
|
|
|
|
|
if ((gst_structure_get_int (structure, "wcversion", &wcversion))) {
|
|
|
|
switch (wcversion) {
|
|
|
|
case 3:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_XAN_WC3;
|
2004-10-02 20:26:10 +00:00
|
|
|
video = TRUE;
|
|
|
|
break;
|
|
|
|
case 4:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_XAN_WC4;
|
2004-10-02 20:26:10 +00:00
|
|
|
video = TRUE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-10-25 17:20:25 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/AMR")) {
|
2005-01-28 10:45:37 +00:00
|
|
|
audio = TRUE;
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_AMR_NB;
|
2006-10-25 17:20:25 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/AMR-WB")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_AMR_WB;
|
2005-01-28 10:45:37 +00:00
|
|
|
audio = TRUE;
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/qcelp")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_QCELP;
|
ext/ffmpeg/gstffmpegcodecmap.*: Add mapping for EAC3 and QCELP audio codecs.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new),
(gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_codecid), (av_smp_format_depth):
* ext/ffmpeg/gstffmpegcodecmap.h:
Add mapping for EAC3 and QCELP audio codecs.
Add conversion functions for all available audo SampleFormat.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
(gst_ffmpegdec_setcaps), (gst_ffmpegdec_negotiate),
(clip_audio_buffer), (gst_ffmpegdec_audio_frame):
Remove assumptions that we can only handle stereo 16bit signed integer
audio, and store the depth locally.
2008-12-17 12:05:12 +00:00
|
|
|
audio = TRUE;
|
2005-07-23 22:10:29 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-h264")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_H264;
|
2005-07-23 22:10:29 +00:00
|
|
|
video = TRUE;
|
2014-01-06 12:36:39 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-h265")) {
|
|
|
|
id = AV_CODEC_ID_HEVC;
|
|
|
|
video = TRUE;
|
2006-09-08 15:25:51 +00:00
|
|
|
} else if (!strcmp (mimetype, "video/x-flash-video")) {
|
|
|
|
gint flvversion = 0;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
2006-09-08 15:25:51 +00:00
|
|
|
if ((gst_structure_get_int (structure, "flvversion", &flvversion))) {
|
|
|
|
switch (flvversion) {
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
case 1:
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_FLV1;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
video = TRUE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2006-09-08 15:25:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-17 12:43:06 +00:00
|
|
|
} else if (!strcmp (mimetype, "audio/x-nellymoser")) {
|
2013-05-06 22:56:22 +00:00
|
|
|
id = AV_CODEC_ID_NELLYMOSER;
|
2007-12-17 12:43:06 +00:00
|
|
|
audio = TRUE;
|
2012-08-07 08:19:16 +00:00
|
|
|
} else if (!strncmp (mimetype, "audio/x-gst-av-", 15)) {
|
2004-03-15 00:01:03 +00:00
|
|
|
gchar ext[16];
|
2022-01-16 17:33:47 +00:00
|
|
|
const AVCodec *codec;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
2004-03-15 00:01:03 +00:00
|
|
|
if (strlen (mimetype) <= 30 &&
|
2012-08-07 08:19:16 +00:00
|
|
|
sscanf (mimetype, "audio/x-gst-av-%s", ext) == 1) {
|
2004-03-15 00:01:03 +00:00
|
|
|
if ((codec = avcodec_find_decoder_by_name (ext)) ||
|
|
|
|
(codec = avcodec_find_encoder_by_name (ext))) {
|
|
|
|
id = codec->id;
|
2005-12-06 19:57:08 +00:00
|
|
|
audio = TRUE;
|
2005-06-27 20:41:55 +00:00
|
|
|
}
|
|
|
|
}
|
2012-08-07 08:19:16 +00:00
|
|
|
} else if (!strncmp (mimetype, "video/x-gst-av-", 15)) {
|
2005-06-27 20:41:55 +00:00
|
|
|
gchar ext[16];
|
2022-01-16 17:33:47 +00:00
|
|
|
const AVCodec *codec;
|
ext/ffmpeg/: Use codecid as extra parameter when getting caps.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ff_vid_caps_new),
(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_smpfmt_to_caps),
(gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_to_pixfmt),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_to_caps),
(gst_ffmpeg_formatid_get_codecids), (gst_ffmpeg_caps_to_codecid),
(gst_ffmpeg_init_pix_fmt_info), (gst_ffmpeg_avpicture_fill),
(gst_ffmpeg_img_convert):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_register):
Use codecid as extra parameter when getting caps.
Restrict H263 caps to allowed sizes for better negotiation.
MP4/3gp can contain AMR-WB as well.
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
Indent.
2007-01-09 14:59:34 +00:00
|
|
|
|
2005-06-27 20:41:55 +00:00
|
|
|
if (strlen (mimetype) <= 30 &&
|
2012-08-07 08:19:16 +00:00
|
|
|
sscanf (mimetype, "video/x-gst-av-%s", ext) == 1) {
|
2005-06-27 20:41:55 +00:00
|
|
|
if ((codec = avcodec_find_decoder_by_name (ext)) ||
|
|
|
|
(codec = avcodec_find_encoder_by_name (ext))) {
|
|
|
|
id = codec->id;
|
|
|
|
video = TRUE;
|
2004-03-15 00:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-07-06 20:49:15 +00:00
|
|
|
|
|
|
|
if (context != NULL) {
|
|
|
|
if (video == TRUE) {
|
2011-04-19 17:29:57 +00:00
|
|
|
context->codec_type = AVMEDIA_TYPE_VIDEO;
|
2003-07-06 20:49:15 +00:00
|
|
|
} else if (audio == TRUE) {
|
2011-04-19 17:29:57 +00:00
|
|
|
context->codec_type = AVMEDIA_TYPE_AUDIO;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
} else {
|
2011-04-19 17:29:57 +00:00
|
|
|
context->codec_type = AVMEDIA_TYPE_UNKNOWN;
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
|
|
|
context->codec_id = id;
|
ext/ffmpeg/gstffmpegcodecmap.*: Change some function names to reflect that they don't really _return_ something, but ...
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_get_palette),
(gst_ffmpeg_set_palette), (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_smpfmt),
(gst_ffmpeg_caps_to_pixfmt), (gst_ffmpeg_caps_with_codectype),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid):
* ext/ffmpeg/gstffmpegcodecmap.h:
Change some function names to reflect that they don't really
_return_ something, but rather _use_ something to fill a
AVCodecContext. s/to/with/. Restructure the extradata handling,
it's now not picking up the type from the caps but rather
using the type as provided in the function. This is a lot
cleaner. Implement MS RLE palette pickup.
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect):
Sync with the above function name changes.
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
(gst_ffmpegdec_open), (gst_ffmpegdec_connect),
(gst_ffmpegdec_chain), (gst_ffmpegdec_change_state):
Add some hacks to convert palette-based raw image formats to
RGBA32. Ugly, but I don't know how else to handle palette-based
RGB, since img_convert() (and thus ffcolorspace) doesn't accept
a palette as argument.
2004-04-16 01:28:36 +00:00
|
|
|
gst_ffmpeg_caps_with_codecid (id, context->codec_type, caps, context);
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
2013-05-06 22:56:22 +00:00
|
|
|
if (id != AV_CODEC_ID_NONE) {
|
2008-12-13 07:55:40 +00:00
|
|
|
GST_DEBUG ("The id=%d belongs to the caps %" GST_PTR_FORMAT, id, caps);
|
2006-09-08 15:25:51 +00:00
|
|
|
} else {
|
2008-12-13 07:55:40 +00:00
|
|
|
GST_WARNING ("Couldn't figure out the id for caps %" GST_PTR_FORMAT, caps);
|
2003-07-06 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return id;
|
|
|
|
}
|