indent

Original commit message from CVS:
indent
parent d5cfdabb
2004-03-29 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/ffmpeg/*.c: indent
2004-03-25 Ronald Bultje <rbultje@ronald.bitfreak.net> 2004-03-25 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_base_init): * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_base_init):
......
...@@ -33,16 +33,16 @@ ...@@ -33,16 +33,16 @@
#include <ffmpeg/avformat.h> #include <ffmpeg/avformat.h>
#endif #endif
extern gboolean gst_ffmpegdemux_register (GstPlugin *plugin); extern gboolean gst_ffmpegdemux_register (GstPlugin * plugin);
extern gboolean gst_ffmpegdec_register (GstPlugin *plugin); extern gboolean gst_ffmpegdec_register (GstPlugin * plugin);
extern gboolean gst_ffmpegenc_register (GstPlugin *plugin); extern gboolean gst_ffmpegenc_register (GstPlugin * plugin);
extern gboolean gst_ffmpegmux_register (GstPlugin *plugin); extern gboolean gst_ffmpegmux_register (GstPlugin * plugin);
extern gboolean gst_ffmpegcsp_register (GstPlugin *plugin); extern gboolean gst_ffmpegcsp_register (GstPlugin * plugin);
extern URLProtocol gstreamer_protocol; extern URLProtocol gstreamer_protocol;
static gboolean static gboolean
plugin_init (GstPlugin *plugin) plugin_init (GstPlugin * plugin)
{ {
if (!gst_library_load ("gstbytestream")) if (!gst_library_load ("gstbytestream"))
return FALSE; return FALSE;
...@@ -54,7 +54,7 @@ plugin_init (GstPlugin *plugin) ...@@ -54,7 +54,7 @@ plugin_init (GstPlugin *plugin)
gst_ffmpegenc_register (plugin); gst_ffmpegenc_register (plugin);
gst_ffmpegdec_register (plugin); gst_ffmpegdec_register (plugin);
gst_ffmpegdemux_register (plugin); gst_ffmpegdemux_register (plugin);
/*gst_ffmpegmux_register (plugin);*/ /*gst_ffmpegmux_register (plugin); */
gst_ffmpegcsp_register (plugin); gst_ffmpegcsp_register (plugin);
register_protocol (&gstreamer_protocol); register_protocol (&gstreamer_protocol);
...@@ -63,14 +63,9 @@ plugin_init (GstPlugin *plugin) ...@@ -63,14 +63,9 @@ plugin_init (GstPlugin *plugin)
return TRUE; return TRUE;
} }
GST_PLUGIN_DEFINE ( GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MAJOR, GST_VERSION_MINOR,
GST_VERSION_MINOR, "ffmpeg",
"ffmpeg", "All FFMPEG codecs",
"All FFMPEG codecs", plugin_init,
plugin_init, FFMPEG_VERSION, "LGPL", "FFMpeg", "http://ffmpeg.sourceforge.net/")
FFMPEG_VERSION,
"LGPL",
"FFMpeg",
"http://ffmpeg.sourceforge.net/"
)
...@@ -86,9 +86,8 @@ ...@@ -86,9 +86,8 @@
*/ */
GstCaps * GstCaps *
gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
AVCodecContext *context, AVCodecContext * context, gboolean encode)
gboolean encode)
{ {
GstCaps *caps = NULL; GstCaps *caps = NULL;
gboolean buildcaps = FALSE; gboolean buildcaps = FALSE;
...@@ -99,9 +98,8 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -99,9 +98,8 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
if (encode) { if (encode) {
/* FIXME: bitrate */ /* FIXME: bitrate */
caps = GST_FF_VID_CAPS_NEW ("video/mpeg", caps = GST_FF_VID_CAPS_NEW ("video/mpeg",
"mpegversion", G_TYPE_INT, 1, "mpegversion", G_TYPE_INT, 1,
"systemstream", G_TYPE_BOOLEAN, FALSE, "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
NULL);
} }
break; break;
...@@ -109,16 +107,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -109,16 +107,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
if (encode) { if (encode) {
/* FIXME: bitrate */ /* FIXME: bitrate */
caps = GST_FF_VID_CAPS_NEW ("video/mpeg", caps = GST_FF_VID_CAPS_NEW ("video/mpeg",
"mpegversion", G_TYPE_INT, 2, "mpegversion", G_TYPE_INT, 2,
"systemstream", G_TYPE_BOOLEAN, FALSE, "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
NULL);
} else { } else {
/* decode both MPEG-1 and MPEG-2; width/height/fps are all in /* decode both MPEG-1 and MPEG-2; width/height/fps are all in
* the MPEG video stream headers, so may be omitted from caps. */ * the MPEG video stream headers, so may be omitted from caps. */
caps = gst_caps_new_simple ("video/mpeg", caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", GST_TYPE_INT_RANGE, 1, 2, "mpegversion", GST_TYPE_INT_RANGE, 1, 2,
"systemstream", G_TYPE_BOOLEAN, FALSE, "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
NULL);
} }
break; break;
...@@ -126,7 +122,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -126,7 +122,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
/* this is a special ID - don't need it in GStreamer, I think */ /* this is a special ID - don't need it in GStreamer, I think */
break; break;
/* I don't know the exact differences between those... Anyone? */ /* I don't know the exact differences between those... Anyone? */
case CODEC_ID_H263: case CODEC_ID_H263:
case CODEC_ID_H263P: case CODEC_ID_H263P:
case CODEC_ID_H263I: case CODEC_ID_H263I:
...@@ -140,9 +136,8 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -140,9 +136,8 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
/* FIXME: context->sub_id must be filled in during decoding */ /* FIXME: context->sub_id must be filled in during decoding */
caps = GST_FF_VID_CAPS_NEW ("video/x-pn-realvideo", caps = GST_FF_VID_CAPS_NEW ("video/x-pn-realvideo",
"systemstream", G_TYPE_BOOLEAN, FALSE, "systemstream", G_TYPE_BOOLEAN, FALSE,
"rmversion", G_TYPE_INT, version, "rmversion", G_TYPE_INT, version, NULL);
NULL);
} while (0); } while (0);
break; break;
...@@ -151,9 +146,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -151,9 +146,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
if (encode) { if (encode) {
/* FIXME: bitrate */ /* FIXME: bitrate */
caps = GST_FF_AUD_CAPS_NEW ("audio/mpeg", caps = GST_FF_AUD_CAPS_NEW ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1, "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 2, NULL);
"layer", G_TYPE_INT, 2,
NULL);
} }
break; break;
...@@ -161,16 +154,13 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -161,16 +154,13 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
if (encode) { if (encode) {
/* FIXME: bitrate */ /* FIXME: bitrate */
caps = GST_FF_AUD_CAPS_NEW ("audio/mpeg", caps = GST_FF_AUD_CAPS_NEW ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1, "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL);
"layer", G_TYPE_INT, 3,
NULL);
} else { } else {
/* Decodes MPEG-1 layer 1/2/3. Samplerate, channels et al are /* Decodes MPEG-1 layer 1/2/3. Samplerate, channels et al are
* in the MPEG audio header, so may be omitted from caps. */ * in the MPEG audio header, so may be omitted from caps. */
caps = gst_caps_new_simple ("audio/mpeg", caps = gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1, "mpegversion", G_TYPE_INT, 1,
"layer", GST_TYPE_INT_RANGE, 1, 3, "layer", GST_TYPE_INT_RANGE, 1, 3, NULL);
NULL);
} }
break; break;
...@@ -195,11 +185,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -195,11 +185,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
} }
break; break;
/* MJPEG is normal JPEG, Motion-JPEG and Quicktime MJPEG-A. MJPEGB /* 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 * 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 * sp5x is, but it's apparently something JPEG... We don't separate
* between those in GStreamer. Should we (at least between MJPEG, * between those in GStreamer. Should we (at least between MJPEG,
* MJPEG-B and sp5x decoding...)? */ * MJPEG-B and sp5x decoding...)? */
case CODEC_ID_MJPEG: case CODEC_ID_MJPEG:
case CODEC_ID_MJPEGB: case CODEC_ID_MJPEGB:
case CODEC_ID_LJPEG: case CODEC_ID_LJPEG:
...@@ -213,18 +203,15 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -213,18 +203,15 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
* the AVI fourcc 'DIVX', but 'mp4v' for Quicktime... */ * the AVI fourcc 'DIVX', but 'mp4v' for Quicktime... */
/* FIXME: bitrate */ /* FIXME: bitrate */
caps = GST_FF_VID_CAPS_NEW ("video/mpeg", caps = GST_FF_VID_CAPS_NEW ("video/mpeg",
"systemstream", G_TYPE_BOOLEAN, FALSE, "systemstream", G_TYPE_BOOLEAN, FALSE,
"mpegversion", G_TYPE_INT, 4, "mpegversion", G_TYPE_INT, 4, NULL);
NULL);
} else { } else {
/* The trick here is to separate xvid, divx, mpeg4, 3ivx et al */ /* The trick here is to separate xvid, divx, mpeg4, 3ivx et al */
caps = GST_FF_VID_CAPS_NEW ("video/mpeg", caps = GST_FF_VID_CAPS_NEW ("video/mpeg",
"mpegversion", G_TYPE_INT, 4, "mpegversion", G_TYPE_INT, 4,
"systemstream", G_TYPE_BOOLEAN, FALSE, "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
NULL);
gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-divx", gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-divx",
"divxversion", GST_TYPE_INT_RANGE, 4, 5, "divxversion", GST_TYPE_INT_RANGE, 4, 5, NULL));
NULL));
gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-xvid")); gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-xvid"));
gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-3ivx")); gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-3ivx"));
} }
...@@ -242,12 +229,10 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -242,12 +229,10 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
/* encode-FIXME: bitrate */ /* encode-FIXME: bitrate */
caps = GST_FF_VID_CAPS_NEW ("video/x-msmpeg", caps = GST_FF_VID_CAPS_NEW ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, version, "msmpegversion", G_TYPE_INT, version, NULL);
NULL);
if (!encode && codec_id == CODEC_ID_MSMPEG4V3) { if (!encode && codec_id == CODEC_ID_MSMPEG4V3) {
gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-divx", gst_caps_append (caps, GST_FF_VID_CAPS_NEW ("video/x-divx",
"divxversion", G_TYPE_INT, 3, "divxversion", G_TYPE_INT, 3, NULL));
NULL));
} }
} while (0); } while (0);
break; break;
...@@ -259,8 +244,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -259,8 +244,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
/* encode-FIXME: bitrate */ /* encode-FIXME: bitrate */
caps = GST_FF_VID_CAPS_NEW ("video/x-wmv", caps = GST_FF_VID_CAPS_NEW ("video/x-wmv",
"wmvversion", G_TYPE_INT, version, "wmvversion", G_TYPE_INT, version, NULL);
NULL);
} while (0); } while (0);
break; break;
...@@ -270,18 +254,16 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -270,18 +254,16 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_SVQ1: case CODEC_ID_SVQ1:
caps = GST_FF_VID_CAPS_NEW ("video/x-svq", caps = GST_FF_VID_CAPS_NEW ("video/x-svq",
"svqversion", G_TYPE_INT, 1, "svqversion", G_TYPE_INT, 1, NULL);
NULL);
break; break;
case CODEC_ID_SVQ3: case CODEC_ID_SVQ3:
caps = GST_FF_VID_CAPS_NEW ("video/x-svq", caps = GST_FF_VID_CAPS_NEW ("video/x-svq",
"svqversion", G_TYPE_INT, 3, "svqversion", G_TYPE_INT, 3,
"halfpel_flag", GST_TYPE_INT_RANGE, 0, 1, "halfpel_flag", GST_TYPE_INT_RANGE, 0, 1,
"thirdpel_flag", GST_TYPE_INT_RANGE, 0, 1, "thirdpel_flag", GST_TYPE_INT_RANGE, 0, 1,
"low_delay", GST_TYPE_INT_RANGE, 0, 1, "low_delay", GST_TYPE_INT_RANGE, 0, 1,
"unknown_svq3_flag", GST_TYPE_INT_RANGE, 0, 1, "unknown_svq3_flag", GST_TYPE_INT_RANGE, 0, 1, NULL);
NULL);
break; break;
case CODEC_ID_DVAUDIO: case CODEC_ID_DVAUDIO:
...@@ -298,12 +280,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -298,12 +280,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
gint version = (codec_id == CODEC_ID_WMAV1) ? 1 : 2; gint version = (codec_id == CODEC_ID_WMAV1) ? 1 : 2;
caps = GST_FF_AUD_CAPS_NEW ("audio/x-wma", caps = GST_FF_AUD_CAPS_NEW ("audio/x-wma",
"wmaversion", G_TYPE_INT, version, "wmaversion", G_TYPE_INT, version,
"flags1", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT, "flags1", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT,
"flags2", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT, "flags2", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT,
"block_align", GST_TYPE_INT_RANGE, 0, G_MAXINT, "block_align", GST_TYPE_INT_RANGE, 0, G_MAXINT,
"bitrate", GST_TYPE_INT_RANGE, 0, G_MAXINT, "bitrate", GST_TYPE_INT_RANGE, 0, G_MAXINT, NULL);
NULL);
} while (0); } while (0);
break; break;
...@@ -313,8 +294,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -313,8 +294,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
gint version = (codec_id == CODEC_ID_MACE3) ? 3 : 6; gint version = (codec_id == CODEC_ID_MACE3) ? 3 : 6;
caps = GST_FF_AUD_CAPS_NEW ("audio/x-mace", caps = GST_FF_AUD_CAPS_NEW ("audio/x-mace",
"maceversion", G_TYPE_INT, version, "maceversion", G_TYPE_INT, version, NULL);
NULL);
} while (0); } while (0);
break; break;
...@@ -332,8 +312,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -332,8 +312,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_INDEO3: case CODEC_ID_INDEO3:
caps = GST_FF_VID_CAPS_NEW ("video/x-indeo", caps = GST_FF_VID_CAPS_NEW ("video/x-indeo",
"indeoversion", G_TYPE_INT, 3, "indeoversion", G_TYPE_INT, 3, NULL);
NULL);
break; break;
case CODEC_ID_VP3: case CODEC_ID_VP3:
...@@ -358,8 +337,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -358,8 +337,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_FFV1: case CODEC_ID_FFV1:
caps = GST_FF_VID_CAPS_NEW ("video/x-ffv", caps = GST_FF_VID_CAPS_NEW ("video/x-ffv",
"ffvversion", G_TYPE_INT, 1, "ffvversion", G_TYPE_INT, 1, NULL);
NULL);
break; break;
case CODEC_ID_4XM: case CODEC_ID_4XM:
...@@ -397,7 +375,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -397,7 +375,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
buildcaps = TRUE; buildcaps = TRUE;
break; break;
/* weird quasi-codecs for the demuxers only */ /* weird quasi-codecs for the demuxers only */
case CODEC_ID_PCM_S16LE: case CODEC_ID_PCM_S16LE:
case CODEC_ID_PCM_S16BE: case CODEC_ID_PCM_S16BE:
case CODEC_ID_PCM_U16LE: case CODEC_ID_PCM_U16LE:
...@@ -406,50 +384,55 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -406,50 +384,55 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_PCM_U8: case CODEC_ID_PCM_U8:
do { do {
gint width = 0, depth = 0, endianness = 0; gint width = 0, depth = 0, endianness = 0;
gboolean signedness = FALSE; /* blabla */ gboolean signedness = FALSE; /* blabla */
switch (codec_id) { switch (codec_id) {
case CODEC_ID_PCM_S16LE: case CODEC_ID_PCM_S16LE:
width = 16; depth = 16; width = 16;
depth = 16;
endianness = G_LITTLE_ENDIAN; endianness = G_LITTLE_ENDIAN;
signedness = TRUE; signedness = TRUE;
break; break;
case CODEC_ID_PCM_S16BE: case CODEC_ID_PCM_S16BE:
width = 16; depth = 16; width = 16;
depth = 16;
endianness = G_BIG_ENDIAN; endianness = G_BIG_ENDIAN;
signedness = TRUE; signedness = TRUE;
break; break;
case CODEC_ID_PCM_U16LE: case CODEC_ID_PCM_U16LE:
width = 16; depth = 16; width = 16;
depth = 16;
endianness = G_LITTLE_ENDIAN; endianness = G_LITTLE_ENDIAN;
signedness = FALSE; signedness = FALSE;
break; break;
case CODEC_ID_PCM_U16BE: case CODEC_ID_PCM_U16BE:
width = 16; depth = 16; width = 16;
depth = 16;
endianness = G_BIG_ENDIAN; endianness = G_BIG_ENDIAN;
signedness = FALSE; signedness = FALSE;
break; break;
case CODEC_ID_PCM_S8: case CODEC_ID_PCM_S8:
width = 8; depth = 8; width = 8;
depth = 8;
endianness = G_BYTE_ORDER; endianness = G_BYTE_ORDER;
signedness = TRUE; signedness = TRUE;
break; break;
case CODEC_ID_PCM_U8: case CODEC_ID_PCM_U8:
width = 8; depth = 8; width = 8;
depth = 8;
endianness = G_BYTE_ORDER; endianness = G_BYTE_ORDER;
signedness = FALSE; signedness = FALSE;
break; break;
default: default:
g_assert(0); /* don't worry, we never get here */ g_assert (0); /* don't worry, we never get here */
break; break;
} }
caps = GST_FF_AUD_CAPS_NEW ("audio/x-raw-int", caps = GST_FF_AUD_CAPS_NEW ("audio/x-raw-int",
"width", G_TYPE_INT, width, "width", G_TYPE_INT, width,
"depth", G_TYPE_INT, depth, "depth", G_TYPE_INT, depth,
"endianness", G_TYPE_INT, endianness, "endianness", G_TYPE_INT, endianness,
"signed", G_TYPE_BOOLEAN, signedness, "signed", G_TYPE_BOOLEAN, signedness, NULL);
NULL);
} while (0); } while (0);
break; break;
...@@ -514,15 +497,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -514,15 +497,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
layout = "g726"; layout = "g726";
break; break;
default: default:
g_assert (0); /* don't worry, we never get here */ g_assert (0); /* don't worry, we never get here */
break; break;
} }
/* FIXME: someone please check whether we need additional properties /* FIXME: someone please check whether we need additional properties
* in this caps definition. */ * in this caps definition. */
caps = GST_FF_AUD_CAPS_NEW ("audio/x-adpcm", caps = GST_FF_AUD_CAPS_NEW ("audio/x-adpcm",
"layout", G_TYPE_STRING, layout, "layout", G_TYPE_STRING, layout, NULL);
NULL);
} while (0); } while (0);
break; break;
...@@ -540,8 +522,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -540,8 +522,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
/* FIXME: properties? */ /* FIXME: properties? */
caps = GST_FF_AUD_CAPS_NEW ("audio/x-pn-realaudio", caps = GST_FF_AUD_CAPS_NEW ("audio/x-pn-realaudio",
"raversion", G_TYPE_INT, version, "raversion", G_TYPE_INT, version, NULL);
NULL);
} while (0); } while (0);
break; break;
...@@ -562,18 +543,17 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -562,18 +543,17 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
layout = "xan"; layout = "xan";
break; break;
default: default:
g_assert (0); /* don't worry, we never get here */ g_assert (0); /* don't worry, we never get here */
break; break;
} }
/* FIXME: someone please check whether we need additional properties /* FIXME: someone please check whether we need additional properties
* in this caps definition. */ * in this caps definition. */
caps = GST_FF_AUD_CAPS_NEW ("audio/x-dpcm", caps = GST_FF_AUD_CAPS_NEW ("audio/x-dpcm",
"layout", G_TYPE_STRING, layout, "layout", G_TYPE_STRING, layout, NULL);
NULL);
} while (0); } while (0);
break; break;
case CODEC_ID_FLAC: case CODEC_ID_FLAC:
/* Note that ffmpeg has no encoder yet, but just for safety. In the /* Note that ffmpeg has no encoder yet, but just for safety. In the
* encoder case, we want to add things like samplerate, channels... */ * encoder case, we want to add things like samplerate, channels... */
...@@ -613,6 +593,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -613,6 +593,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
if (caps != NULL) { if (caps != NULL) {
char *str = gst_caps_to_string (caps); char *str = gst_caps_to_string (caps);
GST_DEBUG ("caps for codec_id=%d: %s", codec_id, str); GST_DEBUG ("caps for codec_id=%d: %s", codec_id, str);
g_free (str); g_free (str);
} else { } else {
...@@ -630,8 +611,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -630,8 +611,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
*/ */
static GstCaps * static GstCaps *
gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context)
AVCodecContext *context)
{ {
GstCaps *caps = NULL; GstCaps *caps = NULL;
...@@ -641,51 +621,65 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, ...@@ -641,51 +621,65 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt,
switch (pix_fmt) { switch (pix_fmt) {
case PIX_FMT_YUV420P: case PIX_FMT_YUV420P:
fmt = GST_MAKE_FOURCC ('I','4','2','0'); fmt = GST_MAKE_FOURCC ('I', '4', '2', '0');
break; break;
case PIX_FMT_YUV422: case PIX_FMT_YUV422:
fmt = GST_MAKE_FOURCC ('Y','U','Y','2'); fmt = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2');
break; break;
case PIX_FMT_RGB24: case PIX_FMT_RGB24:
bpp = depth = 24; bpp = depth = 24;
endianness = G_BIG_ENDIAN; endianness = G_BIG_ENDIAN;
r_mask = 0xff0000; g_mask = 0x00ff00; b_mask = 0x0000ff; r_mask = 0xff0000;
g_mask = 0x00ff00;
b_mask = 0x0000ff;
break; break;
case PIX_FMT_BGR24: case PIX_FMT_BGR24:
bpp = depth = 24; bpp = depth = 24;
endianness = G_BIG_ENDIAN; endianness = G_BIG_ENDIAN;
r_mask = 0x0000ff; g_mask = 0x00ff00; b_mask = 0xff0000; r_mask = 0x0000ff;
g_mask = 0x00ff00;
b_mask = 0xff0000;
break; break;
case PIX_FMT_YUV422P: case PIX_FMT_YUV422P:
fmt = GST_MAKE_FOURCC ('Y','4','2','B'); fmt = GST_MAKE_FOURCC ('Y', '4', '2', 'B');
break; break;
case PIX_FMT_YUV444P: case PIX_FMT_YUV444P:
/* .. */ /* .. */
break; break;
case PIX_FMT_RGBA32: case PIX_FMT_RGBA32:
bpp = 32; depth = 24;