Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84066788 authored by Andreas Huber's avatar Andreas Huber Committed by Marco Nelissen
Browse files

experimental support for fragmented mp4 playback in nuplayer

cherry picked from change 170999

Change-Id: I407775f0290154ad4961134839a15c9f296424c0
parent 9cb20d4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ LOCAL_SRC_FILES:= \

LOCAL_SHARED_LIBRARIES := \
	libstagefright liblog libutils libbinder libgui \
        libstagefright_foundation libmedia libmedia_native
        libstagefright_foundation libmedia libmedia_native libcutils

LOCAL_C_INCLUDES:= \
	frameworks/av/media/libstagefright \
+7 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "utils/Log.h"

#include <binder/ProcessState.h>
#include <cutils/properties.h> // for property_get

#include <media/IStreamSource.h>
#include <media/mediaplayer.h>
@@ -342,8 +343,13 @@ int main(int argc, char **argv) {

    sp<IStreamSource> source;

    char prop[PROPERTY_VALUE_MAX];
    bool usemp4 = property_get("media.stagefright.use-mp4source", prop, NULL) &&
            (!strcmp(prop, "1") || !strcasecmp(prop, "true"));

    size_t len = strlen(argv[1]);
    if (len >= 3 && !strcasecmp(".ts", &argv[1][len - 3])) {
    if ((!usemp4 && len >= 3 && !strcasecmp(".ts", &argv[1][len - 3])) ||
        (usemp4 && len >= 4 && !strcasecmp(".mp4", &argv[1][len - 4]))) {
        int fd = open(argv[1], O_RDONLY);

        if (fd < 0) {
+5 −1
Original line number Diff line number Diff line
@@ -22,7 +22,11 @@

namespace android {

void hexdump(const void *_data, size_t size);
struct AString;

void hexdump(
        const void *_data, size_t size,
        size_t indent = 0, AString *appendTo = NULL);

}  // namespace android

+3 −0
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@ LOCAL_SRC_FILES:= \
        NuPlayerStreamListener.cpp      \
        RTSPSource.cpp                  \
        StreamingSource.cpp             \
        mp4/MP4Source.cpp               \
        mp4/Parser.cpp                  \
        mp4/TrackFragment.cpp           \

LOCAL_C_INCLUDES := \
	$(TOP)/frameworks/av/media/libstagefright/httplive            \
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ status_t NuPlayer::GenericSource::feedMoreTSData() {
    return OK;
}

sp<MetaData> NuPlayer::GenericSource::getFormat(bool audio) {
sp<MetaData> NuPlayer::GenericSource::getFormatMeta(bool audio) {
    sp<MediaSource> source = audio ? mAudioTrack.mSource : mVideoTrack.mSource;

    if (source == NULL) {
Loading