qtmux: add support for muxing PNG
authorTim-Philipp Müller <tim@centricular.com>
Thu, 15 Jun 2017 22:31:24 +0000 (23:31 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 15 Jun 2017 22:31:24 +0000 (23:31 +0100)
Demuxer already supported it.

gst/isomp4/fourcc.h
gst/isomp4/gstqtmux.c
gst/isomp4/gstqtmuxmap.c
gst/isomp4/qtdemux.c

index d302c97..f9c6335 100644 (file)
@@ -186,6 +186,7 @@ G_BEGIN_DECLS
 #define FOURCC_fiel     GST_MAKE_FOURCC('f','i','e','l')
 #define FOURCC_pcst     GST_MAKE_FOURCC('p','c','s','t')
 #define FOURCC_pgap     GST_MAKE_FOURCC('p','g','a','p')
+#define FOURCC_png      GST_MAKE_FOURCC('p','n','g',' ')
 #define FOURCC_pnot     GST_MAKE_FOURCC('p','n','o','t')
 #define FOURCC_qt__     GST_MAKE_FOURCC('q','t',' ',' ')
 #define FOURCC_qtim     GST_MAKE_FOURCC('q','t','i','m')
index 36d6978..ba5539b 100644 (file)
@@ -5280,6 +5280,9 @@ gst_qt_mux_video_sink_set_caps (GstQTPad * qtpad, GstCaps * caps)
   } else if (strcmp (mimetype, "image/jpeg") == 0) {
     entry.fourcc = FOURCC_jpeg;
     sync = FALSE;
+  } else if (strcmp (mimetype, "image/png") == 0) {
+    entry.fourcc = FOURCC_png;
+    sync = FALSE;
   } else if (strcmp (mimetype, "image/x-j2c") == 0 ||
       strcmp (mimetype, "image/x-jpc") == 0) {
     const gchar *colorspace;
index b8e08e0..33acef9 100644 (file)
@@ -192,6 +192,8 @@ GstQTMuxFormatProp gst_qt_mux_format_list[] = {
             COMMON_VIDEO_CAPS "; "
             "image/jpeg, "
             COMMON_VIDEO_CAPS_NO_FRAMERATE "; "
+            "image/png, "
+            COMMON_VIDEO_CAPS_NO_FRAMERATE "; "
             "video/x-vp8, "
             COMMON_VIDEO_CAPS "; "
             "video/x-dirac, "
index f362ee4..0a41b26 100644 (file)
@@ -13568,7 +13568,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
   GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN;
 
   switch (fourcc) {
-    case GST_MAKE_FOURCC ('p', 'n', 'g', ' '):
+    case FOURCC_png:
       _codec ("PNG still images");
       caps = gst_caps_new_empty_simple ("image/png");
       break;