summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudvig Rappe <ludvigr@axis.com>2021-09-02 11:55:09 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-09-07 14:49:52 +0000
commit92338e3d8046e8b7048b988731dc13f709aa0b24 (patch)
treec45e61378e7881226de9c64b5a1ffedcfbc00c66
parentf5cdb2d00240d50dbf7fcb1c6b204bbbd0a8e0c7 (diff)
downloadgstreamer-plugins-base-92338e3d8046e8b7048b988731dc13f709aa0b24.tar.gz
pbutils: Add mjpg to MIME codecs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1270>
-rw-r--r--gst-libs/gst/pbutils/codec-utils.c4
-rw-r--r--tests/check/libs/pbutils.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/gst-libs/gst/pbutils/codec-utils.c b/gst-libs/gst/pbutils/codec-utils.c
index 5d0f5655c..8e06c4a48 100644
--- a/gst-libs/gst/pbutils/codec-utils.c
+++ b/gst-libs/gst/pbutils/codec-utils.c
@@ -2348,6 +2348,8 @@ done:
* Useful for providing the 'codecs' field inside the 'Content-Type' HTTP
* header for containerized formats, such as mp4 or matroska.
*
+ * Registered codecs can be found at http://mp4ra.org/#/codecs
+ *
* Returns: (transfer full): a RFC 6381 compatible codec string or %NULL
*
* Since: 1.20
@@ -2410,6 +2412,8 @@ gst_codec_utils_caps_get_mime_codec (GstCaps * caps)
* available in the mime codec for vp9. This is documented in
* https://www.webmproject.org/vp9/mp4/ */
mime_codec = g_strdup ("vp09");
+ } else if (g_strcmp0 (media_type, "image/jpeg") == 0) {
+ mime_codec = g_strdup ("mjpg");
} else if (g_strcmp0 (media_type, "audio/mpeg") == 0) {
guint8 audio_object_type = 0;
if (aac_caps_structure_get_audio_object_type (caps_st, &audio_object_type)) {
diff --git a/tests/check/libs/pbutils.c b/tests/check/libs/pbutils.c
index e43c5b679..e90f6b44d 100644
--- a/tests/check/libs/pbutils.c
+++ b/tests/check/libs/pbutils.c
@@ -1406,6 +1406,13 @@ GST_START_TEST (test_pb_utils_caps_get_mime_codec)
g_free (mime_codec);
gst_caps_unref (caps);
+ /* mjpeg */
+ caps = gst_caps_new_empty_simple ("image/jpeg");
+ mime_codec = gst_codec_utils_caps_get_mime_codec (caps);
+ fail_unless_equals_string (mime_codec, "mjpg");
+ g_free (mime_codec);
+ gst_caps_unref (caps);
+
/* aac without codec data */
caps = gst_caps_new_empty_simple ("audio/mpeg");
mime_codec = gst_codec_utils_caps_get_mime_codec (caps);