matroska: fix up plugin and element descriptions a bit
[platform/upstream/gst-plugins-good.git] / gst / matroska / webm-mux.c
1 /* GStreamer WebM muxer
2  * Copyright (c) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
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  * <refsect2>
26  * <title>Example launch line</title>
27  * |[
28  * FIXME: add example pipeline
29  * ]| This pipeline muxes this and that into a WebM file.
30  * |[
31  * FIXME: add example pipeline
32  * ]| This pipeline muxes something else into a WebM file.
33  * </refsect2>
34  */
35
36 #ifdef HAVE_CONFIG_H
37 #include "config.h"
38 #endif
39
40 #include "webm-mux.h"
41
42 #define COMMON_VIDEO_CAPS \
43   "width = (int) [ 16, 4096 ], " \
44   "height = (int) [ 16, 4096 ], " \
45   "framerate = (fraction) [ 0, MAX ]"
46
47 #define COMMON_AUDIO_CAPS \
48   "channels = (int) [ 1, MAX ], " \
49   "rate = (int) [ 1, MAX ]"
50
51 GST_BOILERPLATE (GstWebMMux, gst_webm_mux, GstMatroskaMux,
52     GST_TYPE_MATROSKA_MUX);
53
54 static GstStaticPadTemplate webm_src_templ = GST_STATIC_PAD_TEMPLATE ("src",
55     GST_PAD_SRC,
56     GST_PAD_ALWAYS,
57     GST_STATIC_CAPS ("video/webm")
58     );
59
60 static GstStaticPadTemplate webm_videosink_templ =
61 GST_STATIC_PAD_TEMPLATE ("video_%d",
62     GST_PAD_SINK,
63     GST_PAD_REQUEST,
64     GST_STATIC_CAPS ("video/x-vp8, " COMMON_VIDEO_CAPS)
65     );
66
67 static GstStaticPadTemplate webm_audiosink_templ =
68 GST_STATIC_PAD_TEMPLATE ("audio_%d",
69     GST_PAD_SINK,
70     GST_PAD_REQUEST,
71     GST_STATIC_CAPS ("audio/x-vorbis, " COMMON_AUDIO_CAPS)
72     );
73
74 static void
75 gst_webm_mux_base_init (gpointer g_class)
76 {
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_details_simple (gstelement_class, "WebM muxer",
91       "Codec/Muxer",
92       "Muxes video and audio streams into a WebM stream",
93       "GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>");
94 }
95
96 static void
97 gst_webm_mux_init (GstWebMMux * mux, GstWebMMuxClass * g_class)
98 {
99   GST_MATROSKA_MUX (mux)->doctype = GST_MATROSKA_DOCTYPE_WEBM;
100 }