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

Commit 36a4d2cc authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Gapless playback, step 1."

parents 5e7616cc 6b74d671
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ public:
    virtual status_t        setParameter(int key, const Parcel& request) = 0;
    virtual status_t        getParameter(int key, Parcel* reply) = 0;
    virtual status_t        setRetransmitEndpoint(const struct sockaddr_in* endpoint) = 0;
    virtual status_t        setNextPlayer(const sp<IMediaPlayer>& next) = 0;

    // Invoke a generic method on the player by using opaque parcels
    // for the request and reply.
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ public:
        virtual void        close() = 0;

        virtual status_t    setPlaybackRatePermille(int32_t rate) { return INVALID_OPERATION; }
        virtual bool        needsTrailingPadding() { return true; }
    };

                        MediaPlayerBase() : mCookie(0), mNotify(0) {}
+4 −0
Original line number Diff line number Diff line
@@ -96,6 +96,9 @@ enum media_error_type {
enum media_info_type {
    // 0xx
    MEDIA_INFO_UNKNOWN = 1,
    // The player was started because it was used as the next player for another
    // player, which just completed playback
    MEDIA_INFO_STARTED_AS_NEXT = 2,
    // 7xx
    // The video is too complex for the decoder: it can't decode frames fast
    // enough. Possibly only the audio plays fine at this stage.
@@ -207,6 +210,7 @@ public:
            status_t        setParameter(int key, const Parcel& request);
            status_t        getParameter(int key, Parcel* reply);
            status_t        setRetransmitEndpoint(const char* addrString, uint16_t port);
            status_t        setNextMediaPlayer(const sp<MediaPlayer>& player);

private:
            void            clear_l();
+14 −1
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ enum {
    SET_PARAMETER,
    GET_PARAMETER,
    SET_RETRANSMIT_ENDPOINT,
    SET_NEXT_PLAYER,
};

class BpMediaPlayer: public BpInterface<IMediaPlayer>
@@ -307,7 +308,15 @@ public:
        if (OK != err) {
            return err;
        }
        return reply.readInt32();
    }

    status_t setNextPlayer(const sp<IMediaPlayer>& player) {
        Parcel data, reply;
        data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
        sp<IBinder> b(player->asBinder());
        data.writeStrongBinder(b);
        remote()->transact(SET_NEXT_PLAYER, data, &reply);
        return reply.readInt32();
    }
};
@@ -489,7 +498,11 @@ status_t BnMediaPlayer::onTransact(
            } else {
                reply->writeInt32(setRetransmitEndpoint(NULL));
            }

            return NO_ERROR;
        } break;
        case SET_NEXT_PLAYER: {
            CHECK_INTERFACE(IMediaPlayer, data, reply);
            reply->writeInt32(setNextPlayer(interface_cast<IMediaPlayer>(data.readStrongBinder())));
            return NO_ERROR;
        } break;
        default:
+7 −0
Original line number Diff line number Diff line
@@ -788,4 +788,11 @@ void MediaPlayer::died()

}

status_t MediaPlayer::setNextMediaPlayer(const sp<MediaPlayer>& next) {
    if (mPlayer == NULL) {
        return NO_INIT;
    }
    return mPlayer->setNextPlayer(next == NULL ? NULL : next->mPlayer);
}

}; // namespace android
Loading