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

Commit fddc1453 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer2: use DataSource to replace IDataSource."

parents 9728519d c5c79dac
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -726,15 +726,14 @@ status_t MediaPlayer2Manager::Client::setDataSource(
}

status_t MediaPlayer2Manager::Client::setDataSource(
        const sp<IDataSource> &source) {
    sp<DataSource> dataSource = CreateDataSourceFromIDataSource(source);
    player2_type playerType = MediaPlayer2Factory::getPlayerType(this, dataSource);
        const sp<DataSource> &source) {
    player2_type playerType = MediaPlayer2Factory::getPlayerType(this, source);
    sp<MediaPlayer2Base> p = setDataSource_pre(playerType);
    if (p == NULL) {
        return NO_INIT;
    }
    // now set data source
    return mStatus = setDataSource_post(p, p->setDataSource(dataSource));
    return mStatus = setDataSource_post(p, p->setDataSource(source));
}

void MediaPlayer2Manager::Client::disconnectNativeWindow_l() {
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ struct ANativeWindowWrapper;
struct AudioPlaybackRate;
class AudioTrack;
struct AVSyncSettings;
class IDataSource;
class DataSource;
struct MediaHTTPService;
class MediaPlayer2EngineClient;

@@ -297,7 +297,7 @@ private:
        virtual status_t        setDataSource(int fd, int64_t offset, int64_t length);

        virtual status_t        setDataSource(const sp<IStreamSource> &source);
        virtual status_t        setDataSource(const sp<IDataSource> &source);
        virtual status_t        setDataSource(const sp<DataSource> &source);


        sp<MediaPlayer2Base>    setDataSource_pre(player2_type playerType);
+6 −6
Original line number Diff line number Diff line
@@ -32,13 +32,13 @@ struct sockaddr_in;
namespace android {

struct ANativeWindowWrapper;
class Parcel;
class IDataSource;
struct IStreamSource;
struct MediaHTTPService;
struct AudioPlaybackRate;
struct AVSyncSettings;
struct AudioPlaybackRate;
struct BufferingSettings;
class DataSource;
struct IStreamSource;
struct MediaHTTPService;
class Parcel;

typedef MediaSource::ReadOptions::SeekMode MediaPlayer2SeekMode;

@@ -54,7 +54,7 @@ public:

    virtual status_t        setDataSource(int fd, int64_t offset, int64_t length) = 0;
    virtual status_t        setDataSource(const sp<IStreamSource>& source) = 0;
    virtual status_t        setDataSource(const sp<IDataSource>& source) = 0;
    virtual status_t        setDataSource(const sp<DataSource>& source) = 0;
    virtual status_t        setVideoSurfaceTexture(const sp<ANativeWindowWrapper>& nww) = 0;
    virtual status_t        getBufferingSettings(
                                    BufferingSettings* buffering /* nonnull */) = 0;
+3 −3
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ namespace android {

struct AVSyncSettings;
struct ANativeWindowWrapper;
class DataSource;
struct MediaHTTPService;

enum media2_event_type {
    MEDIA2_NOP               = 0, // interface test message
@@ -193,8 +195,6 @@ public:
    virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0;
};

struct MediaHTTPService;

class MediaPlayer2 : public MediaPlayer2EngineClient
{
public:
@@ -208,7 +208,7 @@ public:
                    const KeyedVector<String8, String8> *headers);

            status_t        setDataSource(int fd, int64_t offset, int64_t length);
            status_t        setDataSource(const sp<IDataSource> &source);
            status_t        setDataSource(const sp<DataSource> &source);
            status_t        setVideoSurfaceTexture(const sp<ANativeWindowWrapper>& nww);
            status_t        setListener(const sp<MediaPlayer2Listener>& listener);
            status_t        getBufferingSettings(BufferingSettings* buffering /* nonnull */);
+3 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
#include <media/AudioResamplerPublic.h>
#include <media/AudioSystem.h>
#include <media/AVSyncSettings.h>
#include <media/IDataSource.h>
#include <media/DataSource.h>
#include <media/MediaAnalyticsItem.h>
#include <media/NdkWrapper.h>

@@ -183,9 +183,9 @@ status_t MediaPlayer2::setDataSource(int fd, int64_t offset, int64_t length)
    return err;
}

status_t MediaPlayer2::setDataSource(const sp<IDataSource> &source)
status_t MediaPlayer2::setDataSource(const sp<DataSource> &source)
{
    ALOGV("setDataSource(IDataSource)");
    ALOGV("setDataSource(DataSource)");
    status_t err = UNKNOWN_ERROR;
    sp<MediaPlayer2Engine> player(MediaPlayer2Manager::get().create(this, mAudioSessionId));
    if ((NO_ERROR != doSetRetransmitEndpoint(player)) ||
Loading