mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
Add documentation for the xingheader plugin.
Original commit message from CVS: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * gst/xingheader/gstxingmux.c: * gst/xingheader/gstxingmux.h: Add documentation for the xingheader plugin. * tests/check/elements/xingmux.c: (GST_START_TEST): Set element state to PLAYING before doing something else.
This commit is contained in:
parent
960b1c5b08
commit
afa31cfea0
7 changed files with 112 additions and 33 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2008-01-23 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
* docs/plugins/Makefile.am:
|
||||||
|
* docs/plugins/gst-plugins-bad-plugins-docs.sgml:
|
||||||
|
* docs/plugins/gst-plugins-bad-plugins-sections.txt:
|
||||||
|
* gst/xingheader/gstxingmux.c:
|
||||||
|
* gst/xingheader/gstxingmux.h:
|
||||||
|
Add documentation for the xingheader plugin.
|
||||||
|
|
||||||
|
* tests/check/elements/xingmux.c: (GST_START_TEST):
|
||||||
|
Set element state to PLAYING before doing something else.
|
||||||
|
|
||||||
2008-01-23 Sebastian Dröge <slomo@circular-chaos.org>
|
2008-01-23 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* tests/check/Makefile.am:
|
* tests/check/Makefile.am:
|
||||||
|
|
|
@ -142,7 +142,8 @@ EXTRA_HFILES = \
|
||||||
$(top_srcdir)/gst/videosignal/gstvideodetect.h \
|
$(top_srcdir)/gst/videosignal/gstvideodetect.h \
|
||||||
$(top_srcdir)/gst/videosignal/gstvideomark.h \
|
$(top_srcdir)/gst/videosignal/gstvideomark.h \
|
||||||
$(top_srcdir)/sys/dvb/gstdvbsrc.h \
|
$(top_srcdir)/sys/dvb/gstdvbsrc.h \
|
||||||
$(top_srcdir)/sys/glsink/gstgltestsrc.h
|
$(top_srcdir)/sys/glsink/gstgltestsrc.h \
|
||||||
|
$(top_srcdir)/gst/xingheader/gstxingmux.h
|
||||||
|
|
||||||
# Images to copy into HTML directory.
|
# Images to copy into HTML directory.
|
||||||
HTML_IMAGES =
|
HTML_IMAGES =
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
<xi:include href="xml/element-videomark.xml" />
|
<xi:include href="xml/element-videomark.xml" />
|
||||||
<xi:include href="xml/element-videoparse.xml" />
|
<xi:include href="xml/element-videoparse.xml" />
|
||||||
<xi:include href="xml/element-wildmidi.xml" />
|
<xi:include href="xml/element-wildmidi.xml" />
|
||||||
|
<xi:include href="xml/element-xingmux.xml" />
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter>
|
<chapter>
|
||||||
|
|
|
@ -723,3 +723,17 @@ GST_IS_WILDMIDI_CLASS
|
||||||
GST_TYPE_WILDMIDI
|
GST_TYPE_WILDMIDI
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
|
<SECTION>
|
||||||
|
<FILE>element-xingmux</FILE>
|
||||||
|
<TITLE>xingmux</TITLE>
|
||||||
|
GstXingMux
|
||||||
|
<SUBSECTION Standard>
|
||||||
|
GstXingMuxClass
|
||||||
|
GST_XING_MUX
|
||||||
|
GST_XING_MUX_CLASS
|
||||||
|
GST_IS_XING_MUX
|
||||||
|
GST_IS_XING_MUX_CLASS
|
||||||
|
GST_TYPE_XING_MUX
|
||||||
|
gst_xing_mux_get_type
|
||||||
|
</SECTION>
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,31 @@
|
||||||
|
|
||||||
/* Xing SDK: http://www.mp3-tech.org/programmer/sources/vbrheadersdk.zip */
|
/* Xing SDK: http://www.mp3-tech.org/programmer/sources/vbrheadersdk.zip */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:element-xingmux
|
||||||
|
* @short_description: Adds a Xing header to MP3 files
|
||||||
|
*
|
||||||
|
* <refsect2>
|
||||||
|
* <para>
|
||||||
|
* xingmux adds a Xing header to MP3 files. This contains information about the duration and size
|
||||||
|
* of the file and a seek table and is very useful for getting an almost correct duration and better
|
||||||
|
* seeking on VBR MP3 files.
|
||||||
|
* </para>
|
||||||
|
* <para>
|
||||||
|
* This element will remove any existing Xing, LAME or VBRI headers from the beginning of the file.
|
||||||
|
* </para>
|
||||||
|
* <title>Example launch line</title>
|
||||||
|
* <para>
|
||||||
|
* <programlisting>
|
||||||
|
* gst-launch audiotestsrc num-buffers=1000 ! audioconvert ! lame ! xingmux ! filesink location=test.mp3
|
||||||
|
* gst-launch filesrc location=test.mp3 ! xingmux ! filesink location=test2.mp3
|
||||||
|
* gst-launch filesrc location=test.mp3 ! mp3parse ! xingmux ! filesink location=test2.mp3
|
||||||
|
* </programlisting>
|
||||||
|
* </para>
|
||||||
|
* </refsect2>
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,6 +63,12 @@ GST_BOILERPLATE (GstXingMux, gst_xing_mux, GstElement, GST_TYPE_ELEMENT);
|
||||||
#define GST_XING_TOC_FIELD (1 << 2)
|
#define GST_XING_TOC_FIELD (1 << 2)
|
||||||
#define GST_XING_QUALITY_FIELD (1 << 3)
|
#define GST_XING_QUALITY_FIELD (1 << 3)
|
||||||
|
|
||||||
|
typedef struct _GstXingSeekEntry
|
||||||
|
{
|
||||||
|
gint64 timestamp;
|
||||||
|
gint byte;
|
||||||
|
} GstXingSeekEntry;
|
||||||
|
|
||||||
static void gst_xing_mux_finalize (GObject * obj);
|
static void gst_xing_mux_finalize (GObject * obj);
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
gst_xing_mux_change_state (GstElement * element, GstStateChange transition);
|
gst_xing_mux_change_state (GstElement * element, GstStateChange transition);
|
||||||
|
|
|
@ -21,33 +21,10 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/base/gstadapter.h>
|
||||||
|
|
||||||
typedef struct _GstXingSeekEntry
|
#ifndef __GST_XINGMUX_H__
|
||||||
{
|
#define __GST_XINGMUX_H__
|
||||||
gint64 timestamp;
|
|
||||||
gint byte;
|
|
||||||
} GstXingSeekEntry;
|
|
||||||
|
|
||||||
/* Definition of structure storing data for this element. */
|
G_BEGIN_DECLS
|
||||||
typedef struct _GstXingMux {
|
|
||||||
GstElement element;
|
|
||||||
|
|
||||||
GstPad *sinkpad, *srcpad;
|
|
||||||
|
|
||||||
GstAdapter *adapter;
|
|
||||||
GstClockTime duration;
|
|
||||||
guint64 byte_count;
|
|
||||||
guint64 frame_count;
|
|
||||||
GList *seek_table;
|
|
||||||
gboolean sent_xing;
|
|
||||||
|
|
||||||
/* Copy of the first frame header */
|
|
||||||
guint32 first_header;
|
|
||||||
} GstXingMux;
|
|
||||||
|
|
||||||
/* Standard definition defining a class for this element. */
|
|
||||||
typedef struct _GstXingMuxClass {
|
|
||||||
GstElementClass parent_class;
|
|
||||||
} GstXingMuxClass;
|
|
||||||
|
|
||||||
/* Standard macros for defining types for this element. */
|
/* Standard macros for defining types for this element. */
|
||||||
#define GST_TYPE_XING_MUX \
|
#define GST_TYPE_XING_MUX \
|
||||||
|
@ -61,5 +38,48 @@ typedef struct _GstXingMuxClass {
|
||||||
#define GST_IS_XING_MUX_CLASS(klass) \
|
#define GST_IS_XING_MUX_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XING_MUX))
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XING_MUX))
|
||||||
|
|
||||||
|
typedef struct _GstXingMux GstXingMux;
|
||||||
|
typedef struct _GstXingMuxClass GstXingMuxClass;
|
||||||
|
|
||||||
|
/* Definition of structure storing data for this element. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstXingMux:
|
||||||
|
*
|
||||||
|
* Opaque data structure.
|
||||||
|
*/
|
||||||
|
struct _GstXingMux {
|
||||||
|
GstElement element;
|
||||||
|
|
||||||
|
GstPad *sinkpad, *srcpad;
|
||||||
|
|
||||||
|
/* < private > */
|
||||||
|
|
||||||
|
GstAdapter *adapter;
|
||||||
|
GstClockTime duration;
|
||||||
|
guint64 byte_count;
|
||||||
|
guint64 frame_count;
|
||||||
|
GList *seek_table;
|
||||||
|
gboolean sent_xing;
|
||||||
|
|
||||||
|
/* Copy of the first frame header */
|
||||||
|
guint32 first_header;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Standard definition defining a class for this element. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstXingMuxClass:
|
||||||
|
*
|
||||||
|
* Opaque data structure.
|
||||||
|
*/
|
||||||
|
struct _GstXingMuxClass {
|
||||||
|
GstElementClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
/* Standard function returning type information. */
|
/* Standard function returning type information. */
|
||||||
GType gst_my_filter_get_type (void);
|
GType gst_xing_mux_get_type (void);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __GST_XINGMUX_H__ */
|
||||||
|
|
|
@ -80,20 +80,20 @@ GST_START_TEST (test_xing_remux)
|
||||||
GstElement *xingmux;
|
GstElement *xingmux;
|
||||||
GstBuffer *inbuffer;
|
GstBuffer *inbuffer;
|
||||||
GList *it;
|
GList *it;
|
||||||
guint8 *verify_data;
|
const guint8 *verify_data;
|
||||||
|
|
||||||
xingmux = setup_xingmux ();
|
xingmux = setup_xingmux ();
|
||||||
|
|
||||||
|
fail_unless (gst_element_set_state (xingmux,
|
||||||
|
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
|
||||||
|
"could not set to playing");
|
||||||
|
|
||||||
inbuffer = gst_buffer_new_and_alloc (sizeof (test_xing));
|
inbuffer = gst_buffer_new_and_alloc (sizeof (test_xing));
|
||||||
memcpy (GST_BUFFER_DATA (inbuffer), test_xing, sizeof (test_xing));
|
memcpy (GST_BUFFER_DATA (inbuffer), test_xing, sizeof (test_xing));
|
||||||
|
|
||||||
gst_buffer_set_caps (inbuffer, GST_PAD_CAPS (mysrcpad));
|
gst_buffer_set_caps (inbuffer, GST_PAD_CAPS (mysrcpad));
|
||||||
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: why are the xingmux pads flushing? */
|
|
||||||
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_flush_stop ()));
|
|
||||||
|
|
||||||
/* pushing gives away my reference ... */
|
/* pushing gives away my reference ... */
|
||||||
fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK);
|
fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK);
|
||||||
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()));
|
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()));
|
||||||
|
|
Loading…
Reference in a new issue