From 0c4d3ced0a20b5cef6c51410754b40d4254f596b Mon Sep 17 00:00:00 2001 From: Apurupa Pattapu Date: Tue, 7 Jul 2015 12:27:10 -0700 Subject: Stagefright: Extensions for HTTP progressive streaming. - Extend NuPlayer setDataSource for streaming - Create ExtendedCachedSource only for MediaPlayer streaming usecases by passing a flag to DataSource to use extended cache - Add extension for MediaHTTP Change-Id: Ic87c3744bf905eb8742863951b809e38d0a60339 --- media/libavextensions/Android.mk | 3 ++- media/libavextensions/stagefright/AVExtensions.h | 9 +++++++++ media/libavextensions/stagefright/AVFactory.cpp | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'media/libavextensions') diff --git a/media/libavextensions/Android.mk b/media/libavextensions/Android.mk index 511f13f..26c9f85 100644 --- a/media/libavextensions/Android.mk +++ b/media/libavextensions/Android.mk @@ -12,7 +12,8 @@ LOCAL_C_INCLUDES:= \ $(TOP)/frameworks/native/include/media/hardware \ $(TOP)/frameworks/native/include/media/openmax \ $(TOP)/external/flac/include \ - $(TOP)/hardware/qcom/media/mm-core/inc + $(TOP)/hardware/qcom/media/mm-core/inc \ + $(TOP)/frameworks/av/media/libstagefright \ LOCAL_CFLAGS += -Wno-multichar diff --git a/media/libavextensions/stagefright/AVExtensions.h b/media/libavextensions/stagefright/AVExtensions.h index 04588d5..06257be 100644 --- a/media/libavextensions/stagefright/AVExtensions.h +++ b/media/libavextensions/stagefright/AVExtensions.h @@ -39,6 +39,9 @@ struct ACodec; class MediaExtractor; struct MediaCodec; class AudioParameter; +struct NuCachedSource2; +struct MediaHTTP; +struct IMediaHTTPConnection; /* * Factory to create objects of base-classes in libstagefright @@ -47,6 +50,12 @@ struct AVFactory { virtual sp createACodec(); virtual MediaExtractor* createExtendedExtractor( const sp &source, const char *mime); + virtual sp createCachedSource( + const sp &source, + const char *cacheConfig = NULL, + bool disconnectAtHighwatermark = false); + virtual MediaHTTP* createMediaHTTP( + const sp &conn); // ----- NO TRESSPASSING BEYOND THIS LINE ------ DECLARE_LOADABLE_SINGLETON(AVFactory); diff --git a/media/libavextensions/stagefright/AVFactory.cpp b/media/libavextensions/stagefright/AVFactory.cpp index da60167..22969a2 100644 --- a/media/libavextensions/stagefright/AVFactory.cpp +++ b/media/libavextensions/stagefright/AVFactory.cpp @@ -40,9 +40,11 @@ #include #include #include +#include #include "common/ExtensionsLoader.hpp" #include "stagefright/AVExtensions.h" +#include "include/NuCachedSource2.h" namespace android { @@ -55,6 +57,18 @@ MediaExtractor* AVFactory::createExtendedExtractor( return NULL; } +sp AVFactory::createCachedSource( + const sp &source, + const char *cacheConfig, + bool disconnectAtHighwatermark) { + return new NuCachedSource2(source, cacheConfig, disconnectAtHighwatermark); +} + +MediaHTTP* AVFactory::createMediaHTTP( + const sp &conn) { + return new MediaHTTP(conn); +} + // ----- NO TRESSPASSING BEYOND THIS LINE ------ AVFactory::AVFactory() { } -- cgit v1.1