adaptivedemux: Expose downloader
This allows subclasses to use it and share connections if possible.
This commit is contained in:
parent
5364e4a2ff
commit
c1f98daa74
@ -75,7 +75,6 @@
|
|||||||
#include "gstadaptivedemux.h"
|
#include "gstadaptivedemux.h"
|
||||||
#include "gst/gst-i18n-plugin.h"
|
#include "gst/gst-i18n-plugin.h"
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/base/gstadapter.h>
|
||||||
#include <gst/uridownloader/gsturidownloader.h>
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (adaptivedemux_debug);
|
GST_DEBUG_CATEGORY (adaptivedemux_debug);
|
||||||
#define GST_CAT_DEFAULT adaptivedemux_debug
|
#define GST_CAT_DEFAULT adaptivedemux_debug
|
||||||
@ -328,7 +327,7 @@ gst_adaptive_demux_init (GstAdaptiveDemux * demux,
|
|||||||
|
|
||||||
demux->priv = GST_ADAPTIVE_DEMUX_GET_PRIVATE (demux);
|
demux->priv = GST_ADAPTIVE_DEMUX_GET_PRIVATE (demux);
|
||||||
demux->priv->input_adapter = gst_adapter_new ();
|
demux->priv->input_adapter = gst_adapter_new ();
|
||||||
demux->priv->downloader = gst_uri_downloader_new ();
|
demux->downloader = gst_uri_downloader_new ();
|
||||||
demux->stream_struct_size = sizeof (GstAdaptiveDemuxStream);
|
demux->stream_struct_size = sizeof (GstAdaptiveDemuxStream);
|
||||||
|
|
||||||
gst_segment_init (&demux->segment, GST_FORMAT_TIME);
|
gst_segment_init (&demux->segment, GST_FORMAT_TIME);
|
||||||
@ -372,7 +371,7 @@ gst_adaptive_demux_finalize (GObject * object)
|
|||||||
GST_DEBUG_OBJECT (object, "finalize");
|
GST_DEBUG_OBJECT (object, "finalize");
|
||||||
|
|
||||||
g_object_unref (priv->input_adapter);
|
g_object_unref (priv->input_adapter);
|
||||||
g_object_unref (priv->downloader);
|
g_object_unref (demux->downloader);
|
||||||
|
|
||||||
g_mutex_clear (&priv->updates_timed_lock);
|
g_mutex_clear (&priv->updates_timed_lock);
|
||||||
g_cond_clear (&priv->updates_timed_cond);
|
g_cond_clear (&priv->updates_timed_cond);
|
||||||
@ -553,7 +552,7 @@ gst_adaptive_demux_reset (GstAdaptiveDemux * demux)
|
|||||||
GList *iter;
|
GList *iter;
|
||||||
|
|
||||||
gst_adaptive_demux_stop_tasks (demux);
|
gst_adaptive_demux_stop_tasks (demux);
|
||||||
gst_uri_downloader_reset (demux->priv->downloader);
|
gst_uri_downloader_reset (demux->downloader);
|
||||||
|
|
||||||
if (klass->reset)
|
if (klass->reset)
|
||||||
klass->reset (demux);
|
klass->reset (demux);
|
||||||
@ -1212,7 +1211,7 @@ gst_adaptive_demux_stop_tasks (GstAdaptiveDemux * demux)
|
|||||||
g_cond_broadcast (&demux->manifest_cond);
|
g_cond_broadcast (&demux->manifest_cond);
|
||||||
GST_MANIFEST_UNLOCK (demux);
|
GST_MANIFEST_UNLOCK (demux);
|
||||||
|
|
||||||
gst_uri_downloader_cancel (demux->priv->downloader);
|
gst_uri_downloader_cancel (demux->downloader);
|
||||||
for (iter = demux->streams; iter; iter = g_list_next (iter)) {
|
for (iter = demux->streams; iter; iter = g_list_next (iter)) {
|
||||||
GstAdaptiveDemuxStream *stream = iter->data;
|
GstAdaptiveDemuxStream *stream = iter->data;
|
||||||
|
|
||||||
@ -2478,10 +2477,9 @@ gst_adaptive_demux_update_manifest (GstAdaptiveDemux * demux)
|
|||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
|
|
||||||
download = gst_uri_downloader_fetch_uri (demux->priv->downloader,
|
download = gst_uri_downloader_fetch_uri (demux->downloader,
|
||||||
demux->manifest_uri, NULL, TRUE, TRUE, TRUE, NULL);
|
demux->manifest_uri, NULL, TRUE, TRUE, TRUE, NULL);
|
||||||
if (download) {
|
if (download) {
|
||||||
|
|
||||||
GST_MANIFEST_LOCK (demux);
|
GST_MANIFEST_LOCK (demux);
|
||||||
g_free (demux->manifest_uri);
|
g_free (demux->manifest_uri);
|
||||||
g_free (demux->manifest_base_uri);
|
g_free (demux->manifest_base_uri);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/base/gstadapter.h>
|
||||||
|
#include <gst/uridownloader/gsturidownloader.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@ -176,7 +177,7 @@ struct _GstAdaptiveDemux
|
|||||||
/*< protected >*/
|
/*< protected >*/
|
||||||
GstPad *sinkpad;
|
GstPad *sinkpad;
|
||||||
|
|
||||||
GstAdaptiveDemuxPrivate *priv;
|
GstUriDownloader *downloader;
|
||||||
|
|
||||||
GList *streams;
|
GList *streams;
|
||||||
GList *next_streams;
|
GList *next_streams;
|
||||||
@ -198,6 +199,9 @@ struct _GstAdaptiveDemux
|
|||||||
|
|
||||||
gboolean have_group_id;
|
gboolean have_group_id;
|
||||||
guint group_id;
|
guint group_id;
|
||||||
|
|
||||||
|
/* < private > */
|
||||||
|
GstAdaptiveDemuxPrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user