mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
mssdemux: port to adaptivedemux base class
This commit is contained in:
parent
d627f4b93b
commit
b418c88b26
5 changed files with 195 additions and 1317 deletions
|
@ -7,6 +7,7 @@ libgstsmoothstreaming_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) \
|
||||||
libgstsmoothstreaming_la_LIBADD = \
|
libgstsmoothstreaming_la_LIBADD = \
|
||||||
$(top_builddir)/gst-libs/gst/codecparsers/libgstcodecparsers-$(GST_API_VERSION).la \
|
$(top_builddir)/gst-libs/gst/codecparsers/libgstcodecparsers-$(GST_API_VERSION).la \
|
||||||
$(top_builddir)/gst-libs/gst/uridownloader/libgsturidownloader-$(GST_API_VERSION).la \
|
$(top_builddir)/gst-libs/gst/uridownloader/libgsturidownloader-$(GST_API_VERSION).la \
|
||||||
|
$(top_builddir)/gst-libs/gst/adaptivedemux/libgstadaptivedemux-@GST_API_VERSION@.la \
|
||||||
$(GST_PLUGINS_BASE_LIBS) \
|
$(GST_PLUGINS_BASE_LIBS) \
|
||||||
-lgsttag-$(GST_API_VERSION) \
|
-lgsttag-$(GST_API_VERSION) \
|
||||||
$(GST_BASE_LIBS) $(GST_LIBS) $(ZLIB_LIBS) $(LIBXML2_LIBS)
|
$(GST_BASE_LIBS) $(GST_LIBS) $(ZLIB_LIBS) $(LIBXML2_LIBS)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -24,6 +24,7 @@
|
||||||
#define __GST_MSSDEMUX_H__
|
#define __GST_MSSDEMUX_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
#include <gst/adaptivedemux/gstadaptivedemux.h>
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/base/gstadapter.h>
|
||||||
#include <gst/base/gstdataqueue.h>
|
#include <gst/base/gstdataqueue.h>
|
||||||
#include "gstmssmanifest.h"
|
#include "gstmssmanifest.h"
|
||||||
|
@ -52,63 +53,20 @@ typedef struct _GstMssDemux GstMssDemux;
|
||||||
typedef struct _GstMssDemuxClass GstMssDemuxClass;
|
typedef struct _GstMssDemuxClass GstMssDemuxClass;
|
||||||
|
|
||||||
struct _GstMssDemuxStream {
|
struct _GstMssDemuxStream {
|
||||||
GstPad *pad;
|
GstAdaptiveDemuxStream parent;
|
||||||
|
|
||||||
GstCaps *caps;
|
|
||||||
|
|
||||||
GstMssDemux *parent;
|
|
||||||
|
|
||||||
GstMssStream *manifest_stream;
|
GstMssStream *manifest_stream;
|
||||||
|
|
||||||
#if 0
|
|
||||||
GstUriDownloader *downloader;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
GstEvent *pending_segment;
|
|
||||||
|
|
||||||
GstSegment segment;
|
|
||||||
|
|
||||||
/* Downloading task */
|
|
||||||
GstTask *download_task;
|
|
||||||
GRecMutex download_lock;
|
|
||||||
|
|
||||||
GstFlowReturn last_ret;
|
|
||||||
gboolean eos;
|
|
||||||
gboolean have_data;
|
|
||||||
gboolean cancelled;
|
|
||||||
gboolean restart_download;
|
|
||||||
|
|
||||||
guint download_error_count;
|
|
||||||
|
|
||||||
/* download tooling */
|
|
||||||
GstElement *src;
|
|
||||||
GstPad *src_srcpad;
|
|
||||||
GMutex fragment_download_lock;
|
|
||||||
GCond fragment_download_cond;
|
|
||||||
gboolean download_finished;
|
|
||||||
gboolean starting_fragment;
|
|
||||||
gint64 download_start_time;
|
|
||||||
gint64 download_total_time;
|
|
||||||
gint64 download_total_bytes;
|
|
||||||
gint current_download_rate;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMssDemux {
|
struct _GstMssDemux {
|
||||||
GstBin bin;
|
GstAdaptiveDemux bin;
|
||||||
|
|
||||||
/* pads */
|
/* pads */
|
||||||
GstPad *sinkpad;
|
GstPad *sinkpad;
|
||||||
|
|
||||||
gboolean have_group_id;
|
|
||||||
guint group_id;
|
|
||||||
|
|
||||||
GstBuffer *manifest_buffer;
|
|
||||||
|
|
||||||
GstMssManifest *manifest;
|
GstMssManifest *manifest;
|
||||||
gchar *base_url;
|
gchar *base_url;
|
||||||
gchar *manifest_uri;
|
|
||||||
|
|
||||||
GSList *streams;
|
|
||||||
guint n_videos;
|
guint n_videos;
|
||||||
guint n_audios;
|
guint n_audios;
|
||||||
|
|
||||||
|
@ -121,7 +79,7 @@ struct _GstMssDemux {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMssDemuxClass {
|
struct _GstMssDemuxClass {
|
||||||
GstBinClass parent_class;
|
GstAdaptiveDemuxClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_mss_demux_get_type (void);
|
GType gst_mss_demux_get_type (void);
|
||||||
|
|
|
@ -878,6 +878,20 @@ gst_mss_stream_advance_fragment (GstMssStream * stream)
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GstFlowReturn
|
||||||
|
gst_mss_stream_regress_fragment (GstMssStream * stream)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||||
|
|
||||||
|
if (stream->current_fragment == NULL)
|
||||||
|
return GST_FLOW_EOS;
|
||||||
|
|
||||||
|
stream->current_fragment = g_list_previous (stream->current_fragment);
|
||||||
|
if (stream->current_fragment == NULL)
|
||||||
|
return GST_FLOW_EOS;
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
const gchar *
|
const gchar *
|
||||||
gst_mss_stream_type_name (GstMssStreamType streamtype)
|
gst_mss_stream_type_name (GstMssStreamType streamtype)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ GstFlowReturn gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** u
|
||||||
GstClockTime gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream);
|
GstClockTime gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream);
|
||||||
GstClockTime gst_mss_stream_get_fragment_gst_duration (GstMssStream * stream);
|
GstClockTime gst_mss_stream_get_fragment_gst_duration (GstMssStream * stream);
|
||||||
GstFlowReturn gst_mss_stream_advance_fragment (GstMssStream * stream);
|
GstFlowReturn gst_mss_stream_advance_fragment (GstMssStream * stream);
|
||||||
|
GstFlowReturn gst_mss_stream_regress_fragment (GstMssStream * stream);
|
||||||
void gst_mss_stream_seek (GstMssStream * stream, guint64 time);
|
void gst_mss_stream_seek (GstMssStream * stream, guint64 time);
|
||||||
const gchar * gst_mss_stream_get_lang (GstMssStream * stream);
|
const gchar * gst_mss_stream_get_lang (GstMssStream * stream);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue