├── .gitignore ├── .gitmodules ├── .travis.yml ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── README.md ├── autogen.sh ├── configure.ac ├── doc └── libde265.png ├── examples ├── .gitignore ├── Makefile.am ├── playhevc.c ├── spreedmovie.mkv └── timehevc.c └── src ├── Makefile.am ├── common ├── COPYING ├── README.txt ├── codec-utils.c └── codec-utils.h ├── gstlibde265.c ├── isomp4 ├── 0.10 │ ├── COPYING │ ├── LEGAL │ ├── Makefile.am │ ├── README.txt │ ├── atoms.c │ ├── atoms.h │ ├── atomsrecovery.c │ ├── atomsrecovery.h │ ├── descriptors.c │ ├── descriptors.h │ ├── fourcc.h │ ├── ftypcc.h │ ├── gstqtmoovrecover.c │ ├── gstqtmoovrecover.h │ ├── gstqtmux-doc.c │ ├── gstqtmux-doc.h │ ├── gstqtmux.c │ ├── gstqtmux.h │ ├── gstqtmuxmap.c │ ├── gstqtmuxmap.h │ ├── gstrtpxqtdepay.c │ ├── gstrtpxqtdepay.h │ ├── isomp4-0.10-h265-changes.diff │ ├── isomp4-plugin.c │ ├── properties.c │ ├── properties.h │ ├── qtatomparser.h │ ├── qtdemux.c │ ├── qtdemux.h │ ├── qtdemux.vcproj │ ├── qtdemux_dump.c │ ├── qtdemux_dump.h │ ├── qtdemux_fourcc.h │ ├── qtdemux_lang.c │ ├── qtdemux_lang.h │ ├── qtdemux_types.c │ ├── qtdemux_types.h │ └── qtpalette.h ├── 1.0 │ ├── COPYING │ ├── LEGAL │ ├── Makefile.am │ ├── README.txt │ ├── atoms.c │ ├── atoms.h │ ├── atomsrecovery.c │ ├── atomsrecovery.h │ ├── descriptors.c │ ├── descriptors.h │ ├── fourcc.h │ ├── ftypcc.h │ ├── gstqtmoovrecover.c │ ├── gstqtmoovrecover.h │ ├── gstqtmux-doc.c │ ├── gstqtmux-doc.h │ ├── gstqtmux.c │ ├── gstqtmux.h │ ├── gstqtmuxmap.c │ ├── gstqtmuxmap.h │ ├── gstrtpxqtdepay.c │ ├── gstrtpxqtdepay.h │ ├── isomp4-1.0-h265-changes.diff │ ├── isomp4-plugin.c │ ├── properties.c │ ├── properties.h │ ├── qtatomparser.h │ ├── qtdemux.c │ ├── qtdemux.h │ ├── qtdemux.vcproj │ ├── qtdemux_dump.c │ ├── qtdemux_dump.h │ ├── qtdemux_fourcc.h │ ├── qtdemux_lang.c │ ├── qtdemux_lang.h │ ├── qtdemux_types.c │ ├── qtdemux_types.h │ └── qtpalette.h └── 1.2 │ ├── COPYING │ ├── LEGAL │ ├── Makefile.am │ ├── README.txt │ ├── atoms.c │ ├── atoms.h │ ├── atomsrecovery.c │ ├── atomsrecovery.h │ ├── descriptors.c │ ├── descriptors.h │ ├── fourcc.h │ ├── ftypcc.h │ ├── gstqtmoovrecover.c │ ├── gstqtmoovrecover.h │ ├── gstqtmux-doc.c │ ├── gstqtmux-doc.h │ ├── gstqtmux.c │ ├── gstqtmux.h │ ├── gstqtmuxmap.c │ ├── gstqtmuxmap.h │ ├── gstrtpxqtdepay.c │ ├── gstrtpxqtdepay.h │ ├── isomp4-1.2-h265-changes.diff │ ├── isomp4-plugin.c │ ├── properties.c │ ├── properties.h │ ├── qtatomparser.h │ ├── qtdemux.c │ ├── qtdemux.h │ ├── qtdemux.vcproj │ ├── qtdemux_dump.c │ ├── qtdemux_dump.h │ ├── qtdemux_fourcc.h │ ├── qtdemux_lang.c │ ├── qtdemux_lang.h │ ├── qtdemux_types.c │ ├── qtdemux_types.h │ └── qtpalette.h ├── libde265-dec.c ├── libde265-dec.h └── matroska ├── 0.10 ├── COPYING ├── README.txt ├── ebml-ids.h ├── ebml-read.c ├── ebml-read.h ├── ebml-write.c ├── ebml-write.h ├── lzo.c ├── lzo.h ├── matroska-0.10-h265-changes.diff ├── matroska-demux.c ├── matroska-demux.h ├── matroska-ids.c ├── matroska-ids.h ├── matroska-mux.c ├── matroska-mux.h ├── matroska-parse.c ├── matroska-parse.h ├── matroska-read-common.c ├── matroska-read-common.h ├── matroska.c ├── webm-mux.c └── webm-mux.h ├── 1.0 ├── COPYING ├── README.txt ├── ebml-ids.h ├── ebml-read.c ├── ebml-read.h ├── ebml-write.c ├── ebml-write.h ├── lzo.c ├── lzo.h ├── matroska-1.0-h265-changes.diff ├── matroska-demux.c ├── matroska-demux.h ├── matroska-ids.c ├── matroska-ids.h ├── matroska-mux.c ├── matroska-mux.h ├── matroska-parse.c ├── matroska-parse.h ├── matroska-read-common.c ├── matroska-read-common.h ├── matroska.c ├── webm-mux.c └── webm-mux.h └── 1.2 ├── COPYING ├── README.txt ├── ebml-ids.h ├── ebml-read.c ├── ebml-read.h ├── ebml-write.c ├── ebml-write.h ├── lzo.c ├── lzo.h ├── matroska-1.2-h265-changes.diff ├── matroska-demux.c ├── matroska-demux.h ├── matroska-ids.c ├── matroska-ids.h ├── matroska-mux.c ├── matroska-mux.h ├── matroska-parse.c ├── matroska-parse.h ├── matroska-read-common.c ├── matroska-read-common.h ├── matroska.c ├── webm-mux.c └── webm-mux.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | *.o 3 | *.la 4 | *.lo 5 | *~ 6 | .libs 7 | .deps 8 | Makefile.in 9 | Makefile 10 | config.* 11 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "common"] 2 | path = common 3 | url = git://anongit.freedesktop.org/gstreamer/common 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # stats available at 2 | # https://travis-ci.org/strukturag/gstreamer-libde265/ 3 | language: c 4 | compiler: 5 | - clang 6 | - gcc 7 | 8 | env: 9 | - GSTREAMER=0.10 10 | - GSTREAMER=1.0 11 | 12 | before_install: 13 | - sudo add-apt-repository -y ppa:strukturag/libde265 14 | - sh -c "if [ '$GSTREAMER' = '1.0' ]; then sudo add-apt-repository -y ppa:gstreamer-developers/ppa; fi" 15 | - sudo apt-get update -qq 16 | - sudo apt-get install -y libde265-dev libz-dev libbz2-dev gstreamer$GSTREAMER-tools libgstreamer$GSTREAMER-dev libgstreamer-plugins-base$GSTREAMER-dev libgstreamer-plugins-bad$GSTREAMER-dev 17 | - sh -c "if [ '$GSTREAMER' = '1.0' ]; then sudo apt-get install -y libgstreamer-plugins-good$GSTREAMER-dev; fi" 18 | 19 | install: 20 | - git clone https://github.com/strukturag/libde265-data.git 21 | 22 | script: 23 | - ./autogen.sh 24 | - ./configure --enable-gstreamer$GSTREAMER 25 | - make 26 | - gst-codec-info-$GSTREAMER `pwd`/src/.libs/libgstlibde265.so 27 | - gst-inspect-$GSTREAMER --gst-plugin-path=`pwd`/src/.libs/ gstlibde265 28 | - gst-launch-$GSTREAMER --gst-plugin-path=`pwd`/src/.libs/ filesrc location=`pwd`/libde265-data/RandomAccess/paris-ra-wpp.bin ! libde265dec mode=raw ! fakesink sync=false 29 | - ./examples/timehevc --gst-plugin-path=`pwd`/src/.libs/ `pwd`/examples/spreedmovie.mkv 30 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name 3 | # 4 | # Please add yourself at the end of the list. 5 | 6 | Joachim Bauch 7 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | See https://github.com/strukturag/gstreamer-libde265 for further 2 | information. 3 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | common \ 3 | src \ 4 | examples 5 | 6 | DIST_SUBDIRS = \ 7 | common \ 8 | src \ 9 | examples 10 | 11 | EXTRA_DIST = \ 12 | autogen.sh \ 13 | README.md \ 14 | doc/* 15 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | See https://github.com/strukturag/gstreamer-libde265 for further 2 | information. 3 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | See README.md for further information. 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gstreamer-libde265 2 | 3 | Powered by libde265 4 | 5 | ![powered by libde265](doc/libde265.png) 6 | 7 | ## Deprecated 8 | 9 | The libde265 plugin has been integrated in upstream GStreamer: 10 | https://gstreamer.freedesktop.org/documentation/de265/index.html 11 | 12 | Using code from this repository therefore should no longer be necessary. 13 | 14 | ## Building 15 | 16 | [![Build Status](https://travis-ci.org/strukturag/gstreamer-libde265.png?branch=master)](https://travis-ci.org/strukturag/gstreamer-libde265) 17 | 18 | If you got gstreamer-libde265 from the git repository, you will first 19 | need to run the included `autogen.sh` script to generate the `configure` 20 | script. 21 | 22 | Compile for gstreamer0.10: 23 | 24 | $ ./configure --enable-gstreamer0.10 25 | $ make 26 | 27 | Compile for gstreamer1.0: 28 | 29 | $ ./configure 30 | $ make 31 | 32 | ## Dependencies 33 | 34 | Various libraries are required to build gstreamer-libde265: 35 | - `libde265-dev` (>= 0.7), 36 | - `libz-dev` 37 | - `libbz2-dev` 38 | - `libgstreamer0.10-dev` (only for gstreamer0.10) 39 | - `libgstreamer-plugins-base0.10-dev` (only for gstreamer0.10) 40 | - `libgstreamer-plugins-bad0.10-dev` (only for gstreamer0.10) 41 | - `libgstreamer1.0-dev` (only for gstreamer1.0) 42 | - `libgstreamer-plugins-base1.0-dev` (only for gstreamer1.0) 43 | - `libgstreamer-plugins-good1.0-dev` (only for gstreamer1.0) 44 | - `libgstreamer-plugins-bad1.0-dev` (only for gstreamer1.0) 45 | 46 | Prebuilt packages for old versions of Ubuntu are available at 47 | https://launchpad.net/~strukturag/+archive/libde265 48 | 49 | Please note that the PPA is no longer maintained since the plugin is part of 50 | upstream GStreamer. 51 | 52 | ## Running 53 | 54 | To test, make sure the `libde265.so.0` is in your `LD_LIBRARY_PATH` and 55 | execute: 56 | 57 | $ gst-launch-0.10 \ 58 | --gst-plugin-path=/path/to/gstreamer-libde265/src/.libs/ \ 59 | playbin uri=file:///path/to/sample-hevc.mkv 60 | 61 | You can also playback raw H.265/HEVC bitstreams by switching the decoder 62 | to raw-mode and passing the desired framerate: 63 | 64 | $ gst-launch-0.10 \ 65 | --gst-plugin-path=/path/to/gstreamer-libde265/src/.libs/ \ 66 | filesrc location=/path/to/sample-bitstream.hevc \ 67 | ! libde265dec mode=raw framerate=25/1 ! xvimagesink 68 | 69 | The `examples` folder contains a sample raw bitstream player which can 70 | be used instead of passing the various options to `gst-launch` (assuming 71 | you have all necessary plugins in the GStreamer plugin path): 72 | 73 | $ ./playhevc --fps=25 /path/to/sample-bitstream.hevc 74 | 75 | Other commandline switches are available from 76 | 77 | $ ./playhevc --help-all 78 | 79 | ## Performance 80 | 81 | Decoder performance was measured using the `timehevc` tool from the `examples` 82 | folder. The tool plays a Matroska movie to the GStreamer fakesink and measures 83 | the average framerate. 84 | 85 | | Resolution | avg. fps | CPU usage | 86 | | ----------------- | -------- | --------- | 87 | | [720p][1] | 298 fps | 36 % | 88 | | [1080p][2] | 161 fps | 43 % | 89 | | [4K][3] | 40 fps | 55 % | 90 | 91 | Environment: 92 | - Intel(R) Core(TM) i7-2700K CPU @ 3.50GHz (4 physical CPU cores) 93 | - Ubuntu 12.04, 64bit 94 | - GStreamer 0.10.36 95 | - libde265 0.7 96 | 97 | [1]: http://trailers.divx.com/hevc/TearsOfSteel_720p_24fps_27qp_831kbps_720p_GPSNR_41.65_HM11_2aud_7subs.mkv 98 | [2]: http://trailers.divx.com/hevc/TearsOfSteel_1080p_24fps_27qp_1474kbps_GPSNR_42.29_HM11_2aud_7subs.mkv 99 | [3]: http://trailers.divx.com/hevc/TearsOfSteel_4K_24fps_9500kbps_2aud_9subs.mkv 100 | 101 | Copyright (c) 2014 struktur AG 102 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if test -d .git; 4 | then 5 | # Make sure we have common 6 | if test ! -f common/gst-autogen.sh; 7 | then 8 | echo "+ Setting up common submodule" 9 | git submodule init 10 | fi 11 | git submodule update 12 | 13 | # install pre-commit hook for doing clean commits 14 | if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); 15 | then 16 | rm -f .git/hooks/pre-commit 17 | ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit 18 | fi 19 | fi 20 | 21 | if [ -x "`which autoreconf 2>/dev/null`" ] ; then 22 | exec autoreconf -ivf 23 | fi 24 | 25 | LIBTOOLIZE=libtoolize 26 | SYSNAME=`uname` 27 | if [ "x$SYSNAME" = "xDarwin" ] ; then 28 | LIBTOOLIZE=glibtoolize 29 | fi 30 | aclocal -I m4 && \ 31 | autoheader && \ 32 | $LIBTOOLIZE && \ 33 | autoconf && \ 34 | automake --add-missing --force-missing --copy 35 | -------------------------------------------------------------------------------- /doc/libde265.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/gstreamer-libde265/3f64ada161bddf299edca589b6526cb926e66e56/doc/libde265.png -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | playhevc 2 | timehevc 3 | -------------------------------------------------------------------------------- /examples/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = \ 2 | playhevc \ 3 | timehevc 4 | 5 | playhevc_SOURCES = playhevc.c 6 | playhevc_CFLAGS = \ 7 | $(GST_CFLAGS) 8 | playhevc_LDFLAGS = \ 9 | $(GST_LDFLAGS) \ 10 | $(GST_LIBS) 11 | 12 | timehevc_SOURCES = timehevc.c 13 | timehevc_CFLAGS = \ 14 | $(GST_CFLAGS) 15 | timehevc_LDFLAGS = \ 16 | $(GST_LDFLAGS) \ 17 | $(GST_LIBS) 18 | 19 | EXTRA_DIST = \ 20 | spreedmovie.mkv 21 | -------------------------------------------------------------------------------- /examples/spreedmovie.mkv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/gstreamer-libde265/3f64ada161bddf299edca589b6526cb926e66e56/examples/spreedmovie.mkv -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | plugin_LTLIBRARIES = libgstlibde265.la 2 | 3 | libgstlibde265_la_SOURCES = \ 4 | gstlibde265.c \ 5 | libde265-dec.c \ 6 | libde265-dec.h \ 7 | common/codec-utils.h \ 8 | common/codec-utils.c 9 | 10 | if INCLUDE_MATROSKA_DEMUXER 11 | libgstlibde265_la_SOURCES += \ 12 | matroska/$(USE_GSTREAMER_VERSION)/ebml-ids.h \ 13 | matroska/$(USE_GSTREAMER_VERSION)/ebml-read.c \ 14 | matroska/$(USE_GSTREAMER_VERSION)/ebml-read.h \ 15 | matroska/$(USE_GSTREAMER_VERSION)/lzo.c \ 16 | matroska/$(USE_GSTREAMER_VERSION)/lzo.h \ 17 | matroska/$(USE_GSTREAMER_VERSION)/matroska-demux.c \ 18 | matroska/$(USE_GSTREAMER_VERSION)/matroska-demux.h \ 19 | matroska/$(USE_GSTREAMER_VERSION)/matroska-ids.c \ 20 | matroska/$(USE_GSTREAMER_VERSION)/matroska-ids.h \ 21 | matroska/$(USE_GSTREAMER_VERSION)/matroska-parse.c \ 22 | matroska/$(USE_GSTREAMER_VERSION)/matroska-parse.h \ 23 | matroska/$(USE_GSTREAMER_VERSION)/matroska-read-common.c \ 24 | matroska/$(USE_GSTREAMER_VERSION)/matroska-read-common.h 25 | endif 26 | 27 | if INCLUDE_MP4_DEMUXER 28 | libgstlibde265_la_SOURCES += \ 29 | isomp4/$(USE_GSTREAMER_VERSION)/qtatomparser.h \ 30 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux.h \ 31 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_types.h \ 32 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_dump.h \ 33 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_fourcc.h \ 34 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_lang.h \ 35 | isomp4/$(USE_GSTREAMER_VERSION)/qtpalette.h \ 36 | isomp4/$(USE_GSTREAMER_VERSION)/atoms.h \ 37 | isomp4/$(USE_GSTREAMER_VERSION)/atomsrecovery.h \ 38 | isomp4/$(USE_GSTREAMER_VERSION)/descriptors.h \ 39 | isomp4/$(USE_GSTREAMER_VERSION)/properties.h \ 40 | isomp4/$(USE_GSTREAMER_VERSION)/fourcc.h \ 41 | isomp4/$(USE_GSTREAMER_VERSION)/ftypcc.h \ 42 | isomp4/$(USE_GSTREAMER_VERSION)/isomp4-plugin.c \ 43 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux.c \ 44 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_types.c \ 45 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_dump.c \ 46 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_lang.c \ 47 | isomp4/$(USE_GSTREAMER_VERSION)/atoms.c \ 48 | isomp4/$(USE_GSTREAMER_VERSION)/atomsrecovery.c \ 49 | isomp4/$(USE_GSTREAMER_VERSION)/descriptors.c \ 50 | isomp4/$(USE_GSTREAMER_VERSION)/properties.c 51 | endif 52 | 53 | libgstlibde265_la_CFLAGS = \ 54 | $(GST_CFLAGS) \ 55 | $(GST_PLUGIN_CFLAGS) \ 56 | $(libde265_CFLAGS) 57 | 58 | libgstlibde265_la_LIBADD = \ 59 | $(GST_LIBS) \ 60 | $(GST_PLUGIN_LIBS) \ 61 | $(libde265_LIBS) 62 | 63 | if INCLUDE_MATROSKA_DEMUXER 64 | libgstlibde265_la_CFLAGS += \ 65 | $(zlib_CFLAGS) \ 66 | $(bz2_CFLAGS) \ 67 | -DHAVE_ZLIB \ 68 | -DHAVE_BZ2 69 | 70 | libgstlibde265_la_LIBADD += \ 71 | $(zlib_LIBS) \ 72 | $(bz2_LIBS) 73 | endif 74 | 75 | libgstlibde265_la_LDFLAGS = \ 76 | $(GST_LDFLAGS) \ 77 | $(GST_PLUGIN_LDFLAGS) 78 | 79 | libgstlibde265_la_LIBTOOLFLAGS = \ 80 | --tag=disable-static 81 | 82 | noinst_HEADERS = \ 83 | libde265-dec.h \ 84 | common/codec-utils.h 85 | 86 | if INCLUDE_MATROSKA_DEMUXER 87 | noinst_HEADERS += \ 88 | matroska/$(USE_GSTREAMER_VERSION)/ebml-ids.h \ 89 | matroska/$(USE_GSTREAMER_VERSION)/ebml-read.h \ 90 | matroska/$(USE_GSTREAMER_VERSION)/lzo.h \ 91 | matroska/$(USE_GSTREAMER_VERSION)/matroska-demux.h \ 92 | matroska/$(USE_GSTREAMER_VERSION)/matroska-ids.h \ 93 | matroska/$(USE_GSTREAMER_VERSION)/matroska-parse.h \ 94 | matroska/$(USE_GSTREAMER_VERSION)/matroska-read-common.h 95 | endif 96 | 97 | if INCLUDE_MP4_DEMUXER 98 | noinst_HEADERS += \ 99 | isomp4/$(USE_GSTREAMER_VERSION)/qtatomparser.h \ 100 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux.h \ 101 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_types.h \ 102 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_dump.h \ 103 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_fourcc.h \ 104 | isomp4/$(USE_GSTREAMER_VERSION)/qtdemux_lang.h \ 105 | isomp4/$(USE_GSTREAMER_VERSION)/qtpalette.h \ 106 | isomp4/$(USE_GSTREAMER_VERSION)/atoms.h \ 107 | isomp4/$(USE_GSTREAMER_VERSION)/atomsrecovery.h \ 108 | isomp4/$(USE_GSTREAMER_VERSION)/descriptors.h \ 109 | isomp4/$(USE_GSTREAMER_VERSION)/properties.h \ 110 | isomp4/$(USE_GSTREAMER_VERSION)/fourcc.h \ 111 | isomp4/$(USE_GSTREAMER_VERSION)/ftypcc.h 112 | endif 113 | 114 | EXTRA_DIST = \ 115 | common/*.c \ 116 | common/*.h \ 117 | common/COPYING \ 118 | common/README.txt \ 119 | matroska/*/*.c \ 120 | matroska/*/*.h \ 121 | matroska/*/COPYING \ 122 | matroska/*/README.txt \ 123 | matroska/*/*.diff \ 124 | isomp4/*/*.c \ 125 | isomp4/*/*.h \ 126 | isomp4/*/COPYING \ 127 | isomp4/*/README.txt \ 128 | isomp4/*/*.diff 129 | -------------------------------------------------------------------------------- /src/common/README.txt: -------------------------------------------------------------------------------- 1 | Based on 9ffaaddcbe71a38c37a14175942729664f4bf005 in branch "master" from 2 | http://cgit.freedesktop.org/gstreamer/gst-plugins-base/ 3 | -------------------------------------------------------------------------------- /src/common/codec-utils.h: -------------------------------------------------------------------------------- 1 | /* GStreamer base utils library codec-specific utility functions 2 | * Copyright (C) 2010 Arun Raghavan 3 | * 2010 Collabora Multimedia 4 | * 2010 Nokia Corporation 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __GST_MATROSKA_CODEC_UTILS_H__ 23 | #define __GST_MATROSKA_CODEC_UTILS_H__ 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | /* H.265 */ 30 | 31 | const gchar * gst_codec_utils_h265_get_profile (const guint8 * profile_tier_level, 32 | guint len); 33 | 34 | const gchar * gst_codec_utils_h265_get_tier (const guint8 * profile_tier_level, 35 | guint len); 36 | 37 | const gchar * gst_codec_utils_h265_get_level (const guint8 * profile_tier_level, 38 | guint len); 39 | 40 | guint8 gst_codec_utils_h265_get_level_idc (const gchar * level); 41 | 42 | gboolean gst_codec_utils_h265_caps_set_level_tier_and_profile (GstCaps * caps, 43 | const guint8 * profile_tier_level, 44 | guint len); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* __GST_MATROSKA_CODEC_UTILS_H__ */ 49 | -------------------------------------------------------------------------------- /src/gstlibde265.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer HEVC/H.265 video codec. 3 | * 4 | * Copyright (c) 2014 struktur AG, Joachim Bauch 5 | * 6 | * This file is part of gstreamer-libde265. 7 | * 8 | * libde265 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as 10 | * published by the Free Software Foundation, either version 3 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * libde265 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with libde265. If not, see . 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include 24 | #endif 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #include "libde265-dec.h" 32 | 33 | #if !GST_CHECK_VERSION(1,4,0) 34 | GST_DEBUG_CATEGORY_EXTERN (matroskareadcommon_debug); 35 | 36 | void gst_matroska_register_tags (void); 37 | gboolean gst_matroska_demux_plugin_init (GstPlugin * plugin); 38 | gboolean gst_matroska_parse_plugin_init (GstPlugin * plugin); 39 | gboolean gst_isomp4_plugin_init (GstPlugin * plugin); 40 | #endif 41 | 42 | static gboolean 43 | plugin_init (GstPlugin * plugin) 44 | { 45 | gboolean ret = TRUE; 46 | 47 | gst_pb_utils_init (); 48 | #if !GST_CHECK_VERSION(1,4,0) 49 | gst_matroska_register_tags (); 50 | 51 | GST_DEBUG_CATEGORY_INIT (matroskareadcommon_debug, "matroskareadcommon", 0, 52 | "Matroska demuxer/parser shared debug"); 53 | 54 | ret = gst_matroska_demux_plugin_init (plugin); 55 | ret &= gst_matroska_parse_plugin_init (plugin); 56 | ret &= gst_isomp4_plugin_init (plugin); 57 | #endif 58 | ret &= gst_libde265_dec_plugin_init (plugin); 59 | return ret; 60 | } 61 | 62 | GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, 63 | #if GST_CHECK_VERSION(1,0,0) 64 | libde265, 65 | #else 66 | "gstlibde265", 67 | #endif 68 | "HEVC/H.265 decoder using libde265", plugin_init, VERSION, "LGPL", 69 | #if GST_CHECK_VERSION(1,0,0) 70 | "gstreamer1.0-libde265", 71 | #else 72 | "gstreamer0.10-libde265", 73 | #endif 74 | "https://github.com/strukturag/gstreamer-libde265/") 75 | -------------------------------------------------------------------------------- /src/isomp4/0.10/LEGAL: -------------------------------------------------------------------------------- 1 | This is a demuxer supporting a subset of the Quicktime video container 2 | format developed by Apple. Apple and others have some patents on 3 | some features of the Quicktime container format in regards to technologies 4 | such as QuicktimeVR and RTP hinting. Due to that be aware that if ever 5 | such features are added to this demuxer it would need to be moved to the 6 | -ugly module or those features need to come as add-in functionality stored in 7 | another module. 8 | 9 | As the plugin is as of today's date (19th of June 2007) it does not 10 | violate any software patents we know of. 11 | -------------------------------------------------------------------------------- /src/isomp4/0.10/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | plugin_LTLIBRARIES = libgstisomp4.la 3 | 4 | libgstisomp4_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) 5 | libgstisomp4_la_LIBADD = \ 6 | $(GST_PLUGINS_BASE_LIBS) \ 7 | -lgstriff-@GST_MAJORMINOR@ \ 8 | -lgstaudio-@GST_MAJORMINOR@ \ 9 | -lgstrtp-@GST_MAJORMINOR@ \ 10 | -lgsttag-@GST_MAJORMINOR@ \ 11 | -lgstpbutils-@GST_MAJORMINOR@ \ 12 | $(GST_BASE_LIBS) $(GST_LIBS) $(ZLIB_LIBS) 13 | libgstisomp4_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS} 14 | libgstisomp4_la_SOURCES = isomp4-plugin.c gstrtpxqtdepay.c \ 15 | qtdemux.c qtdemux_types.c qtdemux_dump.c qtdemux_lang.c \ 16 | gstqtmux.c gstqtmoovrecover.c atoms.c atomsrecovery.c descriptors.c \ 17 | properties.c gstqtmuxmap.c 18 | libgstisomp4_la_LIBTOOLFLAGS = --tag=disable-static 19 | 20 | noinst_HEADERS = \ 21 | qtatomparser.h \ 22 | qtdemux.h \ 23 | qtdemux_types.h \ 24 | qtdemux_dump.h \ 25 | qtdemux_fourcc.h \ 26 | qtdemux_lang.h \ 27 | qtpalette.h \ 28 | gstrtpxqtdepay.h \ 29 | gstqtmux.h \ 30 | gstqtmoovrecover.h \ 31 | atoms.h \ 32 | atomsrecovery.h \ 33 | descriptors.h \ 34 | properties.h \ 35 | fourcc.h \ 36 | ftypcc.h \ 37 | gstqtmuxmap.h 38 | 39 | EXTRA_DIST = \ 40 | gstqtmux-doc.c \ 41 | gstqtmux-doc.h 42 | 43 | Android.mk: Makefile.am $(BUILT_SOURCES) 44 | androgenizer \ 45 | -:PROJECT libgstisomp4 -:SHARED libgstisomp4 \ 46 | -:TAGS eng debug \ 47 | -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ 48 | -:SOURCES $(libgstisomp4_la_SOURCES) \ 49 | -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(libgstisomp4_la_CFLAGS) \ 50 | -:LDFLAGS $(libgstisomp4_la_LDFLAGS) \ 51 | $(libgstisomp4_la_LIBADD) \ 52 | -ldl \ 53 | -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ 54 | LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \ 55 | > $@ 56 | -------------------------------------------------------------------------------- /src/isomp4/0.10/README.txt: -------------------------------------------------------------------------------- 1 | Based on 5af6f5bfb6c3619a9ccc3b1681579aeb90e8b89a in branch "0.10" from 2 | http://cgit.freedesktop.org/gstreamer/gst-plugins-good/ 3 | -------------------------------------------------------------------------------- /src/isomp4/0.10/ftypcc.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <2008> Thiago Sousa Santos 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | /* 20 | * Unless otherwise indicated, Source Code is licensed under MIT license. 21 | * See further explanation attached in License Statement (distributed in the file 22 | * LICENSE). 23 | * 24 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | * this software and associated documentation files (the "Software"), to deal in 26 | * the Software without restriction, including without limitation the rights to 27 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 | * of the Software, and to permit persons to whom the Software is furnished to do 29 | * so, subject to the following conditions: 30 | * 31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | 43 | #ifndef __FTYP_CC_H__ 44 | #define __FTYP_CC_H__ 45 | 46 | #include 47 | 48 | G_BEGIN_DECLS 49 | 50 | #define FOURCC_ftyp GST_MAKE_FOURCC('f','t','y','p') 51 | #define FOURCC_isom GST_MAKE_FOURCC('i','s','o','m') 52 | #define FOURCC_iso2 GST_MAKE_FOURCC('i','s','o','2') 53 | #define FOURCC_mp41 GST_MAKE_FOURCC('m','p','4','1') 54 | #define FOURCC_mp42 GST_MAKE_FOURCC('m','p','4','2') 55 | #define FOURCC_mjp2 GST_MAKE_FOURCC('m','j','p','2') 56 | #define FOURCC_3gp4 GST_MAKE_FOURCC('3','g','p','4') 57 | #define FOURCC_3gp6 GST_MAKE_FOURCC('3','g','p','6') 58 | #define FOURCC_3gg6 GST_MAKE_FOURCC('3','g','g','6') 59 | #define FOURCC_3gr6 GST_MAKE_FOURCC('3','g','r','6') 60 | #define FOURCC_3gg7 GST_MAKE_FOURCC('3','g','g','7') 61 | #define FOURCC_avc1 GST_MAKE_FOURCC('a','v','c','1') 62 | #define FOURCC_qt__ GST_MAKE_FOURCC('q','t',' ',' ') 63 | #define FOURCC_isml GST_MAKE_FOURCC('i','s','m','l') 64 | #define FOURCC_piff GST_MAKE_FOURCC('p','i','f','f') 65 | 66 | G_END_DECLS 67 | 68 | #endif /* __FTYP_CC_H__ */ 69 | -------------------------------------------------------------------------------- /src/isomp4/0.10/gstqtmoovrecover.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer plugin for GStreamer 2 | * Copyright (C) 2010 Thiago Santos 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | /* 20 | * Unless otherwise indicated, Source Code is licensed under MIT license. 21 | * See further explanation attached in License Statement (distributed in the file 22 | * LICENSE). 23 | * 24 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | * this software and associated documentation files (the "Software"), to deal in 26 | * the Software without restriction, including without limitation the rights to 27 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 | * of the Software, and to permit persons to whom the Software is furnished to do 29 | * so, subject to the following conditions: 30 | * 31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | 43 | #ifndef __GST_QT_MOOV_RECOVER_H__ 44 | #define __GST_QT_MOOV_RECOVER_H__ 45 | 46 | #include 47 | 48 | #include "atoms.h" 49 | #include "atomsrecovery.h" 50 | 51 | G_BEGIN_DECLS 52 | 53 | #define GST_TYPE_QT_MOOV_RECOVER (gst_qt_moov_recover_get_type()) 54 | #define GST_QT_MOOV_RECOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QT_MOOV_RECOVER, GstQTMoovRecover)) 55 | #define GST_QT_MOOV_RECOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QT_MOOV_RECOVER, GstQTMoovRecover)) 56 | #define GST_IS_QT_MOOV_RECOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QT_MOOV_RECOVER)) 57 | #define GST_IS_QT_MOOV_RECOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QT_MOOV_RECOVER)) 58 | #define GST_QT_MOOV_RECOVER_CAST(obj) ((GstQTMoovRecover*)(obj)) 59 | 60 | 61 | typedef struct _GstQTMoovRecover GstQTMoovRecover; 62 | typedef struct _GstQTMoovRecoverClass GstQTMoovRecoverClass; 63 | 64 | struct _GstQTMoovRecover 65 | { 66 | GstPipeline pipeline; 67 | 68 | GstTask *task; 69 | GStaticRecMutex task_mutex; 70 | 71 | /* properties */ 72 | gboolean faststart_mode; 73 | gchar *recovery_input; 74 | gchar *fixed_output; 75 | gchar *broken_input; 76 | }; 77 | 78 | struct _GstQTMoovRecoverClass 79 | { 80 | GstPipelineClass parent_class; 81 | }; 82 | 83 | GType gst_qt_moov_recover_get_type (void); 84 | gboolean gst_qt_moov_recover_register (GstPlugin * plugin); 85 | 86 | G_END_DECLS 87 | 88 | #endif /* __GST_QT_MOOV_RECOVER_H__ */ 89 | -------------------------------------------------------------------------------- /src/isomp4/0.10/gstqtmux-doc.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer documentation 2 | * Copyright (C) 2008-2010 Thiago Santos 3 | * Copyright (C) 2008 Mark Nauwelaerts 4 | * Copyright (C) 2010 Nokia Corporation. All rights reserved. 5 | * Contact: Stefan Kost 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | /* 23 | * Unless otherwise indicated, Source Code is licensed under MIT license. 24 | * See further explanation attached in License Statement (distributed in the file 25 | * LICENSE). 26 | * 27 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 28 | * this software and associated documentation files (the "Software"), to deal in 29 | * the Software without restriction, including without limitation the rights to 30 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 31 | * of the Software, and to permit persons to whom the Software is furnished to do 32 | * so, subject to the following conditions: 33 | * 34 | * The above copyright notice and this permission notice shall be included in all 35 | * copies or substantial portions of the Software. 36 | * 37 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 42 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 43 | * SOFTWARE. 44 | */ 45 | 46 | #error "This header is for gtk-doc only and not supposed to be included" 47 | 48 | typedef struct _GstMP4Mux GstMP4Mux; 49 | typedef struct _Gst3GPPMux GstMP4Mux; 50 | typedef struct _GstISMLMux GstMP4Mux; 51 | typedef struct _GstMJ2Mux GstMJ2Mux; 52 | 53 | -------------------------------------------------------------------------------- /src/isomp4/0.10/gstqtmuxmap.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer plugin for GStreamer 2 | * Copyright (C) 2008 Thiago Sousa Santos 3 | * Copyright (C) 2008 Mark Nauwelaerts 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | /* 21 | * Unless otherwise indicated, Source Code is licensed under MIT license. 22 | * See further explanation attached in License Statement (distributed in the file 23 | * LICENSE). 24 | * 25 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 26 | * this software and associated documentation files (the "Software"), to deal in 27 | * the Software without restriction, including without limitation the rights to 28 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 29 | * of the Software, and to permit persons to whom the Software is furnished to do 30 | * so, subject to the following conditions: 31 | * 32 | * The above copyright notice and this permission notice shall be included in all 33 | * copies or substantial portions of the Software. 34 | * 35 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 36 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 37 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 38 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 39 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 40 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 41 | * SOFTWARE. 42 | */ 43 | 44 | #ifndef __GST_QT_MUX_MAP_H__ 45 | #define __GST_QT_MUX_MAP_H__ 46 | 47 | #include "atoms.h" 48 | 49 | #include 50 | #include 51 | 52 | typedef enum _GstQTMuxFormat 53 | { 54 | GST_QT_MUX_FORMAT_NONE = 0, 55 | GST_QT_MUX_FORMAT_QT, 56 | GST_QT_MUX_FORMAT_MP4, 57 | GST_QT_MUX_FORMAT_3GP, 58 | GST_QT_MUX_FORMAT_MJ2, 59 | GST_QT_MUX_FORMAT_ISML 60 | } GstQTMuxFormat; 61 | 62 | typedef struct _GstQTMuxFormatProp 63 | { 64 | GstQTMuxFormat format; 65 | GstRank rank; 66 | const gchar *name; 67 | const gchar *long_name; 68 | const gchar *type_name; 69 | GstStaticCaps src_caps; 70 | GstStaticCaps video_sink_caps; 71 | GstStaticCaps audio_sink_caps; 72 | } GstQTMuxFormatProp; 73 | 74 | extern GstQTMuxFormatProp gst_qt_mux_format_list[]; 75 | 76 | void gst_qt_mux_map_format_to_header (GstQTMuxFormat format, GstBuffer ** _prefix, 77 | guint32 * _major, guint32 * verson, 78 | GList ** _compatible, AtomMOOV * moov, 79 | GstClockTime longest_chunk, 80 | gboolean faststart); 81 | 82 | AtomsTreeFlavor gst_qt_mux_map_format_to_flavor (GstQTMuxFormat format); 83 | 84 | #endif /* __GST_QT_MUX_MAP_H__ */ 85 | -------------------------------------------------------------------------------- /src/isomp4/0.10/gstrtpxqtdepay.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <2005> Wim Taymans 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __GST_RTP_XQT_DEPAY_H__ 21 | #define __GST_RTP_XQT_DEPAY_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_TYPE_RTP_XQT_DEPAY \ 30 | (gst_rtp_xqt_depay_get_type()) 31 | #define GST_RTP_XQT_DEPAY(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_XQT_DEPAY,GstRtpXQTDepay)) 33 | #define GST_RTP_XQT_DEPAY_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_XQT_DEPAY,GstRtpXQTDepayClass)) 35 | #define GST_IS_RTP_XQT_DEPAY(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_XQT_DEPAY)) 37 | #define GST_IS_RTP_XQT_DEPAY_CLASS(klass) \ 38 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_XQT_DEPAY)) 39 | 40 | typedef struct _GstRtpXQTDepay GstRtpXQTDepay; 41 | typedef struct _GstRtpXQTDepayClass GstRtpXQTDepayClass; 42 | 43 | struct _GstRtpXQTDepay 44 | { 45 | GstBaseRTPDepayload depayload; 46 | 47 | GstAdapter *adapter; 48 | 49 | gboolean need_resync; 50 | guint16 previous_id; 51 | guint16 current_id; 52 | gboolean have_sd; 53 | }; 54 | 55 | struct _GstRtpXQTDepayClass 56 | { 57 | GstBaseRTPDepayloadClass parent_class; 58 | }; 59 | 60 | GType gst_rtp_xqt_depay_get_type (void); 61 | 62 | G_END_DECLS 63 | 64 | #endif /* __GST_RTP_XQT_DEPAY_H__ */ 65 | -------------------------------------------------------------------------------- /src/isomp4/0.10/isomp4-plugin.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2003> David A. Schleef 4 | * Copyright (C) <2006> Wim Taymans 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #include "qtdemux.h" 27 | 28 | #include 29 | 30 | gboolean 31 | gst_isomp4_plugin_init (GstPlugin * plugin) 32 | { 33 | #ifdef ENABLE_NLS 34 | setlocale (LC_ALL, ""); 35 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); 36 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 37 | #endif /* ENABLE_NLS */ 38 | 39 | gst_pb_utils_init (); 40 | 41 | /* ensure private tag is registered */ 42 | gst_tag_register (GST_QT_DEMUX_PRIVATE_TAG, GST_TAG_FLAG_META, 43 | GST_TYPE_BUFFER, "QT atom", "unparsed QT tag atom", 44 | gst_tag_merge_use_first); 45 | 46 | gst_tag_register (GST_QT_DEMUX_CLASSIFICATION_TAG, GST_TAG_FLAG_META, 47 | G_TYPE_STRING, GST_QT_DEMUX_CLASSIFICATION_TAG, "content classification", 48 | gst_tag_merge_use_first); 49 | 50 | if (!gst_element_register (plugin, "qtdemux", 51 | GST_RANK_PRIMARY + 1, GST_TYPE_QTDEMUX)) 52 | return FALSE; 53 | if (!gst_element_register (plugin, "qtdemux-libde265", 54 | GST_RANK_PRIMARY + 1, GST_TYPE_QTDEMUX)) 55 | return FALSE; 56 | 57 | return TRUE; 58 | } 59 | -------------------------------------------------------------------------------- /src/isomp4/0.10/properties.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer plugin for GStreamer 2 | * Copyright (C) 2008 Thiago Sousa Santos 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | /* 20 | * Unless otherwise indicated, Source Code is licensed under MIT license. 21 | * See further explanation attached in License Statement (distributed in the file 22 | * LICENSE). 23 | * 24 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | * this software and associated documentation files (the "Software"), to deal in 26 | * the Software without restriction, including without limitation the rights to 27 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 | * of the Software, and to permit persons to whom the Software is furnished to do 29 | * so, subject to the following conditions: 30 | * 31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | 43 | #ifndef __PROPERTIES_H__ 44 | #define __PROPERTIES_H__ 45 | 46 | #include 47 | #include 48 | 49 | /** 50 | * Functions for copying atoms properties. 51 | * 52 | * All of them receive, as the input, the property to be copied, the destination 53 | * buffer, and a pointer to an offset in the destination buffer to copy to the right place. 54 | * This offset will be updated to the new value (offset + copied_size) 55 | * The functions return the size of the property that has been copied or 0 56 | * if it couldn't copy. 57 | */ 58 | 59 | void prop_copy_ensure_buffer (guint8 ** buffer, guint64 * bsize, guint64 * offset, guint64 size); 60 | 61 | guint64 prop_copy_uint8 (guint8 prop, guint8 **buffer, guint64 *size, guint64 *offset); 62 | guint64 prop_copy_uint16 (guint16 prop, guint8 **buffer, guint64 *size, guint64 *offset); 63 | guint64 prop_copy_uint32 (guint32 prop, guint8 **buffer, guint64 *size, guint64 *offset); 64 | guint64 prop_copy_uint64 (guint64 prop, guint8 **buffer, guint64 *size, guint64 *offset); 65 | 66 | guint64 prop_copy_int32 (gint32 prop, guint8 **buffer, guint64 *size, guint64 *offset); 67 | 68 | guint64 prop_copy_uint8_array (guint8 *prop, guint size, 69 | guint8 **buffer, guint64 *bsize, guint64 *offset); 70 | guint64 prop_copy_uint16_array (guint16 *prop, guint size, 71 | guint8 **buffer, guint64 *bsize, guint64 *offset); 72 | guint64 prop_copy_uint32_array (guint32 *prop, guint size, 73 | guint8 **buffer, guint64 *bsize, guint64 *offset); 74 | guint64 prop_copy_uint64_array (guint64 *prop, guint size, 75 | guint8 **buffer, guint64 *bsize, guint64 *offset); 76 | 77 | guint64 prop_copy_fourcc (guint32 prop, guint8 **buffer, guint64 *size, guint64 *offset); 78 | guint64 prop_copy_fourcc_array (guint32 *prop, guint size, 79 | guint8 **buffer, guint64 *bsize, guint64 *offset); 80 | guint64 prop_copy_fixed_size_string (guint8 *string, guint str_size, 81 | guint8 **buffer, guint64 *size, guint64 *offset); 82 | guint64 prop_copy_size_string (guint8 *string, guint str_size, 83 | guint8 **buffer, guint64 *size, guint64 *offset); 84 | guint64 prop_copy_null_terminated_string (gchar *string, 85 | guint8 **buffer, guint64 *size, guint64 *offset); 86 | 87 | #endif /* __PROPERTIES_H__ */ 88 | -------------------------------------------------------------------------------- /src/isomp4/0.10/qtatomparser.h: -------------------------------------------------------------------------------- 1 | /* GStreamer QuickTime atom parser 2 | * Copyright (C) 2009 Tim-Philipp Müller 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef QT_ATOM_PARSER_H 22 | #define QT_ATOM_PARSER_H 23 | 24 | #include 25 | 26 | /* our inlined version of GstByteReader */ 27 | 28 | static inline gboolean 29 | qt_atom_parser_has_remaining (GstByteReader * parser, guint64 bytes_needed) 30 | { 31 | return G_LIKELY (parser->size >= bytes_needed) && 32 | G_LIKELY ((parser->size - bytes_needed) >= parser->byte); 33 | } 34 | 35 | static inline gboolean 36 | qt_atom_parser_has_chunks (GstByteReader * parser, guint32 n_chunks, 37 | guint32 chunk_size) 38 | { 39 | /* assumption: n_chunks and chunk_size are 32-bit, we cast to 64-bit here 40 | * to avoid overflows, to handle e.g. (guint32)-1 * size correctly */ 41 | return qt_atom_parser_has_remaining (parser, (guint64) n_chunks * chunk_size); 42 | } 43 | 44 | static inline gboolean 45 | qt_atom_parser_peek_sub (GstByteReader * parser, guint offset, guint size, 46 | GstByteReader * sub) 47 | { 48 | *sub = *parser; 49 | 50 | if (G_UNLIKELY (!gst_byte_reader_skip (sub, offset))) 51 | return FALSE; 52 | 53 | return (gst_byte_reader_get_remaining (sub) >= size); 54 | } 55 | 56 | static inline gboolean 57 | qt_atom_parser_skipn_and_get_uint32 (GstByteReader * parser, 58 | guint bytes_to_skip, guint32 * val) 59 | { 60 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < (bytes_to_skip + 4))) 61 | return FALSE; 62 | 63 | gst_byte_reader_skip_unchecked (parser, bytes_to_skip); 64 | *val = gst_byte_reader_get_uint32_be_unchecked (parser); 65 | return TRUE; 66 | } 67 | 68 | /* off_size must be either 4 or 8 */ 69 | static inline gboolean 70 | qt_atom_parser_get_offset (GstByteReader * parser, guint off_size, 71 | guint64 * val) 72 | { 73 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < off_size)) 74 | return FALSE; 75 | 76 | if (off_size == sizeof (guint64)) { 77 | *val = gst_byte_reader_get_uint64_be_unchecked (parser); 78 | } else { 79 | *val = gst_byte_reader_get_uint32_be_unchecked (parser); 80 | } 81 | return TRUE; 82 | } 83 | 84 | /* off_size must be either 4 or 8 */ 85 | static inline guint64 86 | qt_atom_parser_get_offset_unchecked (GstByteReader * parser, guint off_size) 87 | { 88 | if (off_size == sizeof (guint64)) { 89 | return gst_byte_reader_get_uint64_be_unchecked (parser); 90 | } else { 91 | return gst_byte_reader_get_uint32_be_unchecked (parser); 92 | } 93 | } 94 | 95 | /* size must be from 1 to 4 */ 96 | static inline guint32 97 | qt_atom_parser_get_uint_with_size_unchecked (GstByteReader * parser, 98 | guint size) 99 | { 100 | switch (size) { 101 | case 1: 102 | return gst_byte_reader_get_uint8_unchecked (parser); 103 | case 2: 104 | return gst_byte_reader_get_uint16_be_unchecked (parser); 105 | case 3: 106 | return gst_byte_reader_get_uint24_be_unchecked (parser); 107 | case 4: 108 | return gst_byte_reader_get_uint32_be_unchecked (parser); 109 | default: 110 | g_assert_not_reached (); 111 | gst_byte_reader_skip_unchecked (parser, size); 112 | break; 113 | } 114 | return 0; 115 | } 116 | 117 | static inline gboolean 118 | qt_atom_parser_get_fourcc (GstByteReader * parser, guint32 * fourcc) 119 | { 120 | guint32 f_be; 121 | 122 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < 4)) 123 | return FALSE; 124 | 125 | f_be = gst_byte_reader_get_uint32_be_unchecked (parser); 126 | *fourcc = GUINT32_SWAP_LE_BE (f_be); 127 | return TRUE; 128 | } 129 | 130 | static inline guint32 131 | qt_atom_parser_get_fourcc_unchecked (GstByteReader * parser) 132 | { 133 | guint32 fourcc; 134 | 135 | fourcc = gst_byte_reader_get_uint32_be_unchecked (parser); 136 | return GUINT32_SWAP_LE_BE (fourcc); 137 | } 138 | 139 | #endif /* QT_ATOM_PARSER_H */ 140 | -------------------------------------------------------------------------------- /src/isomp4/0.10/qtdemux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | 21 | #ifndef __GST_QTDEMUX_H__ 22 | #define __GST_QTDEMUX_H__ 23 | 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug); 30 | #define GST_CAT_DEFAULT qtdemux_debug 31 | 32 | #define GST_TYPE_QTDEMUX \ 33 | (gst_qtdemux_get_type()) 34 | #define GST_QTDEMUX(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QTDEMUX,GstQTDemux)) 36 | #define GST_QTDEMUX_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QTDEMUX,GstQTDemuxClass)) 38 | #define GST_IS_QTDEMUX(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QTDEMUX)) 40 | #define GST_IS_QTDEMUX_CLASS(klass) \ 41 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QTDEMUX)) 42 | 43 | #define GST_QTDEMUX_CAST(obj) ((GstQTDemux *)(obj)) 44 | 45 | /* qtdemux produces these for atoms it cannot parse */ 46 | #define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag" 47 | #define GST_QT_DEMUX_CLASSIFICATION_TAG "classification" 48 | 49 | #define GST_QTDEMUX_MAX_STREAMS 32 50 | 51 | typedef struct _GstQTDemux GstQTDemux; 52 | typedef struct _GstQTDemuxClass GstQTDemuxClass; 53 | typedef struct _QtDemuxStream QtDemuxStream; 54 | 55 | struct _GstQTDemux { 56 | GstElement element; 57 | 58 | /* pads */ 59 | GstPad *sinkpad; 60 | 61 | QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS]; 62 | gint n_streams; 63 | gint n_video_streams; 64 | gint n_audio_streams; 65 | gint n_sub_streams; 66 | 67 | guint major_brand; 68 | GstBuffer *comp_brands; 69 | GNode *moov_node; 70 | GNode *moov_node_compressed; 71 | 72 | guint32 timescale; 73 | guint64 duration; 74 | 75 | gboolean fragmented; 76 | /* offset of the mfra atom */ 77 | guint64 mfra_offset; 78 | guint64 moof_offset; 79 | 80 | gint state; 81 | 82 | gboolean pullbased; 83 | gboolean posted_redirect; 84 | 85 | /* push based variables */ 86 | guint neededbytes; 87 | guint todrop; 88 | GstAdapter *adapter; 89 | GstBuffer *mdatbuffer; 90 | guint64 mdatleft; 91 | 92 | guint64 offset; 93 | /* offset of the mdat atom */ 94 | guint64 mdatoffset; 95 | guint64 first_mdat; 96 | gboolean got_moov; 97 | guint header_size; 98 | 99 | GstTagList *tag_list; 100 | 101 | /* configured playback region */ 102 | GstSegment segment; 103 | gboolean segment_running; 104 | GstEvent *pending_newsegment; 105 | 106 | /* gst index support */ 107 | GstIndex *element_index; 108 | gint index_id; 109 | 110 | gint64 requested_seek_time; 111 | guint64 seek_offset; 112 | 113 | gboolean upstream_seekable; 114 | gboolean upstream_size; 115 | }; 116 | 117 | struct _GstQTDemuxClass { 118 | GstElementClass parent_class; 119 | }; 120 | 121 | GType gst_qtdemux_get_type (void); 122 | 123 | G_END_DECLS 124 | 125 | #endif /* __GST_QTDEMUX_H__ */ 126 | -------------------------------------------------------------------------------- /src/isomp4/0.10/qtdemux_dump.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __GST_QTDEMUX_DUMP_H__ 22 | #define __GST_QTDEMUX_DUMP_H__ 23 | 24 | #include 25 | #include "qtdemux.h" 26 | 27 | G_BEGIN_DECLS 28 | gboolean qtdemux_dump_mvhd (GstQTDemux * qtdemux, GstByteReader * data, 29 | int depth); 30 | gboolean qtdemux_dump_tkhd (GstQTDemux * qtdemux, GstByteReader * data, 31 | int depth); 32 | gboolean qtdemux_dump_elst (GstQTDemux * qtdemux, GstByteReader * data, 33 | int depth); 34 | gboolean qtdemux_dump_mdhd (GstQTDemux * qtdemux, GstByteReader * data, 35 | int depth); 36 | gboolean qtdemux_dump_hdlr (GstQTDemux * qtdemux, GstByteReader * data, 37 | int depth); 38 | gboolean qtdemux_dump_vmhd (GstQTDemux * qtdemux, GstByteReader * data, 39 | int depth); 40 | gboolean qtdemux_dump_dref (GstQTDemux * qtdemux, GstByteReader * data, 41 | int depth); 42 | gboolean qtdemux_dump_stsd (GstQTDemux * qtdemux, GstByteReader * data, 43 | int depth); 44 | gboolean qtdemux_dump_stts (GstQTDemux * qtdemux, GstByteReader * data, 45 | int depth); 46 | gboolean qtdemux_dump_stss (GstQTDemux * qtdemux, GstByteReader * data, 47 | int depth); 48 | gboolean qtdemux_dump_stps (GstQTDemux * qtdemux, GstByteReader * data, 49 | int depth); 50 | gboolean qtdemux_dump_stsc (GstQTDemux * qtdemux, GstByteReader * data, 51 | int depth); 52 | gboolean qtdemux_dump_stsz (GstQTDemux * qtdemux, GstByteReader * data, 53 | int depth); 54 | gboolean qtdemux_dump_stco (GstQTDemux * qtdemux, GstByteReader * data, 55 | int depth); 56 | gboolean qtdemux_dump_co64 (GstQTDemux * qtdemux, GstByteReader * data, 57 | int depth); 58 | gboolean qtdemux_dump_dcom (GstQTDemux * qtdemux, GstByteReader * data, 59 | int depth); 60 | gboolean qtdemux_dump_cmvd (GstQTDemux * qtdemux, GstByteReader * data, 61 | int depth); 62 | gboolean qtdemux_dump_ctts (GstQTDemux * qtdemux, GstByteReader * data, 63 | int depth); 64 | gboolean qtdemux_dump_mfro (GstQTDemux * qtdemux, GstByteReader * data, 65 | int depth); 66 | gboolean qtdemux_dump_tfra (GstQTDemux * qtdemux, GstByteReader * data, 67 | int depth); 68 | gboolean qtdemux_dump_tfhd (GstQTDemux * qtdemux, GstByteReader * data, 69 | int depth); 70 | gboolean qtdemux_dump_trun (GstQTDemux * qtdemux, GstByteReader * data, 71 | int depth); 72 | gboolean qtdemux_dump_trex (GstQTDemux * qtdemux, GstByteReader * data, 73 | int depth); 74 | gboolean qtdemux_dump_mehd (GstQTDemux * qtdemux, GstByteReader * data, 75 | int depth); 76 | gboolean qtdemux_dump_sdtp (GstQTDemux * qtdemux, GstByteReader * data, 77 | int depth); 78 | gboolean qtdemux_dump_tfdt (GstQTDemux * qtdemux, GstByteReader * data, 79 | int depth); 80 | gboolean qtdemux_dump_unknown (GstQTDemux * qtdemux, GstByteReader * data, 81 | int depth); 82 | 83 | gboolean qtdemux_node_dump (GstQTDemux * qtdemux, GNode * node); 84 | 85 | G_END_DECLS 86 | #endif /* __GST_QTDEMUX_DUMP_H__ */ 87 | -------------------------------------------------------------------------------- /src/isomp4/0.10/qtdemux_lang.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Quicktime/ISO demuxer language utility functions 2 | * Copyright (C) 2010 Tim-Philipp Müller 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __GST_QTDEMUX_LANG_H__ 21 | #define __GST_QTDEMUX_LANG_H__ 22 | 23 | G_BEGIN_DECLS 24 | 25 | #include 26 | 27 | void qtdemux_lang_map_qt_code_to_iso (gchar id[4], guint16 qt_lang_code); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* __GST_QTDEMUX_LANG_H__ */ 32 | -------------------------------------------------------------------------------- /src/isomp4/0.10/qtdemux_types.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __GST_QTDEMUX_TYPES_H__ 22 | #define __GST_QTDEMUX_TYPES_H__ 23 | 24 | #include 25 | #include 26 | 27 | #include "qtdemux.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef gboolean (*QtDumpFunc) (GstQTDemux * qtdemux, GstByteReader * data, 32 | int depth); 33 | 34 | typedef struct _QtNodeType QtNodeType; 35 | 36 | #define QT_UINT32(a) (GST_READ_UINT32_BE(a)) 37 | #define QT_UINT24(a) (GST_READ_UINT32_BE(a) >> 8) 38 | #define QT_UINT16(a) (GST_READ_UINT16_BE(a)) 39 | #define QT_UINT8(a) (GST_READ_UINT8(a)) 40 | #define QT_FP32(a) ((GST_READ_UINT32_BE(a))/65536.0) 41 | #define QT_SFP32(a) (((gint)(GST_READ_UINT32_BE(a)))/65536.0) 42 | #define QT_FP16(a) ((GST_READ_UINT16_BE(a))/256.0) 43 | #define QT_FOURCC(a) (GST_READ_UINT32_LE(a)) 44 | #define QT_UINT64(a) ((((guint64)QT_UINT32(a))<<32)|QT_UINT32(((guint8 *)a)+4)) 45 | 46 | typedef enum { 47 | QT_FLAG_NONE = (0), 48 | QT_FLAG_CONTAINER = (1 << 0) 49 | } QtFlags; 50 | 51 | struct _QtNodeType { 52 | guint32 fourcc; 53 | const gchar *name; 54 | QtFlags flags; 55 | QtDumpFunc dump; 56 | }; 57 | 58 | enum TfFlags 59 | { 60 | TF_BASE_DATA_OFFSET = 0x000001, /* base-data-offset-present */ 61 | TF_SAMPLE_DESCRIPTION_INDEX = 0x000002, /* sample-description-index-present */ 62 | TF_DEFAULT_SAMPLE_DURATION = 0x000008, /* default-sample-duration-present */ 63 | TF_DEFAULT_SAMPLE_SIZE = 0x000010, /* default-sample-size-present */ 64 | TF_DEFAULT_SAMPLE_FLAGS = 0x000020, /* default-sample-flags-present */ 65 | TF_DURATION_IS_EMPTY = 0x100000 /* duration-is-empty */ 66 | }; 67 | 68 | enum TrFlags 69 | { 70 | TR_DATA_OFFSET = 0x000001, /* data-offset-present */ 71 | TR_FIRST_SAMPLE_FLAGS = 0x000004, /* first-sample-flags-present */ 72 | TR_SAMPLE_DURATION = 0x000100, /* sample-duration-present */ 73 | TR_SAMPLE_SIZE = 0x000200, /* sample-size-present */ 74 | TR_SAMPLE_FLAGS = 0x000400, /* sample-flags-present */ 75 | TR_COMPOSITION_TIME_OFFSETS = 0x000800 /* sample-composition-time-offsets-presents */ 76 | }; 77 | 78 | const QtNodeType *qtdemux_type_get (guint32 fourcc); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __GST_QTDEMUX_TYPES_H__ */ 83 | -------------------------------------------------------------------------------- /src/isomp4/1.0/LEGAL: -------------------------------------------------------------------------------- 1 | This is a demuxer supporting a subset of the Quicktime video container 2 | format developed by Apple. Apple and others have some patents on 3 | some features of the Quicktime container format in regards to technologies 4 | such as QuicktimeVR and RTP hinting. Due to that be aware that if ever 5 | such features are added to this demuxer it would need to be moved to the 6 | -ugly module or those features need to come as add-in functionality stored in 7 | another module. 8 | 9 | As the plugin is as of today's date (19th of June 2007) it does not 10 | violate any software patents we know of. 11 | -------------------------------------------------------------------------------- /src/isomp4/1.0/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | plugin_LTLIBRARIES = libgstisomp4.la 3 | 4 | libgstisomp4_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) 5 | libgstisomp4_la_LIBADD = \ 6 | $(GST_PLUGINS_BASE_LIBS) \ 7 | -lgstriff-@GST_API_VERSION@ \ 8 | -lgstaudio-@GST_API_VERSION@ \ 9 | -lgstvideo-@GST_API_VERSION@ \ 10 | -lgstrtp-@GST_API_VERSION@ \ 11 | -lgsttag-@GST_API_VERSION@ \ 12 | -lgstpbutils-@GST_API_VERSION@ \ 13 | $(GST_BASE_LIBS) $(GST_LIBS) $(ZLIB_LIBS) 14 | libgstisomp4_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS} 15 | libgstisomp4_la_SOURCES = isomp4-plugin.c gstrtpxqtdepay.c \ 16 | qtdemux.c qtdemux_types.c qtdemux_dump.c qtdemux_lang.c \ 17 | gstqtmux.c gstqtmoovrecover.c atoms.c atomsrecovery.c descriptors.c \ 18 | properties.c gstqtmuxmap.c 19 | libgstisomp4_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) 20 | 21 | noinst_HEADERS = \ 22 | qtatomparser.h \ 23 | qtdemux.h \ 24 | qtdemux_types.h \ 25 | qtdemux_dump.h \ 26 | qtdemux_fourcc.h \ 27 | qtdemux_lang.h \ 28 | qtpalette.h \ 29 | gstrtpxqtdepay.h \ 30 | gstqtmux.h \ 31 | gstqtmoovrecover.h \ 32 | atoms.h \ 33 | atomsrecovery.h \ 34 | descriptors.h \ 35 | properties.h \ 36 | fourcc.h \ 37 | ftypcc.h \ 38 | gstqtmuxmap.h 39 | 40 | EXTRA_DIST = \ 41 | gstqtmux-doc.c \ 42 | gstqtmux-doc.h 43 | 44 | Android.mk: Makefile.am $(BUILT_SOURCES) 45 | androgenizer \ 46 | -:PROJECT libgstisomp4 -:SHARED libgstisomp4 \ 47 | -:TAGS eng debug \ 48 | -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ 49 | -:SOURCES $(libgstisomp4_la_SOURCES) \ 50 | -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(libgstisomp4_la_CFLAGS) \ 51 | -:LDFLAGS $(libgstisomp4_la_LDFLAGS) \ 52 | $(libgstisomp4_la_LIBADD) \ 53 | -ldl \ 54 | -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ 55 | LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \ 56 | > $@ 57 | -------------------------------------------------------------------------------- /src/isomp4/1.0/README.txt: -------------------------------------------------------------------------------- 1 | Based on 643d425f51f81b56deec16c01162637546708ee5 in branch "1.0" from 2 | http://cgit.freedesktop.org/gstreamer/gst-plugins-good/ 3 | -------------------------------------------------------------------------------- /src/isomp4/1.0/ftypcc.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <2008> Thiago Sousa Santos 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | /* 20 | * Unless otherwise indicated, Source Code is licensed under MIT license. 21 | * See further explanation attached in License Statement (distributed in the file 22 | * LICENSE). 23 | * 24 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | * this software and associated documentation files (the "Software"), to deal in 26 | * the Software without restriction, including without limitation the rights to 27 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 | * of the Software, and to permit persons to whom the Software is furnished to do 29 | * so, subject to the following conditions: 30 | * 31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | 43 | #ifndef __FTYP_CC_H__ 44 | #define __FTYP_CC_H__ 45 | 46 | #include 47 | 48 | G_BEGIN_DECLS 49 | 50 | #define FOURCC_ftyp GST_MAKE_FOURCC('f','t','y','p') 51 | #define FOURCC_isom GST_MAKE_FOURCC('i','s','o','m') 52 | #define FOURCC_iso2 GST_MAKE_FOURCC('i','s','o','2') 53 | #define FOURCC_mp41 GST_MAKE_FOURCC('m','p','4','1') 54 | #define FOURCC_mp42 GST_MAKE_FOURCC('m','p','4','2') 55 | #define FOURCC_mjp2 GST_MAKE_FOURCC('m','j','p','2') 56 | #define FOURCC_3gp4 GST_MAKE_FOURCC('3','g','p','4') 57 | #define FOURCC_3gp6 GST_MAKE_FOURCC('3','g','p','6') 58 | #define FOURCC_3gg6 GST_MAKE_FOURCC('3','g','g','6') 59 | #define FOURCC_3gr6 GST_MAKE_FOURCC('3','g','r','6') 60 | #define FOURCC_3gg7 GST_MAKE_FOURCC('3','g','g','7') 61 | #define FOURCC_avc1 GST_MAKE_FOURCC('a','v','c','1') 62 | #define FOURCC_qt__ GST_MAKE_FOURCC('q','t',' ',' ') 63 | #define FOURCC_isml GST_MAKE_FOURCC('i','s','m','l') 64 | #define FOURCC_piff GST_MAKE_FOURCC('p','i','f','f') 65 | 66 | G_END_DECLS 67 | 68 | #endif /* __FTYP_CC_H__ */ 69 | -------------------------------------------------------------------------------- /src/isomp4/1.0/gstqtmoovrecover.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer plugin for GStreamer 2 | * Copyright (C) 2010 Thiago Santos 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | /* 20 | * Unless otherwise indicated, Source Code is licensed under MIT license. 21 | * See further explanation attached in License Statement (distributed in the file 22 | * LICENSE). 23 | * 24 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | * this software and associated documentation files (the "Software"), to deal in 26 | * the Software without restriction, including without limitation the rights to 27 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 | * of the Software, and to permit persons to whom the Software is furnished to do 29 | * so, subject to the following conditions: 30 | * 31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | 43 | #ifndef __GST_QT_MOOV_RECOVER_H__ 44 | #define __GST_QT_MOOV_RECOVER_H__ 45 | 46 | #include 47 | 48 | #include "atoms.h" 49 | #include "atomsrecovery.h" 50 | 51 | G_BEGIN_DECLS 52 | 53 | #define GST_TYPE_QT_MOOV_RECOVER (gst_qt_moov_recover_get_type()) 54 | #define GST_QT_MOOV_RECOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QT_MOOV_RECOVER, GstQTMoovRecover)) 55 | #define GST_QT_MOOV_RECOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QT_MOOV_RECOVER, GstQTMoovRecover)) 56 | #define GST_IS_QT_MOOV_RECOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QT_MOOV_RECOVER)) 57 | #define GST_IS_QT_MOOV_RECOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QT_MOOV_RECOVER)) 58 | #define GST_QT_MOOV_RECOVER_CAST(obj) ((GstQTMoovRecover*)(obj)) 59 | 60 | 61 | typedef struct _GstQTMoovRecover GstQTMoovRecover; 62 | typedef struct _GstQTMoovRecoverClass GstQTMoovRecoverClass; 63 | 64 | struct _GstQTMoovRecover 65 | { 66 | GstPipeline pipeline; 67 | 68 | GstTask *task; 69 | GRecMutex task_mutex; 70 | 71 | /* properties */ 72 | gboolean faststart_mode; 73 | gchar *recovery_input; 74 | gchar *fixed_output; 75 | gchar *broken_input; 76 | }; 77 | 78 | struct _GstQTMoovRecoverClass 79 | { 80 | GstPipelineClass parent_class; 81 | }; 82 | 83 | GType gst_qt_moov_recover_get_type (void); 84 | gboolean gst_qt_moov_recover_register (GstPlugin * plugin); 85 | 86 | G_END_DECLS 87 | 88 | #endif /* __GST_QT_MOOV_RECOVER_H__ */ 89 | -------------------------------------------------------------------------------- /src/isomp4/1.0/gstqtmux-doc.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer documentation 2 | * Copyright (C) 2008-2010 Thiago Santos 3 | * Copyright (C) 2008 Mark Nauwelaerts 4 | * Copyright (C) 2010 Nokia Corporation. All rights reserved. 5 | * Contact: Stefan Kost 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | /* 23 | * Unless otherwise indicated, Source Code is licensed under MIT license. 24 | * See further explanation attached in License Statement (distributed in the file 25 | * LICENSE). 26 | * 27 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 28 | * this software and associated documentation files (the "Software"), to deal in 29 | * the Software without restriction, including without limitation the rights to 30 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 31 | * of the Software, and to permit persons to whom the Software is furnished to do 32 | * so, subject to the following conditions: 33 | * 34 | * The above copyright notice and this permission notice shall be included in all 35 | * copies or substantial portions of the Software. 36 | * 37 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 42 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 43 | * SOFTWARE. 44 | */ 45 | 46 | #error "This header is for gtk-doc only and not supposed to be included" 47 | 48 | typedef struct _GstMP4Mux GstMP4Mux; 49 | typedef struct _Gst3GPPMux GstMP4Mux; 50 | typedef struct _GstISMLMux GstMP4Mux; 51 | typedef struct _GstMJ2Mux GstMJ2Mux; 52 | 53 | -------------------------------------------------------------------------------- /src/isomp4/1.0/gstqtmuxmap.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer plugin for GStreamer 2 | * Copyright (C) 2008 Thiago Sousa Santos 3 | * Copyright (C) 2008 Mark Nauwelaerts 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | /* 21 | * Unless otherwise indicated, Source Code is licensed under MIT license. 22 | * See further explanation attached in License Statement (distributed in the file 23 | * LICENSE). 24 | * 25 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 26 | * this software and associated documentation files (the "Software"), to deal in 27 | * the Software without restriction, including without limitation the rights to 28 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 29 | * of the Software, and to permit persons to whom the Software is furnished to do 30 | * so, subject to the following conditions: 31 | * 32 | * The above copyright notice and this permission notice shall be included in all 33 | * copies or substantial portions of the Software. 34 | * 35 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 36 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 37 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 38 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 39 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 40 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 41 | * SOFTWARE. 42 | */ 43 | 44 | #ifndef __GST_QT_MUX_MAP_H__ 45 | #define __GST_QT_MUX_MAP_H__ 46 | 47 | #include "atoms.h" 48 | 49 | #include 50 | #include 51 | 52 | typedef enum _GstQTMuxFormat 53 | { 54 | GST_QT_MUX_FORMAT_NONE = 0, 55 | GST_QT_MUX_FORMAT_QT, 56 | GST_QT_MUX_FORMAT_MP4, 57 | GST_QT_MUX_FORMAT_3GP, 58 | GST_QT_MUX_FORMAT_MJ2, 59 | GST_QT_MUX_FORMAT_ISML 60 | } GstQTMuxFormat; 61 | 62 | typedef struct _GstQTMuxFormatProp 63 | { 64 | GstQTMuxFormat format; 65 | GstRank rank; 66 | const gchar *name; 67 | const gchar *long_name; 68 | const gchar *type_name; 69 | GstStaticCaps src_caps; 70 | GstStaticCaps video_sink_caps; 71 | GstStaticCaps audio_sink_caps; 72 | } GstQTMuxFormatProp; 73 | 74 | extern GstQTMuxFormatProp gst_qt_mux_format_list[]; 75 | 76 | void gst_qt_mux_map_format_to_header (GstQTMuxFormat format, GstBuffer ** _prefix, 77 | guint32 * _major, guint32 * verson, 78 | GList ** _compatible, AtomMOOV * moov, 79 | GstClockTime longest_chunk, 80 | gboolean faststart); 81 | 82 | AtomsTreeFlavor gst_qt_mux_map_format_to_flavor (GstQTMuxFormat format); 83 | 84 | #endif /* __GST_QT_MUX_MAP_H__ */ 85 | -------------------------------------------------------------------------------- /src/isomp4/1.0/gstrtpxqtdepay.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <2005> Wim Taymans 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __GST_RTP_XQT_DEPAY_H__ 21 | #define __GST_RTP_XQT_DEPAY_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_TYPE_RTP_XQT_DEPAY \ 30 | (gst_rtp_xqt_depay_get_type()) 31 | #define GST_RTP_XQT_DEPAY(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_XQT_DEPAY,GstRtpXQTDepay)) 33 | #define GST_RTP_XQT_DEPAY_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_XQT_DEPAY,GstRtpXQTDepayClass)) 35 | #define GST_IS_RTP_XQT_DEPAY(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_XQT_DEPAY)) 37 | #define GST_IS_RTP_XQT_DEPAY_CLASS(klass) \ 38 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_XQT_DEPAY)) 39 | 40 | typedef struct _GstRtpXQTDepay GstRtpXQTDepay; 41 | typedef struct _GstRtpXQTDepayClass GstRtpXQTDepayClass; 42 | 43 | struct _GstRtpXQTDepay 44 | { 45 | GstRTPBaseDepayload depayload; 46 | 47 | GstAdapter *adapter; 48 | 49 | gboolean need_resync; 50 | guint16 previous_id; 51 | guint16 current_id; 52 | gboolean have_sd; 53 | }; 54 | 55 | struct _GstRtpXQTDepayClass 56 | { 57 | GstRTPBaseDepayloadClass parent_class; 58 | }; 59 | 60 | GType gst_rtp_xqt_depay_get_type (void); 61 | 62 | G_END_DECLS 63 | 64 | #endif /* __GST_RTP_XQT_DEPAY_H__ */ 65 | -------------------------------------------------------------------------------- /src/isomp4/1.0/isomp4-plugin.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2003> David A. Schleef 4 | * Copyright (C) <2006> Wim Taymans 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #include "qtdemux.h" 27 | 28 | #include 29 | 30 | gboolean 31 | gst_isomp4_plugin_init (GstPlugin * plugin) 32 | { 33 | #ifdef ENABLE_NLS 34 | setlocale (LC_ALL, ""); 35 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); 36 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 37 | #endif /* ENABLE_NLS */ 38 | 39 | gst_pb_utils_init (); 40 | 41 | /* ensure private tag is registered */ 42 | gst_tag_register (GST_QT_DEMUX_PRIVATE_TAG, GST_TAG_FLAG_META, 43 | GST_TYPE_SAMPLE, "QT atom", "unparsed QT tag atom", 44 | gst_tag_merge_use_first); 45 | 46 | gst_tag_register (GST_QT_DEMUX_CLASSIFICATION_TAG, GST_TAG_FLAG_META, 47 | G_TYPE_STRING, GST_QT_DEMUX_CLASSIFICATION_TAG, "content classification", 48 | gst_tag_merge_use_first); 49 | 50 | if (!gst_element_register (plugin, "qtdemux", 51 | GST_RANK_PRIMARY + 1, GST_TYPE_QTDEMUX)) 52 | return FALSE; 53 | if (!gst_element_register (plugin, "qtdemux-libde265", 54 | GST_RANK_PRIMARY + 1, GST_TYPE_QTDEMUX)) 55 | return FALSE; 56 | 57 | return TRUE; 58 | } 59 | -------------------------------------------------------------------------------- /src/isomp4/1.0/qtatomparser.h: -------------------------------------------------------------------------------- 1 | /* GStreamer QuickTime atom parser 2 | * Copyright (C) 2009 Tim-Philipp Müller 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef QT_ATOM_PARSER_H 22 | #define QT_ATOM_PARSER_H 23 | 24 | #include 25 | 26 | /* our inlined version of GstByteReader */ 27 | 28 | static inline gboolean 29 | qt_atom_parser_has_remaining (GstByteReader * parser, guint64 bytes_needed) 30 | { 31 | return G_LIKELY (parser->size >= bytes_needed) && 32 | G_LIKELY ((parser->size - bytes_needed) >= parser->byte); 33 | } 34 | 35 | static inline gboolean 36 | qt_atom_parser_has_chunks (GstByteReader * parser, guint32 n_chunks, 37 | guint32 chunk_size) 38 | { 39 | /* assumption: n_chunks and chunk_size are 32-bit, we cast to 64-bit here 40 | * to avoid overflows, to handle e.g. (guint32)-1 * size correctly */ 41 | return qt_atom_parser_has_remaining (parser, (guint64) n_chunks * chunk_size); 42 | } 43 | 44 | static inline gboolean 45 | qt_atom_parser_peek_sub (GstByteReader * parser, guint offset, guint size, 46 | GstByteReader * sub) 47 | { 48 | *sub = *parser; 49 | 50 | if (G_UNLIKELY (!gst_byte_reader_skip (sub, offset))) 51 | return FALSE; 52 | 53 | return (gst_byte_reader_get_remaining (sub) >= size); 54 | } 55 | 56 | static inline gboolean 57 | qt_atom_parser_skipn_and_get_uint32 (GstByteReader * parser, 58 | guint bytes_to_skip, guint32 * val) 59 | { 60 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < (bytes_to_skip + 4))) 61 | return FALSE; 62 | 63 | gst_byte_reader_skip_unchecked (parser, bytes_to_skip); 64 | *val = gst_byte_reader_get_uint32_be_unchecked (parser); 65 | return TRUE; 66 | } 67 | 68 | /* off_size must be either 4 or 8 */ 69 | static inline gboolean 70 | qt_atom_parser_get_offset (GstByteReader * parser, guint off_size, 71 | guint64 * val) 72 | { 73 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < off_size)) 74 | return FALSE; 75 | 76 | if (off_size == sizeof (guint64)) { 77 | *val = gst_byte_reader_get_uint64_be_unchecked (parser); 78 | } else { 79 | *val = gst_byte_reader_get_uint32_be_unchecked (parser); 80 | } 81 | return TRUE; 82 | } 83 | 84 | /* off_size must be either 4 or 8 */ 85 | static inline guint64 86 | qt_atom_parser_get_offset_unchecked (GstByteReader * parser, guint off_size) 87 | { 88 | if (off_size == sizeof (guint64)) { 89 | return gst_byte_reader_get_uint64_be_unchecked (parser); 90 | } else { 91 | return gst_byte_reader_get_uint32_be_unchecked (parser); 92 | } 93 | } 94 | 95 | /* size must be from 1 to 4 */ 96 | static inline guint32 97 | qt_atom_parser_get_uint_with_size_unchecked (GstByteReader * parser, 98 | guint size) 99 | { 100 | switch (size) { 101 | case 1: 102 | return gst_byte_reader_get_uint8_unchecked (parser); 103 | case 2: 104 | return gst_byte_reader_get_uint16_be_unchecked (parser); 105 | case 3: 106 | return gst_byte_reader_get_uint24_be_unchecked (parser); 107 | case 4: 108 | return gst_byte_reader_get_uint32_be_unchecked (parser); 109 | default: 110 | g_assert_not_reached (); 111 | gst_byte_reader_skip_unchecked (parser, size); 112 | break; 113 | } 114 | return 0; 115 | } 116 | 117 | static inline gboolean 118 | qt_atom_parser_get_fourcc (GstByteReader * parser, guint32 * fourcc) 119 | { 120 | guint32 f_be; 121 | 122 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < 4)) 123 | return FALSE; 124 | 125 | f_be = gst_byte_reader_get_uint32_be_unchecked (parser); 126 | *fourcc = GUINT32_SWAP_LE_BE (f_be); 127 | return TRUE; 128 | } 129 | 130 | static inline guint32 131 | qt_atom_parser_get_fourcc_unchecked (GstByteReader * parser) 132 | { 133 | guint32 fourcc; 134 | 135 | fourcc = gst_byte_reader_get_uint32_be_unchecked (parser); 136 | return GUINT32_SWAP_LE_BE (fourcc); 137 | } 138 | 139 | #endif /* QT_ATOM_PARSER_H */ 140 | -------------------------------------------------------------------------------- /src/isomp4/1.0/qtdemux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | 21 | #ifndef __GST_QTDEMUX_H__ 22 | #define __GST_QTDEMUX_H__ 23 | 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug); 30 | #define GST_CAT_DEFAULT qtdemux_debug 31 | 32 | #define GST_TYPE_QTDEMUX \ 33 | (gst_qtdemux_get_type()) 34 | #define GST_QTDEMUX(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QTDEMUX,GstQTDemux)) 36 | #define GST_QTDEMUX_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QTDEMUX,GstQTDemuxClass)) 38 | #define GST_IS_QTDEMUX(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QTDEMUX)) 40 | #define GST_IS_QTDEMUX_CLASS(klass) \ 41 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QTDEMUX)) 42 | 43 | #define GST_QTDEMUX_CAST(obj) ((GstQTDemux *)(obj)) 44 | 45 | /* qtdemux produces these for atoms it cannot parse */ 46 | #define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag" 47 | #define GST_QT_DEMUX_CLASSIFICATION_TAG "classification" 48 | 49 | #define GST_QTDEMUX_MAX_STREAMS 32 50 | 51 | typedef struct _GstQTDemux GstQTDemux; 52 | typedef struct _GstQTDemuxClass GstQTDemuxClass; 53 | typedef struct _QtDemuxStream QtDemuxStream; 54 | 55 | struct _GstQTDemux { 56 | GstElement element; 57 | 58 | /* pads */ 59 | GstPad *sinkpad; 60 | 61 | QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS]; 62 | gint n_streams; 63 | gint n_video_streams; 64 | gint n_audio_streams; 65 | gint n_sub_streams; 66 | 67 | guint major_brand; 68 | GstBuffer *comp_brands; 69 | GNode *moov_node; 70 | GNode *moov_node_compressed; 71 | 72 | guint32 timescale; 73 | guint64 duration; 74 | 75 | gboolean fragmented; 76 | /* offset of the mfra atom */ 77 | guint64 mfra_offset; 78 | guint64 moof_offset; 79 | 80 | gint state; 81 | 82 | gboolean pullbased; 83 | gboolean posted_redirect; 84 | 85 | /* push based variables */ 86 | guint neededbytes; 87 | guint todrop; 88 | GstAdapter *adapter; 89 | GstBuffer *mdatbuffer; 90 | guint64 mdatleft; 91 | 92 | guint64 offset; 93 | /* offset of the mdat atom */ 94 | guint64 mdatoffset; 95 | guint64 first_mdat; 96 | gboolean got_moov; 97 | guint header_size; 98 | 99 | GstTagList *tag_list; 100 | 101 | /* configured playback region */ 102 | GstSegment segment; 103 | GstEvent *pending_newsegment; 104 | 105 | #if 0 106 | /* gst index support */ 107 | GstIndex *element_index; 108 | gint index_id; 109 | #endif 110 | 111 | gint64 requested_seek_time; 112 | guint64 seek_offset; 113 | 114 | gboolean upstream_seekable; 115 | gint64 upstream_size; 116 | }; 117 | 118 | struct _GstQTDemuxClass { 119 | GstElementClass parent_class; 120 | }; 121 | 122 | GType gst_qtdemux_get_type (void); 123 | 124 | G_END_DECLS 125 | 126 | #endif /* __GST_QTDEMUX_H__ */ 127 | -------------------------------------------------------------------------------- /src/isomp4/1.0/qtdemux_dump.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __GST_QTDEMUX_DUMP_H__ 22 | #define __GST_QTDEMUX_DUMP_H__ 23 | 24 | #include 25 | #include "qtdemux.h" 26 | 27 | G_BEGIN_DECLS 28 | gboolean qtdemux_dump_mvhd (GstQTDemux * qtdemux, GstByteReader * data, 29 | int depth); 30 | gboolean qtdemux_dump_tkhd (GstQTDemux * qtdemux, GstByteReader * data, 31 | int depth); 32 | gboolean qtdemux_dump_elst (GstQTDemux * qtdemux, GstByteReader * data, 33 | int depth); 34 | gboolean qtdemux_dump_mdhd (GstQTDemux * qtdemux, GstByteReader * data, 35 | int depth); 36 | gboolean qtdemux_dump_hdlr (GstQTDemux * qtdemux, GstByteReader * data, 37 | int depth); 38 | gboolean qtdemux_dump_vmhd (GstQTDemux * qtdemux, GstByteReader * data, 39 | int depth); 40 | gboolean qtdemux_dump_dref (GstQTDemux * qtdemux, GstByteReader * data, 41 | int depth); 42 | gboolean qtdemux_dump_stsd (GstQTDemux * qtdemux, GstByteReader * data, 43 | int depth); 44 | gboolean qtdemux_dump_stts (GstQTDemux * qtdemux, GstByteReader * data, 45 | int depth); 46 | gboolean qtdemux_dump_stss (GstQTDemux * qtdemux, GstByteReader * data, 47 | int depth); 48 | gboolean qtdemux_dump_stps (GstQTDemux * qtdemux, GstByteReader * data, 49 | int depth); 50 | gboolean qtdemux_dump_stsc (GstQTDemux * qtdemux, GstByteReader * data, 51 | int depth); 52 | gboolean qtdemux_dump_stsz (GstQTDemux * qtdemux, GstByteReader * data, 53 | int depth); 54 | gboolean qtdemux_dump_stco (GstQTDemux * qtdemux, GstByteReader * data, 55 | int depth); 56 | gboolean qtdemux_dump_co64 (GstQTDemux * qtdemux, GstByteReader * data, 57 | int depth); 58 | gboolean qtdemux_dump_dcom (GstQTDemux * qtdemux, GstByteReader * data, 59 | int depth); 60 | gboolean qtdemux_dump_cmvd (GstQTDemux * qtdemux, GstByteReader * data, 61 | int depth); 62 | gboolean qtdemux_dump_ctts (GstQTDemux * qtdemux, GstByteReader * data, 63 | int depth); 64 | gboolean qtdemux_dump_mfro (GstQTDemux * qtdemux, GstByteReader * data, 65 | int depth); 66 | gboolean qtdemux_dump_tfra (GstQTDemux * qtdemux, GstByteReader * data, 67 | int depth); 68 | gboolean qtdemux_dump_tfhd (GstQTDemux * qtdemux, GstByteReader * data, 69 | int depth); 70 | gboolean qtdemux_dump_trun (GstQTDemux * qtdemux, GstByteReader * data, 71 | int depth); 72 | gboolean qtdemux_dump_trex (GstQTDemux * qtdemux, GstByteReader * data, 73 | int depth); 74 | gboolean qtdemux_dump_mehd (GstQTDemux * qtdemux, GstByteReader * data, 75 | int depth); 76 | gboolean qtdemux_dump_sdtp (GstQTDemux * qtdemux, GstByteReader * data, 77 | int depth); 78 | gboolean qtdemux_dump_tfdt (GstQTDemux * qtdemux, GstByteReader * data, 79 | int depth); 80 | gboolean qtdemux_dump_unknown (GstQTDemux * qtdemux, GstByteReader * data, 81 | int depth); 82 | 83 | gboolean qtdemux_node_dump (GstQTDemux * qtdemux, GNode * node); 84 | 85 | G_END_DECLS 86 | #endif /* __GST_QTDEMUX_DUMP_H__ */ 87 | -------------------------------------------------------------------------------- /src/isomp4/1.0/qtdemux_lang.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Quicktime/ISO demuxer language utility functions 2 | * Copyright (C) 2010 Tim-Philipp Müller 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __GST_QTDEMUX_LANG_H__ 21 | #define __GST_QTDEMUX_LANG_H__ 22 | 23 | G_BEGIN_DECLS 24 | 25 | #include 26 | 27 | void qtdemux_lang_map_qt_code_to_iso (gchar id[4], guint16 qt_lang_code); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* __GST_QTDEMUX_LANG_H__ */ 32 | -------------------------------------------------------------------------------- /src/isomp4/1.0/qtdemux_types.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __GST_QTDEMUX_TYPES_H__ 22 | #define __GST_QTDEMUX_TYPES_H__ 23 | 24 | #include 25 | #include 26 | 27 | #include "qtdemux.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef gboolean (*QtDumpFunc) (GstQTDemux * qtdemux, GstByteReader * data, 32 | int depth); 33 | 34 | typedef struct _QtNodeType QtNodeType; 35 | 36 | #define QT_UINT32(a) (GST_READ_UINT32_BE(a)) 37 | #define QT_UINT24(a) (GST_READ_UINT32_BE(a) >> 8) 38 | #define QT_UINT16(a) (GST_READ_UINT16_BE(a)) 39 | #define QT_UINT8(a) (GST_READ_UINT8(a)) 40 | #define QT_FP32(a) ((GST_READ_UINT32_BE(a))/65536.0) 41 | #define QT_SFP32(a) (((gint)(GST_READ_UINT32_BE(a)))/65536.0) 42 | #define QT_FP16(a) ((GST_READ_UINT16_BE(a))/256.0) 43 | #define QT_FOURCC(a) (GST_READ_UINT32_LE(a)) 44 | #define QT_UINT64(a) ((((guint64)QT_UINT32(a))<<32)|QT_UINT32(((guint8 *)a)+4)) 45 | 46 | typedef enum { 47 | QT_FLAG_NONE = (0), 48 | QT_FLAG_CONTAINER = (1 << 0) 49 | } QtFlags; 50 | 51 | struct _QtNodeType { 52 | guint32 fourcc; 53 | const gchar *name; 54 | QtFlags flags; 55 | QtDumpFunc dump; 56 | }; 57 | 58 | enum TfFlags 59 | { 60 | TF_BASE_DATA_OFFSET = 0x000001, /* base-data-offset-present */ 61 | TF_SAMPLE_DESCRIPTION_INDEX = 0x000002, /* sample-description-index-present */ 62 | TF_DEFAULT_SAMPLE_DURATION = 0x000008, /* default-sample-duration-present */ 63 | TF_DEFAULT_SAMPLE_SIZE = 0x000010, /* default-sample-size-present */ 64 | TF_DEFAULT_SAMPLE_FLAGS = 0x000020, /* default-sample-flags-present */ 65 | TF_DURATION_IS_EMPTY = 0x100000 /* duration-is-empty */ 66 | }; 67 | 68 | enum TrFlags 69 | { 70 | TR_DATA_OFFSET = 0x000001, /* data-offset-present */ 71 | TR_FIRST_SAMPLE_FLAGS = 0x000004, /* first-sample-flags-present */ 72 | TR_SAMPLE_DURATION = 0x000100, /* sample-duration-present */ 73 | TR_SAMPLE_SIZE = 0x000200, /* sample-size-present */ 74 | TR_SAMPLE_FLAGS = 0x000400, /* sample-flags-present */ 75 | TR_COMPOSITION_TIME_OFFSETS = 0x000800 /* sample-composition-time-offsets-presents */ 76 | }; 77 | 78 | const QtNodeType *qtdemux_type_get (guint32 fourcc); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __GST_QTDEMUX_TYPES_H__ */ 83 | -------------------------------------------------------------------------------- /src/isomp4/1.2/LEGAL: -------------------------------------------------------------------------------- 1 | This is a demuxer supporting a subset of the Quicktime video container 2 | format developed by Apple. Apple and others have some patents on 3 | some features of the Quicktime container format in regards to technologies 4 | such as QuicktimeVR and RTP hinting. Due to that be aware that if ever 5 | such features are added to this demuxer it would need to be moved to the 6 | -ugly module or those features need to come as add-in functionality stored in 7 | another module. 8 | 9 | As the plugin is as of today's date (19th of June 2007) it does not 10 | violate any software patents we know of. 11 | -------------------------------------------------------------------------------- /src/isomp4/1.2/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | plugin_LTLIBRARIES = libgstisomp4.la 3 | 4 | libgstisomp4_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) 5 | libgstisomp4_la_LIBADD = \ 6 | $(GST_PLUGINS_BASE_LIBS) \ 7 | -lgstriff-@GST_API_VERSION@ \ 8 | -lgstaudio-@GST_API_VERSION@ \ 9 | -lgstvideo-@GST_API_VERSION@ \ 10 | -lgstrtp-@GST_API_VERSION@ \ 11 | -lgsttag-@GST_API_VERSION@ \ 12 | -lgstpbutils-@GST_API_VERSION@ \ 13 | $(GST_BASE_LIBS) $(GST_LIBS) $(ZLIB_LIBS) $(LIBM) 14 | libgstisomp4_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS} 15 | libgstisomp4_la_SOURCES = isomp4-plugin.c gstrtpxqtdepay.c \ 16 | qtdemux.c qtdemux_types.c qtdemux_dump.c qtdemux_lang.c \ 17 | gstqtmux.c gstqtmoovrecover.c atoms.c atomsrecovery.c descriptors.c \ 18 | properties.c gstqtmuxmap.c 19 | libgstisomp4_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) 20 | 21 | noinst_HEADERS = \ 22 | qtatomparser.h \ 23 | qtdemux.h \ 24 | qtdemux_types.h \ 25 | qtdemux_dump.h \ 26 | qtdemux_fourcc.h \ 27 | qtdemux_lang.h \ 28 | qtpalette.h \ 29 | gstrtpxqtdepay.h \ 30 | gstqtmux.h \ 31 | gstqtmoovrecover.h \ 32 | atoms.h \ 33 | atomsrecovery.h \ 34 | descriptors.h \ 35 | properties.h \ 36 | fourcc.h \ 37 | ftypcc.h \ 38 | gstqtmuxmap.h 39 | 40 | EXTRA_DIST = \ 41 | gstqtmux-doc.c \ 42 | gstqtmux-doc.h 43 | 44 | Android.mk: Makefile.am $(BUILT_SOURCES) 45 | androgenizer \ 46 | -:PROJECT libgstisomp4 -:SHARED libgstisomp4 \ 47 | -:TAGS eng debug \ 48 | -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ 49 | -:SOURCES $(libgstisomp4_la_SOURCES) \ 50 | -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(libgstisomp4_la_CFLAGS) \ 51 | -:LDFLAGS $(libgstisomp4_la_LDFLAGS) \ 52 | $(libgstisomp4_la_LIBADD) \ 53 | -ldl \ 54 | -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ 55 | LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \ 56 | > $@ 57 | -------------------------------------------------------------------------------- /src/isomp4/1.2/README.txt: -------------------------------------------------------------------------------- 1 | Based on c4a7ae648e496e67f5f7da299658a1c10f28c65a in branch "1.2" from 2 | http://cgit.freedesktop.org/gstreamer/gst-plugins-good/ 3 | -------------------------------------------------------------------------------- /src/isomp4/1.2/ftypcc.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <2008> Thiago Sousa Santos 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | /* 20 | * Unless otherwise indicated, Source Code is licensed under MIT license. 21 | * See further explanation attached in License Statement (distributed in the file 22 | * LICENSE). 23 | * 24 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | * this software and associated documentation files (the "Software"), to deal in 26 | * the Software without restriction, including without limitation the rights to 27 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 | * of the Software, and to permit persons to whom the Software is furnished to do 29 | * so, subject to the following conditions: 30 | * 31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | 43 | #ifndef __FTYP_CC_H__ 44 | #define __FTYP_CC_H__ 45 | 46 | #include 47 | 48 | G_BEGIN_DECLS 49 | 50 | #define FOURCC_ftyp GST_MAKE_FOURCC('f','t','y','p') 51 | #define FOURCC_isom GST_MAKE_FOURCC('i','s','o','m') 52 | #define FOURCC_iso2 GST_MAKE_FOURCC('i','s','o','2') 53 | #define FOURCC_mp41 GST_MAKE_FOURCC('m','p','4','1') 54 | #define FOURCC_mp42 GST_MAKE_FOURCC('m','p','4','2') 55 | #define FOURCC_mjp2 GST_MAKE_FOURCC('m','j','p','2') 56 | #define FOURCC_3gp4 GST_MAKE_FOURCC('3','g','p','4') 57 | #define FOURCC_3gp6 GST_MAKE_FOURCC('3','g','p','6') 58 | #define FOURCC_3gg6 GST_MAKE_FOURCC('3','g','g','6') 59 | #define FOURCC_3gr6 GST_MAKE_FOURCC('3','g','r','6') 60 | #define FOURCC_3gg7 GST_MAKE_FOURCC('3','g','g','7') 61 | #define FOURCC_avc1 GST_MAKE_FOURCC('a','v','c','1') 62 | #define FOURCC_avc3 GST_MAKE_FOURCC('a','v','c','3') 63 | #define FOURCC_qt__ GST_MAKE_FOURCC('q','t',' ',' ') 64 | #define FOURCC_isml GST_MAKE_FOURCC('i','s','m','l') 65 | #define FOURCC_piff GST_MAKE_FOURCC('p','i','f','f') 66 | 67 | G_END_DECLS 68 | #endif /* __FTYP_CC_H__ */ 69 | -------------------------------------------------------------------------------- /src/isomp4/1.2/gstqtmoovrecover.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer plugin for GStreamer 2 | * Copyright (C) 2010 Thiago Santos 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | /* 20 | * Unless otherwise indicated, Source Code is licensed under MIT license. 21 | * See further explanation attached in License Statement (distributed in the file 22 | * LICENSE). 23 | * 24 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | * this software and associated documentation files (the "Software"), to deal in 26 | * the Software without restriction, including without limitation the rights to 27 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 | * of the Software, and to permit persons to whom the Software is furnished to do 29 | * so, subject to the following conditions: 30 | * 31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | 43 | #ifndef __GST_QT_MOOV_RECOVER_H__ 44 | #define __GST_QT_MOOV_RECOVER_H__ 45 | 46 | #include 47 | 48 | #include "atoms.h" 49 | #include "atomsrecovery.h" 50 | 51 | G_BEGIN_DECLS 52 | 53 | #define GST_TYPE_QT_MOOV_RECOVER (gst_qt_moov_recover_get_type()) 54 | #define GST_QT_MOOV_RECOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QT_MOOV_RECOVER, GstQTMoovRecover)) 55 | #define GST_QT_MOOV_RECOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QT_MOOV_RECOVER, GstQTMoovRecover)) 56 | #define GST_IS_QT_MOOV_RECOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QT_MOOV_RECOVER)) 57 | #define GST_IS_QT_MOOV_RECOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QT_MOOV_RECOVER)) 58 | #define GST_QT_MOOV_RECOVER_CAST(obj) ((GstQTMoovRecover*)(obj)) 59 | 60 | 61 | typedef struct _GstQTMoovRecover GstQTMoovRecover; 62 | typedef struct _GstQTMoovRecoverClass GstQTMoovRecoverClass; 63 | 64 | struct _GstQTMoovRecover 65 | { 66 | GstPipeline pipeline; 67 | 68 | GstTask *task; 69 | GRecMutex task_mutex; 70 | 71 | /* properties */ 72 | gboolean faststart_mode; 73 | gchar *recovery_input; 74 | gchar *fixed_output; 75 | gchar *broken_input; 76 | }; 77 | 78 | struct _GstQTMoovRecoverClass 79 | { 80 | GstPipelineClass parent_class; 81 | }; 82 | 83 | GType gst_qt_moov_recover_get_type (void); 84 | gboolean gst_qt_moov_recover_register (GstPlugin * plugin); 85 | 86 | G_END_DECLS 87 | 88 | #endif /* __GST_QT_MOOV_RECOVER_H__ */ 89 | -------------------------------------------------------------------------------- /src/isomp4/1.2/gstqtmux-doc.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer documentation 2 | * Copyright (C) 2008-2010 Thiago Santos 3 | * Copyright (C) 2008 Mark Nauwelaerts 4 | * Copyright (C) 2010 Nokia Corporation. All rights reserved. 5 | * Contact: Stefan Kost 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | /* 23 | * Unless otherwise indicated, Source Code is licensed under MIT license. 24 | * See further explanation attached in License Statement (distributed in the file 25 | * LICENSE). 26 | * 27 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 28 | * this software and associated documentation files (the "Software"), to deal in 29 | * the Software without restriction, including without limitation the rights to 30 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 31 | * of the Software, and to permit persons to whom the Software is furnished to do 32 | * so, subject to the following conditions: 33 | * 34 | * The above copyright notice and this permission notice shall be included in all 35 | * copies or substantial portions of the Software. 36 | * 37 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 42 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 43 | * SOFTWARE. 44 | */ 45 | 46 | #error "This header is for gtk-doc only and not supposed to be included" 47 | 48 | typedef struct _GstMP4Mux GstMP4Mux; 49 | typedef struct _Gst3GPPMux GstMP4Mux; 50 | typedef struct _GstISMLMux GstMP4Mux; 51 | typedef struct _GstMJ2Mux GstMJ2Mux; 52 | 53 | -------------------------------------------------------------------------------- /src/isomp4/1.2/gstqtmuxmap.h: -------------------------------------------------------------------------------- 1 | /* Quicktime muxer plugin for GStreamer 2 | * Copyright (C) 2008 Thiago Sousa Santos 3 | * Copyright (C) 2008 Mark Nauwelaerts 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | /* 21 | * Unless otherwise indicated, Source Code is licensed under MIT license. 22 | * See further explanation attached in License Statement (distributed in the file 23 | * LICENSE). 24 | * 25 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 26 | * this software and associated documentation files (the "Software"), to deal in 27 | * the Software without restriction, including without limitation the rights to 28 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 29 | * of the Software, and to permit persons to whom the Software is furnished to do 30 | * so, subject to the following conditions: 31 | * 32 | * The above copyright notice and this permission notice shall be included in all 33 | * copies or substantial portions of the Software. 34 | * 35 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 36 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 37 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 38 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 39 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 40 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 41 | * SOFTWARE. 42 | */ 43 | 44 | #ifndef __GST_QT_MUX_MAP_H__ 45 | #define __GST_QT_MUX_MAP_H__ 46 | 47 | #include "atoms.h" 48 | 49 | #include 50 | #include 51 | 52 | typedef enum _GstQTMuxFormat 53 | { 54 | GST_QT_MUX_FORMAT_NONE = 0, 55 | GST_QT_MUX_FORMAT_QT, 56 | GST_QT_MUX_FORMAT_MP4, 57 | GST_QT_MUX_FORMAT_3GP, 58 | GST_QT_MUX_FORMAT_MJ2, 59 | GST_QT_MUX_FORMAT_ISML 60 | } GstQTMuxFormat; 61 | 62 | typedef struct _GstQTMuxFormatProp 63 | { 64 | GstQTMuxFormat format; 65 | GstRank rank; 66 | const gchar *name; 67 | const gchar *long_name; 68 | const gchar *type_name; 69 | GstStaticCaps src_caps; 70 | GstStaticCaps video_sink_caps; 71 | GstStaticCaps audio_sink_caps; 72 | } GstQTMuxFormatProp; 73 | 74 | extern GstQTMuxFormatProp gst_qt_mux_format_list[]; 75 | 76 | void gst_qt_mux_map_format_to_header (GstQTMuxFormat format, GstBuffer ** _prefix, 77 | guint32 * _major, guint32 * verson, 78 | GList ** _compatible, AtomMOOV * moov, 79 | GstClockTime longest_chunk, 80 | gboolean faststart); 81 | 82 | AtomsTreeFlavor gst_qt_mux_map_format_to_flavor (GstQTMuxFormat format); 83 | 84 | #endif /* __GST_QT_MUX_MAP_H__ */ 85 | -------------------------------------------------------------------------------- /src/isomp4/1.2/gstrtpxqtdepay.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <2005> Wim Taymans 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __GST_RTP_XQT_DEPAY_H__ 21 | #define __GST_RTP_XQT_DEPAY_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_TYPE_RTP_XQT_DEPAY \ 30 | (gst_rtp_xqt_depay_get_type()) 31 | #define GST_RTP_XQT_DEPAY(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_XQT_DEPAY,GstRtpXQTDepay)) 33 | #define GST_RTP_XQT_DEPAY_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_XQT_DEPAY,GstRtpXQTDepayClass)) 35 | #define GST_IS_RTP_XQT_DEPAY(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_XQT_DEPAY)) 37 | #define GST_IS_RTP_XQT_DEPAY_CLASS(klass) \ 38 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_XQT_DEPAY)) 39 | 40 | typedef struct _GstRtpXQTDepay GstRtpXQTDepay; 41 | typedef struct _GstRtpXQTDepayClass GstRtpXQTDepayClass; 42 | 43 | struct _GstRtpXQTDepay 44 | { 45 | GstRTPBaseDepayload depayload; 46 | 47 | GstAdapter *adapter; 48 | 49 | gboolean need_resync; 50 | guint16 previous_id; 51 | guint16 current_id; 52 | gboolean have_sd; 53 | }; 54 | 55 | struct _GstRtpXQTDepayClass 56 | { 57 | GstRTPBaseDepayloadClass parent_class; 58 | }; 59 | 60 | GType gst_rtp_xqt_depay_get_type (void); 61 | 62 | G_END_DECLS 63 | 64 | #endif /* __GST_RTP_XQT_DEPAY_H__ */ 65 | -------------------------------------------------------------------------------- /src/isomp4/1.2/isomp4-plugin.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2003> David A. Schleef 4 | * Copyright (C) <2006> Wim Taymans 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #include "qtdemux.h" 27 | 28 | #include 29 | 30 | gboolean 31 | gst_isomp4_plugin_init (GstPlugin * plugin) 32 | { 33 | #ifdef ENABLE_NLS 34 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); 35 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 36 | #endif /* ENABLE_NLS */ 37 | 38 | gst_pb_utils_init (); 39 | 40 | /* ensure private tag is registered */ 41 | gst_tag_register (GST_QT_DEMUX_PRIVATE_TAG, GST_TAG_FLAG_META, 42 | GST_TYPE_SAMPLE, "QT atom", "unparsed QT tag atom", 43 | gst_tag_merge_use_first); 44 | 45 | gst_tag_register (GST_QT_DEMUX_CLASSIFICATION_TAG, GST_TAG_FLAG_META, 46 | G_TYPE_STRING, GST_QT_DEMUX_CLASSIFICATION_TAG, "content classification", 47 | gst_tag_merge_use_first); 48 | 49 | if (!gst_element_register (plugin, "qtdemux", 50 | GST_RANK_PRIMARY + 1, GST_TYPE_QTDEMUX)) 51 | return FALSE; 52 | if (!gst_element_register (plugin, "qtdemux-libde265", 53 | GST_RANK_PRIMARY + 1, GST_TYPE_QTDEMUX)) 54 | return FALSE; 55 | 56 | return TRUE; 57 | } 58 | -------------------------------------------------------------------------------- /src/isomp4/1.2/qtatomparser.h: -------------------------------------------------------------------------------- 1 | /* GStreamer QuickTime atom parser 2 | * Copyright (C) 2009 Tim-Philipp Müller 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef QT_ATOM_PARSER_H 22 | #define QT_ATOM_PARSER_H 23 | 24 | #include 25 | 26 | /* our inlined version of GstByteReader */ 27 | 28 | static inline gboolean 29 | qt_atom_parser_has_remaining (GstByteReader * parser, guint64 bytes_needed) 30 | { 31 | return G_LIKELY (parser->size >= bytes_needed) && 32 | G_LIKELY ((parser->size - bytes_needed) >= parser->byte); 33 | } 34 | 35 | static inline gboolean 36 | qt_atom_parser_has_chunks (GstByteReader * parser, guint32 n_chunks, 37 | guint32 chunk_size) 38 | { 39 | /* assumption: n_chunks and chunk_size are 32-bit, we cast to 64-bit here 40 | * to avoid overflows, to handle e.g. (guint32)-1 * size correctly */ 41 | return qt_atom_parser_has_remaining (parser, (guint64) n_chunks * chunk_size); 42 | } 43 | 44 | static inline gboolean 45 | qt_atom_parser_peek_sub (GstByteReader * parser, guint offset, guint size, 46 | GstByteReader * sub) 47 | { 48 | *sub = *parser; 49 | 50 | if (G_UNLIKELY (!gst_byte_reader_skip (sub, offset))) 51 | return FALSE; 52 | 53 | return (gst_byte_reader_get_remaining (sub) >= size); 54 | } 55 | 56 | static inline gboolean 57 | qt_atom_parser_skipn_and_get_uint32 (GstByteReader * parser, 58 | guint bytes_to_skip, guint32 * val) 59 | { 60 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < (bytes_to_skip + 4))) 61 | return FALSE; 62 | 63 | gst_byte_reader_skip_unchecked (parser, bytes_to_skip); 64 | *val = gst_byte_reader_get_uint32_be_unchecked (parser); 65 | return TRUE; 66 | } 67 | 68 | /* off_size must be either 4 or 8 */ 69 | static inline gboolean 70 | qt_atom_parser_get_offset (GstByteReader * parser, guint off_size, 71 | guint64 * val) 72 | { 73 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < off_size)) 74 | return FALSE; 75 | 76 | if (off_size == sizeof (guint64)) { 77 | *val = gst_byte_reader_get_uint64_be_unchecked (parser); 78 | } else { 79 | *val = gst_byte_reader_get_uint32_be_unchecked (parser); 80 | } 81 | return TRUE; 82 | } 83 | 84 | /* off_size must be either 4 or 8 */ 85 | static inline guint64 86 | qt_atom_parser_get_offset_unchecked (GstByteReader * parser, guint off_size) 87 | { 88 | if (off_size == sizeof (guint64)) { 89 | return gst_byte_reader_get_uint64_be_unchecked (parser); 90 | } else { 91 | return gst_byte_reader_get_uint32_be_unchecked (parser); 92 | } 93 | } 94 | 95 | /* size must be from 1 to 4 */ 96 | static inline guint32 97 | qt_atom_parser_get_uint_with_size_unchecked (GstByteReader * parser, 98 | guint size) 99 | { 100 | switch (size) { 101 | case 1: 102 | return gst_byte_reader_get_uint8_unchecked (parser); 103 | case 2: 104 | return gst_byte_reader_get_uint16_be_unchecked (parser); 105 | case 3: 106 | return gst_byte_reader_get_uint24_be_unchecked (parser); 107 | case 4: 108 | return gst_byte_reader_get_uint32_be_unchecked (parser); 109 | default: 110 | g_assert_not_reached (); 111 | gst_byte_reader_skip_unchecked (parser, size); 112 | break; 113 | } 114 | return 0; 115 | } 116 | 117 | static inline gboolean 118 | qt_atom_parser_get_fourcc (GstByteReader * parser, guint32 * fourcc) 119 | { 120 | guint32 f_be; 121 | 122 | if (G_UNLIKELY (gst_byte_reader_get_remaining (parser) < 4)) 123 | return FALSE; 124 | 125 | f_be = gst_byte_reader_get_uint32_be_unchecked (parser); 126 | *fourcc = GUINT32_SWAP_LE_BE (f_be); 127 | return TRUE; 128 | } 129 | 130 | static inline guint32 131 | qt_atom_parser_get_fourcc_unchecked (GstByteReader * parser) 132 | { 133 | guint32 fourcc; 134 | 135 | fourcc = gst_byte_reader_get_uint32_be_unchecked (parser); 136 | return GUINT32_SWAP_LE_BE (fourcc); 137 | } 138 | 139 | #endif /* QT_ATOM_PARSER_H */ 140 | -------------------------------------------------------------------------------- /src/isomp4/1.2/qtdemux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __GST_QTDEMUX_H__ 22 | #define __GST_QTDEMUX_H__ 23 | 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug); 30 | #define GST_CAT_DEFAULT qtdemux_debug 31 | 32 | #define GST_TYPE_QTDEMUX \ 33 | (gst_qtdemux_get_type()) 34 | #define GST_QTDEMUX(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QTDEMUX,GstQTDemux)) 36 | #define GST_QTDEMUX_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QTDEMUX,GstQTDemuxClass)) 38 | #define GST_IS_QTDEMUX(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QTDEMUX)) 40 | #define GST_IS_QTDEMUX_CLASS(klass) \ 41 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QTDEMUX)) 42 | 43 | #define GST_QTDEMUX_CAST(obj) ((GstQTDemux *)(obj)) 44 | 45 | /* qtdemux produces these for atoms it cannot parse */ 46 | #define GST_QT_DEMUX_PRIVATE_TAG "private-qt-tag" 47 | #define GST_QT_DEMUX_CLASSIFICATION_TAG "classification" 48 | 49 | #define GST_QTDEMUX_MAX_STREAMS 32 50 | 51 | typedef struct _GstQTDemux GstQTDemux; 52 | typedef struct _GstQTDemuxClass GstQTDemuxClass; 53 | typedef struct _QtDemuxStream QtDemuxStream; 54 | 55 | struct _GstQTDemux { 56 | GstElement element; 57 | 58 | /* pads */ 59 | GstPad *sinkpad; 60 | 61 | QtDemuxStream *streams[GST_QTDEMUX_MAX_STREAMS]; 62 | gint n_streams; 63 | gint n_video_streams; 64 | gint n_audio_streams; 65 | gint n_sub_streams; 66 | 67 | gboolean have_group_id; 68 | guint group_id; 69 | 70 | guint major_brand; 71 | GstBuffer *comp_brands; 72 | GNode *moov_node; 73 | GNode *moov_node_compressed; 74 | 75 | guint32 timescale; 76 | guint64 duration; 77 | 78 | gboolean fragmented; 79 | /* offset of the mfra atom */ 80 | guint64 mfra_offset; 81 | guint64 moof_offset; 82 | 83 | gint state; 84 | 85 | gboolean pullbased; 86 | gboolean posted_redirect; 87 | 88 | /* push based variables */ 89 | guint neededbytes; 90 | guint todrop; 91 | GstAdapter *adapter; 92 | GstBuffer *mdatbuffer; 93 | guint64 mdatleft; 94 | /* When restoring the mdat to the adatpter, this buffer 95 | * stores any trailing data that was after the last atom parsed as it 96 | * has to be restored later along with the correct offset. Used in 97 | * fragmented scenario where mdat/moof are one after the other 98 | * in any order. 99 | * 100 | * Check https://bugzilla.gnome.org/show_bug.cgi?id=710623 */ 101 | GstBuffer *restoredata_buffer; 102 | guint64 restoredata_offset; 103 | 104 | guint64 offset; 105 | /* offset of the mdat atom */ 106 | guint64 mdatoffset; 107 | guint64 first_mdat; 108 | gboolean got_moov; 109 | guint header_size; 110 | 111 | GstTagList *tag_list; 112 | 113 | /* configured playback region */ 114 | GstSegment segment; 115 | GstEvent *pending_newsegment; 116 | gboolean upstream_newsegment; 117 | gint64 seek_offset; 118 | gint64 push_seek_start; 119 | gint64 push_seek_stop; 120 | 121 | #if 0 122 | /* gst index support */ 123 | GstIndex *element_index; 124 | gint index_id; 125 | #endif 126 | 127 | gboolean upstream_seekable; 128 | gint64 upstream_size; 129 | 130 | /* MSS streams have a single media that is unspecified at the atoms, so 131 | * upstream provides it at the caps */ 132 | GstCaps *media_caps; 133 | gboolean exposed; 134 | gboolean mss_mode; /* flag to indicate that we're working with a smoothstreaming fragment */ 135 | guint64 fragment_start; 136 | 137 | gint64 chapters_track_id; 138 | 139 | GstClockTime min_elst_offset; 140 | }; 141 | 142 | struct _GstQTDemuxClass { 143 | GstElementClass parent_class; 144 | }; 145 | 146 | GType gst_qtdemux_get_type (void); 147 | 148 | G_END_DECLS 149 | 150 | #endif /* __GST_QTDEMUX_H__ */ 151 | -------------------------------------------------------------------------------- /src/isomp4/1.2/qtdemux_dump.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __GST_QTDEMUX_DUMP_H__ 22 | #define __GST_QTDEMUX_DUMP_H__ 23 | 24 | #include 25 | #include "qtdemux.h" 26 | 27 | G_BEGIN_DECLS 28 | gboolean qtdemux_dump_mvhd (GstQTDemux * qtdemux, GstByteReader * data, 29 | int depth); 30 | gboolean qtdemux_dump_tkhd (GstQTDemux * qtdemux, GstByteReader * data, 31 | int depth); 32 | gboolean qtdemux_dump_elst (GstQTDemux * qtdemux, GstByteReader * data, 33 | int depth); 34 | gboolean qtdemux_dump_mdhd (GstQTDemux * qtdemux, GstByteReader * data, 35 | int depth); 36 | gboolean qtdemux_dump_hdlr (GstQTDemux * qtdemux, GstByteReader * data, 37 | int depth); 38 | gboolean qtdemux_dump_vmhd (GstQTDemux * qtdemux, GstByteReader * data, 39 | int depth); 40 | gboolean qtdemux_dump_dref (GstQTDemux * qtdemux, GstByteReader * data, 41 | int depth); 42 | gboolean qtdemux_dump_stsd (GstQTDemux * qtdemux, GstByteReader * data, 43 | int depth); 44 | gboolean qtdemux_dump_stts (GstQTDemux * qtdemux, GstByteReader * data, 45 | int depth); 46 | gboolean qtdemux_dump_stss (GstQTDemux * qtdemux, GstByteReader * data, 47 | int depth); 48 | gboolean qtdemux_dump_stps (GstQTDemux * qtdemux, GstByteReader * data, 49 | int depth); 50 | gboolean qtdemux_dump_stsc (GstQTDemux * qtdemux, GstByteReader * data, 51 | int depth); 52 | gboolean qtdemux_dump_stsz (GstQTDemux * qtdemux, GstByteReader * data, 53 | int depth); 54 | gboolean qtdemux_dump_stco (GstQTDemux * qtdemux, GstByteReader * data, 55 | int depth); 56 | gboolean qtdemux_dump_co64 (GstQTDemux * qtdemux, GstByteReader * data, 57 | int depth); 58 | gboolean qtdemux_dump_dcom (GstQTDemux * qtdemux, GstByteReader * data, 59 | int depth); 60 | gboolean qtdemux_dump_cmvd (GstQTDemux * qtdemux, GstByteReader * data, 61 | int depth); 62 | gboolean qtdemux_dump_ctts (GstQTDemux * qtdemux, GstByteReader * data, 63 | int depth); 64 | gboolean qtdemux_dump_mfro (GstQTDemux * qtdemux, GstByteReader * data, 65 | int depth); 66 | gboolean qtdemux_dump_tfra (GstQTDemux * qtdemux, GstByteReader * data, 67 | int depth); 68 | gboolean qtdemux_dump_tfhd (GstQTDemux * qtdemux, GstByteReader * data, 69 | int depth); 70 | gboolean qtdemux_dump_trun (GstQTDemux * qtdemux, GstByteReader * data, 71 | int depth); 72 | gboolean qtdemux_dump_trex (GstQTDemux * qtdemux, GstByteReader * data, 73 | int depth); 74 | gboolean qtdemux_dump_mehd (GstQTDemux * qtdemux, GstByteReader * data, 75 | int depth); 76 | gboolean qtdemux_dump_sdtp (GstQTDemux * qtdemux, GstByteReader * data, 77 | int depth); 78 | gboolean qtdemux_dump_tfdt (GstQTDemux * qtdemux, GstByteReader * data, 79 | int depth); 80 | gboolean qtdemux_dump_unknown (GstQTDemux * qtdemux, GstByteReader * data, 81 | int depth); 82 | 83 | gboolean qtdemux_node_dump (GstQTDemux * qtdemux, GNode * node); 84 | 85 | G_END_DECLS 86 | #endif /* __GST_QTDEMUX_DUMP_H__ */ 87 | -------------------------------------------------------------------------------- /src/isomp4/1.2/qtdemux_lang.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Quicktime/ISO demuxer language utility functions 2 | * Copyright (C) 2010 Tim-Philipp Müller 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __GST_QTDEMUX_LANG_H__ 21 | #define __GST_QTDEMUX_LANG_H__ 22 | 23 | G_BEGIN_DECLS 24 | 25 | #include 26 | 27 | void qtdemux_lang_map_qt_code_to_iso (gchar id[4], guint16 qt_lang_code); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* __GST_QTDEMUX_LANG_H__ */ 32 | -------------------------------------------------------------------------------- /src/isomp4/1.2/qtdemux_types.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) <1999> Erik Walthinsen 3 | * Copyright (C) <2009> STEricsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __GST_QTDEMUX_TYPES_H__ 22 | #define __GST_QTDEMUX_TYPES_H__ 23 | 24 | #include 25 | #include 26 | 27 | #include "qtdemux.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef gboolean (*QtDumpFunc) (GstQTDemux * qtdemux, GstByteReader * data, 32 | int depth); 33 | 34 | typedef struct _QtNodeType QtNodeType; 35 | 36 | #define QT_UINT32(a) (GST_READ_UINT32_BE(a)) 37 | #define QT_UINT24(a) (GST_READ_UINT32_BE(a) >> 8) 38 | #define QT_UINT16(a) (GST_READ_UINT16_BE(a)) 39 | #define QT_UINT8(a) (GST_READ_UINT8(a)) 40 | #define QT_FP32(a) ((GST_READ_UINT32_BE(a))/65536.0) 41 | #define QT_SFP32(a) (((gint)(GST_READ_UINT32_BE(a)))/65536.0) 42 | #define QT_FP16(a) ((GST_READ_UINT16_BE(a))/256.0) 43 | #define QT_FOURCC(a) (GST_READ_UINT32_LE(a)) 44 | #define QT_UINT64(a) ((((guint64)QT_UINT32(a))<<32)|QT_UINT32(((guint8 *)a)+4)) 45 | 46 | typedef enum { 47 | QT_FLAG_NONE = (0), 48 | QT_FLAG_CONTAINER = (1 << 0) 49 | } QtFlags; 50 | 51 | struct _QtNodeType { 52 | guint32 fourcc; 53 | const gchar *name; 54 | QtFlags flags; 55 | QtDumpFunc dump; 56 | }; 57 | 58 | enum TfFlags 59 | { 60 | TF_BASE_DATA_OFFSET = 0x000001, /* base-data-offset-present */ 61 | TF_SAMPLE_DESCRIPTION_INDEX = 0x000002, /* sample-description-index-present */ 62 | TF_DEFAULT_SAMPLE_DURATION = 0x000008, /* default-sample-duration-present */ 63 | TF_DEFAULT_SAMPLE_SIZE = 0x000010, /* default-sample-size-present */ 64 | TF_DEFAULT_SAMPLE_FLAGS = 0x000020, /* default-sample-flags-present */ 65 | TF_DURATION_IS_EMPTY = 0x100000 /* duration-is-empty */ 66 | }; 67 | 68 | enum TrFlags 69 | { 70 | TR_DATA_OFFSET = 0x000001, /* data-offset-present */ 71 | TR_FIRST_SAMPLE_FLAGS = 0x000004, /* first-sample-flags-present */ 72 | TR_SAMPLE_DURATION = 0x000100, /* sample-duration-present */ 73 | TR_SAMPLE_SIZE = 0x000200, /* sample-size-present */ 74 | TR_SAMPLE_FLAGS = 0x000400, /* sample-flags-present */ 75 | TR_COMPOSITION_TIME_OFFSETS = 0x000800 /* sample-composition-time-offsets-presents */ 76 | }; 77 | 78 | const QtNodeType *qtdemux_type_get (guint32 fourcc); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __GST_QTDEMUX_TYPES_H__ */ 83 | -------------------------------------------------------------------------------- /src/libde265-dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer HEVC/H.265 video codec. 3 | * 4 | * Copyright (c) 2014 struktur AG, Joachim Bauch 5 | * 6 | * This file is part of gstreamer-libde265. 7 | * 8 | * libde265 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as 10 | * published by the Free Software Foundation, either version 3 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * libde265 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with libde265. If not, see . 20 | */ 21 | 22 | #ifndef __GST_LIBDE265_DEC_H__ 23 | #define __GST_LIBDE265_DEC_H__ 24 | 25 | #ifdef HAVE_CONFIG_H 26 | #include 27 | #endif 28 | 29 | #include 30 | #if GST_CHECK_VERSION(1,0,0) 31 | #include 32 | 33 | #define VIDEO_DECODER_BASE GstVideoDecoder 34 | #define VIDEO_DECODER_CLASS GstVideoDecoderClass 35 | #define VIDEO_DECODER_TYPE GST_TYPE_VIDEO_DECODER 36 | #define VIDEO_DECODER_GET_CLASS GST_VIDEO_DECODER_CLASS 37 | #define VIDEO_FRAME GstVideoCodecFrame 38 | #define VIDEO_STATE GstVideoCodecState 39 | #define NEED_DATA_RESULT GST_VIDEO_DECODER_FLOW_NEED_DATA 40 | #define GET_FRAME gst_video_decoder_get_frame 41 | #define HAVE_FRAME gst_video_decoder_have_frame 42 | #define FINISH_FRAME gst_video_decoder_finish_frame 43 | #define ALLOC_OUTPUT_FRAME gst_video_decoder_allocate_output_frame 44 | #define FRAME_PTS(frame) ((frame)->pts) 45 | #else 46 | #include 47 | 48 | #define VIDEO_DECODER_BASE GstBaseVideoDecoder 49 | #define VIDEO_DECODER_CLASS GstBaseVideoDecoderClass 50 | #define VIDEO_DECODER_TYPE GST_TYPE_BASE_VIDEO_DECODER 51 | #define VIDEO_DECODER_GET_CLASS GST_BASE_VIDEO_DECODER_CLASS 52 | #define VIDEO_FRAME GstVideoFrame 53 | #define VIDEO_STATE GstVideoState 54 | #define NEED_DATA_RESULT GST_BASE_VIDEO_DECODER_FLOW_NEED_DATA 55 | #define GET_FRAME gst_base_video_decoder_get_frame 56 | #define HAVE_FRAME gst_base_video_decoder_have_frame 57 | #define FINISH_FRAME gst_base_video_decoder_finish_frame 58 | #define ALLOC_OUTPUT_FRAME gst_base_video_decoder_alloc_src_frame 59 | #define FRAME_PTS(frame) ((frame)->presentation_timestamp) 60 | #endif 61 | 62 | #include 63 | 64 | G_BEGIN_DECLS 65 | 66 | #define GST_TYPE_LIBDE265_DEC \ 67 | (gst_libde265_dec_get_type()) 68 | #define GST_LIBDE265_DEC(obj) \ 69 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LIBDE265_DEC,GstLibde265Dec)) 70 | #define GST_LIBDE265_DEC_CLASS(klass) \ 71 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_LIBDE265_DEC,GstLibde265DecClass)) 72 | 73 | 74 | typedef enum { 75 | GST_TYPE_LIBDE265_DEC_PACKETIZED, 76 | GST_TYPE_LIBDE265_DEC_RAW 77 | } GstLibde265DecMode; 78 | 79 | typedef struct _GstLibde265Dec { 80 | VIDEO_DECODER_BASE parent; 81 | 82 | /* private */ 83 | de265_decoder_context *ctx; 84 | int width; 85 | int height; 86 | GstLibde265DecMode mode; 87 | int length_size; 88 | int fps_n; 89 | int fps_d; 90 | int max_threads; 91 | int buffer_full; 92 | void *codec_data; 93 | int codec_data_size; 94 | #if GST_CHECK_VERSION(1,0,0) 95 | int frame_number; 96 | GstVideoCodecState *input_state; 97 | GstVideoCodecState *output_state; 98 | #endif 99 | } GstLibde265Dec; 100 | 101 | typedef struct _GstLibde265DecClass { 102 | VIDEO_DECODER_CLASS parent; 103 | } GstLibde265DecClass; 104 | 105 | G_END_DECLS 106 | 107 | gboolean gst_libde265_dec_plugin_init (GstPlugin *plugin); 108 | 109 | #endif // __GST_LIBDE265_DEC_H__ 110 | -------------------------------------------------------------------------------- /src/matroska/0.10/README.txt: -------------------------------------------------------------------------------- 1 | Based on 5af6f5bfb6c3619a9ccc3b1681579aeb90e8b89a in branch "0.10" from 2 | http://cgit.freedesktop.org/gstreamer/gst-plugins-good/ 3 | -------------------------------------------------------------------------------- /src/matroska/0.10/ebml-ids.h: -------------------------------------------------------------------------------- 1 | /* GStreamer EBML I/O 2 | * (c) 2003 Ronald Bultje 3 | * 4 | * ebml-ids.h: definition of EBML data IDs 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef __GST_EBML_IDS_H__ 23 | #define __GST_EBML_IDS_H__ 24 | 25 | G_BEGIN_DECLS 26 | 27 | /* EBML version supported */ 28 | #define GST_EBML_VERSION 1 29 | 30 | /* Unknown size (all bits set to 1) */ 31 | #define GST_EBML_SIZE_UNKNOWN G_GINT64_CONSTANT(0x00ffffffffffffff) 32 | 33 | /* top-level master-IDs */ 34 | #define GST_EBML_ID_HEADER 0x1A45DFA3 35 | 36 | /* IDs in the HEADER master */ 37 | #define GST_EBML_ID_EBMLVERSION 0x4286 38 | #define GST_EBML_ID_EBMLREADVERSION 0x42F7 39 | #define GST_EBML_ID_EBMLMAXIDLENGTH 0x42F2 40 | #define GST_EBML_ID_EBMLMAXSIZELENGTH 0x42F3 41 | #define GST_EBML_ID_DOCTYPE 0x4282 42 | #define GST_EBML_ID_DOCTYPEVERSION 0x4287 43 | #define GST_EBML_ID_DOCTYPEREADVERSION 0x4285 44 | 45 | /* general EBML types */ 46 | #define GST_EBML_ID_VOID 0xEC 47 | #define GST_EBML_ID_CRC32 0xBF 48 | 49 | /* EbmlDate offset from the unix epoch in seconds, 2001/01/01 00:00:00 UTC */ 50 | #define GST_EBML_DATE_OFFSET 978307200 51 | 52 | G_END_DECLS 53 | 54 | #endif /* __GST_EBML_IDS_H__ */ 55 | -------------------------------------------------------------------------------- /src/matroska/0.10/lzo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LZO 1x decompression 3 | * copyright (c) 2006 Reimar Doeffinger 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef FFMPEG_LZO_H 23 | #define FFMPEG_LZO_H 24 | 25 | #define LZO_INPUT_DEPLETED 1 26 | #define LZO_OUTPUT_FULL 2 27 | #define LZO_INVALID_BACKPTR 4 28 | #define LZO_ERROR 8 29 | 30 | #define LZO_INPUT_PADDING 8 31 | #define LZO_OUTPUT_PADDING 12 32 | 33 | int lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); 34 | 35 | #endif /* FFMPEG_LZO_H */ 36 | -------------------------------------------------------------------------------- /src/matroska/0.10/matroska-demux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2011 Debarshi Ray 4 | * 5 | * matroska-demux.h: matroska file/stream demuxer definition 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_DEMUX_H__ 24 | #define __GST_MATROSKA_DEMUX_H__ 25 | 26 | #include 27 | 28 | #include "ebml-read.h" 29 | #include "matroska-ids.h" 30 | #include "matroska-read-common.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_DEMUX \ 35 | (gst_matroska_demux_get_type ()) 36 | #define GST_MATROSKA_DEMUX(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxH265)) 38 | #define GST_MATROSKA_DEMUX_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxH265Class)) 40 | #define GST_IS_MATROSKA_DEMUX(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_DEMUX)) 42 | #define GST_IS_MATROSKA_DEMUX_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_DEMUX)) 44 | 45 | typedef struct _GstMatroskaDemuxH265 { 46 | GstElement parent; 47 | 48 | /* < private > */ 49 | 50 | GstMatroskaReadCommon common; 51 | 52 | /* pads */ 53 | GstClock *clock; 54 | guint num_v_streams; 55 | guint num_a_streams; 56 | guint num_t_streams; 57 | 58 | /* state */ 59 | gboolean streaming; 60 | guint level_up; 61 | guint64 seek_block; 62 | gboolean seek_first; 63 | 64 | /* did we parse cues/tracks/segmentinfo already? */ 65 | gboolean tracks_parsed; 66 | GList *seek_parsed; 67 | 68 | /* cluster positions (optional) */ 69 | GArray *clusters; 70 | 71 | /* keeping track of playback position */ 72 | gboolean segment_running; 73 | GstClockTime last_stop_end; 74 | GstClockTime stream_start_time; 75 | 76 | /* Stop time for reverse playback */ 77 | GstClockTime to_time; 78 | GstEvent *close_segment; 79 | GstEvent *new_segment; 80 | 81 | /* some state saving */ 82 | GstClockTime cluster_time; 83 | guint64 cluster_offset; 84 | guint64 first_cluster_offset; 85 | guint64 next_cluster_offset; 86 | GstClockTime requested_seek_time; 87 | guint64 seek_offset; 88 | 89 | /* index stuff */ 90 | gboolean seekable; 91 | gboolean building_index; 92 | guint64 index_offset; 93 | GstEvent *seek_event; 94 | gboolean need_newsegment; 95 | 96 | /* reverse playback */ 97 | GArray *seek_index; 98 | gint seek_entry; 99 | 100 | /* gap handling */ 101 | guint64 max_gap_time; 102 | 103 | /* for non-finalized files, with invalid segment duration */ 104 | gboolean invalid_duration; 105 | } GstMatroskaDemuxH265; 106 | 107 | typedef struct _GstMatroskaDemuxH265Class { 108 | GstElementClass parent; 109 | } GstMatroskaDemuxH265Class; 110 | 111 | gboolean gst_matroska_demux_plugin_init (GstPlugin *plugin); 112 | 113 | G_END_DECLS 114 | 115 | #endif /* __GST_MATROSKA_DEMUX_H__ */ 116 | -------------------------------------------------------------------------------- /src/matroska/0.10/matroska-ids.c: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (C) 2003 Ronald Bultje 3 | * (C) 2006 Tim-Philipp Müller 4 | * 5 | * matroska-ids.c: matroska track context utility functions 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include "config.h" 25 | #endif 26 | 27 | #include "matroska-ids.h" 28 | 29 | gboolean 30 | gst_matroska_track_init_video_context (GstMatroskaTrackContext ** p_context) 31 | { 32 | GstMatroskaTrackVideoContext *video_context; 33 | 34 | g_assert (p_context != NULL && *p_context != NULL); 35 | 36 | /* already set up? (track info might come before track type) */ 37 | if ((*p_context)->type == GST_MATROSKA_TRACK_TYPE_VIDEO) { 38 | GST_LOG ("video context already set up"); 39 | return TRUE; 40 | } 41 | 42 | /* it better not have been set up as some other track type ... */ 43 | if ((*p_context)->type != 0) { 44 | g_return_val_if_reached (FALSE); 45 | } 46 | 47 | video_context = g_renew (GstMatroskaTrackVideoContext, *p_context, 1); 48 | *p_context = (GstMatroskaTrackContext *) video_context; 49 | 50 | /* defaults */ 51 | (*p_context)->type = GST_MATROSKA_TRACK_TYPE_VIDEO; 52 | video_context->display_width = 0; 53 | video_context->display_height = 0; 54 | video_context->pixel_width = 0; 55 | video_context->pixel_height = 0; 56 | video_context->asr_mode = 0; 57 | video_context->fourcc = 0; 58 | video_context->default_fps = 0.0; 59 | video_context->earliest_time = GST_CLOCK_TIME_NONE; 60 | return TRUE; 61 | } 62 | 63 | gboolean 64 | gst_matroska_track_init_audio_context (GstMatroskaTrackContext ** p_context) 65 | { 66 | GstMatroskaTrackAudioContext *audio_context; 67 | 68 | g_assert (p_context != NULL && *p_context != NULL); 69 | 70 | /* already set up? (track info might come before track type) */ 71 | if ((*p_context)->type == GST_MATROSKA_TRACK_TYPE_AUDIO) 72 | return TRUE; 73 | 74 | /* it better not have been set up as some other track type ... */ 75 | if ((*p_context)->type != 0) { 76 | g_return_val_if_reached (FALSE); 77 | } 78 | 79 | audio_context = g_renew (GstMatroskaTrackAudioContext, *p_context, 1); 80 | *p_context = (GstMatroskaTrackContext *) audio_context; 81 | 82 | /* defaults */ 83 | (*p_context)->type = GST_MATROSKA_TRACK_TYPE_AUDIO; 84 | audio_context->channels = 1; 85 | audio_context->samplerate = 8000; 86 | return TRUE; 87 | } 88 | 89 | gboolean 90 | gst_matroska_track_init_subtitle_context (GstMatroskaTrackContext ** p_context) 91 | { 92 | GstMatroskaTrackSubtitleContext *subtitle_context; 93 | 94 | g_assert (p_context != NULL && *p_context != NULL); 95 | 96 | /* already set up? (track info might come before track type) */ 97 | if ((*p_context)->type == GST_MATROSKA_TRACK_TYPE_SUBTITLE) 98 | return TRUE; 99 | 100 | /* it better not have been set up as some other track type ... */ 101 | if ((*p_context)->type != 0) { 102 | g_return_val_if_reached (FALSE); 103 | } 104 | 105 | subtitle_context = g_renew (GstMatroskaTrackSubtitleContext, *p_context, 1); 106 | *p_context = (GstMatroskaTrackContext *) subtitle_context; 107 | 108 | (*p_context)->type = GST_MATROSKA_TRACK_TYPE_SUBTITLE; 109 | subtitle_context->invalid_utf8 = FALSE; 110 | subtitle_context->seen_markup_tag = FALSE; 111 | return TRUE; 112 | } 113 | 114 | void 115 | gst_matroska_register_tags (void) 116 | { 117 | /* TODO: register other custom tags */ 118 | } 119 | -------------------------------------------------------------------------------- /src/matroska/0.10/matroska-mux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2005 Michal Benes 4 | * 5 | * matroska-mux.h: matroska file/stream muxer object types 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_MUX_H__ 24 | #define __GST_MATROSKA_MUX_H__ 25 | 26 | #include 27 | #include 28 | 29 | #include "ebml-write.h" 30 | #include "matroska-ids.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_MUX \ 35 | (gst_matroska_mux_get_type ()) 36 | #define GST_MATROSKA_MUX(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_MUX, GstMatroskaMux)) 38 | #define GST_MATROSKA_MUX_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_MUX, GstMatroskaMuxClass)) 40 | #define GST_IS_MATROSKA_MUX(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_MUX)) 42 | #define GST_IS_MATROSKA_MUX_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_MUX)) 44 | 45 | typedef enum { 46 | GST_MATROSKA_MUX_STATE_START, 47 | GST_MATROSKA_MUX_STATE_HEADER, 48 | GST_MATROSKA_MUX_STATE_DATA, 49 | } GstMatroskaMuxState; 50 | 51 | typedef struct _GstMatroskaMetaSeekIndex { 52 | guint32 id; 53 | guint64 pos; 54 | } GstMatroskaMetaSeekIndex; 55 | 56 | /* all information needed for one matroska stream */ 57 | typedef struct 58 | { 59 | GstCollectData2 collect; /* we extend the CollectData */ 60 | GstMatroskaTrackContext *track; 61 | 62 | guint64 duration; 63 | GstClockTime start_ts; 64 | GstClockTime end_ts; /* last timestamp + (if available) duration */ 65 | guint64 default_duration_scaled; 66 | } 67 | GstMatroskaPad; 68 | 69 | 70 | typedef struct _GstMatroskaMux { 71 | GstElement element; 72 | 73 | /* < private > */ 74 | 75 | /* pads */ 76 | GstPad *srcpad; 77 | GstCollectPads2 *collect; 78 | GstEbmlWrite *ebml_write; 79 | 80 | guint num_streams, 81 | num_v_streams, num_a_streams, num_t_streams; 82 | 83 | /* Application name (for the writing application header element) */ 84 | gchar *writing_app; 85 | 86 | /* EBML DocType. */ 87 | const gchar *doctype; 88 | 89 | /* DocType version. */ 90 | guint doctype_version; 91 | 92 | /* state */ 93 | GstMatroskaMuxState state; 94 | 95 | /* a cue (index) table */ 96 | GstMatroskaIndex *index; 97 | guint num_indexes; 98 | GstClockTimeDiff min_index_interval; 99 | gboolean streamable; 100 | 101 | /* timescale in the file */ 102 | guint64 time_scale; 103 | /* based on timescale, limit of nanoseconds you can have in a cluster */ 104 | guint64 max_cluster_duration; 105 | 106 | /* length, position (time, ns) */ 107 | guint64 duration; 108 | 109 | /* byte-positions of master-elements (for replacing contents) */ 110 | guint64 segment_pos, 111 | seekhead_pos, 112 | cues_pos, 113 | tags_pos, 114 | info_pos, 115 | tracks_pos, 116 | duration_pos, 117 | meta_pos; 118 | guint64 segment_master; 119 | 120 | /* current cluster */ 121 | guint64 cluster, 122 | cluster_time, 123 | cluster_pos, 124 | prev_cluster_size; 125 | 126 | /* GstForceKeyUnit event */ 127 | GstEvent *force_key_unit_event; 128 | 129 | } GstMatroskaMux; 130 | 131 | typedef struct _GstMatroskaMuxClass { 132 | GstElementClass parent; 133 | } GstMatroskaMuxClass; 134 | 135 | GType gst_matroska_mux_get_type (void); 136 | 137 | G_END_DECLS 138 | 139 | #endif /* __GST_MATROSKA_MUX_H__ */ 140 | -------------------------------------------------------------------------------- /src/matroska/0.10/matroska-parse.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2011 Debarshi Ray 4 | * 5 | * matroska-parse.h: matroska file/stream parseer definition 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_PARSE_H__ 24 | #define __GST_MATROSKA_PARSE_H__ 25 | 26 | #include 27 | 28 | #include "ebml-read.h" 29 | #include "matroska-ids.h" 30 | #include "matroska-read-common.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_PARSE \ 35 | (gst_matroska_parse_get_type ()) 36 | #define GST_MATROSKA_PARSE(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_PARSE, GstMatroskaParseH265)) 38 | #define GST_MATROSKA_PARSE_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_PARSE, GstMatroskaParseH265Class)) 40 | #define GST_IS_MATROSKA_PARSE(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_PARSE)) 42 | #define GST_IS_MATROSKA_PARSE_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_PARSE)) 44 | 45 | typedef struct _GstMatroskaParseH265 { 46 | GstElement parent; 47 | 48 | /* < private > */ 49 | 50 | GstMatroskaReadCommon common; 51 | 52 | /* pads */ 53 | GstPad *srcpad; 54 | GstClock *clock; 55 | guint num_v_streams; 56 | guint num_a_streams; 57 | guint num_t_streams; 58 | 59 | GstBuffer *streamheader; 60 | gboolean pushed_headers; 61 | GstClockTime last_timestamp; 62 | 63 | /* state */ 64 | //gboolean streaming; 65 | guint level_up; 66 | guint64 seek_block; 67 | gboolean seek_first; 68 | 69 | /* did we parse cues/tracks/segmentinfo already? */ 70 | gboolean tracks_parsed; 71 | GList *seek_parsed; 72 | 73 | /* keeping track of playback position */ 74 | gboolean segment_running; 75 | GstClockTime last_stop_end; 76 | 77 | GstEvent *close_segment; 78 | GstEvent *new_segment; 79 | 80 | /* some state saving */ 81 | GstClockTime cluster_time; 82 | guint64 cluster_offset; 83 | guint64 first_cluster_offset; 84 | guint64 next_cluster_offset; 85 | 86 | /* index stuff */ 87 | gboolean seekable; 88 | gboolean building_index; 89 | guint64 index_offset; 90 | GstEvent *seek_event; 91 | gboolean need_newsegment; 92 | 93 | /* reverse playback */ 94 | GArray *seek_index; 95 | gint seek_entry; 96 | } GstMatroskaParseH265; 97 | 98 | typedef struct _GstMatroskaParseH265Class { 99 | GstElementClass parent; 100 | } GstMatroskaParseH265Class; 101 | 102 | gboolean gst_matroska_parse_plugin_init (GstPlugin *plugin); 103 | 104 | G_END_DECLS 105 | 106 | #endif /* __GST_MATROSKA_PARSE_H__ */ 107 | -------------------------------------------------------------------------------- /src/matroska/0.10/matroska.c: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * 4 | * matroska.c: plugin loader 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #include "matroska-demux.h" 27 | #include "matroska-parse.h" 28 | #include "matroska-read-common.h" 29 | #include "matroska-mux.h" 30 | #include "matroska-ids.h" 31 | #include "webm-mux.h" 32 | 33 | #include 34 | 35 | static gboolean 36 | plugin_init (GstPlugin * plugin) 37 | { 38 | gboolean ret; 39 | 40 | gst_pb_utils_init (); 41 | 42 | gst_matroska_register_tags (); 43 | 44 | GST_DEBUG_CATEGORY_INIT (matroskareadcommon_debug, "matroskareadcommon", 0, 45 | "Matroska demuxer/parser shared debug"); 46 | 47 | ret = gst_matroska_demux_plugin_init (plugin); 48 | ret &= gst_matroska_parse_plugin_init (plugin); 49 | ret &= gst_element_register (plugin, "matroskamux", GST_RANK_PRIMARY, 50 | GST_TYPE_MATROSKA_MUX); 51 | ret &= gst_element_register (plugin, "webmmux", GST_RANK_PRIMARY, 52 | GST_TYPE_WEBM_MUX); 53 | 54 | return ret; 55 | } 56 | 57 | GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, 58 | GST_VERSION_MINOR, 59 | "matroska", 60 | "Matroska and WebM stream handling", 61 | plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) 62 | -------------------------------------------------------------------------------- /src/matroska/0.10/webm-mux.c: -------------------------------------------------------------------------------- 1 | /* GStreamer WebM muxer 2 | * Copyright (c) 2010 Sebastian Dröge 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /** 21 | * SECTION:element-webmmux 22 | * 23 | * webmmux muxes VP8 video and Vorbis audio streams into a WebM file. 24 | * 25 | * 26 | * Example launch line 27 | * |[ 28 | * gst-launch-0.10 webmmux name=mux ! filesink location=newfile.webm \ 29 | * uridecodebin uri=file:///path/to/somefile.ogv name=demux \ 30 | * demux. ! ffmpegcolorspace ! vp8enc ! queue ! mux.video_0 \ 31 | * demux. ! progressreport ! audioconvert ! audiorate ! vorbisenc ! queue ! mux.audio_0 32 | * ]| This pipeline re-encodes a video file of any format into a WebM file. 33 | * |[ 34 | * gst-launch-0.10 webmmux name=mux ! filesink location=test.webm \ 35 | * videotestsrc num-buffers=250 ! video/x-raw-yuv,framerate=25/1 ! ffmpegcolorspace ! vp8enc ! queue ! mux.video_0 \ 36 | * audiotestsrc samplesperbuffer=44100 num-buffers=10 ! audio/x-raw-float,rate=44100 ! vorbisenc ! queue ! mux.audio_0 37 | * ]| This pipeline muxes a test video and a sine wave into a WebM file. 38 | * 39 | */ 40 | 41 | #ifdef HAVE_CONFIG_H 42 | #include "config.h" 43 | #endif 44 | 45 | #include "webm-mux.h" 46 | 47 | #define COMMON_VIDEO_CAPS \ 48 | "width = (int) [ 16, 4096 ], " \ 49 | "height = (int) [ 16, 4096 ], " \ 50 | "framerate = (fraction) [ 0, MAX ]" 51 | 52 | #define COMMON_AUDIO_CAPS \ 53 | "channels = (int) [ 1, MAX ], " \ 54 | "rate = (int) [ 1, MAX ]" 55 | 56 | GST_BOILERPLATE (GstWebMMux, gst_webm_mux, GstMatroskaMux, 57 | GST_TYPE_MATROSKA_MUX); 58 | 59 | static GstStaticPadTemplate webm_src_templ = GST_STATIC_PAD_TEMPLATE ("src", 60 | GST_PAD_SRC, 61 | GST_PAD_ALWAYS, 62 | GST_STATIC_CAPS ("video/webm") 63 | ); 64 | 65 | static GstStaticPadTemplate webm_videosink_templ = 66 | GST_STATIC_PAD_TEMPLATE ("video_%d", 67 | GST_PAD_SINK, 68 | GST_PAD_REQUEST, 69 | GST_STATIC_CAPS ("video/x-vp8, " COMMON_VIDEO_CAPS) 70 | ); 71 | 72 | static GstStaticPadTemplate webm_audiosink_templ = 73 | GST_STATIC_PAD_TEMPLATE ("audio_%d", 74 | GST_PAD_SINK, 75 | GST_PAD_REQUEST, 76 | GST_STATIC_CAPS ("audio/x-vorbis, " COMMON_AUDIO_CAPS) 77 | ); 78 | 79 | static void 80 | gst_webm_mux_base_init (gpointer g_class) 81 | { 82 | } 83 | 84 | static void 85 | gst_webm_mux_class_init (GstWebMMuxClass * klass) 86 | { 87 | GstElementClass *gstelement_class = (GstElementClass *) klass; 88 | 89 | gst_element_class_add_static_pad_template (gstelement_class, 90 | &webm_videosink_templ); 91 | gst_element_class_add_static_pad_template (gstelement_class, 92 | &webm_audiosink_templ); 93 | gst_element_class_add_static_pad_template (gstelement_class, &webm_src_templ); 94 | gst_element_class_set_details_simple (gstelement_class, "WebM muxer", 95 | "Codec/Muxer", 96 | "Muxes video and audio streams into a WebM stream", 97 | "GStreamer maintainers "); 98 | } 99 | 100 | static void 101 | gst_webm_mux_init (GstWebMMux * mux, GstWebMMuxClass * g_class) 102 | { 103 | GST_MATROSKA_MUX (mux)->doctype = GST_MATROSKA_DOCTYPE_WEBM; 104 | } 105 | -------------------------------------------------------------------------------- /src/matroska/0.10/webm-mux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer WebM muxer 2 | * Copyright (c) 2010 Sebastian Dröge 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __GST_WEBM_MUX_H__ 21 | #define __GST_WEBM_MUX_H__ 22 | 23 | #include "matroska-mux.h" 24 | 25 | #define GST_TYPE_WEBM_MUX \ 26 | (gst_webm_mux_get_type ()) 27 | #define GST_WEBM_MUX(obj) \ 28 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WEBM_MUX, GstWebMMux)) 29 | #define GST_WEBM_MUX_CLASS(klass) \ 30 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WEBM_MUX, GstWebMMuxClass)) 31 | #define GST_IS_WEBM_MUX(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WEBM_MUX)) 33 | #define GST_IS_WEBM_MUX_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WEBM_MUX)) 35 | 36 | typedef struct _GstWebMMux GstWebMMux; 37 | typedef struct _GstWebMMuxClass GstWebMMuxClass; 38 | 39 | struct _GstWebMMux { 40 | GstMatroskaMux matroskamux; 41 | }; 42 | 43 | struct _GstWebMMuxClass { 44 | GstMatroskaMuxClass matroskamuxclass; 45 | }; 46 | 47 | GType gst_webm_mux_get_type (void); 48 | 49 | #endif /* __GST_WEBM_MUX_H__ */ 50 | -------------------------------------------------------------------------------- /src/matroska/1.0/README.txt: -------------------------------------------------------------------------------- 1 | Based on 643d425f51f81b56deec16c01162637546708ee5 in branch "1.0" from 2 | http://cgit.freedesktop.org/gstreamer/gst-plugins-good/ 3 | -------------------------------------------------------------------------------- /src/matroska/1.0/ebml-ids.h: -------------------------------------------------------------------------------- 1 | /* GStreamer EBML I/O 2 | * (c) 2003 Ronald Bultje 3 | * 4 | * ebml-ids.h: definition of EBML data IDs 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef __GST_EBML_IDS_H__ 23 | #define __GST_EBML_IDS_H__ 24 | 25 | G_BEGIN_DECLS 26 | 27 | /* EBML version supported */ 28 | #define GST_EBML_VERSION 1 29 | 30 | /* Unknown size (all bits set to 1) */ 31 | #define GST_EBML_SIZE_UNKNOWN G_GINT64_CONSTANT(0x00ffffffffffffff) 32 | 33 | /* top-level master-IDs */ 34 | #define GST_EBML_ID_HEADER 0x1A45DFA3 35 | 36 | /* IDs in the HEADER master */ 37 | #define GST_EBML_ID_EBMLVERSION 0x4286 38 | #define GST_EBML_ID_EBMLREADVERSION 0x42F7 39 | #define GST_EBML_ID_EBMLMAXIDLENGTH 0x42F2 40 | #define GST_EBML_ID_EBMLMAXSIZELENGTH 0x42F3 41 | #define GST_EBML_ID_DOCTYPE 0x4282 42 | #define GST_EBML_ID_DOCTYPEVERSION 0x4287 43 | #define GST_EBML_ID_DOCTYPEREADVERSION 0x4285 44 | 45 | /* general EBML types */ 46 | #define GST_EBML_ID_VOID 0xEC 47 | #define GST_EBML_ID_CRC32 0xBF 48 | 49 | /* EbmlDate offset from the unix epoch in seconds, 2001/01/01 00:00:00 UTC */ 50 | #define GST_EBML_DATE_OFFSET 978307200 51 | 52 | G_END_DECLS 53 | 54 | #endif /* __GST_EBML_IDS_H__ */ 55 | -------------------------------------------------------------------------------- /src/matroska/1.0/lzo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LZO 1x decompression 3 | * copyright (c) 2006 Reimar Doeffinger 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef FFMPEG_LZO_H 23 | #define FFMPEG_LZO_H 24 | 25 | #define LZO_INPUT_DEPLETED 1 26 | #define LZO_OUTPUT_FULL 2 27 | #define LZO_INVALID_BACKPTR 4 28 | #define LZO_ERROR 8 29 | 30 | #define LZO_INPUT_PADDING 8 31 | #define LZO_OUTPUT_PADDING 12 32 | 33 | int lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); 34 | 35 | #endif /* FFMPEG_LZO_H */ 36 | -------------------------------------------------------------------------------- /src/matroska/1.0/matroska-demux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2011 Debarshi Ray 4 | * 5 | * matroska-demux.h: matroska file/stream demuxer definition 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_DEMUX_H__ 24 | #define __GST_MATROSKA_DEMUX_H__ 25 | 26 | #include 27 | 28 | #include "ebml-read.h" 29 | #include "matroska-ids.h" 30 | #include "matroska-read-common.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_DEMUX \ 35 | (gst_matroska_demux_get_type ()) 36 | #define GST_MATROSKA_DEMUX(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxH265)) 38 | #define GST_MATROSKA_DEMUX_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxH265Class)) 40 | #define GST_IS_MATROSKA_DEMUX(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_DEMUX)) 42 | #define GST_IS_MATROSKA_DEMUX_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_DEMUX)) 44 | 45 | typedef struct _GstMatroskaDemuxH265 { 46 | GstElement parent; 47 | 48 | /* < private > */ 49 | 50 | GstMatroskaReadCommon common; 51 | 52 | /* pads */ 53 | GstClock *clock; 54 | guint num_v_streams; 55 | guint num_a_streams; 56 | guint num_t_streams; 57 | 58 | /* state */ 59 | gboolean streaming; 60 | guint level_up; 61 | guint64 seek_block; 62 | gboolean seek_first; 63 | 64 | /* did we parse cues/tracks/segmentinfo already? */ 65 | gboolean tracks_parsed; 66 | GList *seek_parsed; 67 | 68 | /* cluster positions (optional) */ 69 | GArray *clusters; 70 | 71 | /* keeping track of playback position */ 72 | GstClockTime last_stop_end; 73 | GstClockTime stream_start_time; 74 | 75 | /* Stop time for reverse playback */ 76 | GstClockTime to_time; 77 | GstEvent *new_segment; 78 | 79 | /* some state saving */ 80 | GstClockTime cluster_time; 81 | guint64 cluster_offset; 82 | guint64 first_cluster_offset; 83 | guint64 next_cluster_offset; 84 | GstClockTime requested_seek_time; 85 | guint64 seek_offset; 86 | 87 | /* index stuff */ 88 | gboolean seekable; 89 | gboolean building_index; 90 | guint64 index_offset; 91 | GstEvent *seek_event; 92 | gboolean need_segment; 93 | 94 | /* reverse playback */ 95 | GArray *seek_index; 96 | gint seek_entry; 97 | 98 | /* gap handling */ 99 | guint64 max_gap_time; 100 | 101 | /* for non-finalized files, with invalid segment duration */ 102 | gboolean invalid_duration; 103 | } GstMatroskaDemuxH265; 104 | 105 | typedef struct _GstMatroskaDemuxH265Class { 106 | GstElementClass parent; 107 | } GstMatroskaDemuxH265Class; 108 | 109 | gboolean gst_matroska_demux_plugin_init (GstPlugin *plugin); 110 | 111 | G_END_DECLS 112 | 113 | #endif /* __GST_MATROSKA_DEMUX_H__ */ 114 | -------------------------------------------------------------------------------- /src/matroska/1.0/matroska-ids.c: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (C) 2003 Ronald Bultje 3 | * (C) 2006 Tim-Philipp Müller 4 | * 5 | * matroska-ids.c: matroska track context utility functions 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include "config.h" 25 | #endif 26 | 27 | #include "matroska-ids.h" 28 | 29 | gboolean 30 | gst_matroska_track_init_video_context (GstMatroskaTrackContext ** p_context) 31 | { 32 | GstMatroskaTrackVideoContext *video_context; 33 | 34 | g_assert (p_context != NULL && *p_context != NULL); 35 | 36 | /* already set up? (track info might come before track type) */ 37 | if ((*p_context)->type == GST_MATROSKA_TRACK_TYPE_VIDEO) { 38 | GST_LOG ("video context already set up"); 39 | return TRUE; 40 | } 41 | 42 | /* it better not have been set up as some other track type ... */ 43 | if ((*p_context)->type != 0) { 44 | g_return_val_if_reached (FALSE); 45 | } 46 | 47 | video_context = g_renew (GstMatroskaTrackVideoContext, *p_context, 1); 48 | *p_context = (GstMatroskaTrackContext *) video_context; 49 | 50 | /* defaults */ 51 | (*p_context)->type = GST_MATROSKA_TRACK_TYPE_VIDEO; 52 | video_context->display_width = 0; 53 | video_context->display_height = 0; 54 | video_context->pixel_width = 0; 55 | video_context->pixel_height = 0; 56 | video_context->asr_mode = 0; 57 | video_context->fourcc = 0; 58 | video_context->default_fps = 0.0; 59 | video_context->earliest_time = GST_CLOCK_TIME_NONE; 60 | return TRUE; 61 | } 62 | 63 | gboolean 64 | gst_matroska_track_init_audio_context (GstMatroskaTrackContext ** p_context) 65 | { 66 | GstMatroskaTrackAudioContext *audio_context; 67 | 68 | g_assert (p_context != NULL && *p_context != NULL); 69 | 70 | /* already set up? (track info might come before track type) */ 71 | if ((*p_context)->type == GST_MATROSKA_TRACK_TYPE_AUDIO) 72 | return TRUE; 73 | 74 | /* it better not have been set up as some other track type ... */ 75 | if ((*p_context)->type != 0) { 76 | g_return_val_if_reached (FALSE); 77 | } 78 | 79 | audio_context = g_renew (GstMatroskaTrackAudioContext, *p_context, 1); 80 | *p_context = (GstMatroskaTrackContext *) audio_context; 81 | 82 | /* defaults */ 83 | (*p_context)->type = GST_MATROSKA_TRACK_TYPE_AUDIO; 84 | audio_context->channels = 1; 85 | audio_context->samplerate = 8000; 86 | return TRUE; 87 | } 88 | 89 | gboolean 90 | gst_matroska_track_init_subtitle_context (GstMatroskaTrackContext ** p_context) 91 | { 92 | GstMatroskaTrackSubtitleContext *subtitle_context; 93 | 94 | g_assert (p_context != NULL && *p_context != NULL); 95 | 96 | /* already set up? (track info might come before track type) */ 97 | if ((*p_context)->type == GST_MATROSKA_TRACK_TYPE_SUBTITLE) 98 | return TRUE; 99 | 100 | /* it better not have been set up as some other track type ... */ 101 | if ((*p_context)->type != 0) { 102 | g_return_val_if_reached (FALSE); 103 | } 104 | 105 | subtitle_context = g_renew (GstMatroskaTrackSubtitleContext, *p_context, 1); 106 | *p_context = (GstMatroskaTrackContext *) subtitle_context; 107 | 108 | (*p_context)->type = GST_MATROSKA_TRACK_TYPE_SUBTITLE; 109 | subtitle_context->invalid_utf8 = FALSE; 110 | subtitle_context->seen_markup_tag = FALSE; 111 | return TRUE; 112 | } 113 | 114 | void 115 | gst_matroska_register_tags (void) 116 | { 117 | /* TODO: register other custom tags */ 118 | } 119 | -------------------------------------------------------------------------------- /src/matroska/1.0/matroska-mux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2005 Michal Benes 4 | * 5 | * matroska-mux.h: matroska file/stream muxer object types 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_MUX_H__ 24 | #define __GST_MATROSKA_MUX_H__ 25 | 26 | #include 27 | #include 28 | 29 | #include "ebml-write.h" 30 | #include "matroska-ids.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_MUX \ 35 | (gst_matroska_mux_get_type ()) 36 | #define GST_MATROSKA_MUX(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_MUX, GstMatroskaMux)) 38 | #define GST_MATROSKA_MUX_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_MUX, GstMatroskaMuxClass)) 40 | #define GST_IS_MATROSKA_MUX(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_MUX)) 42 | #define GST_IS_MATROSKA_MUX_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_MUX)) 44 | 45 | typedef enum { 46 | GST_MATROSKA_MUX_STATE_START, 47 | GST_MATROSKA_MUX_STATE_HEADER, 48 | GST_MATROSKA_MUX_STATE_DATA, 49 | } GstMatroskaMuxState; 50 | 51 | typedef struct _GstMatroskaMetaSeekIndex { 52 | guint32 id; 53 | guint64 pos; 54 | } GstMatroskaMetaSeekIndex; 55 | 56 | typedef gboolean (*GstMatroskaCapsFunc) (GstPad *pad, GstCaps *caps); 57 | 58 | /* all information needed for one matroska stream */ 59 | typedef struct 60 | { 61 | GstCollectData collect; /* we extend the CollectData */ 62 | GstMatroskaCapsFunc capsfunc; 63 | GstMatroskaTrackContext *track; 64 | 65 | guint64 duration; 66 | GstClockTime start_ts; 67 | GstClockTime end_ts; /* last timestamp + (if available) duration */ 68 | guint64 default_duration_scaled; 69 | } 70 | GstMatroskaPad; 71 | 72 | 73 | typedef struct _GstMatroskaMux { 74 | GstElement element; 75 | 76 | /* < private > */ 77 | 78 | /* pads */ 79 | GstPad *srcpad; 80 | GstCollectPads *collect; 81 | GstEbmlWrite *ebml_write; 82 | 83 | guint num_streams, 84 | num_v_streams, num_a_streams, num_t_streams; 85 | 86 | /* Application name (for the writing application header element) */ 87 | gchar *writing_app; 88 | 89 | /* EBML DocType. */ 90 | const gchar *doctype; 91 | 92 | /* DocType version. */ 93 | guint doctype_version; 94 | 95 | /* state */ 96 | GstMatroskaMuxState state; 97 | 98 | /* a cue (index) table */ 99 | GstMatroskaIndex *index; 100 | guint num_indexes; 101 | GstClockTimeDiff min_index_interval; 102 | gboolean streamable; 103 | 104 | /* timescale in the file */ 105 | guint64 time_scale; 106 | /* based on timescale, limit of nanoseconds you can have in a cluster */ 107 | guint64 max_cluster_duration; 108 | 109 | /* length, position (time, ns) */ 110 | guint64 duration; 111 | 112 | /* byte-positions of master-elements (for replacing contents) */ 113 | guint64 segment_pos, 114 | seekhead_pos, 115 | cues_pos, 116 | chapters_pos, 117 | tags_pos, 118 | info_pos, 119 | tracks_pos, 120 | duration_pos, 121 | meta_pos; 122 | guint64 segment_master; 123 | 124 | /* current cluster */ 125 | guint64 cluster, 126 | cluster_time, 127 | cluster_pos, 128 | prev_cluster_size; 129 | 130 | /* GstForceKeyUnit event */ 131 | GstEvent *force_key_unit_event; 132 | } GstMatroskaMux; 133 | 134 | typedef struct _GstMatroskaMuxClass { 135 | GstElementClass parent; 136 | } GstMatroskaMuxClass; 137 | 138 | GType gst_matroska_mux_get_type (void); 139 | 140 | G_END_DECLS 141 | 142 | #endif /* __GST_MATROSKA_MUX_H__ */ 143 | -------------------------------------------------------------------------------- /src/matroska/1.0/matroska-parse.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2011 Debarshi Ray 4 | * 5 | * matroska-parse.h: matroska file/stream parseer definition 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_PARSE_H__ 24 | #define __GST_MATROSKA_PARSE_H__ 25 | 26 | #include 27 | 28 | #include "ebml-read.h" 29 | #include "matroska-ids.h" 30 | #include "matroska-read-common.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_PARSE \ 35 | (gst_matroska_parse_get_type ()) 36 | #define GST_MATROSKA_PARSE(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_PARSE, GstMatroskaParseH265)) 38 | #define GST_MATROSKA_PARSE_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_PARSE, GstMatroskaParseH265Class)) 40 | #define GST_IS_MATROSKA_PARSE(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_PARSE)) 42 | #define GST_IS_MATROSKA_PARSE_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_PARSE)) 44 | 45 | typedef struct _GstMatroskaParseH265 { 46 | GstElement parent; 47 | 48 | /* < private > */ 49 | 50 | GstMatroskaReadCommon common; 51 | 52 | /* pads */ 53 | GstPad *srcpad; 54 | GstClock *clock; 55 | guint num_v_streams; 56 | guint num_a_streams; 57 | guint num_t_streams; 58 | 59 | GstBuffer *streamheader; 60 | gboolean pushed_headers; 61 | GstClockTime last_timestamp; 62 | 63 | /* state */ 64 | //gboolean streaming; 65 | guint level_up; 66 | guint64 seek_block; 67 | gboolean seek_first; 68 | 69 | /* did we parse cues/tracks/segmentinfo already? */ 70 | gboolean tracks_parsed; 71 | GList *seek_parsed; 72 | 73 | /* keeping track of playback position */ 74 | gboolean segment_running; 75 | GstClockTime last_stop_end; 76 | 77 | GstEvent *close_segment; 78 | GstEvent *new_segment; 79 | 80 | /* some state saving */ 81 | GstClockTime cluster_time; 82 | guint64 cluster_offset; 83 | guint64 first_cluster_offset; 84 | guint64 next_cluster_offset; 85 | 86 | /* index stuff */ 87 | gboolean seekable; 88 | gboolean building_index; 89 | guint64 index_offset; 90 | GstEvent *seek_event; 91 | gboolean need_newsegment; 92 | 93 | /* reverse playback */ 94 | GArray *seek_index; 95 | gint seek_entry; 96 | } GstMatroskaParseH265; 97 | 98 | typedef struct _GstMatroskaParseH265Class { 99 | GstElementClass parent; 100 | } GstMatroskaParseH265Class; 101 | 102 | gboolean gst_matroska_parse_plugin_init (GstPlugin *plugin); 103 | 104 | G_END_DECLS 105 | 106 | #endif /* __GST_MATROSKA_PARSE_H__ */ 107 | -------------------------------------------------------------------------------- /src/matroska/1.0/matroska.c: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * 4 | * matroska.c: plugin loader 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #include "matroska-demux.h" 27 | #include "matroska-parse.h" 28 | #include "matroska-read-common.h" 29 | #include "matroska-mux.h" 30 | #include "matroska-ids.h" 31 | #include "webm-mux.h" 32 | 33 | #include 34 | 35 | static gboolean 36 | plugin_init (GstPlugin * plugin) 37 | { 38 | gboolean ret; 39 | 40 | gst_pb_utils_init (); 41 | 42 | gst_matroska_register_tags (); 43 | 44 | GST_DEBUG_CATEGORY_INIT (matroskareadcommon_debug, "matroskareadcommon", 0, 45 | "Matroska demuxer/parser shared debug"); 46 | 47 | ret = gst_matroska_demux_plugin_init (plugin); 48 | ret &= gst_matroska_parse_plugin_init (plugin); 49 | ret &= gst_element_register (plugin, "matroskamux", GST_RANK_PRIMARY, 50 | GST_TYPE_MATROSKA_MUX); 51 | ret &= gst_element_register (plugin, "webmmux", GST_RANK_PRIMARY, 52 | GST_TYPE_WEBM_MUX); 53 | 54 | return ret; 55 | } 56 | 57 | GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, 58 | GST_VERSION_MINOR, 59 | matroska, 60 | "Matroska and WebM stream handling", 61 | plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) 62 | -------------------------------------------------------------------------------- /src/matroska/1.0/webm-mux.c: -------------------------------------------------------------------------------- 1 | /* GStreamer WebM muxer 2 | * Copyright (c) 2010 Sebastian Dröge 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /** 21 | * SECTION:element-webmmux 22 | * 23 | * webmmux muxes VP8 video and Vorbis audio streams into a WebM file. 24 | * 25 | * 26 | * Example launch line 27 | * |[ 28 | * gst-launch-0.10 webmmux name=mux ! filesink location=newfile.webm \ 29 | * uridecodebin uri=file:///path/to/somefile.ogv name=demux \ 30 | * demux. ! videoconvert ! vp8enc ! queue ! mux.video_0 \ 31 | * demux. ! progressreport ! audioconvert ! audiorate ! vorbisenc ! queue ! mux.audio_0 32 | * ]| This pipeline re-encodes a video file of any format into a WebM file. 33 | * |[ 34 | * gst-launch-0.10 webmmux name=mux ! filesink location=test.webm \ 35 | * videotestsrc num-buffers=250 ! video/x-raw,framerate=25/1 ! videoconvert ! vp8enc ! queue ! mux.video_0 \ 36 | * audiotestsrc samplesperbuffer=44100 num-buffers=10 ! audio/x-raw,rate=44100 ! vorbisenc ! queue ! mux.audio_0 37 | * ]| This pipeline muxes a test video and a sine wave into a WebM file. 38 | * 39 | */ 40 | 41 | #ifdef HAVE_CONFIG_H 42 | #include "config.h" 43 | #endif 44 | 45 | #include "webm-mux.h" 46 | 47 | #define COMMON_VIDEO_CAPS \ 48 | "width = (int) [ 16, 4096 ], " \ 49 | "height = (int) [ 16, 4096 ], " \ 50 | "framerate = (fraction) [ 0, MAX ]" 51 | 52 | #define COMMON_AUDIO_CAPS \ 53 | "channels = (int) [ 1, MAX ], " \ 54 | "rate = (int) [ 1, MAX ]" 55 | 56 | G_DEFINE_TYPE (GstWebMMux, gst_webm_mux, GST_TYPE_MATROSKA_MUX); 57 | 58 | static GstStaticPadTemplate webm_src_templ = GST_STATIC_PAD_TEMPLATE ("src", 59 | GST_PAD_SRC, 60 | GST_PAD_ALWAYS, 61 | GST_STATIC_CAPS ("video/webm; audio/webm") 62 | ); 63 | 64 | static GstStaticPadTemplate webm_videosink_templ = 65 | GST_STATIC_PAD_TEMPLATE ("video_%u", 66 | GST_PAD_SINK, 67 | GST_PAD_REQUEST, 68 | GST_STATIC_CAPS ("video/x-vp8, " COMMON_VIDEO_CAPS) 69 | ); 70 | 71 | static GstStaticPadTemplate webm_audiosink_templ = 72 | GST_STATIC_PAD_TEMPLATE ("audio_%u", 73 | GST_PAD_SINK, 74 | GST_PAD_REQUEST, 75 | GST_STATIC_CAPS ("audio/x-vorbis, " COMMON_AUDIO_CAPS) 76 | ); 77 | 78 | static void 79 | gst_webm_mux_class_init (GstWebMMuxClass * klass) 80 | { 81 | GstElementClass *gstelement_class = (GstElementClass *) klass; 82 | 83 | gst_element_class_add_pad_template (gstelement_class, 84 | gst_static_pad_template_get (&webm_videosink_templ)); 85 | gst_element_class_add_pad_template (gstelement_class, 86 | gst_static_pad_template_get (&webm_audiosink_templ)); 87 | gst_element_class_add_pad_template (gstelement_class, 88 | gst_static_pad_template_get (&webm_src_templ)); 89 | gst_element_class_set_static_metadata (gstelement_class, "WebM muxer", 90 | "Codec/Muxer", 91 | "Muxes video and audio streams into a WebM stream", 92 | "GStreamer maintainers "); 93 | } 94 | 95 | static void 96 | gst_webm_mux_init (GstWebMMux * mux) 97 | { 98 | GST_MATROSKA_MUX (mux)->doctype = GST_MATROSKA_DOCTYPE_WEBM; 99 | } 100 | -------------------------------------------------------------------------------- /src/matroska/1.0/webm-mux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer WebM muxer 2 | * Copyright (c) 2010 Sebastian Dröge 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __GST_WEBM_MUX_H__ 21 | #define __GST_WEBM_MUX_H__ 22 | 23 | #include "matroska-mux.h" 24 | 25 | #define GST_TYPE_WEBM_MUX \ 26 | (gst_webm_mux_get_type ()) 27 | #define GST_WEBM_MUX(obj) \ 28 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WEBM_MUX, GstWebMMux)) 29 | #define GST_WEBM_MUX_CLASS(klass) \ 30 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WEBM_MUX, GstWebMMuxClass)) 31 | #define GST_IS_WEBM_MUX(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WEBM_MUX)) 33 | #define GST_IS_WEBM_MUX_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WEBM_MUX)) 35 | 36 | typedef struct _GstWebMMux GstWebMMux; 37 | typedef struct _GstWebMMuxClass GstWebMMuxClass; 38 | 39 | struct _GstWebMMux { 40 | GstMatroskaMux matroskamux; 41 | }; 42 | 43 | struct _GstWebMMuxClass { 44 | GstMatroskaMuxClass matroskamuxclass; 45 | }; 46 | 47 | GType gst_webm_mux_get_type (void); 48 | 49 | #endif /* __GST_WEBM_MUX_H__ */ 50 | -------------------------------------------------------------------------------- /src/matroska/1.2/README.txt: -------------------------------------------------------------------------------- 1 | Based on c4a7ae648e496e67f5f7da299658a1c10f28c65a in branch "1.2" from 2 | http://cgit.freedesktop.org/gstreamer/gst-plugins-good/ 3 | -------------------------------------------------------------------------------- /src/matroska/1.2/ebml-ids.h: -------------------------------------------------------------------------------- 1 | /* GStreamer EBML I/O 2 | * (c) 2003 Ronald Bultje 3 | * 4 | * ebml-ids.h: definition of EBML data IDs 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef __GST_EBML_IDS_H__ 23 | #define __GST_EBML_IDS_H__ 24 | 25 | G_BEGIN_DECLS 26 | 27 | /* EBML version supported */ 28 | #define GST_EBML_VERSION 1 29 | 30 | /* Unknown size (all bits set to 1) */ 31 | #define GST_EBML_SIZE_UNKNOWN G_GINT64_CONSTANT(0x00ffffffffffffff) 32 | 33 | /* top-level master-IDs */ 34 | #define GST_EBML_ID_HEADER 0x1A45DFA3 35 | 36 | /* IDs in the HEADER master */ 37 | #define GST_EBML_ID_EBMLVERSION 0x4286 38 | #define GST_EBML_ID_EBMLREADVERSION 0x42F7 39 | #define GST_EBML_ID_EBMLMAXIDLENGTH 0x42F2 40 | #define GST_EBML_ID_EBMLMAXSIZELENGTH 0x42F3 41 | #define GST_EBML_ID_DOCTYPE 0x4282 42 | #define GST_EBML_ID_DOCTYPEVERSION 0x4287 43 | #define GST_EBML_ID_DOCTYPEREADVERSION 0x4285 44 | 45 | /* general EBML types */ 46 | #define GST_EBML_ID_VOID 0xEC 47 | #define GST_EBML_ID_CRC32 0xBF 48 | 49 | /* EbmlDate offset from the unix epoch in seconds, 2001/01/01 00:00:00 UTC */ 50 | #define GST_EBML_DATE_OFFSET 978307200 51 | 52 | G_END_DECLS 53 | 54 | #endif /* __GST_EBML_IDS_H__ */ 55 | -------------------------------------------------------------------------------- /src/matroska/1.2/lzo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LZO 1x decompression 3 | * copyright (c) 2006 Reimar Doeffinger 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef FFMPEG_LZO_H 23 | #define FFMPEG_LZO_H 24 | 25 | #define LZO_INPUT_DEPLETED 1 26 | #define LZO_OUTPUT_FULL 2 27 | #define LZO_INVALID_BACKPTR 4 28 | #define LZO_ERROR 8 29 | 30 | #define LZO_INPUT_PADDING 8 31 | #define LZO_OUTPUT_PADDING 12 32 | 33 | int lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); 34 | 35 | #endif /* FFMPEG_LZO_H */ 36 | -------------------------------------------------------------------------------- /src/matroska/1.2/matroska-demux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2011 Debarshi Ray 4 | * 5 | * matroska-demux.h: matroska file/stream demuxer definition 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_DEMUX_H__ 24 | #define __GST_MATROSKA_DEMUX_H__ 25 | 26 | #include 27 | 28 | #include "ebml-read.h" 29 | #include "matroska-ids.h" 30 | #include "matroska-read-common.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_DEMUX \ 35 | (gst_matroska_demux_get_type ()) 36 | #define GST_MATROSKA_DEMUX(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxH265)) 38 | #define GST_MATROSKA_DEMUX_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxH265Class)) 40 | #define GST_IS_MATROSKA_DEMUX(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_DEMUX)) 42 | #define GST_IS_MATROSKA_DEMUX_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_DEMUX)) 44 | 45 | typedef struct _GstMatroskaDemuxH265 { 46 | GstElement parent; 47 | 48 | /* < private > */ 49 | 50 | GstMatroskaReadCommon common; 51 | 52 | /* pads */ 53 | GstClock *clock; 54 | guint num_v_streams; 55 | guint num_a_streams; 56 | guint num_t_streams; 57 | 58 | guint group_id; 59 | gboolean have_group_id; 60 | 61 | /* state */ 62 | gboolean streaming; 63 | guint level_up; 64 | guint64 seek_block; 65 | gboolean seek_first; 66 | 67 | /* did we parse cues/tracks/segmentinfo already? */ 68 | gboolean tracks_parsed; 69 | GList *seek_parsed; 70 | 71 | /* cluster positions (optional) */ 72 | GArray *clusters; 73 | 74 | /* keeping track of playback position */ 75 | GstClockTime last_stop_end; 76 | GstClockTime stream_start_time; 77 | 78 | /* Stop time for reverse playback */ 79 | GstClockTime to_time; 80 | GstEvent *new_segment; 81 | 82 | /* some state saving */ 83 | GstClockTime cluster_time; 84 | guint64 cluster_offset; 85 | guint64 first_cluster_offset; 86 | guint64 next_cluster_offset; 87 | GstClockTime requested_seek_time; 88 | guint64 seek_offset; 89 | 90 | /* index stuff */ 91 | gboolean seekable; 92 | gboolean building_index; 93 | guint64 index_offset; 94 | GstEvent *seek_event; 95 | gboolean need_segment; 96 | guint32 segment_seqnum; 97 | 98 | /* reverse playback */ 99 | GArray *seek_index; 100 | gint seek_entry; 101 | 102 | /* gap handling */ 103 | guint64 max_gap_time; 104 | 105 | /* for non-finalized files, with invalid segment duration */ 106 | gboolean invalid_duration; 107 | } GstMatroskaDemuxH265; 108 | 109 | typedef struct _GstMatroskaDemuxH265Class { 110 | GstElementClass parent; 111 | } GstMatroskaDemuxH265Class; 112 | 113 | gboolean gst_matroska_demux_plugin_init (GstPlugin *plugin); 114 | 115 | G_END_DECLS 116 | 117 | #endif /* __GST_MATROSKA_DEMUX_H__ */ 118 | -------------------------------------------------------------------------------- /src/matroska/1.2/matroska-mux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2005 Michal Benes 4 | * 5 | * matroska-mux.h: matroska file/stream muxer object types 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_MUX_H__ 24 | #define __GST_MATROSKA_MUX_H__ 25 | 26 | #include 27 | #include 28 | 29 | #include "ebml-write.h" 30 | #include "matroska-ids.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_MUX \ 35 | (gst_matroska_mux_get_type ()) 36 | #define GST_MATROSKA_MUX(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_MUX, GstMatroskaMux)) 38 | #define GST_MATROSKA_MUX_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_MUX, GstMatroskaMuxClass)) 40 | #define GST_IS_MATROSKA_MUX(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_MUX)) 42 | #define GST_IS_MATROSKA_MUX_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_MUX)) 44 | 45 | typedef enum { 46 | GST_MATROSKA_MUX_STATE_START, 47 | GST_MATROSKA_MUX_STATE_HEADER, 48 | GST_MATROSKA_MUX_STATE_DATA, 49 | } GstMatroskaMuxState; 50 | 51 | typedef struct _GstMatroskaMetaSeekIndex { 52 | guint32 id; 53 | guint64 pos; 54 | } GstMatroskaMetaSeekIndex; 55 | 56 | typedef gboolean (*GstMatroskaCapsFunc) (GstPad *pad, GstCaps *caps); 57 | 58 | /* all information needed for one matroska stream */ 59 | typedef struct 60 | { 61 | GstCollectData collect; /* we extend the CollectData */ 62 | GstMatroskaCapsFunc capsfunc; 63 | GstMatroskaTrackContext *track; 64 | 65 | guint64 duration; 66 | GstClockTime start_ts; 67 | GstClockTime end_ts; /* last timestamp + (if available) duration */ 68 | guint64 default_duration_scaled; 69 | } 70 | GstMatroskaPad; 71 | 72 | 73 | typedef struct _GstMatroskaMux { 74 | GstElement element; 75 | 76 | /* < private > */ 77 | 78 | /* pads */ 79 | GstPad *srcpad; 80 | GstCollectPads *collect; 81 | GstEbmlWrite *ebml_write; 82 | 83 | guint num_streams, 84 | num_v_streams, num_a_streams, num_t_streams; 85 | 86 | /* Application name (for the writing application header element) */ 87 | gchar *writing_app; 88 | 89 | /* EBML DocType. */ 90 | const gchar *doctype; 91 | 92 | /* DocType version. */ 93 | guint doctype_version; 94 | 95 | /* state */ 96 | GstMatroskaMuxState state; 97 | 98 | /* a cue (index) table */ 99 | GstMatroskaIndex *index; 100 | guint num_indexes; 101 | GstClockTimeDiff min_index_interval; 102 | gboolean streamable; 103 | 104 | /* timescale in the file */ 105 | guint64 time_scale; 106 | /* based on timescale, limit of nanoseconds you can have in a cluster */ 107 | guint64 max_cluster_duration; 108 | 109 | /* length, position (time, ns) */ 110 | guint64 duration; 111 | 112 | /* byte-positions of master-elements (for replacing contents) */ 113 | guint64 segment_pos, 114 | seekhead_pos, 115 | cues_pos, 116 | chapters_pos, 117 | tags_pos, 118 | info_pos, 119 | tracks_pos, 120 | duration_pos, 121 | meta_pos; 122 | guint64 segment_master; 123 | 124 | /* current cluster */ 125 | guint64 cluster, 126 | cluster_time, 127 | cluster_pos, 128 | prev_cluster_size; 129 | 130 | /* GstForceKeyUnit event */ 131 | GstEvent *force_key_unit_event; 132 | } GstMatroskaMux; 133 | 134 | typedef struct _GstMatroskaMuxClass { 135 | GstElementClass parent; 136 | } GstMatroskaMuxClass; 137 | 138 | GType gst_matroska_mux_get_type (void); 139 | 140 | G_END_DECLS 141 | 142 | #endif /* __GST_MATROSKA_MUX_H__ */ 143 | -------------------------------------------------------------------------------- /src/matroska/1.2/matroska-parse.h: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * (c) 2011 Debarshi Ray 4 | * 5 | * matroska-parse.h: matroska file/stream parseer definition 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef __GST_MATROSKA_PARSE_H__ 24 | #define __GST_MATROSKA_PARSE_H__ 25 | 26 | #include 27 | 28 | #include "ebml-read.h" 29 | #include "matroska-ids.h" 30 | #include "matroska-read-common.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_MATROSKA_PARSE \ 35 | (gst_matroska_parse_get_type ()) 36 | #define GST_MATROSKA_PARSE(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_PARSE, GstMatroskaParseH265)) 38 | #define GST_MATROSKA_PARSE_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_PARSE, GstMatroskaParseH265Class)) 40 | #define GST_IS_MATROSKA_PARSE(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_PARSE)) 42 | #define GST_IS_MATROSKA_PARSE_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_PARSE)) 44 | 45 | typedef struct _GstMatroskaParseH265 { 46 | GstElement parent; 47 | 48 | /* < private > */ 49 | 50 | GstMatroskaReadCommon common; 51 | 52 | /* pads */ 53 | GstPad *srcpad; 54 | GstClock *clock; 55 | guint num_v_streams; 56 | guint num_a_streams; 57 | guint num_t_streams; 58 | 59 | GstBuffer *streamheader; 60 | gboolean pushed_headers; 61 | GstClockTime last_timestamp; 62 | 63 | /* state */ 64 | //gboolean streaming; 65 | guint level_up; 66 | guint64 seek_block; 67 | gboolean seek_first; 68 | 69 | /* did we parse cues/tracks/segmentinfo already? */ 70 | gboolean tracks_parsed; 71 | GList *seek_parsed; 72 | 73 | /* keeping track of playback position */ 74 | gboolean segment_running; 75 | GstClockTime last_stop_end; 76 | 77 | GstEvent *close_segment; 78 | GstEvent *new_segment; 79 | 80 | /* some state saving */ 81 | GstClockTime cluster_time; 82 | guint64 cluster_offset; 83 | guint64 first_cluster_offset; 84 | guint64 next_cluster_offset; 85 | 86 | /* index stuff */ 87 | gboolean seekable; 88 | gboolean building_index; 89 | guint64 index_offset; 90 | GstEvent *seek_event; 91 | gboolean need_newsegment; 92 | 93 | /* reverse playback */ 94 | GArray *seek_index; 95 | gint seek_entry; 96 | } GstMatroskaParseH265; 97 | 98 | typedef struct _GstMatroskaParseH265Class { 99 | GstElementClass parent; 100 | } GstMatroskaParseH265Class; 101 | 102 | gboolean gst_matroska_parse_plugin_init (GstPlugin *plugin); 103 | 104 | G_END_DECLS 105 | 106 | #endif /* __GST_MATROSKA_PARSE_H__ */ 107 | -------------------------------------------------------------------------------- /src/matroska/1.2/matroska.c: -------------------------------------------------------------------------------- 1 | /* GStreamer Matroska muxer/demuxer 2 | * (c) 2003 Ronald Bultje 3 | * 4 | * matroska.c: plugin loader 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif 25 | 26 | #include "matroska-demux.h" 27 | #include "matroska-parse.h" 28 | #include "matroska-read-common.h" 29 | #include "matroska-mux.h" 30 | #include "matroska-ids.h" 31 | #include "webm-mux.h" 32 | 33 | #include 34 | 35 | static gboolean 36 | plugin_init (GstPlugin * plugin) 37 | { 38 | gboolean ret; 39 | 40 | gst_pb_utils_init (); 41 | 42 | gst_matroska_register_tags (); 43 | 44 | GST_DEBUG_CATEGORY_INIT (matroskareadcommon_debug, "matroskareadcommon", 0, 45 | "Matroska demuxer/parser shared debug"); 46 | 47 | ret = gst_matroska_demux_plugin_init (plugin); 48 | ret &= gst_matroska_parse_plugin_init (plugin); 49 | ret &= gst_element_register (plugin, "matroskamux", GST_RANK_PRIMARY, 50 | GST_TYPE_MATROSKA_MUX); 51 | ret &= gst_element_register (plugin, "webmmux", GST_RANK_PRIMARY, 52 | GST_TYPE_WEBM_MUX); 53 | 54 | return ret; 55 | } 56 | 57 | GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, 58 | GST_VERSION_MINOR, 59 | matroska, 60 | "Matroska and WebM stream handling", 61 | plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) 62 | -------------------------------------------------------------------------------- /src/matroska/1.2/webm-mux.c: -------------------------------------------------------------------------------- 1 | /* GStreamer WebM muxer 2 | * Copyright (c) 2010 Sebastian Dröge 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /** 21 | * SECTION:element-webmmux 22 | * 23 | * webmmux muxes VP8 video and Vorbis audio streams into a WebM file. 24 | * 25 | * 26 | * Example launch line 27 | * |[ 28 | * gst-launch-0.10 webmmux name=mux ! filesink location=newfile.webm \ 29 | * uridecodebin uri=file:///path/to/somefile.ogv name=demux \ 30 | * demux. ! videoconvert ! vp8enc ! queue ! mux.video_0 \ 31 | * demux. ! progressreport ! audioconvert ! audiorate ! vorbisenc ! queue ! mux.audio_0 32 | * ]| This pipeline re-encodes a video file of any format into a WebM file. 33 | * |[ 34 | * gst-launch-0.10 webmmux name=mux ! filesink location=test.webm \ 35 | * videotestsrc num-buffers=250 ! video/x-raw,framerate=25/1 ! videoconvert ! vp8enc ! queue ! mux.video_0 \ 36 | * audiotestsrc samplesperbuffer=44100 num-buffers=10 ! audio/x-raw,rate=44100 ! vorbisenc ! queue ! mux.audio_0 37 | * ]| This pipeline muxes a test video and a sine wave into a WebM file. 38 | * 39 | */ 40 | 41 | #ifdef HAVE_CONFIG_H 42 | #include "config.h" 43 | #endif 44 | 45 | #include "webm-mux.h" 46 | 47 | #define COMMON_VIDEO_CAPS \ 48 | "width = (int) [ 16, 4096 ], " \ 49 | "height = (int) [ 16, 4096 ], " \ 50 | "framerate = (fraction) [ 0, MAX ]" 51 | 52 | #define COMMON_AUDIO_CAPS \ 53 | "channels = (int) [ 1, MAX ], " \ 54 | "rate = (int) [ 1, MAX ]" 55 | 56 | G_DEFINE_TYPE (GstWebMMux, gst_webm_mux, GST_TYPE_MATROSKA_MUX); 57 | 58 | static GstStaticPadTemplate webm_src_templ = GST_STATIC_PAD_TEMPLATE ("src", 59 | GST_PAD_SRC, 60 | GST_PAD_ALWAYS, 61 | GST_STATIC_CAPS ("video/webm; audio/webm") 62 | ); 63 | 64 | static GstStaticPadTemplate webm_videosink_templ = 65 | GST_STATIC_PAD_TEMPLATE ("video_%u", 66 | GST_PAD_SINK, 67 | GST_PAD_REQUEST, 68 | GST_STATIC_CAPS ("video/x-vp8, " COMMON_VIDEO_CAPS ";" 69 | "video/x-vp9, " COMMON_VIDEO_CAPS) 70 | ); 71 | 72 | static GstStaticPadTemplate webm_audiosink_templ = 73 | GST_STATIC_PAD_TEMPLATE ("audio_%u", 74 | GST_PAD_SINK, 75 | GST_PAD_REQUEST, 76 | GST_STATIC_CAPS ("audio/x-vorbis, " COMMON_AUDIO_CAPS) 77 | ); 78 | 79 | static void 80 | gst_webm_mux_class_init (GstWebMMuxClass * klass) 81 | { 82 | GstElementClass *gstelement_class = (GstElementClass *) klass; 83 | 84 | gst_element_class_add_pad_template (gstelement_class, 85 | gst_static_pad_template_get (&webm_videosink_templ)); 86 | gst_element_class_add_pad_template (gstelement_class, 87 | gst_static_pad_template_get (&webm_audiosink_templ)); 88 | gst_element_class_add_pad_template (gstelement_class, 89 | gst_static_pad_template_get (&webm_src_templ)); 90 | gst_element_class_set_static_metadata (gstelement_class, "WebM muxer", 91 | "Codec/Muxer", 92 | "Muxes video and audio streams into a WebM stream", 93 | "GStreamer maintainers "); 94 | } 95 | 96 | static void 97 | gst_webm_mux_init (GstWebMMux * mux) 98 | { 99 | GST_MATROSKA_MUX (mux)->doctype = GST_MATROSKA_DOCTYPE_WEBM; 100 | } 101 | -------------------------------------------------------------------------------- /src/matroska/1.2/webm-mux.h: -------------------------------------------------------------------------------- 1 | /* GStreamer WebM muxer 2 | * Copyright (c) 2010 Sebastian Dröge 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __GST_WEBM_MUX_H__ 21 | #define __GST_WEBM_MUX_H__ 22 | 23 | #include "matroska-mux.h" 24 | 25 | #define GST_TYPE_WEBM_MUX \ 26 | (gst_webm_mux_get_type ()) 27 | #define GST_WEBM_MUX(obj) \ 28 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WEBM_MUX, GstWebMMux)) 29 | #define GST_WEBM_MUX_CLASS(klass) \ 30 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WEBM_MUX, GstWebMMuxClass)) 31 | #define GST_IS_WEBM_MUX(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WEBM_MUX)) 33 | #define GST_IS_WEBM_MUX_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WEBM_MUX)) 35 | 36 | typedef struct _GstWebMMux GstWebMMux; 37 | typedef struct _GstWebMMuxClass GstWebMMuxClass; 38 | 39 | struct _GstWebMMux { 40 | GstMatroskaMux matroskamux; 41 | }; 42 | 43 | struct _GstWebMMuxClass { 44 | GstMatroskaMuxClass matroskamuxclass; 45 | }; 46 | 47 | GType gst_webm_mux_get_type (void); 48 | 49 | #endif /* __GST_WEBM_MUX_H__ */ 50 | --------------------------------------------------------------------------------