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

Commit 75b75814 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

ApexCodec: make ApexCodec_Buffer struct opaque

Bug: 380086439
Test: presubmit
Change-Id: I0853cede4c77bcf4ec5ef286f204d8ea9aac5bc6
parent 093c8fb7
Loading
Loading
Loading
Loading
+101 −2
Original line number Diff line number Diff line
@@ -36,13 +36,25 @@ namespace {
// Method pointers to libcom.android.media.swcodec.apexcodecs methods are held in an array
// which simplifies checking all pointers are initialized.
enum MethodIndex {
    k_ApexCodec_Buffer_clear,
    k_ApexCodec_Buffer_create,
    k_ApexCodec_Buffer_destroy,
    k_ApexCodec_Buffer_getBufferInfo,
    k_ApexCodec_Buffer_getConfigUpdates,
    k_ApexCodec_Buffer_getGraphicBuffer,
    k_ApexCodec_Buffer_getLinearBuffer,
    k_ApexCodec_Buffer_getType,
    k_ApexCodec_Buffer_setBufferInfo,
    k_ApexCodec_Buffer_setConfigUpdates,
    k_ApexCodec_Buffer_setGraphicBuffer,
    k_ApexCodec_Buffer_setLinearBuffer,
    k_ApexCodec_Component_create,
    k_ApexCodec_Component_destroy,
    k_ApexCodec_Component_flush,
    k_ApexCodec_Component_getConfigurable,
    k_ApexCodec_Component_process,
    k_ApexCodec_Component_start,
    k_ApexCodec_Component_reset,
    k_ApexCodec_Component_start,
    k_ApexCodec_Configurable_config,
    k_ApexCodec_Configurable_query,
    k_ApexCodec_Configurable_querySupportedParams,
@@ -114,13 +126,24 @@ private:
        RWLock::AutoWLock l(mLock);
#undef BIND_SYMBOL
#define BIND_SYMBOL(name) bindSymbol_l(handle, #name, k_##name);
        BIND_SYMBOL(ApexCodec_Buffer_clear);
        BIND_SYMBOL(ApexCodec_Buffer_create);
        BIND_SYMBOL(ApexCodec_Buffer_destroy);
        BIND_SYMBOL(ApexCodec_Buffer_getBufferInfo);
        BIND_SYMBOL(ApexCodec_Buffer_getConfigUpdates);
        BIND_SYMBOL(ApexCodec_Buffer_getGraphicBuffer);
        BIND_SYMBOL(ApexCodec_Buffer_getLinearBuffer);
        BIND_SYMBOL(ApexCodec_Buffer_getType);
        BIND_SYMBOL(ApexCodec_Buffer_setConfigUpdates);
        BIND_SYMBOL(ApexCodec_Buffer_setGraphicBuffer);
        BIND_SYMBOL(ApexCodec_Buffer_setLinearBuffer);
        BIND_SYMBOL(ApexCodec_Component_create);
        BIND_SYMBOL(ApexCodec_Component_destroy);
        BIND_SYMBOL(ApexCodec_Component_flush);
        BIND_SYMBOL(ApexCodec_Component_getConfigurable);
        BIND_SYMBOL(ApexCodec_Component_process);
        BIND_SYMBOL(ApexCodec_Component_start);
        BIND_SYMBOL(ApexCodec_Component_reset);
        BIND_SYMBOL(ApexCodec_Component_start);
        BIND_SYMBOL(ApexCodec_Configurable_config);
        BIND_SYMBOL(ApexCodec_Configurable_query);
        BIND_SYMBOL(ApexCodec_Configurable_querySupportedParams);
@@ -176,6 +199,82 @@ ApexCodec_ComponentTraits *ApexCodec_Traits_get(
    INVOKE_METHOD(ApexCodec_Traits_get, nullptr, store, index);
}

ApexCodec_Buffer *ApexCodec_Buffer_create() {
    INVOKE_METHOD(ApexCodec_Buffer_create, nullptr);
}

void ApexCodec_Buffer_destroy(ApexCodec_Buffer *buffer) {
    INVOKE_METHOD(ApexCodec_Buffer_destroy, void(), buffer);
}

void ApexCodec_Buffer_clear(ApexCodec_Buffer *buffer) {
    INVOKE_METHOD(ApexCodec_Buffer_clear, void(), buffer);
}

ApexCodec_BufferType ApexCodec_Buffer_getType(ApexCodec_Buffer *buffer) {
    INVOKE_METHOD(ApexCodec_Buffer_getType, APEXCODEC_BUFFER_TYPE_EMPTY, buffer);
}

void ApexCodec_Buffer_setBufferInfo(
        ApexCodec_Buffer *_Nonnull buffer,
        ApexCodec_BufferFlags flags,
        uint64_t frameIndex,
        uint64_t timestampUs) {
    INVOKE_METHOD(ApexCodec_Buffer_setBufferInfo, void(),
                  buffer, flags, frameIndex, timestampUs);
}

ApexCodec_Status ApexCodec_Buffer_setLinearBuffer(
        ApexCodec_Buffer *buffer,
        const ApexCodec_LinearBuffer *linearBuffer) {
    INVOKE_METHOD(ApexCodec_Buffer_setLinearBuffer, APEXCODEC_STATUS_OMITTED,
                  buffer, linearBuffer);
}

ApexCodec_Status ApexCodec_Buffer_setGraphicBuffer(
        ApexCodec_Buffer *buffer,
        AHardwareBuffer *graphicBuffer) {
    INVOKE_METHOD(ApexCodec_Buffer_setGraphicBuffer, APEXCODEC_STATUS_OMITTED,
                  buffer, graphicBuffer);
}

ApexCodec_Status ApexCodec_Buffer_setConfigUpdates(
        ApexCodec_Buffer *buffer,
        const ApexCodec_LinearBuffer *configUpdates) {
    INVOKE_METHOD(ApexCodec_Buffer_setConfigUpdates, APEXCODEC_STATUS_OMITTED,
                  buffer, configUpdates);
}

ApexCodec_Status ApexCodec_Buffer_getBufferInfo(
        ApexCodec_Buffer *buffer,
        ApexCodec_BufferFlags *outFlags,
        uint64_t *outFrameIndex,
        uint64_t *outTimestampUs) {
    INVOKE_METHOD(ApexCodec_Buffer_getBufferInfo, APEXCODEC_STATUS_OMITTED,
                  buffer, outFlags, outFrameIndex, outTimestampUs);
}

ApexCodec_Status ApexCodec_Buffer_getLinearBuffer(
        ApexCodec_Buffer *buffer,
        ApexCodec_LinearBuffer *outLinearBuffer) {
    INVOKE_METHOD(ApexCodec_Buffer_getLinearBuffer, APEXCODEC_STATUS_OMITTED,
                  buffer, outLinearBuffer);
}

ApexCodec_Status ApexCodec_Buffer_getGraphicBuffer(
        ApexCodec_Buffer *buffer,
        AHardwareBuffer **outGraphicBuffer) {
    INVOKE_METHOD(ApexCodec_Buffer_getGraphicBuffer, APEXCODEC_STATUS_OMITTED,
                  buffer, outGraphicBuffer);
}

ApexCodec_Status ApexCodec_Buffer_getConfigUpdates(
        ApexCodec_Buffer *buffer,
        ApexCodec_LinearBuffer *outConfigUpdates,
        bool *outOwnedByClient) {
    INVOKE_METHOD(ApexCodec_Buffer_getConfigUpdates, APEXCODEC_STATUS_OMITTED,
                  buffer, outConfigUpdates, outOwnedByClient);
}
ApexCodec_Status ApexCodec_Component_create(
        ApexCodec_ComponentStore *store, const char *name, ApexCodec_Component **comp) {
    INVOKE_METHOD(ApexCodec_Component_create, APEXCODEC_STATUS_OMITTED, store, name, comp);
+214 −134
Original line number Diff line number Diff line
@@ -1434,7 +1434,7 @@ public:
            mListener(listener),
            mComponent(comp),
            mStopped(false),
            mOutputBufferType(APEXCODEC_BUFFER_TYPE_INVALID) {
            mOutputBufferType(APEXCODEC_BUFFER_TYPE_EMPTY) {
    }

    void start() {
@@ -1455,7 +1455,7 @@ public:
            LOG(ERROR) << "ApexHandler::start -- unrecognized component kind " << kind.value;
            return;
        }
        ApexCodec_BufferType outputBufferType = APEXCODEC_BUFFER_TYPE_INVALID;
        ApexCodec_BufferType outputBufferType = APEXCODEC_BUFFER_TYPE_EMPTY;
        if (domain.value == C2Component::DOMAIN_AUDIO) {
            // For both encoders and decoders the output buffer type is linear.
            outputBufferType = APEXCODEC_BUFFER_TYPE_LINEAR;
@@ -1528,10 +1528,11 @@ private:
                LOG(DEBUG) << "handleWork -- listener died.";
                return;
            }
            ApexCodec_Buffer input;
            input.flags = (ApexCodec_BufferFlags)workItem->input.flags;
            input.frameIndex = workItem->input.ordinal.frameIndex.peekll();
            input.timestampUs = workItem->input.ordinal.timestamp.peekll();
            thread_local ApexCodec_Buffer *input = ApexCodec_Buffer_create();
            ApexCodec_Buffer_clear(input);
            ApexCodec_BufferFlags flags = (ApexCodec_BufferFlags)workItem->input.flags;
            uint64_t frameIndex = workItem->input.ordinal.frameIndex.peekll();
            uint64_t timestampUs = workItem->input.ordinal.timestamp.peekll();

            if (workItem->input.buffers.size() > 1) {
                LOG(ERROR) << "handleWork -- input buffer size is "
@@ -1543,7 +1544,7 @@ private:
            if (!workItem->input.buffers.empty()) {
                buffer = workItem->input.buffers[0];
            }
            if (!FillMemory(buffer, &input, &linearView)) {
            if (!FillMemory(buffer, input, &linearView, flags, frameIndex, timestampUs)) {
                LOG(ERROR) << "handleWork -- failed to map input";
                return;
            }
@@ -1553,31 +1554,46 @@ private:
                listener->onError(mComponent, C2_CORRUPTED);
                return;
            }
            input.configUpdates.data = configUpdatesVector.data();
            input.configUpdates.size = configUpdatesVector.size();
            ApexCodec_LinearBuffer configUpdates;
            configUpdates.data = configUpdatesVector.data();
            configUpdates.size = configUpdatesVector.size();
            ApexCodec_Buffer_setConfigUpdates(input, &configUpdates);
            mWorkMap.insert_or_assign(
                    workItem->input.ordinal.frameIndex.peekll(), std::move(workItem));

            std::list<std::unique_ptr<C2Work>> workItems;
            bool inputDrained = false;
            while (!inputDrained) {
                ApexCodec_Buffer output;
                thread_local ApexCodec_Buffer *output = ApexCodec_Buffer_create();
                ApexCodec_Buffer_clear(output);
                std::shared_ptr<C2LinearBlock> linearBlock;
                std::optional<C2WriteView> linearView;
                std::shared_ptr<C2GraphicBlock> graphicBlock;
                allocOutputBuffer(&output, &linearBlock, &linearView, &graphicBlock);
                allocOutputBuffer(output, &linearBlock, &linearView, &graphicBlock);
                size_t consumed = 0;
                size_t produced = 0;
                ApexCodec_Status status = ApexCodec_Component_process(
                        mApexComponent, &input, &output, &consumed, &produced);
                        mApexComponent, input, output, &consumed, &produced);
                if (status == APEXCODEC_STATUS_NO_MEMORY) {
                    continue;
                } else if (status != APEXCODEC_STATUS_OK) {
                    LOG(ERROR) << "handleWork -- component process failed with status " << status;
                    produced = 0;
                }
                if (produced > 0) {
                    auto it = mWorkMap.find(output.frameIndex);
                    ApexCodec_BufferFlags outputFlags;
                    uint64_t outputFrameIndex;
                    uint64_t outputTimestampUs;
                    ApexCodec_Status status = ApexCodec_Buffer_getBufferInfo(
                            output, &outputFlags, &outputFrameIndex, &outputTimestampUs);
                    if (status != APEXCODEC_STATUS_OK) {
                        LOG(WARNING) << "handleWork -- failed to get output buffer info";
                        outputFrameIndex = ~(uint64_t(0));
                    }
                    auto it = mWorkMap.find(outputFrameIndex);
                    std::unique_ptr<C2Work> outputWorkItem;
                    if (it != mWorkMap.end()) {
                        if (output.flags & APEXCODEC_FLAG_INCOMPLETE) {
                        if (outputFlags & APEXCODEC_FLAG_INCOMPLETE) {
                            outputWorkItem = std::make_unique<C2Work>();
                            outputWorkItem->input.ordinal = it->second->input.ordinal;
                            outputWorkItem->input.flags = it->second->input.flags;
@@ -1587,10 +1603,10 @@ private:
                        }
                    } else {
                        LOG(WARNING) << "handleWork -- no work item found for output frame index "
                                    << output.frameIndex;
                                    << outputFrameIndex;
                        outputWorkItem = std::make_unique<C2Work>();
                        outputWorkItem->input.ordinal.frameIndex = output.frameIndex;
                        outputWorkItem->input.ordinal.timestamp = output.timestampUs;
                        outputWorkItem->input.ordinal.frameIndex = outputFrameIndex;
                        outputWorkItem->input.ordinal.timestamp = outputTimestampUs;
                    }
                    outputWorkItem->worklets.emplace_back(new C2Worklet);
                    const std::unique_ptr<C2Worklet> &worklet = outputWorkItem->worklets.front();
@@ -1598,35 +1614,52 @@ private:
                        LOG(ERROR) << "handleWork -- output work item has null worklet";
                        return;
                    }
                    worklet->output.ordinal.frameIndex = output.frameIndex;
                    worklet->output.ordinal.timestamp = output.timestampUs;
                    worklet->output.ordinal.frameIndex = outputFrameIndex;
                    worklet->output.ordinal.timestamp = outputTimestampUs;
                    ApexCodec_LinearBuffer outputConfigUpdates;
                    bool ownedByClient = false;
                    status = ApexCodec_Buffer_getConfigUpdates(
                            output, &outputConfigUpdates, &ownedByClient);
                    if (status != APEXCODEC_STATUS_OK) {
                        LOG(WARNING) << "handleWork -- failed to get output config updates";
                        return;
                    } else if (ownedByClient) {
                        LOG(WARNING) << "handleWork -- output config updates are owned by client";
                        return;
                    }
                    // non-owning hidl_vec<> to wrap around the output config updates
                    hidl_vec<uint8_t> outputConfigUpdates;
                    outputConfigUpdates.setToExternal(
                            output.configUpdates.data, output.configUpdates.size);
                    hidl_vec<uint8_t> outputConfigUpdatesVec;
                    outputConfigUpdatesVec.setToExternal(
                            outputConfigUpdates.data, outputConfigUpdates.size);
                    std::vector<C2Param*> outputConfigUpdatePtrs;
                    parseParamsBlob(&outputConfigUpdatePtrs, outputConfigUpdates);
                    parseParamsBlob(&outputConfigUpdatePtrs, outputConfigUpdatesVec);
                    worklet->output.configUpdate.clear();
                    std::ranges::transform(
                            outputConfigUpdatePtrs,
                            std::back_inserter(worklet->output.configUpdate),
                            [](C2Param* param) { return C2Param::Copy(*param); });
                    worklet->output.flags = (C2FrameData::flags_t)output.flags;
                    worklet->output.flags = (C2FrameData::flags_t)outputFlags;

                    workItems.push_back(std::move(outputWorkItem));
                }

                ApexCodec_BufferType inputType = ApexCodec_Buffer_getType(input);
                // determine whether the input buffer is drained
                if (input.type == APEXCODEC_BUFFER_TYPE_LINEAR) {
                    if (input.memory.linear.size < consumed) {
                if (inputType == APEXCODEC_BUFFER_TYPE_LINEAR) {
                    ApexCodec_LinearBuffer inputBuffer;
                    status = ApexCodec_Buffer_getLinearBuffer(input, &inputBuffer);
                    if (status != APEXCODEC_STATUS_OK) {
                        LOG(WARNING) << "handleWork -- failed to get input linear buffer";
                        inputDrained = true;
                    } else if (inputBuffer.size < consumed) {
                        LOG(WARNING) << "handleWork -- component consumed more bytes "
                                     << "than the input buffer size";
                        inputDrained = true;
                    } else {
                        input.memory.linear.data += consumed;
                        input.memory.linear.size -= consumed;
                        inputBuffer.data += consumed;
                        inputBuffer.size -= consumed;
                    }
                } else if (input.type == APEXCODEC_BUFFER_TYPE_GRAPHIC) {
                } else if (inputType == APEXCODEC_BUFFER_TYPE_GRAPHIC) {
                    inputDrained = (consumed > 0);
                }
            }
@@ -1669,7 +1702,9 @@ private:
            std::shared_ptr<C2LinearBlock> *linearBlock,
            std::optional<C2WriteView> *linearView,
            std::shared_ptr<C2GraphicBlock> *graphicBlock) {
        if (mOutputBufferType == APEXCODEC_BUFFER_TYPE_LINEAR) {
        if (__builtin_available(android 36, *)) {
            switch (mOutputBufferType) {
                case APEXCODEC_BUFFER_TYPE_LINEAR: {
                    if (!ensureBlockPool()) {
                        return;
                    }
@@ -1682,7 +1717,6 @@ private:
                        comp->query({&maxBufferSize}, {}, C2_MAY_BLOCK, {});
                        mLinearBlockCapacity = maxBufferSize ? maxBufferSize.value : 1024 * 1024;
                    }
            output->type = APEXCODEC_BUFFER_TYPE_LINEAR;
                    c2_status_t status = mBlockPool->fetchLinearBlock(
                            mLinearBlockCapacity,
                            C2MemoryUsage(C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE),
@@ -1694,9 +1728,18 @@ private:
                    if ((*linearView)->error() != C2_OK) {
                        return;
                    }
            output->memory.linear.data = (*linearView)->data();
            output->memory.linear.size = (*linearView)->capacity();
        } else if (mOutputBufferType == APEXCODEC_BUFFER_TYPE_GRAPHIC) {
                    ApexCodec_LinearBuffer linear;
                    linear.data = (*linearView)->data();
                    linear.size = (*linearView)->capacity();
                    ApexCodec_Status apexStatus = ApexCodec_Buffer_setLinearBuffer(
                            output, &linear);
                    if (apexStatus != APEXCODEC_STATUS_OK) {
                        LOG(ERROR) << "allocOutputBuffer -- failed to set linear buffer";
                        return;
                    }
                    break;
                }
                case APEXCODEC_BUFFER_TYPE_GRAPHIC: {
                    if (!ensureBlockPool()) {
                        return;
                    }
@@ -1708,12 +1751,12 @@ private:
                        C2StreamMaxPictureSizeTuning::output maxPictureSize(0u /* stream */);
                        C2StreamPictureSizeInfo::output pictureSize(0u /* stream */);
                        C2StreamPixelFormatInfo::output pixelFormat(0u /* stream */);
                comp->query({&maxPictureSize, &pictureSize, &pixelFormat}, {}, C2_MAY_BLOCK, {});
                        comp->query({&maxPictureSize, &pictureSize, &pixelFormat},
                                    {}, C2_MAY_BLOCK, {});
                        mWidth = maxPictureSize ? maxPictureSize.width : pictureSize.width;
                        mHeight = maxPictureSize ? maxPictureSize.height : pictureSize.height;
                        mFormat = pixelFormat ? pixelFormat.value : HAL_PIXEL_FORMAT_YCBCR_420_888;
                    }
            output->type = APEXCODEC_BUFFER_TYPE_GRAPHIC;
                    c2_status_t status = mBlockPool->fetchGraphicBlock(
                            mWidth, mHeight, mFormat,
                            C2MemoryUsage(C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE),
@@ -1735,23 +1778,41 @@ private:
                    AHardwareBuffer *hardwareBuffer =
                        AHardwareBuffer_from_GraphicBuffer(graphicBuffer.get());
                    AHardwareBuffer_acquire(hardwareBuffer);
            output->memory.graphic = hardwareBuffer;
        } else {
                    ApexCodec_Status apexStatus = ApexCodec_Buffer_setGraphicBuffer(
                            output, hardwareBuffer);
                    if (apexStatus != APEXCODEC_STATUS_OK) {
                        LOG(ERROR) << "allocOutputBuffer -- failed to set graphic buffer";
                        return;
                    }
                    break;
                }
                default: {
                    LOG(ERROR) << "allocOutputBuffer -- unsupported output buffer type: "
                            << mOutputBufferType;
                    return;
                }
            }
        } else {
            LOG(ERROR) << "allocOutputBuffer -- ApexCodec is not supported";
        }
    }

    static bool FillMemory(
            const std::shared_ptr<C2Buffer>& buffer,
            ApexCodec_Buffer* apexBuffer,
            std::optional<C2ReadView>* linearView) {
            std::optional<C2ReadView>* linearView,
            ApexCodec_BufferFlags flags,
            uint64_t frameIndex,
            uint64_t timestampUs) {
        if (__builtin_available(android 36, *)) {
            if (buffer->data().type() == C2BufferData::LINEAR) {
            apexBuffer->type = APEXCODEC_BUFFER_TYPE_LINEAR;
                if (buffer->data().linearBlocks().empty()) {
                apexBuffer->memory.linear.data = nullptr;
                apexBuffer->memory.linear.size = 0;
                    ApexCodec_Status status = ApexCodec_Buffer_setLinearBuffer(apexBuffer, nullptr);
                    if (status != APEXCODEC_STATUS_OK) {
                        LOG(ERROR) << "FillMemory -- failed to set linear buffer";
                        return false;
                    }
                    ApexCodec_Buffer_setBufferInfo(apexBuffer, flags, frameIndex, timestampUs);
                    return true;
                } else if (buffer->data().linearBlocks().size() > 1) {
                    return false;
@@ -1760,13 +1821,25 @@ private:
                if ((*linearView)->error() != C2_OK) {
                    return false;
                }
            apexBuffer->memory.linear.data = const_cast<uint8_t*>((*linearView)->data());
            apexBuffer->memory.linear.size = (*linearView)->capacity();
                ApexCodec_LinearBuffer linear;
                linear.data = const_cast<uint8_t*>((*linearView)->data());
                linear.size = (*linearView)->capacity();
                ApexCodec_Status status = ApexCodec_Buffer_setLinearBuffer(apexBuffer, &linear);
                if (status != APEXCODEC_STATUS_OK) {
                    LOG(ERROR) << "FillMemory -- failed to set linear buffer";
                    return false;
                }
                ApexCodec_Buffer_setBufferInfo(apexBuffer, flags, frameIndex, timestampUs);
                return true;
            } else if (buffer->data().type() == C2BufferData::GRAPHIC) {
            apexBuffer->type = APEXCODEC_BUFFER_TYPE_GRAPHIC;
                if (buffer->data().graphicBlocks().empty()) {
                apexBuffer->memory.graphic = nullptr;
                    ApexCodec_Status status = ApexCodec_Buffer_setGraphicBuffer(
                            apexBuffer, nullptr);
                    if (status != APEXCODEC_STATUS_OK) {
                        LOG(ERROR) << "FillMemory -- failed to set graphic buffer";
                        return false;
                    }
                    ApexCodec_Buffer_setBufferInfo(apexBuffer, flags, frameIndex, timestampUs);
                    return true;
                } else if (buffer->data().graphicBlocks().size() > 1) {
                    return false;
@@ -1785,9 +1858,16 @@ private:
                AHardwareBuffer *hardwareBuffer =
                    AHardwareBuffer_from_GraphicBuffer(graphicBuffer.get());
                AHardwareBuffer_acquire(hardwareBuffer);
            apexBuffer->memory.graphic = hardwareBuffer;
                ApexCodec_Status status = ApexCodec_Buffer_setGraphicBuffer(
                        apexBuffer, hardwareBuffer);
                if (status != APEXCODEC_STATUS_OK) {
                    LOG(ERROR) << "FillMemory -- failed to set graphic buffer";
                    return false;
                }
                ApexCodec_Buffer_setBufferInfo(apexBuffer, flags, frameIndex, timestampUs);
                return true;
            }
        }
        return false;
    }

+64 −0
Original line number Diff line number Diff line
@@ -63,6 +63,70 @@ ApexCodec_Configurable *ApexCodec_Component_getConfigurable(
    return nullptr;
}

ApexCodec_Buffer *ApexCodec_Buffer_create() {
    return nullptr;
}

void ApexCodec_Buffer_destroy(ApexCodec_Buffer *buffer) {}

void ApexCodec_Buffer_clear(ApexCodec_Buffer *buffer) {}

ApexCodec_BufferType ApexCodec_Buffer_getType(ApexCodec_Buffer *buffer) {
    return APEXCODEC_BUFFER_TYPE_EMPTY;
}

void ApexCodec_Buffer_setBufferInfo(
        ApexCodec_Buffer *buffer,
        ApexCodec_BufferFlags flags,
        uint64_t frameIndex,
        uint64_t timestampUs) {
}

ApexCodec_Status ApexCodec_Buffer_setLinearBuffer(
        ApexCodec_Buffer *buffer,
        const ApexCodec_LinearBuffer *linearBuffer) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Buffer_setGraphicBuffer(
        ApexCodec_Buffer *buffer,
        AHardwareBuffer *graphicBuffer) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Buffer_setConfigUpdates(
        ApexCodec_Buffer *buffer,
        const ApexCodec_LinearBuffer *configUpdates) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Buffer_getBufferInfo(
        ApexCodec_Buffer *buffer,
        ApexCodec_BufferFlags *outFlags,
        uint64_t *outFrameIndex,
        uint64_t *outTimestampUs) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Buffer_getLinearBuffer(
        ApexCodec_Buffer *buffer,
        ApexCodec_LinearBuffer *outLinearBuffer) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Buffer_getGraphicBuffer(
        ApexCodec_Buffer *buffer,
        AHardwareBuffer **outGraphicBuffer) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_Buffer_getConfigUpdates(
        ApexCodec_Buffer *buffer,
        ApexCodec_LinearBuffer *outConfigUpdates,
        bool *outOwnedByClient) {
    return APEXCODEC_STATUS_OMITTED;
}

ApexCodec_Status ApexCodec_SupportedValues_getTypeAndValues(
        ApexCodec_SupportedValues *supportedValues,
        ApexCodec_SupportedValuesType *type,
+205 −37

File changed.

Preview size limit exceeded, changes collapsed.

+13 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading