Commit c991a04a authored by Thiago Sousa Santos's avatar Thiago Sousa Santos Committed by Tim-Philipp Müller

Copy qtmux from revision 148 of the gst-qtmux repository.

Original commit message from CVS:
patch by: Thiago Sousa Santos <thiagossantos@gmail.com>
* configure.ac:
* gst/quicktime/Makefile.am:
* gst/quicktime/atoms.c:
* gst/quicktime/atoms.h:
* gst/quicktime/descriptors.c:
* gst/quicktime/descriptors.h:
* gst/quicktime/fourcc.h:
* gst/quicktime/ftypcc.h:
* gst/quicktime/gstqtmux.c:
* gst/quicktime/gstqtmux.h:
* gst/quicktime/gstqtmuxmap.c:
* gst/quicktime/gstqtmuxmap.h:
* gst/quicktime/properties.c:
* gst/quicktime/properties.h:
Copy qtmux from revision 148 of the gst-qtmux repository.
Fixes #550280.
parent ed96310d
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Quicktime muxer plugin for GStreamer
* Copyright (C) 2008 Thiago Sousa Santos <thiagoss@embedded.ufcg.edu.br>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __DESCRIPTORS_H__
#define __DESCRIPTORS_H__
#include <glib.h>
#include <string.h>
#include "properties.h"
/*
* Tags for descriptor (each kind is represented by a number, instead of fourcc as in atoms)
*/
#define OBJECT_DESC_TAG 0x01
#define INIT_OBJECT_DESC_TAG 0x02
#define ES_DESCRIPTOR_TAG 0x03
#define DECODER_CONFIG_DESC_TAG 0x04
#define DECODER_SPECIFIC_INFO_TAG 0x05
#define SL_CONFIG_DESC_TAG 0x06
#define ES_ID_INC_TAG 0x0E
#define MP4_INIT_OBJECT_DESC_TAG 0x10
#define ESDS_OBJECT_TYPE_MPEG1_P3 0x6B
#define ESDS_OBJECT_TYPE_MPEG2_P7_MAIN 0x66
#define ESDS_OBJECT_TYPE_MPEG4_P7_LC 0x67
#define ESDS_OBJECT_TYPE_MPEG4_P7_SSR 0x68
#define ESDS_OBJECT_TYPE_MPEG4_P2 0x20
#define ESDS_OBJECT_TYPE_MPEG4_P3 0x40
#define ESDS_STREAM_TYPE_VISUAL 0x04
#define ESDS_STREAM_TYPE_AUDIO 0x05
typedef struct _BaseDescriptor
{
guint8 tag;
/* the first bit of each byte indicates if the next byte should be used */
guint8 size[4];
} BaseDescriptor;
typedef struct _SLConfigDescriptor
{
BaseDescriptor base;
guint8 predefined; /* everything is supposed predefined */
} SLConfigDescriptor;
typedef struct _DecoderSpecificInfoDescriptor
{
BaseDescriptor base;
guint32 length;
guint8 *data;
} DecoderSpecificInfoDescriptor;
typedef struct _DecoderConfigDescriptor {
BaseDescriptor base;
guint8 object_type;
/* following are condensed into streamType:
* bit(6) streamType;
* bit(1) upStream;
* const bit(1) reserved=1;
*/
guint8 stream_type;
guint8 buffer_size_DB[3];
guint32 max_bitrate;
guint32 avg_bitrate;
DecoderSpecificInfoDescriptor *dec_specific_info;
} DecoderConfigDescriptor;
typedef struct _ESDescriptor
{
BaseDescriptor base;
guint16 id;
/* flags contains the following:
* bit(1) streamDependenceFlag;
* bit(1) URL_Flag;
* bit(1) OCRstreamFlag;
* bit(5) streamPriority;
*/
guint8 flags;
guint16 depends_on_es_id;
guint8 url_length; /* only if URL_flag is set */
guint8 *url_string; /* size is url_length */
guint16 ocr_es_id; /* only if OCRstreamFlag is set */
DecoderConfigDescriptor dec_conf_desc;
SLConfigDescriptor sl_conf_desc;
/* optional remainder of ESDescriptor is not used */
} ESDescriptor;
/* --- FUNCTIONS --- */
void desc_es_init (ESDescriptor *es);
ESDescriptor *desc_es_descriptor_new ();
guint64 desc_es_descriptor_copy_data (ESDescriptor *es, guint8 **buffer,
guint64 *size, guint64 *offset);
void desc_es_descriptor_clear (ESDescriptor *es);
DecoderSpecificInfoDescriptor *desc_dec_specific_info_new();
void desc_dec_specific_info_free (DecoderSpecificInfoDescriptor *dsid);
void desc_dec_specific_info_alloc_data (DecoderSpecificInfoDescriptor *dsid,
guint32 size);
#endif /* __DESCRIPTORS_H__ */
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __FOURCC_H__
#define __FOURCC_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define FOURCC_null 0x0
#define FOURCC_moov GST_MAKE_FOURCC('m','o','o','v')
#define FOURCC_mvhd GST_MAKE_FOURCC('m','v','h','d')
#define FOURCC_clip GST_MAKE_FOURCC('c','l','i','p')
#define FOURCC_trak GST_MAKE_FOURCC('t','r','a','k')
#define FOURCC_udta GST_MAKE_FOURCC('u','d','t','a')
#define FOURCC_ctab GST_MAKE_FOURCC('c','t','a','b')
#define FOURCC_tkhd GST_MAKE_FOURCC('t','k','h','d')
#define FOURCC_crgn GST_MAKE_FOURCC('c','r','g','n')
#define FOURCC_matt GST_MAKE_FOURCC('m','a','t','t')
#define FOURCC_kmat GST_MAKE_FOURCC('k','m','a','t')
#define FOURCC_edts GST_MAKE_FOURCC('e','d','t','s')
#define FOURCC_elst GST_MAKE_FOURCC('e','l','s','t')
#define FOURCC_load GST_MAKE_FOURCC('l','o','a','d')
#define FOURCC_tref GST_MAKE_FOURCC('t','r','e','f')
#define FOURCC_imap GST_MAKE_FOURCC('i','m','a','p')
#define FOURCC___in GST_MAKE_FOURCC(' ',' ','i','n')
#define FOURCC___ty GST_MAKE_FOURCC(' ',' ','t','y')
#define FOURCC_mdia GST_MAKE_FOURCC('m','d','i','a')
#define FOURCC_mdhd GST_MAKE_FOURCC('m','d','h','d')
#define FOURCC_hdlr GST_MAKE_FOURCC('h','d','l','r')
#define FOURCC_dhlr GST_MAKE_FOURCC('d','h','l','r')
#define FOURCC_mhlr GST_MAKE_FOURCC('m','h','l','r')
#define FOURCC_minf GST_MAKE_FOURCC('m','i','n','f')
#define FOURCC_mdir GST_MAKE_FOURCC('m','d','i','r')
#define FOURCC_vmhd GST_MAKE_FOURCC('v','m','h','d')
#define FOURCC_smhd GST_MAKE_FOURCC('s','m','h','d')
#define FOURCC_gmhd GST_MAKE_FOURCC('g','m','h','d')
#define FOURCC_gmin GST_MAKE_FOURCC('g','m','i','n')
#define FOURCC_dinf GST_MAKE_FOURCC('d','i','n','f')
#define FOURCC_dref GST_MAKE_FOURCC('d','r','e','f')
#define FOURCC_stbl GST_MAKE_FOURCC('s','t','b','l')
#define FOURCC_stsd GST_MAKE_FOURCC('s','t','s','d')
#define FOURCC_stts GST_MAKE_FOURCC('s','t','t','s')
#define FOURCC_stss GST_MAKE_FOURCC('s','t','s','s')
#define FOURCC_stsc GST_MAKE_FOURCC('s','t','s','c')
#define FOURCC_stsz GST_MAKE_FOURCC('s','t','s','z')
#define FOURCC_stco GST_MAKE_FOURCC('s','t','c','o')
#define FOURCC_vide GST_MAKE_FOURCC('v','i','d','e')
#define FOURCC_soun GST_MAKE_FOURCC('s','o','u','n')
#define FOURCC_strm GST_MAKE_FOURCC('s','t','r','m')
#define FOURCC_rtsp GST_MAKE_FOURCC('r','t','s','p')
#define FOURCC_co64 GST_MAKE_FOURCC('c','o','6','4')
#define FOURCC_cmov GST_MAKE_FOURCC('c','m','o','v')
#define FOURCC_dcom GST_MAKE_FOURCC('d','c','o','m')
#define FOURCC_cmvd GST_MAKE_FOURCC('c','m','v','d')
#define FOURCC_hint GST_MAKE_FOURCC('h','i','n','t')
#define FOURCC_mp4a GST_MAKE_FOURCC('m','p','4','a')
#define FOURCC__mp3 GST_MAKE_FOURCC('.','m','p','3')
#define FOURCC_mp4s GST_MAKE_FOURCC('m','p','4','s')
#define FOURCC_mp4v GST_MAKE_FOURCC('m','p','4','v')
#define FOURCC_2vuy GST_MAKE_FOURCC('2','v','u','y')
#define FOURCC_wave GST_MAKE_FOURCC('w','a','v','e')
#define FOURCC_appl GST_MAKE_FOURCC('a','p','p','l')
#define FOURCC_esds GST_MAKE_FOURCC('e','s','d','s')
#define FOURCC_hnti GST_MAKE_FOURCC('h','n','t','i')
#define FOURCC_rtp_ GST_MAKE_FOURCC('r','t','p',' ')
#define FOURCC_sdp_ GST_MAKE_FOURCC('s','d','p',' ')
#define FOURCC_meta GST_MAKE_FOURCC('m','e','t','a')
#define FOURCC_ilst GST_MAKE_FOURCC('i','l','s','t')
#define FOURCC__nam GST_MAKE_FOURCC(0xa9,'n','a','m')
#define FOURCC__ART GST_MAKE_FOURCC(0xa9,'A','R','T')
#define FOURCC__wrt GST_MAKE_FOURCC(0xa9,'w','r','t')
#define FOURCC__grp GST_MAKE_FOURCC(0xa9,'g','r','p')
#define FOURCC__alb GST_MAKE_FOURCC(0xa9,'a','l','b')
#define FOURCC__day GST_MAKE_FOURCC(0xa9,'d','a','y')
#define FOURCC__des GST_MAKE_FOURCC(0xa9,'d','e','s')
#define FOURCC_gnre GST_MAKE_FOURCC('g','n','r','e')
#define FOURCC_disc GST_MAKE_FOURCC('d','i','s','c')
#define FOURCC_disk GST_MAKE_FOURCC('d','i','s','k')
#define FOURCC_trkn GST_MAKE_FOURCC('t','r','k','n')
#define FOURCC_cprt GST_MAKE_FOURCC('c','p','r','t')
#define FOURCC_covr GST_MAKE_FOURCC('c','o','v','r')
#define FOURCC_cpil GST_MAKE_FOURCC('c','p','i','l')
#define FOURCC_tmpo GST_MAKE_FOURCC('t','m','p','o')
#define FOURCC__too GST_MAKE_FOURCC(0xa9,'t','o','o')
#define FOURCC_keyw GST_MAKE_FOURCC('k','e','y','w')
#define FOURCC_____ GST_MAKE_FOURCC('-','-','-','-')
#define FOURCC_free GST_MAKE_FOURCC('f','r','e','e')
#define FOURCC_data GST_MAKE_FOURCC('d','a','t','a')
#define FOURCC_SVQ3 GST_MAKE_FOURCC('S','V','Q','3')
#define FOURCC_rmra GST_MAKE_FOURCC('r','m','r','a')
#define FOURCC_rmda GST_MAKE_FOURCC('r','m','d','a')
#define FOURCC_rdrf GST_MAKE_FOURCC('r','d','r','f')
#define FOURCC__gen GST_MAKE_FOURCC(0xa9, 'g', 'e', 'n')
#define FOURCC_rmdr GST_MAKE_FOURCC('r','m','d','r')
#define FOURCC_rmvc GST_MAKE_FOURCC('r','m','v','c')
#define FOURCC_qtim GST_MAKE_FOURCC('q','t','i','m')
#define FOURCC_drms GST_MAKE_FOURCC('d','r','m','s')
#define FOURCC_avc1 GST_MAKE_FOURCC('a','v','c','1')
#define FOURCC_h263 GST_MAKE_FOURCC('h','2','6','3')
#define FOURCC_avcC GST_MAKE_FOURCC('a','v','c','C')
#define FOURCC_VP31 GST_MAKE_FOURCC('V','P','3','1')
#define FOURCC_rle_ GST_MAKE_FOURCC('r','l','e',' ')
#define FOURCC_MAC6 GST_MAKE_FOURCC('M','A','C','6')
#define FOURCC_MAC3 GST_MAKE_FOURCC('M','A','C','3')
#define FOURCC_ima4 GST_MAKE_FOURCC('i','m','a','4')
#define FOURCC_ulaw GST_MAKE_FOURCC('u','l','a','w')
#define FOURCC_alaw GST_MAKE_FOURCC('a','l','a','w')
#define FOURCC_twos GST_MAKE_FOURCC('t','w','o','s')
#define FOURCC_sowt GST_MAKE_FOURCC('s','o','w','t')
#define FOURCC_raw_ GST_MAKE_FOURCC('r','a','w',' ')
#define FOURCC_QDM2 GST_MAKE_FOURCC('Q','D','M','2')
#define FOURCC_alac GST_MAKE_FOURCC('a','l','a','c')
#define FOURCC_samr GST_MAKE_FOURCC('s','a','m','r')
#define FOURCC_sawb GST_MAKE_FOURCC('s','a','w','b')
#define FOURCC_mdat GST_MAKE_FOURCC('m','d','a','t')
#define FOURCC_wide GST_MAKE_FOURCC('w','i','d','e')
#define FOURCC_PICT GST_MAKE_FOURCC('P','I','C','T')
#define FOURCC_pnot GST_MAKE_FOURCC('p','n','o','t')
#define FOURCC_zlib GST_MAKE_FOURCC('z','l','i','b')
#define FOURCC_alis GST_MAKE_FOURCC('a','l','i','s')
#define FOURCC_url_ GST_MAKE_FOURCC('u','r','l',' ')
#define FOURCC_frma GST_MAKE_FOURCC('f','r','m','a')
#define FOURCC_ctts GST_MAKE_FOURCC('c','t','t','s')
#define FOURCC_drac GST_MAKE_FOURCC('d','r','a','c')
#define FOURCC_jpeg GST_MAKE_FOURCC('j','p','e','g')
/* Xiph fourcc */
#define FOURCC_XiTh GST_MAKE_FOURCC('X','i','T','h')
#define FOURCC_XdxT GST_MAKE_FOURCC('X','d','x','T')
#define FOURCC_tCtH GST_MAKE_FOURCC('t','C','t','H')
#define FOURCC_tCt_ GST_MAKE_FOURCC('t','C','t','#')
#define FOURCC_tCtC GST_MAKE_FOURCC('t','C','t','C')
/* ilst metatags */
#define FOURCC_titl GST_MAKE_FOURCC('t','i','t','l')
#define FOURCC__cmt GST_MAKE_FOURCC(0xa9, 'c','m','t')
G_END_DECLS
#endif /* __FOURCC_H__ */
/* GStreamer
* Copyright (C) <2008> Thiago Sousa Santos <thiagoss@embedded.ufcg.edu.br>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __FTYP_CC_H__
#define __FTYP_CC_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define FOURCC_ftyp GST_MAKE_FOURCC('f','t','y','p')
#define FOURCC_isom GST_MAKE_FOURCC('i','s','o','m')
#define FOURCC_iso2 GST_MAKE_FOURCC('i','s','o','2')
#define FOURCC_mp41 GST_MAKE_FOURCC('m','p','4','1')
#define FOURCC_mp42 GST_MAKE_FOURCC('m','p','4','2')
#define FOURCC_mjp2 GST_MAKE_FOURCC('m','j','p','2')
#define FOURCC_3gg7 GST_MAKE_FOURCC('3','g','g','7')
#define FOURCC_avc1 GST_MAKE_FOURCC('a','v','c','1')
#define FOURCC_qt__ GST_MAKE_FOURCC('q','t',' ',' ')
G_END_DECLS
#endif /* __FTYP_CC_H__ */
This diff is collapsed.
/* Quicktime muxer plugin for GStreamer
* Copyright (C) 2008 Thiago Sousa Santos <thiagoss@embedded.ufcg.edu.br>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_QT_MUX_H__
#define __GST_QT_MUX_H__
#include <gst/gst.h>
#include <gst/base/gstcollectpads.h>
#include "fourcc.h"
#include "atoms.h"
#include "gstqtmuxmap.h"
G_BEGIN_DECLS
#define GST_TYPE_QT_MUX (gst_qt_mux_get_type())
#define GST_QT_MUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QT_MUX, GstQTMux))
#define GST_QT_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QT_MUX, GstQTMux))
#define GST_IS_QT_MUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QT_MUX))
#define GST_IS_QT_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QT_MUX))
#define GST_QT_MUX_CAST(obj) ((GstQTMux*)(obj))
typedef struct _GstQTMux GstQTMux;
typedef struct _GstQTMuxClass GstQTMuxClass;
typedef struct _GstQTPad
{
GstCollectData collect; /* we extend the CollectData */
/* fourcc id of stream */
guint32 fourcc;
/* whether using format that have out of order buffers */
gboolean is_out_of_order;
/* if not 0, track with constant sized samples, e.g. raw audio */
guint sample_size;
/* make sync table entry */
gboolean sync;
GstBuffer *last_buf;
/* dts of last_buf */
GstClockTime last_dts;
/* all the atom and chunk book-keeping is delegated here
* unowned/uncounted reference, parent MOOV owns */
AtomTRAK *trak;
} GstQTPad;
typedef enum _GstQTMuxState
{
GST_QT_MUX_STATE_NONE,
GST_QT_MUX_STATE_STARTED,
GST_QT_MUX_STATE_DATA,
GST_QT_MUX_STATE_EOS
} GstQTMuxState;
struct _GstQTMux
{
GstElement element;
GstPad *srcpad;
GstCollectPads *collect;
/* state */
GstQTMuxState state;
/* size of header (prefix, atoms (ftyp, mdat)) */
guint64 header_size;
/* accumulated size of raw media data (a priori not including mdat header) */
guint64 mdat_size;
/* position of mdat extended size field (for later updating) */
guint64 mdat_pos;
/* atom helper objects */
AtomsContext *context;
AtomFTYP *ftyp;
AtomMOOV *moov;
/* fast start */
FILE *fast_start_file;
GstTagList *tags;
/* properties */
guint32 timescale;
AtomsTreeFlavor flavor;
gboolean fast_start;
gboolean large_file;
gboolean do_ctts;
gchar *fast_start_file_path;
/* for collect pads event handling function */
GstPadEventFunction collect_event;
};
struct _GstQTMuxClass
{
GstElementClass parent_class;
GstQTMuxFormat format;
};
/* type register helper struct */
typedef struct _GstQTMuxClassParams
{
GstQTMuxFormatProp *prop;
GstCaps *src_caps;
GstCaps *video_sink_caps;
GstCaps *audio_sink_caps;
} GstQTMuxClassParams;
#define GST_QT_MUX_PARAMS_QDATA g_quark_from_static_string("qt-mux-params")
GType gst_qt_mux_get_type (void);
G_END_DECLS
#endif /* __GST_QT_MUX_H__ */
/* Quicktime muxer plugin for GStreamer
* Copyright (C) 2008 Thiago Sousa Santos <thiagoss@embedded.ufcg.edu.br>
* Copyright (C) 2008 Mark Nauwelaerts <mnauw@users.sf.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "gstqtmuxmap.h"
#include "fourcc.h"
#include "ftypcc.h"
/* static info related to various format */
#define COMMON_VIDEO_CAPS \
"width = (int) [ 16, 4096 ], " \
"height = (int) [ 16, 4096 ], " \
"framerate = (fraction) [ 0, MAX ]"
#define COMMON_VIDEO_CAPS_NO_FRAMERATE \
"width = (int) [ 16, 4096 ], " \
"height = (int) [ 16, 4096 ] "
#define H264_CAPS \
"video/x-h264, " \
COMMON_VIDEO_CAPS
#define MPEG4V_CAPS \
"video/mpeg, " \
"mpegversion = (int) 4, "\
"systemstream = (boolean) false, " \
COMMON_VIDEO_CAPS "; " \
"video/x-divx, " \
"divxversion = (int) 5, "\
COMMON_VIDEO_CAPS
#define COMMON_AUDIO_CAPS(c, r) \
"channels = (int) [ 1, " G_STRINGIFY (c) " ], " \
"rate = (int) [ 1, " G_STRINGIFY (r) " ]"
#define PCM_CAPS \
"audio/x-raw-int, " \
"width = (int) 8, " \
"depth = (int) 8, " \
COMMON_AUDIO_CAPS (2, MAX) ", " \
"signed = (boolean) { true, false }; " \
"audio/x-raw-int, " \
"width = (int) 16, " \
"depth = (int) 16, " \
"endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }, " \
COMMON_AUDIO_CAPS (2, MAX) ", " \
"signed = (boolean) true " \
#define PCM_CAPS_FULL \
PCM_CAPS "; " \
"audio/x-raw-int, " \
"width = (int) 24, " \
"depth = (int) 24, " \
"endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }, " \
COMMON_AUDIO_CAPS (2, MAX) ", " \
"signed = (boolean) true; " \
"audio/x-raw-int, " \
"width = (int) 32, " \
"depth = (int) 32, " \
"endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }, " \
COMMON_AUDIO_CAPS (2, MAX) ", " \
"signed = (boolean) true "
#define MP3_CAPS \
"audio/mpeg, " \
"mpegversion = (int) 1, " \
"layer = (int) 3, " \
COMMON_AUDIO_CAPS (2, MAX)
#define AAC_CAPS \
"audio/mpeg, " \
"mpegversion = (int) 4, " \
COMMON_AUDIO_CAPS (8, MAX)
GstQTMuxFormatProp gst_qt_mux_format_list[] = {
/* original QuickTime format; see Apple site (e.g. qtff.pdf) */
{
GST_QT_MUX_FORMAT_QT,
"qtmux",
"QuickTime",
"GstQTMux",
GST_STATIC_CAPS ("video/quicktime"),
GST_STATIC_CAPS ("video/x-raw-rgb, "
COMMON_VIDEO_CAPS "; "
"video/x-raw-yuv, "
"format = (fourcc) UYVY, "
COMMON_VIDEO_CAPS "; "
"video/x-h263, "
"h263version = (string) h263, "
COMMON_VIDEO_CAPS "; "
MPEG4V_CAPS "; "
H264_CAPS "; "
"video/x-dv, "
"systemstream = (boolean) false, "
COMMON_VIDEO_CAPS "; "
"image/jpeg, "
COMMON_VIDEO_CAPS_NO_FRAMERATE "; " "video/x-qt-part"),
GST_STATIC_CAPS (PCM_CAPS_FULL "; "
MP3_CAPS " ; "
AAC_CAPS " ; "
"audio/x-alaw, "
COMMON_AUDIO_CAPS (2, MAX) "; "
"audio/x-mulaw, " COMMON_AUDIO_CAPS (2, MAX))
}
,
/* ISO 14496-14: mp42 as ISO base media extension
* (supersedes original ISO 144996-1 mp41) */
{
GST_QT_MUX_FORMAT_MP4,
"mp4mux",
"MP4",
"GstMP4Mux",
/* FIXME does not feel right, due to qt caps mess */
GST_STATIC_CAPS ("video/quicktime"),
GST_STATIC_CAPS (MPEG4V_CAPS "; " H264_CAPS),
GST_STATIC_CAPS (MP3_CAPS "; " AAC_CAPS)
}
,
/* 3GPP Technical Specification 26.244 V7.3.0
* (extended in 3GPP2 File Formats for Multimedia Services) */
{
GST_QT_MUX_FORMAT_3GP,
"gppmux",
"3GPP",
"GstGPPMux",
GST_STATIC_CAPS ("application/x-3gp"),
GST_STATIC_CAPS (H264_CAPS),
GST_STATIC_CAPS ("audio/AMR, "
COMMON_AUDIO_CAPS (8, MAX) "; " MP3_CAPS "; " AAC_CAPS)
}
,
/* ISO 15444-3: Motion-JPEG-2000 (also ISO base media extension) */
{
GST_QT_MUX_FORMAT_MJ2,
"mj2mux",
"MJ2",
"GstMJ2Mux",
GST_STATIC_CAPS ("video/mj2"),
GST_STATIC_CAPS ("image/x-j2c, " COMMON_VIDEO_CAPS),
GST_STATIC_CAPS (PCM_CAPS)
}
,
{
GST_QT_MUX_FORMAT_NONE,
}
,
};
/* pretty static, but may turn out needed a few times */
AtomsTreeFlavor
gst_qt_mux_map_format_to_flavor (GstQTMuxFormat format)
{
if (format == GST_QT_MUX_FORMAT_QT)
return ATOMS_TREE_FLAVOR_MOV;
else
return ATOMS_TREE_FLAVOR_ISOM;
}
/* pretty static, but possibly dynamic format info */
/* notes:
* - avc1 brand is not used, since the specific extensions indicated by it
* are not used (e.g. sample groupings, etc)
* - 3GPP2 specific formats not (yet) used, only 3GPP, so no need yet either
* for 3g2a (but later on, moov might be used to conditionally switch to
* 3g2a if needed) */
void
gst_qt_mux_map_format_to_header (GstQTMuxFormat format, GstBuffer ** _prefix,
guint32 * _major, guint32 * _version, GList ** _compatible, AtomMOOV * moov)
{
static guint32 qt_brands[] = { 0 };
static guint32 mp4_brands[] = { FOURCC_mp41, FOURCC_isom, FOURCC_iso2, 0 };
static guint32 gpp_brands[] = { FOURCC_isom, FOURCC_iso2, 0 };
static guint32 mjp2_brands[] = { FOURCC_isom, FOURCC_iso2, 0 };
static guint8 mjp2_prefix[] =
{ 0, 0, 0, 12, 'j', 'P', ' ', ' ', 0x0D, 0x0A, 0x87, 0x0A };
guint32 *comp = NULL;
guint32 major = 0, version;
GstBuffer *prefix = NULL;
GList *result = NULL;
g_return_if_fail (_prefix != NULL);
g_return_if_fail (_major != NULL);
g_return_if_fail (_version != NULL);
g_return_if_fail (_compatible != NULL);
version = 1;
switch (format) {
case GST_QT_MUX_FORMAT_QT: