hlsdemux: port to adaptive base class

Conflicts:
	ext/hls/gsthlsdemux.c
	ext/hls/gsthlsdemux.h
This commit is contained in:
Thiago Santos 2014-08-27 16:26:19 -03:00
parent c65aeedb6f
commit 1e9ce11efd
3 changed files with 454 additions and 1509 deletions

View file

@ -11,6 +11,7 @@ libgstfragmented_la_SOURCES = \
libgstfragmented_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GIO_CFLAGS) $(LIBGCRYPT_CFLAGS) $(NETTLE_CFLAGS)
libgstfragmented_la_LIBADD = \
$(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) -lgstpbutils-$(GST_API_VERSION) -lgstvideo-$(GST_API_VERSION) \
$(GST_BASE_LIBS) $(GST_LIBS) $(GIO_LIBS) $(LIBM) $(LIBGCRYPT_LIBS) $(NETTLE_LIBS) $(OPENSSL_LIBS)
libgstfragmented_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -no-undefined

1912
ext/hls/gsthlsdemux.c Executable file → Normal file

File diff suppressed because it is too large Load diff

50
ext/hls/gsthlsdemux.h Executable file → Normal file
View file

@ -29,6 +29,7 @@
#include "m3u8.h"
#include "gstfragmented.h"
#include <gst/uridownloader/gsturidownloader.h>
#include <gst/adaptivedemux/gstadaptivedemux.h>
#if defined(HAVE_OPENSSL)
#include <openssl/evp.h>
#elif defined(HAVE_NETTLE)
@ -63,16 +64,10 @@ typedef struct _GstHLSDemuxClass GstHLSDemuxClass;
*/
struct _GstHLSDemux
{
GstBin parent;
GstAdaptiveDemux parent;
GstPad *sinkpad;
GstPad *srcpad;
gint srcpad_counter;
gboolean have_group_id;
guint group_id;
GstBuffer *playlist;
GstCaps *input_caps;
GstUriDownloader *downloader;
gchar *uri; /* Original playlist URI */
@ -86,51 +81,12 @@ struct _GstHLSDemux
guint connection_speed; /* Network connection speed in kbps (0 = unknown) */
/* Streaming task */
GstTask *stream_task;
GRecMutex stream_lock;
gboolean stop_stream_task;
GMutex download_lock; /* Used for protecting queue and the two conds */
GCond download_cond; /* Signalled when something is added to the queue */
gboolean end_of_playlist;
gint download_failed_count;
gint64 next_download;
/* Updates task */
GstTask *updates_task;
GRecMutex updates_lock;
gint64 next_update; /* Time of the next update */
gboolean stop_updates_task;
GMutex updates_timed_lock;
GCond updates_timed_cond; /* Signalled when the playlist should be updated */
/* Position in the stream */
GstSegment segment;
gboolean need_segment;
gboolean discont;
/* Cache for the last key */
gchar *key_url;
GstFragment *key_fragment;
/* Current download rate (bps) */
gint current_download_rate;
/* fragment download tooling */
GstElement *src;
GstPad *src_srcpad; /* handy link to src's src pad */
GMutex fragment_download_lock;
gboolean download_finished;
GCond fragment_download_cond;
GstClockTime current_timestamp;
GstClockTime current_duration;
gboolean starting_fragment;
gboolean reset_crypto;
gint64 download_start_time;
gint64 download_total_time;
gint64 download_total_bytes;
GstFlowReturn last_ret;
GError *last_error;
/* decryption tooling */
#if defined(HAVE_OPENSSL)
EVP_CIPHER_CTX aes_ctx;
@ -150,7 +106,7 @@ struct _GstHLSDemux
struct _GstHLSDemuxClass
{
GstBinClass parent_class;
GstAdaptiveDemuxClass parent_class;
};
GType gst_hls_demux_get_type (void);