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

Commit e1db3968 authored by Cristoforo Cataldo's avatar Cristoforo Cataldo Committed by Steve Kondik
Browse files

libmedia: Add legacy compatible overloads for some methods

These overloads are needed by Samsung legacy camera libs.

Change-Id: I12590b1e86c2e0fa9958c5baa714110ff77a5eec
parent 97aedf37
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -206,6 +206,12 @@ public:
            void            died();
            void            disconnect();

#ifdef SAMSUNG_CAMERA_LEGACY
            status_t        setDataSource(
                    const char *url,
                    const KeyedVector<String8, String8> *headers);
#endif

            status_t        setDataSource(
                    const sp<IMediaHTTPService> &httpService,
                    const char *url,
@@ -234,6 +240,17 @@ public:
            bool            isLooping();
            status_t        setVolume(float leftVolume, float rightVolume);
            void            notify(int msg, int ext1, int ext2, const Parcel *obj = NULL);

#ifdef SAMSUNG_CAMERA_LEGACY
    static  status_t        decode(
            const char* url,
            uint32_t *pSampleRate,
            int* pNumChannels,
            audio_format_t* pFormat,
            const sp<IMemoryHeap>& heap,
            size_t *pSize);
#endif

    static  status_t        decode(
            const sp<IMediaHTTPService> &httpService,
            const char* url,
+24 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@

#include <media/mediaplayer.h>
#include <media/AudioSystem.h>
#include <media/IMediaHTTPService.h>

#include <binder/MemoryBase.h>

@@ -142,6 +143,15 @@ status_t MediaPlayer::attachNewPlayer(const sp<IMediaPlayer>& player)
    return err;
}

#ifdef SAMSUNG_CAMERA_LEGACY
status_t MediaPlayer::setDataSource(
        const char *url, const KeyedVector<String8, String8> *headers)
{
    sp<IMediaHTTPService> httpService;
    return setDataSource(httpService, url, headers);
}
#endif

status_t MediaPlayer::setDataSource(
        const sp<IMediaHTTPService> &httpService,
        const char *url, const KeyedVector<String8, String8> *headers)
@@ -841,6 +851,20 @@ void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj)
    }
}

#ifdef SAMSUNG_CAMERA_LEGACY
/*static*/ status_t MediaPlayer::decode(
        const char* url,
        uint32_t *pSampleRate,
        int* pNumChannels,
        audio_format_t* pFormat,
        const sp<IMemoryHeap>& heap,
        size_t *pSize)
{
    sp<IMediaHTTPService> httpService;
    return decode(httpService, url, pSampleRate, pNumChannels, pFormat, heap, pSize);
}
#endif

/*static*/ status_t MediaPlayer::decode(
        const sp<IMediaHTTPService> &httpService,
        const char* url,