From: Thibault Saunier Date: Wed, 18 Nov 2015 10:01:20 +0000 (+0100) Subject: matroska-mux: Implement prores support X-Git-Tag: 1.10.4~688 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10d1ba1477de6eb7b9deadc72b5c0a24cc8fd5d4;p=platform%2Fupstream%2Fgst-plugins-good.git matroska-mux: Implement prores support https://bugzilla.gnome.org/show_bug.cgi?id=758258 --- diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index 2f2d762..399ba4e 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -130,6 +130,8 @@ static GstStaticPadTemplate videosink_templ = "video/x-raw, " "format = (string) { YUY2, I420, YV12, UYVY, AYUV, GRAY8, BGR, RGB }, " COMMON_VIDEO_CAPS "; " + "video/x-prores, " + COMMON_VIDEO_CAPS "; " "video/x-wmv, " "wmvversion = (int) [ 1, 3 ], " COMMON_VIDEO_CAPS) ); @@ -1249,6 +1251,30 @@ skip_details: context->codec_priv = priv_data; context->codec_priv_size = priv_data_size; } + } else if (strcmp (mimetype, "video/x-prores") == 0) { + const gchar *variant; + + gst_matroska_mux_free_codec_priv (context); + + variant = gst_structure_get_string (structure, "format"); + if (!variant || !g_strcmp0 (variant, "standard")) + context->codec_priv = g_strdup ("apcn"); + else if (!g_strcmp0 (variant, "hq")) + context->codec_priv = g_strdup ("apch"); + else if (!g_strcmp0 (variant, "lt")) + context->codec_priv = g_strdup ("apcs"); + else if (!g_strcmp0 (variant, "proxy")) + context->codec_priv = g_strdup ("apco"); + else if (!g_strcmp0 (variant, "4444")) + context->codec_priv = g_strdup ("ap4h"); + else { + GST_WARNING_OBJECT (mux, "Unhandled prores format: %s", variant); + + goto refuse_caps; + } + + context->codec_priv_size = sizeof (guint32); + gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_VIDEO_PRORES); } return TRUE; @@ -3469,6 +3495,11 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad, buf = gst_matroska_mux_handle_dirac_packet (mux, collect_pad, buf); if (!buf) return GST_FLOW_OK; + } else if (strcmp (collect_pad->track->codec_id, + GST_MATROSKA_CODEC_ID_VIDEO_PRORES) == 0) { + /* Remove the 'Frame container atom' header' */ + buf = gst_buffer_make_writable (buf); + gst_buffer_resize (buf, 8, gst_buffer_get_size (buf) - 8); } buffer_timestamp =