2003-11-21 21:34:27 +00:00
|
|
|
/* GStreamer Matroska muxer/demuxer
|
|
|
|
* (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
|
|
|
*
|
|
|
|
* matroska-ids.h: matroska file/stream data IDs
|
|
|
|
*
|
|
|
|
* 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_MATROSKA_IDS_H__
|
|
|
|
#define __GST_MATROSKA_IDS_H__
|
|
|
|
|
2006-04-25 16:38:50 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2003-11-21 21:34:27 +00:00
|
|
|
#include "ebml-ids.h"
|
|
|
|
|
|
|
|
/*
|
Riff, EBML, fourcc etc. work. Not fully finished, but better than what we used to have and definately worth a first b...
Original commit message from CVS:
Riff, EBML, fourcc etc. work. Not fully finished, but better than
what we used to have and definately worth a first broad testing.
I've revived rifflib. Rifflib used to be a bytestream-for-riff, which
just dup'ed bytestream. I've rewritten rifflib to be a modern riff-
chunk parser that uses bytestream fully, plus adds some extra functions
so that riff file parsing becomes extremely easy. It also contains some
small usability functions for strh/strf and metadata parsing. Note that
it doesn't use the new tagging yet, that's a TODO.
Avidemux has been rewritten to use this. I think we all agreed that
avidemux was pretty much a big mess, which is because it used all
sort of bytestream magic all around the place. It was just ugly.
This is a lot nicer, very complete and safe. I think this is far more
robust than what the old avidemux could ever have been. Of course, it
might contain bugs, please let me know.
EBML writing has also been implemented. This is useful for matroska.
I'm intending to modify avidemux (with a riffwriter) similarly. Maybe
I'll change wavparse/-enc too to use rifflib.
Lastly, several plugins have been modified to use rifflib's fourcc
parsing instead of their own. this puts fourcc parsing in one central
place, which should make it a lot simpler to add new fourccs. We might
want to move this to its own lib instead of rifflib.
Enjoy!
2003-12-07 20:00:41 +00:00
|
|
|
* Matroska element IDs. max. 32-bit.
|
2003-11-21 21:34:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* toplevel segment */
|
|
|
|
#define GST_MATROSKA_ID_SEGMENT 0x18538067
|
|
|
|
|
|
|
|
/* matroska top-level master IDs */
|
|
|
|
#define GST_MATROSKA_ID_INFO 0x1549A966
|
|
|
|
#define GST_MATROSKA_ID_TRACKS 0x1654AE6B
|
|
|
|
#define GST_MATROSKA_ID_CUES 0x1C53BB6B
|
|
|
|
#define GST_MATROSKA_ID_TAGS 0x1254C367
|
|
|
|
#define GST_MATROSKA_ID_SEEKHEAD 0x114D9B74
|
|
|
|
#define GST_MATROSKA_ID_CLUSTER 0x1F43B675
|
|
|
|
|
|
|
|
/* IDs in the info master */
|
|
|
|
#define GST_MATROSKA_ID_TIMECODESCALE 0x2AD7B1
|
|
|
|
#define GST_MATROSKA_ID_DURATION 0x4489
|
|
|
|
#define GST_MATROSKA_ID_WRITINGAPP 0x5741
|
|
|
|
#define GST_MATROSKA_ID_MUXINGAPP 0x4D80
|
|
|
|
#define GST_MATROSKA_ID_DATEUTC 0x4461
|
2004-09-01 12:10:21 +00:00
|
|
|
#define GST_MATROSKA_ID_SEGMENTUID 0x73A4
|
2003-11-21 21:34:27 +00:00
|
|
|
|
|
|
|
/* ID in the tracks master */
|
|
|
|
#define GST_MATROSKA_ID_TRACKENTRY 0xAE
|
|
|
|
|
|
|
|
/* IDs in the trackentry master */
|
|
|
|
#define GST_MATROSKA_ID_TRACKNUMBER 0xD7
|
|
|
|
#define GST_MATROSKA_ID_TRACKUID 0x73C5
|
|
|
|
#define GST_MATROSKA_ID_TRACKTYPE 0x83
|
|
|
|
#define GST_MATROSKA_ID_TRACKAUDIO 0xE1
|
|
|
|
#define GST_MATROSKA_ID_TRACKVIDEO 0xE0
|
|
|
|
#define GST_MATROSKA_ID_CODECID 0x86
|
|
|
|
#define GST_MATROSKA_ID_CODECPRIVATE 0x63A2
|
|
|
|
#define GST_MATROSKA_ID_CODECNAME 0x258688
|
|
|
|
#define GST_MATROSKA_ID_CODECINFOURL 0x3B4040
|
|
|
|
#define GST_MATROSKA_ID_CODECDOWNLOADURL 0x26B240
|
|
|
|
#define GST_MATROSKA_ID_TRACKNAME 0x536E
|
|
|
|
#define GST_MATROSKA_ID_TRACKLANGUAGE 0x22B59C
|
|
|
|
#define GST_MATROSKA_ID_TRACKFLAGENABLED 0xB9
|
|
|
|
#define GST_MATROSKA_ID_TRACKFLAGDEFAULT 0x88
|
|
|
|
#define GST_MATROSKA_ID_TRACKFLAGLACING 0x9C
|
|
|
|
#define GST_MATROSKA_ID_TRACKMINCACHE 0x6DE7
|
|
|
|
#define GST_MATROSKA_ID_TRACKMAXCACHE 0x6DF8
|
|
|
|
#define GST_MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383
|
2006-09-04 16:21:17 +00:00
|
|
|
#define GST_MATROSKA_ID_CONTENTENCODINGS 0x6D80
|
2003-11-21 21:34:27 +00:00
|
|
|
|
|
|
|
/* IDs in the trackvideo master */
|
|
|
|
#define GST_MATROSKA_ID_VIDEOFRAMERATE 0x2383E3
|
|
|
|
#define GST_MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0
|
|
|
|
#define GST_MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA
|
|
|
|
#define GST_MATROSKA_ID_VIDEOPIXELWIDTH 0xB0
|
|
|
|
#define GST_MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA
|
|
|
|
#define GST_MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A
|
|
|
|
#define GST_MATROSKA_ID_VIDEOSTEREOMODE 0x53B9
|
|
|
|
#define GST_MATROSKA_ID_VIDEOASPECTRATIO 0x54B3
|
|
|
|
#define GST_MATROSKA_ID_VIDEOCOLOURSPACE 0x2EB524
|
|
|
|
|
|
|
|
/* IDs in the trackaudio master */
|
|
|
|
#define GST_MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5
|
|
|
|
#define GST_MATROSKA_ID_AUDIOBITDEPTH 0x6264
|
|
|
|
#define GST_MATROSKA_ID_AUDIOCHANNELS 0x9F
|
|
|
|
|
|
|
|
/* ID in the cues master */
|
|
|
|
#define GST_MATROSKA_ID_POINTENTRY 0xBB
|
|
|
|
|
|
|
|
/* IDs in the pointentry master */
|
|
|
|
#define GST_MATROSKA_ID_CUETIME 0xB3
|
|
|
|
#define GST_MATROSKA_ID_CUETRACKPOSITION 0xB7
|
|
|
|
|
|
|
|
/* IDs in the cuetrackposition master */
|
|
|
|
#define GST_MATROSKA_ID_CUETRACK 0xF7
|
|
|
|
#define GST_MATROSKA_ID_CUECLUSTERPOSITION 0xF1
|
|
|
|
|
|
|
|
/* IDs in the tags master */
|
2004-05-01 17:27:23 +00:00
|
|
|
#define GST_MATROSKA_ID_TAG 0x7373
|
|
|
|
|
|
|
|
/* in the tag master */
|
|
|
|
#define GST_MATROSKA_ID_SIMPLETAG 0x67C8
|
|
|
|
|
|
|
|
/* in the simpletag master */
|
|
|
|
#define GST_MATROSKA_ID_TAGNAME 0x45A3
|
|
|
|
#define GST_MATROSKA_ID_TAGSTRING 0x4487
|
2003-11-21 21:34:27 +00:00
|
|
|
|
|
|
|
/* IDs in the seekhead master */
|
|
|
|
#define GST_MATROSKA_ID_SEEKENTRY 0x4DBB
|
|
|
|
|
|
|
|
/* IDs in the seekpoint master */
|
|
|
|
#define GST_MATROSKA_ID_SEEKID 0x53AB
|
|
|
|
#define GST_MATROSKA_ID_SEEKPOSITION 0x53AC
|
|
|
|
|
|
|
|
/* IDs in the cluster master */
|
|
|
|
#define GST_MATROSKA_ID_CLUSTERTIMECODE 0xE7
|
|
|
|
#define GST_MATROSKA_ID_BLOCKGROUP 0xA0
|
2005-10-28 15:32:48 +00:00
|
|
|
#define GST_MATROSKA_ID_SIMPLEBLOCK 0xA3
|
2004-07-18 16:58:08 +00:00
|
|
|
#define GST_MATROSKA_ID_REFERENCEBLOCK 0xFB
|
2003-11-21 21:34:27 +00:00
|
|
|
|
|
|
|
/* IDs in the blockgroup master */
|
|
|
|
#define GST_MATROSKA_ID_BLOCK 0xA1
|
|
|
|
#define GST_MATROSKA_ID_BLOCKDURATION 0x9B
|
|
|
|
|
2006-09-04 16:21:17 +00:00
|
|
|
/* IDs in the contentencodings master */
|
|
|
|
#define GST_MATROSKA_ID_CONTENTENCODING 0x6240
|
|
|
|
|
|
|
|
/* IDS IN THE CONTENTENCODING MASTER */
|
|
|
|
#define GST_MATROSKA_ID_CONTENTENCODINGORDER 0X5031
|
|
|
|
#define GST_MATROSKA_ID_CONTENTENCODINGSCOPE 0X5032
|
|
|
|
#define GST_MATROSKA_ID_CONTENTENCODINGTYPE 0X5033
|
|
|
|
#define GST_MATROSKA_ID_CONTENTCOMPRESSION 0X5034
|
|
|
|
#define GST_MATROSKA_ID_CONTENTENCRYPTION 0X5035
|
|
|
|
|
|
|
|
/* IDS IN THE CONTENTCOMPRESSION MASTER */
|
|
|
|
#define GST_MATROSKA_ID_CONTENTCOMPALGO 0X4254
|
|
|
|
#define GST_MATROSKA_ID_CONTENTCOMPSETTINGS 0X4255
|
|
|
|
|
|
|
|
|
2003-11-21 21:34:27 +00:00
|
|
|
/*
|
|
|
|
* Matroska Codec IDs. Strings.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC "V_MS/VFW/FOURCC"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_UNCOMPRESSED "V_UNCOMPRESSED"
|
|
|
|
#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"
|
2005-10-14 12:43:30 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_MPEG4_AVC "V_MPEG4/ISO/AVC"
|
2003-11-21 21:34:27 +00:00
|
|
|
#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"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_MJPEG "V_MJPEG"
|
2006-01-23 18:39:31 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_REALVIDEO1 "V_REAL/RV10"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_REALVIDEO2 "V_REAL/RV20"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_REALVIDEO3 "V_REAL/RV30"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_REALVIDEO4 "V_REAL/RV40"
|
gst/matroska/: Add support for muxing/demuxing theora video (#342448; too bad none of the usual linux players can act...
Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_push_xiph_codec_priv_data),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_video_caps), (gst_matroska_demux_audio_caps):
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init),
(gst_matroska_mux_video_pad_setcaps),
(xiph3_streamheader_to_codecdata),
(vorbis_streamheader_to_codecdata),
(theora_streamheader_to_codecdata),
(gst_matroska_mux_audio_pad_setcaps),
(gst_matroska_mux_write_data):
Add support for muxing/demuxing theora video (#342448; too bad
none of the usual linux players can actually play this). Playback
in GStreamer will require additional changes to theoradec in -base.
Refactor streamheaders <=> CodecPrivateData code a bit; some small
cleanups.
2006-05-23 13:44:11 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_THEORA "V_THEORA"
|
2008-02-29 06:18:55 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_VIDEO_DIRAC "V_DIRAC"
|
2006-01-23 18:39:31 +00:00
|
|
|
/* TODO: Quicktime */
|
2003-11-21 21:34:27 +00:00
|
|
|
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L1 "A_MPEG/L1"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L2 "A_MPEG/L2"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L3 "A_MPEG/L3"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_PCM_INT_BE "A_PCM/INT/BIG"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_PCM_INT_LE "A_PCM/INT/LIT"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_PCM_FLOAT "A_PCM/FLOAT/IEEE"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_AC3 "A_AC3"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_DTS "A_DTS"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_VORBIS "A_VORBIS"
|
gst/matroska/: not perfect yet though, needs some tweaking in flacdec; also, seeking could be better.
Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_push_hdr_buf),
(gst_matroska_demux_push_flac_codec_priv_data),
(gst_matroska_demux_push_xiph_codec_priv_data),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_video_caps), (gst_matroska_demux_audio_caps):
* gst/matroska/matroska-ids.h:
Add basic FLAC support (#311586), not perfect yet though, needs some
tweaking in flacdec; also, seeking could be better.
Do better bounds checking when deserialising vorbis stream headers
to make sure we don't read beyond the end of the buffer on bad input.
2006-09-04 15:06:25 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_FLAC "A_FLAC"
|
2003-11-21 21:34:27 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_ACM "A_MS/ACM"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG2 "A_AAC/MPEG2/"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG4 "A_AAC/MPEG4/"
|
2004-08-25 14:41:12 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_TTA "A_TTA1"
|
2005-10-14 12:43:30 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_WAVPACK4 "A_WAVPACK4"
|
2006-01-23 18:39:31 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_REAL_14_4 "A_REAL/28_8"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_REAL_28_8 "A_REAL/28_8"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_REAL_COOK "A_REAL/COOK"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_REAL_SIPR "A_REAL/SIPR"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_REAL_RALF "A_REAL/RALF"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_AUDIO_REAL_ATRC "A_REAL/ATRC"
|
|
|
|
|
|
|
|
/* TODO: AC3-9/10 (?), Musepack, Quicktime */
|
2003-11-21 21:34:27 +00:00
|
|
|
|
OGM text support, Matroska UTF-8 text support, deadlock fixes all over the place, subtitle awareness in decodebin/pla...
Original commit message from CVS:
* configure.ac:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_new):
* ext/ogg/gstogmparse.c: (gst_ogm_text_parse_get_type),
(gst_ogm_text_parse_base_init), (gst_ogm_text_parse_init),
(gst_ogm_parse_get_sink_querytypes), (gst_ogm_parse_sink_convert),
(gst_ogm_parse_sink_query), (gst_ogm_parse_chain),
(gst_ogm_parse_plugin_init):
* ext/pango/gsttextoverlay.c: (gst_textoverlay_linkedpads),
(gst_textoverlay_link), (gst_textoverlay_getcaps),
(gst_textoverlay_event), (gst_textoverlay_video_chain),
(gst_textoverlay_loop), (gst_textoverlay_init), (plugin_init):
* ext/pango/gsttextoverlay.h:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_handle_seek_event),
(gst_matroska_demux_sync_streams),
(gst_matroska_demux_parse_blockgroup),
(gst_matroska_demux_subtitle_caps),
(gst_matroska_demux_plugin_init):
* gst/matroska/matroska-ids.h:
* gst/playback/gstdecodebin.c: (close_pad_link):
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_init),
(gen_preroll_element), (remove_groups), (add_stream),
(new_decoded_pad), (setup_subtitles), (gen_source_element),
(setup_source):
* gst/playback/gstplaybasebin.h:
* gst/playback/gstplaybin.c: (gen_text_element), (setup_sinks):
* gst/subparse/Makefile.am:
* gst/subparse/gstsubparse.c: (gst_subparse_get_type),
(gst_subparse_base_init), (gst_subparse_class_init),
(gst_subparse_init), (gst_subparse_formats),
(gst_subparse_eventmask), (gst_subparse_event),
(gst_subparse_handle_event), (convert_encoding), (get_next_line),
(parse_mdvdsub), (parse_mdvdsub_init), (parse_subrip),
(parse_subrip_deinit), (parse_subrip_init), (parse_mpsub),
(parse_mpsub_deinit), (parse_mpsub_init),
(gst_subparse_buffer_format_autodetect),
(gst_subparse_format_autodetect), (gst_subparse_loop),
(gst_subparse_change_state), (gst_subparse_type_find),
(plugin_init):
* gst/subparse/gstsubparse.h:
* gst/typefind/gsttypefindfunctions.c: (ogmtext_type_find),
(plugin_init):
Add subtitle support, .sub parser (supports SRT and MPsub),
OGM text support, Matroska UTF-8 text support, deadlock fixes
all over the place, subtitle awareness in decodebin/playbin
and some fixes to textoverlay to handle subtitles in a stream
correctly. Fixes #100931.
2005-01-08 18:22:41 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_SUBTITLE_UTF8 "S_TEXT/UTF8"
|
2006-02-18 17:20:48 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_SUBTITLE_SSA "S_TEXT/SSA"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_SUBTITLE_ASS "S_TEXT/ASS"
|
|
|
|
#define GST_MATROSKA_CODEC_ID_SUBTITLE_USF "S_TEXT/USF"
|
2006-09-04 16:21:17 +00:00
|
|
|
#define GST_MATROSKA_CODEC_ID_SUBTITLE_VOBSUB "S_VOBSUB"
|
OGM text support, Matroska UTF-8 text support, deadlock fixes all over the place, subtitle awareness in decodebin/pla...
Original commit message from CVS:
* configure.ac:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_new):
* ext/ogg/gstogmparse.c: (gst_ogm_text_parse_get_type),
(gst_ogm_text_parse_base_init), (gst_ogm_text_parse_init),
(gst_ogm_parse_get_sink_querytypes), (gst_ogm_parse_sink_convert),
(gst_ogm_parse_sink_query), (gst_ogm_parse_chain),
(gst_ogm_parse_plugin_init):
* ext/pango/gsttextoverlay.c: (gst_textoverlay_linkedpads),
(gst_textoverlay_link), (gst_textoverlay_getcaps),
(gst_textoverlay_event), (gst_textoverlay_video_chain),
(gst_textoverlay_loop), (gst_textoverlay_init), (plugin_init):
* ext/pango/gsttextoverlay.h:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_handle_seek_event),
(gst_matroska_demux_sync_streams),
(gst_matroska_demux_parse_blockgroup),
(gst_matroska_demux_subtitle_caps),
(gst_matroska_demux_plugin_init):
* gst/matroska/matroska-ids.h:
* gst/playback/gstdecodebin.c: (close_pad_link):
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_init),
(gen_preroll_element), (remove_groups), (add_stream),
(new_decoded_pad), (setup_subtitles), (gen_source_element),
(setup_source):
* gst/playback/gstplaybasebin.h:
* gst/playback/gstplaybin.c: (gen_text_element), (setup_sinks):
* gst/subparse/Makefile.am:
* gst/subparse/gstsubparse.c: (gst_subparse_get_type),
(gst_subparse_base_init), (gst_subparse_class_init),
(gst_subparse_init), (gst_subparse_formats),
(gst_subparse_eventmask), (gst_subparse_event),
(gst_subparse_handle_event), (convert_encoding), (get_next_line),
(parse_mdvdsub), (parse_mdvdsub_init), (parse_subrip),
(parse_subrip_deinit), (parse_subrip_init), (parse_mpsub),
(parse_mpsub_deinit), (parse_mpsub_init),
(gst_subparse_buffer_format_autodetect),
(gst_subparse_format_autodetect), (gst_subparse_loop),
(gst_subparse_change_state), (gst_subparse_type_find),
(plugin_init):
* gst/subparse/gstsubparse.h:
* gst/typefind/gsttypefindfunctions.c: (ogmtext_type_find),
(plugin_init):
Add subtitle support, .sub parser (supports SRT and MPsub),
OGM text support, Matroska UTF-8 text support, deadlock fixes
all over the place, subtitle awareness in decodebin/playbin
and some fixes to textoverlay to handle subtitles in a stream
correctly. Fixes #100931.
2005-01-08 18:22:41 +00:00
|
|
|
|
2004-05-01 17:27:23 +00:00
|
|
|
/*
|
|
|
|
* Matrodka tags. Strings.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GST_MATROSKA_TAG_ID_TITLE "TITLE"
|
|
|
|
#define GST_MATROSKA_TAG_ID_AUTHOR "AUTHOR"
|
|
|
|
#define GST_MATROSKA_TAG_ID_ALBUM "ALBUM"
|
|
|
|
#define GST_MATROSKA_TAG_ID_COMMENTS "COMMENTS"
|
|
|
|
#define GST_MATROSKA_TAG_ID_BITSPS "BITSPS"
|
|
|
|
#define GST_MATROSKA_TAG_ID_ENCODER "ENCODER"
|
|
|
|
#define GST_MATROSKA_TAG_ID_DATE "DATE"
|
|
|
|
#define GST_MATROSKA_TAG_ID_ISRC "ISRC"
|
|
|
|
#define GST_MATROSKA_TAG_ID_COPYRIGHT "COPYRIGHT"
|
|
|
|
|
2003-11-21 21:34:27 +00:00
|
|
|
/*
|
|
|
|
* Enumerations for various types (mapping from binary
|
|
|
|
* value to what it actually means).
|
|
|
|
*/
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_MATROSKA_TRACK_TYPE_VIDEO = 0x1,
|
|
|
|
GST_MATROSKA_TRACK_TYPE_AUDIO = 0x2,
|
|
|
|
GST_MATROSKA_TRACK_TYPE_COMPLEX = 0x3,
|
|
|
|
GST_MATROSKA_TRACK_TYPE_LOGO = 0x10,
|
2003-11-21 21:34:27 +00:00
|
|
|
GST_MATROSKA_TRACK_TYPE_SUBTITLE = 0x11,
|
2004-03-15 16:32:54 +00:00
|
|
|
GST_MATROSKA_TRACK_TYPE_CONTROL = 0x20,
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaTrackType;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_MATROSKA_EYE_MODE_MONO = 0x0,
|
2003-11-21 21:34:27 +00:00
|
|
|
GST_MATROSKA_EYE_MODE_RIGHT = 0x1,
|
2004-03-15 16:32:54 +00:00
|
|
|
GST_MATROSKA_EYE_MODE_LEFT = 0x2,
|
|
|
|
GST_MATROSKA_EYE_MODE_BOTH = 0x3,
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaEyeMode;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_MATROSKA_ASPECT_RATIO_MODE_FREE = 0x0,
|
|
|
|
GST_MATROSKA_ASPECT_RATIO_MODE_KEEP = 0x1,
|
2003-11-21 21:34:27 +00:00
|
|
|
GST_MATROSKA_ASPECT_RATIO_MODE_FIXED = 0x2,
|
|
|
|
} GstMatroskaAspectRatioMode;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These aren't in any way "matroska-form" things,
|
|
|
|
* it's just something I use in the muxer/demuxer.
|
|
|
|
*/
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_MATROSKA_TRACK_ENABLED = (1<<0),
|
|
|
|
GST_MATROSKA_TRACK_DEFAULT = (1<<1),
|
|
|
|
GST_MATROSKA_TRACK_LACING = (1<<2),
|
|
|
|
GST_MATROSKA_TRACK_SHIFT = (1<<16)
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaTrackFlags;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_MATROSKA_VIDEOTRACK_INTERLACED = (GST_MATROSKA_TRACK_SHIFT<<0)
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaVideoTrackFlags;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstMatroskaTrackContext {
|
|
|
|
GstPad *pad;
|
|
|
|
GstCaps *caps;
|
2005-12-06 19:44:58 +00:00
|
|
|
guint index;
|
gst/matroska/: Handle return values from pull_range in a more granular way to properly shut down on seeks.
Original commit message from CVS:
* gst/matroska/ebml-read.c: (gst_ebml_read_peek_bytes),
(gst_ebml_read_pull_bytes), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_peek_id),
(gst_ebml_read_skip), (gst_ebml_read_buffer),
(gst_ebml_read_bytes), (gst_ebml_read_uint), (gst_ebml_read_sint),
(gst_ebml_read_float), (gst_ebml_read_ascii), (gst_ebml_read_utf8),
(gst_ebml_read_date), (gst_ebml_read_master),
(gst_ebml_read_binary), (gst_ebml_read_header):
* gst/matroska/ebml-read.h:
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_combine_flows), (gst_matroska_demux_reset),
(gst_matroska_demux_read_track_encodings),
(gst_matroska_demux_add_stream),
(gst_matroska_demux_handle_src_query),
(gst_matroska_demux_handle_seek_event),
(gst_matroska_demux_init_stream),
(gst_matroska_demux_parse_tracks),
(gst_matroska_demux_parse_index_cuetrack),
(gst_matroska_demux_parse_index_pointentry),
(gst_matroska_demux_parse_index), (gst_matroska_demux_parse_info),
(gst_matroska_demux_parse_metadata_id_simple_tag),
(gst_matroska_demux_parse_metadata_id_tag),
(gst_matroska_demux_parse_metadata),
(gst_matroska_demux_sync_streams),
(gst_matroska_demux_push_hdr_buf),
(gst_matroska_demux_push_flac_codec_priv_data),
(gst_matroska_demux_push_xiph_codec_priv_data),
(gst_matroska_demux_add_wvpk_header),
(gst_matroska_demux_check_subtitle_buffer),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_parse_cluster),
(gst_matroska_demux_parse_contents_seekentry),
(gst_matroska_demux_parse_contents),
(gst_matroska_demux_loop_stream_parse_id),
(gst_matroska_demux_loop_stream), (gst_matroska_demux_loop):
* gst/matroska/matroska-demux.h:
* gst/matroska/matroska-ids.h:
Handle return values from pull_range in a more granular way to properly
shut down on seeks.
Combine return values from push.
Implement proper error handling.
Prepare for handling seeking correctly.
2008-03-06 19:47:48 +00:00
|
|
|
GstFlowReturn last_flow;
|
2003-11-21 21:34:27 +00:00
|
|
|
|
|
|
|
/* some often-used info */
|
2004-03-15 16:32:54 +00:00
|
|
|
gchar *codec_id, *codec_name, *name, *language;
|
|
|
|
gpointer codec_priv;
|
|
|
|
guint codec_priv_size;
|
2003-11-21 21:34:27 +00:00
|
|
|
GstMatroskaTrackType type;
|
2004-03-15 16:32:54 +00:00
|
|
|
guint uid, num;
|
2003-11-21 21:34:27 +00:00
|
|
|
GstMatroskaTrackFlags flags;
|
2004-03-15 16:32:54 +00:00
|
|
|
guint64 default_duration;
|
OGM text support, Matroska UTF-8 text support, deadlock fixes all over the place, subtitle awareness in decodebin/pla...
Original commit message from CVS:
* configure.ac:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_new):
* ext/ogg/gstogmparse.c: (gst_ogm_text_parse_get_type),
(gst_ogm_text_parse_base_init), (gst_ogm_text_parse_init),
(gst_ogm_parse_get_sink_querytypes), (gst_ogm_parse_sink_convert),
(gst_ogm_parse_sink_query), (gst_ogm_parse_chain),
(gst_ogm_parse_plugin_init):
* ext/pango/gsttextoverlay.c: (gst_textoverlay_linkedpads),
(gst_textoverlay_link), (gst_textoverlay_getcaps),
(gst_textoverlay_event), (gst_textoverlay_video_chain),
(gst_textoverlay_loop), (gst_textoverlay_init), (plugin_init):
* ext/pango/gsttextoverlay.h:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_handle_seek_event),
(gst_matroska_demux_sync_streams),
(gst_matroska_demux_parse_blockgroup),
(gst_matroska_demux_subtitle_caps),
(gst_matroska_demux_plugin_init):
* gst/matroska/matroska-ids.h:
* gst/playback/gstdecodebin.c: (close_pad_link):
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_init),
(gen_preroll_element), (remove_groups), (add_stream),
(new_decoded_pad), (setup_subtitles), (gen_source_element),
(setup_source):
* gst/playback/gstplaybasebin.h:
* gst/playback/gstplaybin.c: (gen_text_element), (setup_sinks):
* gst/subparse/Makefile.am:
* gst/subparse/gstsubparse.c: (gst_subparse_get_type),
(gst_subparse_base_init), (gst_subparse_class_init),
(gst_subparse_init), (gst_subparse_formats),
(gst_subparse_eventmask), (gst_subparse_event),
(gst_subparse_handle_event), (convert_encoding), (get_next_line),
(parse_mdvdsub), (parse_mdvdsub_init), (parse_subrip),
(parse_subrip_deinit), (parse_subrip_init), (parse_mpsub),
(parse_mpsub_deinit), (parse_mpsub_init),
(gst_subparse_buffer_format_autodetect),
(gst_subparse_format_autodetect), (gst_subparse_loop),
(gst_subparse_change_state), (gst_subparse_type_find),
(plugin_init):
* gst/subparse/gstsubparse.h:
* gst/typefind/gsttypefindfunctions.c: (ogmtext_type_find),
(plugin_init):
Add subtitle support, .sub parser (supports SRT and MPsub),
OGM text support, Matroska UTF-8 text support, deadlock fixes
all over the place, subtitle awareness in decodebin/playbin
and some fixes to textoverlay to handle subtitles in a stream
correctly. Fixes #100931.
2005-01-08 18:22:41 +00:00
|
|
|
guint64 pos;
|
2006-04-20 13:23:40 +00:00
|
|
|
|
|
|
|
gboolean set_discont; /* TRUE = set DISCONT flag on next buffer */
|
gst/matroska/: Add support for muxing/demuxing theora video (#342448; too bad none of the usual linux players can act...
Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_push_xiph_codec_priv_data),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_video_caps), (gst_matroska_demux_audio_caps):
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init),
(gst_matroska_mux_video_pad_setcaps),
(xiph3_streamheader_to_codecdata),
(vorbis_streamheader_to_codecdata),
(theora_streamheader_to_codecdata),
(gst_matroska_mux_audio_pad_setcaps),
(gst_matroska_mux_write_data):
Add support for muxing/demuxing theora video (#342448; too bad
none of the usual linux players can actually play this). Playback
in GStreamer will require additional changes to theoradec in -base.
Refactor streamheaders <=> CodecPrivateData code a bit; some small
cleanups.
2006-05-23 13:44:11 +00:00
|
|
|
|
|
|
|
/* Special flag for Vorbis and Theora, for which we need to send
|
|
|
|
* codec_priv first before sending any data, and just testing
|
|
|
|
* for time == 0 is not enough to detect that. Used by demuxer */
|
|
|
|
gboolean send_xiph_headers;
|
|
|
|
|
gst/matroska/: not perfect yet though, needs some tweaking in flacdec; also, seeking could be better.
Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_push_hdr_buf),
(gst_matroska_demux_push_flac_codec_priv_data),
(gst_matroska_demux_push_xiph_codec_priv_data),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_video_caps), (gst_matroska_demux_audio_caps):
* gst/matroska/matroska-ids.h:
Add basic FLAC support (#311586), not perfect yet though, needs some
tweaking in flacdec; also, seeking could be better.
Do better bounds checking when deserialising vorbis stream headers
to make sure we don't read beyond the end of the buffer on bad input.
2006-09-04 15:06:25 +00:00
|
|
|
/* Special flag for Flac, for which we need to reconstruct the header
|
|
|
|
* buffer from the codec_priv data before sending any data, and just
|
|
|
|
* testing for time == 0 is not enough to detect that. Used by demuxer */
|
|
|
|
gboolean send_flac_headers;
|
|
|
|
|
2007-11-13 17:01:07 +00:00
|
|
|
/* Special flag for VobSub, for which we have to send colour table info
|
|
|
|
* (if available) first before sending any data, and just testing
|
|
|
|
* for time == 0 is not enough to detect that. Used by demuxer */
|
|
|
|
gboolean send_dvd_event;
|
|
|
|
|
gst/matroska/: Add support for muxing/demuxing theora video (#342448; too bad none of the usual linux players can act...
Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_push_xiph_codec_priv_data),
(gst_matroska_demux_parse_blockgroup_or_simpleblock),
(gst_matroska_demux_video_caps), (gst_matroska_demux_audio_caps):
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init),
(gst_matroska_mux_video_pad_setcaps),
(xiph3_streamheader_to_codecdata),
(vorbis_streamheader_to_codecdata),
(theora_streamheader_to_codecdata),
(gst_matroska_mux_audio_pad_setcaps),
(gst_matroska_mux_write_data):
Add support for muxing/demuxing theora video (#342448; too bad
none of the usual linux players can actually play this). Playback
in GStreamer will require additional changes to theoradec in -base.
Refactor streamheaders <=> CodecPrivateData code a bit; some small
cleanups.
2006-05-23 13:44:11 +00:00
|
|
|
/* Special counter for muxer to skip the first N vorbis/theora headers -
|
|
|
|
* they are put into codec private data, not muxed into the stream */
|
|
|
|
guint xiph_headers_to_skip;
|
2006-06-29 11:41:55 +00:00
|
|
|
|
|
|
|
/* Tags to send after newsegment event */
|
|
|
|
GstTagList *pending_tags;
|
2006-09-04 16:21:17 +00:00
|
|
|
|
|
|
|
/* A GArray of GstMatroskaTrackEncoding structures which contain the
|
|
|
|
* encoding (compression/encryption) settings for this track, if any */
|
|
|
|
GArray *encodings;
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaTrackContext;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstMatroskaTrackVideoContext {
|
2003-11-21 21:34:27 +00:00
|
|
|
GstMatroskaTrackContext parent;
|
|
|
|
|
2006-12-11 13:59:33 +00:00
|
|
|
guint pixel_width, pixel_height;
|
|
|
|
guint display_width, display_height;
|
|
|
|
gdouble default_fps;
|
2003-11-21 21:34:27 +00:00
|
|
|
GstMatroskaEyeMode eye_mode;
|
|
|
|
GstMatroskaAspectRatioMode asr_mode;
|
2004-03-15 16:32:54 +00:00
|
|
|
guint32 fourcc;
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaTrackVideoContext;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstMatroskaTrackAudioContext {
|
2003-11-21 21:34:27 +00:00
|
|
|
GstMatroskaTrackContext parent;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
guint samplerate, channels, bitdepth;
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaTrackAudioContext;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstMatroskaTrackComplexContext {
|
2003-11-21 21:34:27 +00:00
|
|
|
GstMatroskaTrackContext parent;
|
|
|
|
|
|
|
|
/* nothing special goes here, apparently */
|
|
|
|
} GstMatroskaTrackComplexContext;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstMatroskaTrackSubtitleContext {
|
2003-11-21 21:34:27 +00:00
|
|
|
GstMatroskaTrackContext parent;
|
|
|
|
|
2006-06-22 16:27:03 +00:00
|
|
|
gboolean check_utf8; /* buffers should be valid UTF-8 */
|
|
|
|
gboolean invalid_utf8; /* work around broken files */
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaTrackSubtitleContext;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstMatroskaIndex {
|
|
|
|
guint64 pos; /* of the corresponding *cluster*! */
|
|
|
|
guint16 track; /* reference to 'num' */
|
|
|
|
guint64 time; /* in nanoseconds */
|
2003-11-21 21:34:27 +00:00
|
|
|
} GstMatroskaIndex;
|
|
|
|
|
2005-10-14 12:43:30 +00:00
|
|
|
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;
|
|
|
|
|
2006-09-04 16:21:17 +00:00
|
|
|
typedef struct _GstMatroskaTrackEncoding {
|
|
|
|
guint order;
|
|
|
|
guint scope : 3;
|
|
|
|
guint type : 1;
|
|
|
|
guint comp_algo : 2;
|
|
|
|
guint8 *comp_settings;
|
|
|
|
guint comp_settings_length;
|
|
|
|
} GstMatroskaTrackEncoding;
|
|
|
|
|
2006-04-25 16:38:50 +00:00
|
|
|
gboolean gst_matroska_track_init_video_context (GstMatroskaTrackContext ** p_context);
|
|
|
|
gboolean gst_matroska_track_init_audio_context (GstMatroskaTrackContext ** p_context);
|
|
|
|
gboolean gst_matroska_track_init_subtitle_context (GstMatroskaTrackContext ** p_context);
|
|
|
|
gboolean gst_matroska_track_init_complex_context (GstMatroskaTrackContext ** p_context);
|
|
|
|
|
2003-11-21 21:34:27 +00:00
|
|
|
#endif /* __GST_MATROSKA_IDS_H__ */
|