summaryrefslogtreecommitdiff
path: root/gst/qtmux/atoms.c
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2009-01-28 13:25:14 +0100
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2009-01-28 13:34:44 +0100
commit6bbce931bc57f372e99e25acf56b06e446679863 (patch)
treeeec334074da715b411cab922bfa510afe6723204 /gst/qtmux/atoms.c
parentb34204a54b901eddc700a7a039cce46d10f8f18c (diff)
downloadgstreamer-plugins-bad-6bbce931bc57f372e99e25acf56b06e446679863.tar.gz
Additional media type support in qtmux (and friends).
Support AMR and H263 for both qtmux and gppmux, and add extensions in sample table description.
Diffstat (limited to 'gst/qtmux/atoms.c')
-rw-r--r--gst/qtmux/atoms.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/gst/qtmux/atoms.c b/gst/qtmux/atoms.c
index cbe66f622..df6958e04 100644
--- a/gst/qtmux/atoms.c
+++ b/gst/qtmux/atoms.c
@@ -2972,3 +2972,55 @@ build_codec_data_extension (guint32 fourcc, const GstBuffer * codec_data)
return result;
}
+
+AtomInfo *
+build_amr_extension ()
+{
+ guint8 ext[9];
+ GstBuffer *buf;
+ AtomInfo *res;
+
+ buf = gst_buffer_new ();
+ GST_BUFFER_DATA (buf) = ext;
+ GST_BUFFER_SIZE (buf) = sizeof (ext);
+
+ /* vendor */
+ GST_WRITE_UINT32_LE (ext, 0);
+ /* decoder version */
+ GST_WRITE_UINT8 (ext + 4, 0);
+ /* mode set (all modes) */
+ GST_WRITE_UINT16_BE (ext + 5, 0x81FF);
+ /* mode change period (no restriction) */
+ GST_WRITE_UINT8 (ext + 7, 0);
+ /* frames per sample */
+ GST_WRITE_UINT8 (ext + 8, 1);
+
+ res = build_codec_data_extension (GST_MAKE_FOURCC ('d', 'a', 'm', 'r'), buf);
+ gst_buffer_unref (buf);
+ return res;
+}
+
+AtomInfo *
+build_h263_extension ()
+{
+ guint8 ext[7];
+ GstBuffer *buf;
+ AtomInfo *res;
+
+ buf = gst_buffer_new ();
+ GST_BUFFER_DATA (buf) = ext;
+ GST_BUFFER_SIZE (buf) = sizeof (ext);
+
+ /* vendor */
+ GST_WRITE_UINT32_LE (ext, 0);
+ /* decoder version */
+ GST_WRITE_UINT8 (ext + 4, 0);
+ /* level / profile */
+ /* FIXME ? maybe ? obtain somewhere; baseline for now */
+ GST_WRITE_UINT8 (ext + 5, 10);
+ GST_WRITE_UINT8 (ext + 6, 0);
+
+ res = build_codec_data_extension (GST_MAKE_FOURCC ('d', '2', '6', '3'), buf);
+ gst_buffer_unref (buf);
+ return res;
+}