Commit 22b9a5cd authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

Port matroska muxer to 0.9 (#318847).

Original commit message from CVS:
Reviewed by: Tim-Philipp Müller  <tim at centricular dot net>
* configure.ac:
* gst/matroska/Makefile.am:
* gst/matroska/ebml-ids.h:
* gst/matroska/ebml-write.c:
* gst/matroska/ebml-write.h:
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c:
* gst/matroska/matroska-mux.h:
* gst/matroska/matroska.c: (plugin_init):
Port matroska muxer to 0.9 (#318847).
parent fb495736
2005-10-14 Michal Benes <michal dot benes at xeris dot cz>
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
* configure.ac:
* gst/matroska/Makefile.am:
* gst/matroska/ebml-ids.h:
* gst/matroska/ebml-write.c:
* gst/matroska/ebml-write.h:
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c:
* gst/matroska/matroska-mux.h:
* gst/matroska/matroska.c: (plugin_init):
Port matroska muxer to 0.9 (#318847).
2005-10-13 Tim-Philipp Müller <tim at centricular dot net>
* ext/speex/gstspeexenc.c: (gst_speexenc_get_tag_value),
......
......@@ -275,6 +275,7 @@ GST_PLUGINS_ALL="\
goom \
law \
level \
matroska \
rtp \
rtsp \
smpte \
......@@ -593,6 +594,7 @@ gst/effectv/Makefile
gst/goom/Makefile
gst/law/Makefile
gst/level/Makefile
gst/matroska/Makefile
gst/rtp/Makefile
gst/rtsp/Makefile
gst/smpte/Makefile
......
plugin_LTLIBRARIES = libgstmatroska.la
libgstmatroska_la_SOURCES = \
ebml-read.c \
ebml-write.c \
matroska.c \
matroska-demux.c \
matroska-mux.c
# ebml-read.c
# matroska-demux.c
noinst_HEADERS = \
ebml-ids.h \
ebml-read.h \
......@@ -15,6 +16,14 @@ noinst_HEADERS = \
matroska-ids.h \
matroska-mux.h
libgstmatroska_la_CFLAGS = $(GST_CFLAGS)
libgstmatroska_la_LIBADD = $(GST_LIBS)
libgstmatroska_la_CFLAGS = \
$(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_CFLAGS) \
-I$(top_srcdir)/gst-libs
libgstmatroska_la_LIBADD = \
$(GST_BASE_LIBS) \
$(GST_PLUGINS_BASE_LIBS) \
$(GST_LIBS) \
-lgstriff-@GST_MAJORMINOR@
libgstmatroska_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......@@ -27,6 +27,9 @@ G_BEGIN_DECLS
/* EBML version supported */
#define GST_EBML_VERSION 1
/* Unknown size (all bits set to 1) */
#define GST_EBML_SIZE_UNKNOWN G_GINT64_CONSTANT(0x00ffffffffffffff)
/* top-level master-IDs */
#define GST_EBML_ID_HEADER 0x1A45DFA3
......
This diff is collapsed.
/* GStreamer EBML I/O
* (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
* (c) 2005 Michal Benes <michal.benes@xeris.cz>
*
* ebml-write.c: write EBML data to file/stream
*
......@@ -41,21 +42,35 @@ G_BEGIN_DECLS
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_EBML_WRITE, GstEbmlWriteClass))
typedef struct _GstEbmlWrite {
GstElement parent;
GstObject object;
GstPad *srcpad;
guint64 pos;
GstBuffer *cache;
guint cache_size;
guint handled;
GstFlowReturn last_write_result;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
} GstEbmlWrite;
typedef struct _GstEbmlWriteClass {
GstElementClass parent;
GstObjectClass parent;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
} GstEbmlWriteClass;
GType gst_ebml_write_get_type (void);
GstEbmlWrite *gst_ebml_write_new (GstPad *srcpad);
void gst_ebml_write_reset (GstEbmlWrite *ebml);
GstFlowReturn gst_ebml_last_write_result (GstEbmlWrite *ebml);
/*
* Caching means that we do not push one buffer for
* each element, but fill this one until a flush.
......
......@@ -132,6 +132,7 @@
#define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_SP "V_MPEG4/ISO/SP"
#define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_ASP "V_MPEG4/ISO/ASP"
#define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_AP "V_MPEG4/ISO/AP"
#define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_AVC "V_MPEG4/ISO/AVC"
#define GST_MATROSKA_CODEC_ID_VIDEO_MSMPEG4V3 "V_MPEG4/MS/V3"
#define GST_MATROSKA_CODEC_ID_VIDEO_MPEG1 "V_MPEG1"
#define GST_MATROSKA_CODEC_ID_VIDEO_MPEG2 "V_MPEG2"
......@@ -151,6 +152,7 @@
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG2 "A_AAC/MPEG2/"
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG4 "A_AAC/MPEG4/"
#define GST_MATROSKA_CODEC_ID_AUDIO_TTA "A_TTA1"
#define GST_MATROSKA_CODEC_ID_AUDIO_WAVPACK4 "A_WAVPACK4"
/* TODO: AC3-9/10 (?), Real, Musepack, Quicktime */
#define GST_MATROSKA_CODEC_ID_SUBTITLE_UTF8 "S_TEXT/UTF8"
......@@ -267,4 +269,17 @@ typedef struct _GstMatroskaIndex {
guint64 time; /* in nanoseconds */
} GstMatroskaIndex;
typedef struct _Wavpack4Header {
guchar ck_id [4]; /* "wvpk" */
guint32 ck_size; /* size of entire frame (minus 8, of course) */
guint16 version; /* 0x403 for now */
guint8 track_no; /* track number (0 if not used, like now) */
guint8 index_no; /* remember these? (0 if not used, like now) */
guint32 total_samples; /* for entire file (-1 if unknown) */
guint32 block_index; /* index of first sample in block (to file begin) */
guint32 block_samples; /* # samples in this block */
guint32 flags; /* various flags for id and decoding */
guint32 crc; /* crc for actual decoded data */
} Wavpack4Header;
#endif /* __GST_MATROSKA_IDS_H__ */
This diff is collapsed.
/* GStreamer Matroska muxer/demuxer
* (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
* (c) 2005 Michal Benes <michal.benes@xeris.cz>
*
* matroska-mux.h: matroska file/stream muxer object types
*
......@@ -23,6 +24,7 @@
#define __GST_MATROSKA_MUX_H__
#include <gst/gst.h>
#include <gst/base/gstcollectpads.h>
#include "ebml-write.h"
#include "matroska-ids.h"
......@@ -40,8 +42,6 @@ G_BEGIN_DECLS
#define GST_IS_MATROSKA_MUX_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_MUX))
#define GST_MATROSKA_MUX_MAX_STREAMS 64
typedef struct _BITMAPINFOHEADER {
guint32 bi_size;
guint32 bi_width;
......@@ -67,22 +67,32 @@ typedef struct _GstMatroskaMetaSeekIndex {
guint64 pos;
} GstMatroskaMetaSeekIndex;
/* all information needed for one matroska stream */
typedef struct
{
GstCollectData collect; /* we extend the CollectData */
GstMatroskaTrackContext *track;
GstBuffer *buffer; /* the queued buffer for this pad */
guint64 duration;
}
GstMatroskaPad;
typedef struct _GstMatroskaMux {
GstEbmlWrite parent;
GstElement element;
/* pads */
GstPad *srcpad;
struct {
GstMatroskaTrackContext *track;
GstBuffer *buffer;
gboolean eos;
guint64 duration;
} sink[GST_MATROSKA_MUX_MAX_STREAMS];
GstCollectPads *collect;
GstEbmlWrite *ebml_write;
guint num_streams,
num_v_streams, num_a_streams, num_t_streams;
/* metadata - includes writing_app and creation_time */
GstCaps *metadata;
/* Application name (for the writing application header element) */
gchar *writing_app;
/* state */
GstMatroskaMuxState state;
......@@ -99,15 +109,13 @@ typedef struct _GstMatroskaMux {
/* byte-positions of master-elements (for replacing contents) */
guint64 segment_pos,
seekhead_pos,
cues_pos,
#if 0
tags_pos,
#endif
info_pos,
tracks_pos,
duration_pos,
meta_pos;
seekhead_pos,
cues_pos,
/* tags_pos, */
info_pos,
tracks_pos,
duration_pos,
meta_pos;
guint64 segment_master;
/* current cluster */
......@@ -121,7 +129,7 @@ typedef struct _GstMatroskaMux {
} GstMatroskaMux;
typedef struct _GstMatroskaMuxClass {
GstEbmlWriteClass parent;
GstElementClass parent;
} GstMatroskaMuxClass;
GType gst_matroska_mux_get_type (void);
......
......@@ -23,14 +23,14 @@
#include "config.h"
#endif
#include "matroska-demux.h"
/* #include "matroska-demux.h" */
#include "matroska-mux.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
return (gst_matroska_demux_plugin_init (plugin) &&
gst_matroska_mux_plugin_init (plugin));
return /* gst_matroska_demux_plugin_init (plugin) && */
gst_matroska_mux_plugin_init (plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment