mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +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 = \
|
||||
$(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/adaptivedemux/libgstadaptivedemux-@GST_API_VERSION@.la \
|
||||
$(GST_PLUGINS_BASE_LIBS) \
|
||||
-lgsttag-$(GST_API_VERSION) \
|
||||
$(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__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/adaptivedemux/gstadaptivedemux.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
#include <gst/base/gstdataqueue.h>
|
||||
#include "gstmssmanifest.h"
|
||||
|
@ -52,63 +53,20 @@ typedef struct _GstMssDemux GstMssDemux;
|
|||
typedef struct _GstMssDemuxClass GstMssDemuxClass;
|
||||
|
||||
struct _GstMssDemuxStream {
|
||||
GstPad *pad;
|
||||
|
||||
GstCaps *caps;
|
||||
|
||||
GstMssDemux *parent;
|
||||
GstAdaptiveDemuxStream parent;
|
||||
|
||||
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 {
|
||||
GstBin bin;
|
||||
GstAdaptiveDemux bin;
|
||||
|
||||
/* pads */
|
||||
GstPad *sinkpad;
|
||||
|
||||
gboolean have_group_id;
|
||||
guint group_id;
|
||||
|
||||
GstBuffer *manifest_buffer;
|
||||
|
||||
GstMssManifest *manifest;
|
||||
gchar *base_url;
|
||||
gchar *manifest_uri;
|
||||
|
||||
GSList *streams;
|
||||
guint n_videos;
|
||||
guint n_audios;
|
||||
|
||||
|
@ -121,7 +79,7 @@ struct _GstMssDemux {
|
|||
};
|
||||
|
||||
struct _GstMssDemuxClass {
|
||||
GstBinClass parent_class;
|
||||
GstAdaptiveDemuxClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_mss_demux_get_type (void);
|
||||
|
|
|
@ -878,6 +878,20 @@ gst_mss_stream_advance_fragment (GstMssStream * stream)
|
|||
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 *
|
||||
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_duration (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);
|
||||
const gchar * gst_mss_stream_get_lang (GstMssStream * stream);
|
||||
|
||||
|
|
Loading…
Reference in a new issue