dashsink: add dashmp4mux support

As mp4mux is not correctly suppporting the fragment generation,
see
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1722,
we deprecate and advertize the current status of usage.

Added the possibility to use the rust dashmp4mux element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5403>
This commit is contained in:
Stéphane Cerveau 2023-09-27 12:42:40 +02:00 committed by GStreamer Marge Bot
parent 2644b3608f
commit 898e153968
2 changed files with 26 additions and 3 deletions

View file

@ -10057,9 +10057,14 @@
"value": "0"
},
{
"desc": "Use mp4mux",
"desc": "Use mp4mux (deprecated, non-functional)",
"name": "mp4",
"value": "1"
},
{
"desc": "Use dashmp4mux",
"name": "dashmp4",
"value": "2"
}
]
}

View file

@ -100,6 +100,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_dash_sink_debug);
* GstDashSinkMuxerType:
* @GST_DASH_SINK_MUXER_TS: Use mpegtsmux
* @GST_DASH_SINK_MUXER_MP4: Use mp4mux
* @GST_DASH_SINK_MUXER_DASHMP4: Use dashmp4mux
*
* Muxer type
*/
@ -107,6 +108,7 @@ typedef enum
{
GST_DASH_SINK_MUXER_TS = 0,
GST_DASH_SINK_MUXER_MP4 = 1,
GST_DASH_SINK_MUXER_DASHMP4 = 2,
} GstDashSinkMuxerType;
typedef struct _DashSinkMuxer
@ -124,7 +126,14 @@ gst_dash_sink_muxer_get_type (void)
static GType dash_sink_muxer_type = 0;
static const GEnumValue muxer_type[] = {
{GST_DASH_SINK_MUXER_TS, "Use mpegtsmux", "ts"},
{GST_DASH_SINK_MUXER_MP4, "Use mp4mux", "mp4"},
{GST_DASH_SINK_MUXER_MP4, "Use mp4mux (deprecated, non-functional)", "mp4"},
/**
* GstDashSinkMuxerType::dashmp4
*
*
* Since: 1.24
*/
{GST_DASH_SINK_MUXER_DASHMP4, "Use dashmp4mux", "dashmp4"},
{0, NULL, NULL},
};
@ -146,6 +155,11 @@ static const DashSinkMuxer dash_muxer_list[] = {
"mp4mux",
"video/mp4",
"mp4"},
{
GST_DASH_SINK_MUXER_DASHMP4,
"dashmp4mux",
"video/mp4",
"mp4"},
};
#define DEFAULT_SEGMENT_LIST_TPL "_%05d"
@ -646,9 +660,13 @@ gst_dash_sink_add_splitmuxsink (GstDashSink * sink, GstDashSinkStream * stream)
gst_element_factory_make (dash_muxer_list[sink->muxer].element_name,
NULL);
if (sink->muxer == GST_DASH_SINK_MUXER_MP4)
if (sink->muxer == GST_DASH_SINK_MUXER_MP4) {
g_object_set (mux, "fragment-duration", sink->target_duration * GST_MSECOND,
NULL);
} else if (sink->muxer == GST_DASH_SINK_MUXER_DASHMP4) {
g_object_set (mux, "fragment-duration", sink->target_duration * GST_SECOND,
NULL);
}
g_return_val_if_fail (mux != NULL, FALSE);