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

Commit b5295375 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7557983 from b486977a to sc-release

Change-Id: If60b4a43efe339ee93cdb0dfcd5bb8b6c2f60303
parents 85591725 b486977a
Loading
Loading
Loading
Loading
+1 −11
Original line number Original line Diff line number Diff line
@@ -1301,17 +1301,7 @@ RawGraphicOutputBuffers::RawGraphicOutputBuffers(


sp<Codec2Buffer> RawGraphicOutputBuffers::wrap(const std::shared_ptr<C2Buffer> &buffer) {
sp<Codec2Buffer> RawGraphicOutputBuffers::wrap(const std::shared_ptr<C2Buffer> &buffer) {
    if (buffer == nullptr) {
    if (buffer == nullptr) {
        sp<Codec2Buffer> c2buffer = ConstGraphicBlockBuffer::AllocateEmpty(
        return new Codec2Buffer(mFormat, new ABuffer(nullptr, 0));
                mFormat,
                [lbp = mLocalBufferPool](size_t capacity) {
                    return lbp->newBuffer(capacity);
                });
        if (c2buffer == nullptr) {
            ALOGD("[%s] ConstGraphicBlockBuffer::AllocateEmpty failed", mName);
            return nullptr;
        }
        c2buffer->setRange(0, 0);
        return c2buffer;
    } else {
    } else {
        return ConstGraphicBlockBuffer::Allocate(
        return ConstGraphicBlockBuffer::Allocate(
                mFormat,
                mFormat,
+13 −0
Original line number Original line Diff line number Diff line
@@ -106,6 +106,19 @@ TEST(RawGraphicOutputBuffersTest, ChangeNumSlots) {
    }
    }
}
}


TEST(RawGraphicOutputBuffersTest, WrapNullBuffer) {
    constexpr int32_t kWidth = 320;
    constexpr int32_t kHeight = 240;

    std::shared_ptr<RawGraphicOutputBuffers> buffers =
        GetRawGraphicOutputBuffers(kWidth, kHeight);

    sp<Codec2Buffer> buffer = buffers->wrap(nullptr);
    ASSERT_EQ(nullptr, buffer->base());
    ASSERT_EQ(0, buffer->size());
    ASSERT_EQ(0, buffer->offset());
}

TEST(RawGraphicOutputBuffersTest, FlexYuvColorFormat) {
TEST(RawGraphicOutputBuffersTest, FlexYuvColorFormat) {
    constexpr int32_t kWidth = 320;
    constexpr int32_t kWidth = 320;
    constexpr int32_t kHeight = 240;
    constexpr int32_t kHeight = 240;
+7 −5
Original line number Original line Diff line number Diff line
@@ -145,15 +145,17 @@ void NuPlayer::RTSPSource::stop() {
        return;
        return;
    }
    }


    // Close socket before posting message to RTSPSource message handler.
    if (mHandler != NULL) {
        close(mHandler->getARTSPConnection()->getSocket());
    }

    sp<AMessage> msg = new AMessage(kWhatDisconnect, this);
    sp<AMessage> msg = new AMessage(kWhatDisconnect, this);


    sp<AMessage> dummy;
    sp<AMessage> dummy;
    msg->postAndAwaitResponse(&dummy);
    msg->postAndAwaitResponse(&dummy);

    // Close socket after posting message to RTSPSource message handler.
    if (mHandler != NULL && mHandler->getARTSPConnection()->getSocket() >= 0) {
        ALOGD("closing rtsp socket if not closed yet.");
        close(mHandler->getARTSPConnection()->getSocket());
    }

}
}


status_t NuPlayer::RTSPSource::feedMoreTSData() {
status_t NuPlayer::RTSPSource::feedMoreTSData() {
+11 −0
Original line number Original line Diff line number Diff line
@@ -594,4 +594,15 @@ sp<MetaData> APacketSource::getFormat() {
    return mFormat;
    return mFormat;
}
}


bool APacketSource::isVideo() {
    bool isVideo = false;

    const char *mime;
    if (mFormat->findCString(kKeyMIMEType, &mime)) {
        isVideo = !strncasecmp(mime, "video/", 6);
    }

    return isVideo;
}

}  // namespace android
}  // namespace android
+2 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,8 @@ struct APacketSource : public RefBase {


    virtual sp<MetaData> getFormat();
    virtual sp<MetaData> getFormat();


    bool isVideo();

protected:
protected:
    virtual ~APacketSource();
    virtual ~APacketSource();


Loading