mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
gst-libs/gst/riff/: Add gst_riff_init() to initialize the debug category, instead of plugin_init(). Port riff-media.[...
Original commit message from CVS: * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps), (gst_riff_create_audio_caps), (gst_riff_create_iavs_caps), (gst_riff_create_video_template_caps), (gst_riff_create_audio_template_caps), (gst_riff_create_iavs_template_caps): * gst-libs/gst/riff/riff-media.h: * gst-libs/gst/riff/riff-read.h: * gst-libs/gst/riff/riff.c: (gst_riff_init): Add gst_riff_init() to initialize the debug category, instead of plugin_init(). Port riff-media.[ch] from -THREADED to HEAD.
This commit is contained in:
parent
d7c5ab0cb6
commit
a8bff2dd5e
5 changed files with 41 additions and 109 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2005-06-30 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps),
|
||||
(gst_riff_create_audio_caps), (gst_riff_create_iavs_caps),
|
||||
(gst_riff_create_video_template_caps),
|
||||
(gst_riff_create_audio_template_caps),
|
||||
(gst_riff_create_iavs_template_caps):
|
||||
* gst-libs/gst/riff/riff-media.h:
|
||||
* gst-libs/gst/riff/riff-read.h:
|
||||
* gst-libs/gst/riff/riff.c: (gst_riff_init):
|
||||
Add gst_riff_init() to initialize the debug category, instead
|
||||
of plugin_init(). Port riff-media.[ch] from -THREADED to HEAD.
|
||||
|
||||
2005-06-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_init):
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
GstCaps *
|
||||
gst_riff_create_video_caps_with_data (guint32 codec_fcc,
|
||||
gst_riff_create_video_caps (guint32 codec_fcc,
|
||||
gst_riff_strh * strh, gst_riff_strf_vids * strf,
|
||||
GstBuffer * strf_data, GstBuffer * strd_data, char **codec_name)
|
||||
{
|
||||
|
@ -94,10 +94,6 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc,
|
|||
|
||||
case GST_MAKE_FOURCC ('H', 'F', 'Y', 'U'):
|
||||
caps = gst_caps_new_simple ("video/x-huffyuv", NULL);
|
||||
if (strf) {
|
||||
gst_caps_set_simple (caps, "bpp",
|
||||
G_TYPE_INT, (int) strf->bit_cnt, NULL);
|
||||
}
|
||||
if (codec_name)
|
||||
*codec_name = g_strdup ("Huffman Lossless Codec");
|
||||
break;
|
||||
|
@ -140,7 +136,6 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc,
|
|||
break;
|
||||
|
||||
case GST_MAKE_FOURCC ('M', '2', '6', '3'):
|
||||
case GST_MAKE_FOURCC ('m', '2', '6', '3'):
|
||||
caps = gst_caps_new_simple ("video/x-h263", NULL);
|
||||
if (codec_name)
|
||||
*codec_name = g_strdup ("Microsoft H.263");
|
||||
|
@ -164,25 +159,6 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc,
|
|||
*codec_name = g_strdup ("Xirlink H.263");
|
||||
break;
|
||||
|
||||
/* apparently not standard H.263...? */
|
||||
case GST_MAKE_FOURCC ('I', '2', '6', '3'):
|
||||
caps = gst_caps_new_simple ("video/x-intel-h263", NULL);
|
||||
if (codec_name)
|
||||
*codec_name = g_strdup ("Intel H.263");
|
||||
break;
|
||||
|
||||
case GST_MAKE_FOURCC ('h', '2', '6', '4'):
|
||||
caps = gst_caps_new_simple ("video/x-h264", NULL);
|
||||
if (codec_name)
|
||||
*codec_name = g_strdup ("ITU H.264");
|
||||
break;
|
||||
|
||||
case GST_MAKE_FOURCC ('V', 'S', 'S', 'H'):
|
||||
caps = gst_caps_new_simple ("video/x-h264", NULL);
|
||||
if (codec_name)
|
||||
*codec_name = g_strdup ("VideoSoft H.264");
|
||||
break;
|
||||
|
||||
case GST_MAKE_FOURCC ('D', 'I', 'V', '3'):
|
||||
case GST_MAKE_FOURCC ('d', 'i', 'v', '3'):
|
||||
case GST_MAKE_FOURCC ('D', 'I', 'V', '4'):
|
||||
|
@ -205,13 +181,6 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc,
|
|||
*codec_name = g_strdup ("DivX MPEG-4 Version 4");
|
||||
break;
|
||||
|
||||
case GST_MAKE_FOURCC ('B', 'L', 'Z', '0'):
|
||||
caps = gst_caps_new_simple ("video/x-divx",
|
||||
"divxversion", G_TYPE_INT, 4, NULL);
|
||||
if (codec_name)
|
||||
*codec_name = g_strdup ("Blizzard DivX");
|
||||
break;
|
||||
|
||||
case GST_MAKE_FOURCC ('D', 'X', '5', '0'):
|
||||
caps = gst_caps_new_simple ("video/x-divx",
|
||||
"divxversion", G_TYPE_INT, 5, NULL);
|
||||
|
@ -386,21 +355,13 @@ gst_riff_create_video_caps_with_data (guint32 codec_fcc,
|
|||
}
|
||||
|
||||
GstCaps *
|
||||
gst_riff_create_video_caps (guint32 codec_fcc,
|
||||
gst_riff_strh * strh, gst_riff_strf_vids * strf, char **codec_name)
|
||||
{
|
||||
return gst_riff_create_video_caps_with_data (codec_fcc,
|
||||
strh, strf, NULL, NULL, codec_name);
|
||||
}
|
||||
|
||||
GstCaps *
|
||||
gst_riff_create_audio_caps_with_data (guint16 codec_id,
|
||||
gst_riff_create_audio_caps (guint16 codec_id,
|
||||
gst_riff_strh * strh, gst_riff_strf_auds * strf,
|
||||
GstBuffer * strf_data, GstBuffer * strd_data, char **codec_name)
|
||||
{
|
||||
gboolean block_align = FALSE, rate_chan = TRUE;
|
||||
GstCaps *caps = NULL;
|
||||
gint rate_min = 1000, rate_max = 96000;
|
||||
gint rate_min = 8000, rate_max = 96000;
|
||||
gint channels_max = 2;
|
||||
|
||||
switch (codec_id) {
|
||||
|
@ -458,15 +419,6 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id,
|
|||
if (strf != NULL && strf->size != 8) {
|
||||
GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.",
|
||||
strf->size);
|
||||
strf->size = 8;
|
||||
strf->av_bps = 8;
|
||||
strf->blockalign = strf->av_bps * strf->channels;
|
||||
}
|
||||
if (strf != NULL && (strf->av_bps == 0 || strf->blockalign == 0)) {
|
||||
GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of mulaw audio",
|
||||
strf->av_bps, strf->blockalign);
|
||||
strf->av_bps = strf->size;
|
||||
strf->blockalign = strf->av_bps * strf->channels;
|
||||
}
|
||||
caps = gst_caps_new_simple ("audio/x-mulaw", NULL);
|
||||
if (codec_name)
|
||||
|
@ -477,15 +429,6 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id,
|
|||
if (strf != NULL && strf->size != 8) {
|
||||
GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.",
|
||||
strf->size);
|
||||
strf->size = 8;
|
||||
strf->av_bps = 8;
|
||||
strf->blockalign = strf->av_bps * strf->channels;
|
||||
}
|
||||
if (strf != NULL && (strf->av_bps == 0 || strf->blockalign == 0)) {
|
||||
GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of alaw audio",
|
||||
strf->av_bps, strf->blockalign);
|
||||
strf->av_bps = strf->size;
|
||||
strf->blockalign = strf->av_bps * strf->channels;
|
||||
}
|
||||
caps = gst_caps_new_simple ("audio/x-alaw", NULL);
|
||||
if (codec_name)
|
||||
|
@ -576,17 +519,10 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id,
|
|||
return caps;
|
||||
}
|
||||
|
||||
GstCaps *
|
||||
gst_riff_create_audio_caps (guint16 codec_id,
|
||||
gst_riff_strh * strh, gst_riff_strf_auds * strf, char **codec_name)
|
||||
{
|
||||
return gst_riff_create_audio_caps_with_data (codec_id,
|
||||
strh, strf, NULL, NULL, codec_name);
|
||||
}
|
||||
|
||||
GstCaps *
|
||||
gst_riff_create_iavs_caps (guint32 codec_fcc,
|
||||
gst_riff_strh * strh, gst_riff_strf_iavs * strf, char **codec_name)
|
||||
gst_riff_strh * strh, gst_riff_strf_iavs * strf,
|
||||
GstBuffer * init_data, GstBuffer * extra_data, char **codec_name)
|
||||
{
|
||||
GstCaps *caps = NULL;
|
||||
|
||||
|
@ -631,8 +567,6 @@ gst_riff_create_video_template_caps (void)
|
|||
GST_MAKE_FOURCC ('D', 'I', 'V', '3'),
|
||||
GST_MAKE_FOURCC ('M', 'P', 'E', 'G'),
|
||||
GST_MAKE_FOURCC ('H', '2', '6', '3'),
|
||||
GST_MAKE_FOURCC ('I', '2', '6', '3'),
|
||||
GST_MAKE_FOURCC ('h', '2', '6', '4'),
|
||||
GST_MAKE_FOURCC ('D', 'I', 'V', 'X'),
|
||||
GST_MAKE_FOURCC ('D', 'X', '5', '0'),
|
||||
GST_MAKE_FOURCC ('X', 'V', 'I', 'D'),
|
||||
|
@ -651,7 +585,7 @@ gst_riff_create_video_template_caps (void)
|
|||
|
||||
caps = gst_caps_new_empty ();
|
||||
for (i = 0; tags[i] != 0; i++) {
|
||||
one = gst_riff_create_video_caps (tags[i], NULL, NULL, NULL);
|
||||
one = gst_riff_create_video_caps (tags[i], NULL, NULL, NULL, NULL, NULL);
|
||||
if (one)
|
||||
gst_caps_append (caps, one);
|
||||
}
|
||||
|
@ -683,7 +617,7 @@ gst_riff_create_audio_template_caps (void)
|
|||
|
||||
caps = gst_caps_new_empty ();
|
||||
for (i = 0; tags[i] != 0; i++) {
|
||||
one = gst_riff_create_audio_caps (tags[i], NULL, NULL, NULL);
|
||||
one = gst_riff_create_audio_caps (tags[i], NULL, NULL, NULL, NULL, NULL);
|
||||
if (one)
|
||||
gst_caps_append (caps, one);
|
||||
}
|
||||
|
@ -704,7 +638,7 @@ gst_riff_create_iavs_template_caps (void)
|
|||
|
||||
caps = gst_caps_new_empty ();
|
||||
for (i = 0; tags[i] != 0; i++) {
|
||||
one = gst_riff_create_iavs_caps (tags[i], NULL, NULL, NULL);
|
||||
one = gst_riff_create_iavs_caps (tags[i], NULL, NULL, NULL, NULL, NULL);
|
||||
if (one)
|
||||
gst_caps_append (caps, one);
|
||||
}
|
||||
|
|
|
@ -29,48 +29,36 @@
|
|||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Create one caps. strh/strf can be NULL (for non-fixed caps).
|
||||
* Create caos. strh/strf, strf/strd_data and codec_name can be NULL.
|
||||
*/
|
||||
|
||||
GstCaps *gst_riff_create_video_caps (guint32 codec_fcc,
|
||||
gst_riff_strh *strh,
|
||||
gst_riff_strf_vids *strf,
|
||||
char **codec_name);
|
||||
GstCaps *gst_riff_create_audio_caps (guint16 codec_id,
|
||||
gst_riff_strh *strh,
|
||||
gst_riff_strf_auds *strf,
|
||||
char **codec_name);
|
||||
GstCaps *gst_riff_create_iavs_caps (guint32 codec_fcc,
|
||||
gst_riff_strh *strh,
|
||||
gst_riff_strf_iavs *strf,
|
||||
char **codec_name);
|
||||
|
||||
/*
|
||||
* Extended...
|
||||
*/
|
||||
|
||||
GstCaps *
|
||||
gst_riff_create_video_caps_with_data (guint32 codec_fcc,
|
||||
GstCaps * gst_riff_create_video_caps (guint32 codec_fcc,
|
||||
gst_riff_strh * strh,
|
||||
gst_riff_strf_vids * strf,
|
||||
GstBuffer * strf_data,
|
||||
GstBuffer * strd_data,
|
||||
char ** codec_name);
|
||||
|
||||
GstCaps *
|
||||
gst_riff_create_audio_caps_with_data (guint16 codec_id,
|
||||
GstCaps * gst_riff_create_audio_caps (guint16 codec_id,
|
||||
gst_riff_strh * strh,
|
||||
gst_riff_strf_auds * strf,
|
||||
GstBuffer * strf_data,
|
||||
GstBuffer * strd_data,
|
||||
char ** codec_name);
|
||||
|
||||
GstCaps * gst_riff_create_iavs_caps (guint32 codec_fcc,
|
||||
gst_riff_strh * strh,
|
||||
gst_riff_strf_iavs * strf,
|
||||
GstBuffer * strf_data,
|
||||
GstBuffer * strd_data,
|
||||
char ** codec_name);
|
||||
/*
|
||||
* Create template caps (includes all known types).
|
||||
*/
|
||||
|
||||
GstCaps *gst_riff_create_video_template_caps (void);
|
||||
GstCaps *gst_riff_create_audio_template_caps (void);
|
||||
GstCaps *gst_riff_create_iavs_template_caps (void);
|
||||
GstCaps * gst_riff_create_video_template_caps (void);
|
||||
GstCaps * gst_riff_create_audio_template_caps (void);
|
||||
GstCaps * gst_riff_create_iavs_template_caps (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -77,6 +77,11 @@ void gst_riff_parse_info (GstElement * element,
|
|||
GstBuffer * buf,
|
||||
GstTagList ** taglist);
|
||||
|
||||
/*
|
||||
* Init.
|
||||
*/
|
||||
void gst_riff_init (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_RIFF_READ_H__ */
|
||||
|
|
|
@ -27,16 +27,8 @@
|
|||
|
||||
GST_DEBUG_CATEGORY (riff_debug);
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
void
|
||||
gst_riff_init (void)
|
||||
{
|
||||
GST_DEBUG_CATEGORY_INIT (riff_debug, "riff", 0, "RIFF I/O");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"riff",
|
||||
"RIFF I/O functions",
|
||||
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
|
||||
|
|
Loading…
Reference in a new issue