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;
+}
guint8 stream_type, const GstBuffer * codec_data);
AtomInfo * build_jp2h_extension (AtomTRAK * trak, gint width, gint height,
guint32 fourcc);
+AtomInfo * build_amr_extension ();
+AtomInfo * build_h263_extension ();
/*
entry.sample_size = 16;
entry.samples_per_packet = 160;
entry.bytes_per_sample = 2;
+ ext_atom = build_amr_extension ();
+ } else if (strcmp (mimetype, "audio/AMR-WB") == 0) {
+ entry.fourcc = FOURCC_sawb;
+ entry.sample_size = 16;
+ entry.samples_per_packet = 320;
+ entry.bytes_per_sample = 2;
+ ext_atom = build_amr_extension ();
} else if (strcmp (mimetype, "audio/x-raw-int") == 0) {
gint width;
gint depth;
}
} else if (strcmp (mimetype, "video/x-h263") == 0) {
entry.fourcc = FOURCC_h263;
+ ext_atom = build_h263_extension ();
} else if (strcmp (mimetype, "video/x-divx") == 0 ||
strcmp (mimetype, "video/mpeg") == 0) {
gint version = 0;
"width = (int) [ 16, 4096 ], " \
"height = (int) [ 16, 4096 ] "
+#define H263_CAPS \
+ "video/x-h263, " \
+ COMMON_VIDEO_CAPS
+
#define H264_CAPS \
"video/x-h264, " \
COMMON_VIDEO_CAPS
"mpegversion = (int) 4, " \
COMMON_AUDIO_CAPS (8, MAX)
+#define AMR_CAPS \
+ "audio/AMR, " \
+ "rate = (int) 8000, " \
+ "channels = [ 1, 2 ]; " \
+ "audio/AMR-WB, " \
+ "rate = (int) 16000, " \
+ "channels = [ 1, 2 ] "
GstQTMuxFormatProp gst_qt_mux_format_list[] = {
/* original QuickTime format; see Apple site (e.g. qtff.pdf) */
"video/x-raw-yuv, "
"format = (fourcc) UYVY, "
COMMON_VIDEO_CAPS "; "
- "video/x-h263, "
- "h263version = (string) h263, "
- COMMON_VIDEO_CAPS "; "
MPEG4V_CAPS "; "
+ H263_CAPS "; "
H264_CAPS "; "
"video/x-dv, "
"systemstream = (boolean) false, "
GST_STATIC_CAPS (PCM_CAPS_FULL "; "
MP3_CAPS " ; "
AAC_CAPS " ; "
- "audio/x-alaw, "
- COMMON_AUDIO_CAPS (2, MAX) "; "
- "audio/x-mulaw, " COMMON_AUDIO_CAPS (2, MAX))
+ "audio/x-alaw, " COMMON_AUDIO_CAPS (2, MAX) "; " AMR_CAPS)
}
,
/* ISO 14496-14: mp42 as ISO base media extension
"3GPP",
"GstGPPMux",
GST_STATIC_CAPS ("application/x-3gp"),
- GST_STATIC_CAPS (H264_CAPS),
- GST_STATIC_CAPS ("audio/AMR, "
- COMMON_AUDIO_CAPS (8, MAX) "; " MP3_CAPS "; " AAC_CAPS)
+ GST_STATIC_CAPS (H263_CAPS "; " H264_CAPS),
+ GST_STATIC_CAPS (AMR_CAPS "; " MP3_CAPS "; " AAC_CAPS)
}
,
/* ISO 15444-3: Motion-JPEG-2000 (also ISO base media extension) */