mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 10:42:22 +00:00
Various changes and cleanups.
Original commit message from CVS: Various changes and cleanups.
This commit is contained in:
parent
468a8b363b
commit
7f84d638b6
4 changed files with 11 additions and 28 deletions
|
@ -64,7 +64,8 @@ vorbisdec_get_type (void)
|
||||||
|
|
||||||
if (!vorbisdec_type) {
|
if (!vorbisdec_type) {
|
||||||
static const GTypeInfo vorbisdec_info = {
|
static const GTypeInfo vorbisdec_info = {
|
||||||
sizeof (VorbisDecClass), NULL,
|
sizeof (VorbisDecClass),
|
||||||
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc) gst_vorbisdec_class_init,
|
(GClassInitFunc) gst_vorbisdec_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -113,9 +114,6 @@ gst_vorbisdec_pull (VorbisDec * vorbisdec, ogg_sync_state * oy)
|
||||||
|
|
||||||
buf = gst_pad_pull (vorbisdec->sinkpad);
|
buf = gst_pad_pull (vorbisdec->sinkpad);
|
||||||
|
|
||||||
/* this is fatal */
|
|
||||||
g_assert (buf != NULL);
|
|
||||||
|
|
||||||
if (GST_IS_EVENT (buf)) {
|
if (GST_IS_EVENT (buf)) {
|
||||||
switch (GST_EVENT_TYPE (buf)) {
|
switch (GST_EVENT_TYPE (buf)) {
|
||||||
case GST_EVENT_FLUSH:
|
case GST_EVENT_FLUSH:
|
||||||
|
@ -173,11 +171,7 @@ gst_vorbisdec_loop (GstElement * element)
|
||||||
stream initial header) We need the first page to get the stream
|
stream initial header) We need the first page to get the stream
|
||||||
serialno. */
|
serialno. */
|
||||||
|
|
||||||
/* FIXME HACK! trap COTHREAD_STOPPING here */
|
gst_element_yield (GST_ELEMENT (vorbisdec));
|
||||||
if (GST_ELEMENT_IS_COTHREAD_STOPPING (vorbisdec)) {
|
|
||||||
GST_DEBUG (0, "HACK HACK HACK, switching to cothread zero on COTHREAD_STOPPING\n");
|
|
||||||
cothread_switch (cothread_current_main ());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* submit a 4k block to libvorbis' Ogg layer */
|
/* submit a 4k block to libvorbis' Ogg layer */
|
||||||
buf = gst_vorbisdec_pull (vorbisdec, &oy);
|
buf = gst_vorbisdec_pull (vorbisdec, &oy);
|
||||||
|
@ -193,7 +187,7 @@ gst_vorbisdec_loop (GstElement * element)
|
||||||
if (ogg_sync_pageout (&oy, &og) != 1) {
|
if (ogg_sync_pageout (&oy, &og) != 1) {
|
||||||
/* error case. Must not be Vorbis data */
|
/* error case. Must not be Vorbis data */
|
||||||
gst_element_error (element, "input does not appear to be an Ogg bitstream.");
|
gst_element_error (element, "input does not appear to be an Ogg bitstream.");
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the serial number and set up the rest of decode. */
|
/* Get the serial number and set up the rest of decode. */
|
||||||
|
@ -265,14 +259,7 @@ gst_vorbisdec_loop (GstElement * element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* no harm in not checkiindent: Standard input:375: Warning:old style assignment ambiguity in "=-". Assuming "= -"
|
gst_element_yield (GST_ELEMENT (vorbisdec));
|
||||||
|
|
||||||
ng before adding more */
|
|
||||||
/* FIXME HACK! trap COTHREAD_STOPPING here */
|
|
||||||
if (GST_ELEMENT_IS_COTHREAD_STOPPING (vorbisdec)) {
|
|
||||||
GST_DEBUG (0, "HACK HACK HACK, switching to cothread zero on COTHREAD_STOPPING\n");
|
|
||||||
cothread_switch (cothread_current_main ());
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = gst_vorbisdec_pull (vorbisdec, &oy);
|
buf = gst_vorbisdec_pull (vorbisdec, &oy);
|
||||||
bytes = GST_BUFFER_SIZE (buf);
|
bytes = GST_BUFFER_SIZE (buf);
|
||||||
|
@ -420,12 +407,7 @@ ng before adding more */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!eos) {
|
if (!eos) {
|
||||||
|
gst_element_yield (GST_ELEMENT (vorbisdec));
|
||||||
/* FIXME HACK! trap COTHREAD_STOPPING here */
|
|
||||||
if (GST_ELEMENT_IS_COTHREAD_STOPPING (vorbisdec)) {
|
|
||||||
GST_DEBUG (0, "HACK HACK HACK, switching to cothread zero on COTHREAD_STOPPING\n");
|
|
||||||
cothread_switch (cothread_current_main ());
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = gst_vorbisdec_pull (vorbisdec, &oy);
|
buf = gst_vorbisdec_pull (vorbisdec, &oy);
|
||||||
bytes = GST_BUFFER_SIZE (buf);
|
bytes = GST_BUFFER_SIZE (buf);
|
||||||
|
|
|
@ -37,7 +37,7 @@ extern "C" {
|
||||||
#define GST_VORBISDEC(obj) \
|
#define GST_VORBISDEC(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VORBISDEC,VorbisDec))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VORBISDEC,VorbisDec))
|
||||||
#define GST_VORBISDEC_CLASS(klass) \
|
#define GST_VORBISDEC_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VORBISDEC,VorbisDec))
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VORBISDEC,VorbisDecClass))
|
||||||
#define GST_IS_VORBISDEC(obj) \
|
#define GST_IS_VORBISDEC(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VORBISDEC))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VORBISDEC))
|
||||||
#define GST_IS_VORBISDEC_CLASS(obj) \
|
#define GST_IS_VORBISDEC_CLASS(obj) \
|
||||||
|
|
|
@ -74,7 +74,8 @@ vorbisenc_get_type (void)
|
||||||
|
|
||||||
if (!vorbisenc_type) {
|
if (!vorbisenc_type) {
|
||||||
static const GTypeInfo vorbisenc_info = {
|
static const GTypeInfo vorbisenc_info = {
|
||||||
sizeof (VorbisEncClass), NULL,
|
sizeof (VorbisEncClass),
|
||||||
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc) gst_vorbisenc_class_init,
|
(GClassInitFunc) gst_vorbisenc_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -163,7 +164,7 @@ gst_vorbisenc_setup (VorbisEnc * vorbisenc)
|
||||||
|
|
||||||
/* add a comment */
|
/* add a comment */
|
||||||
vorbis_comment_init (&vorbisenc->vc);
|
vorbis_comment_init (&vorbisenc->vc);
|
||||||
vorbis_comment_add (&vorbisenc->vc, comment);
|
vorbis_comment_add (&vorbisenc->vc, (gchar *)comment);
|
||||||
gst_element_send_event (GST_ELEMENT (vorbisenc),
|
gst_element_send_event (GST_ELEMENT (vorbisenc),
|
||||||
gst_event_new_info ("comment", GST_PROPS_STRING (comment), NULL));
|
gst_event_new_info ("comment", GST_PROPS_STRING (comment), NULL));
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ extern "C" {
|
||||||
#define GST_VORBISENC(obj) \
|
#define GST_VORBISENC(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VORBISENC,VorbisEnc))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VORBISENC,VorbisEnc))
|
||||||
#define GST_VORBISENC_CLASS(klass) \
|
#define GST_VORBISENC_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VORBISENC,VorbisEnc))
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VORBISENC,VorbisEncClass))
|
||||||
#define GST_IS_VORBISENC(obj) \
|
#define GST_IS_VORBISENC(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VORBISENC))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VORBISENC))
|
||||||
#define GST_IS_VORBISENC_CLASS(obj) \
|
#define GST_IS_VORBISENC_CLASS(obj) \
|
||||||
|
|
Loading…
Reference in a new issue