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

Commit 2480ddf3 authored by Henry Fang's avatar Henry Fang Committed by Android (Google) Code Review
Browse files

Merge "Add TEMI filter, releasing AV handle and CI-CAM"

parents fb64aa59 89f12f58
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import ITimeFilter;
/**
 * Demultiplexer(Demux) takes a single multiplexed input and splits it into
 * one or more output.
 *
 */
interface IDemux {
    /**
@@ -134,4 +133,30 @@ interface IDemux {
     */
    openDvr(DvrType type, uint32_t bufferSize, IDvrCallback cb)
        generates (Result result, IDvr dvr);

    /**
     * Connect Conditional Access Modules (CAM) through Common Interface (CI)
     *
     * It is used by the client to connect CI-CAM. The demux uses the output
     * from the frontend as the input by default, and must change to use the
     * output from CI-CAM as the input after this call take place.
     *
     * @param ciCamId specify CI-CAM Id to connect.
     * @return result Result status of the operation.
     *         SUCCESS if successful,
     *         UNKNOWN_ERROR if failed for other reasons.
     */
    connectCiCam(uint32_t ciCamId) generates (Result result);

    /**
     * Disconnect Conditional Access Modules (CAM)
     *
     * It is used by the client to disconnect CI-CAM. The demux will use the
     * output from the frontend as the input after this call take place.
     *
     * @return result Result status of the operation.
     *         SUCCESS if successful,
     *         UNKNOWN_ERROR if failed for other reasons.
     */
    disconnectCiCam() generates (Result result);
};
+15 −0
Original line number Diff line number Diff line
@@ -112,6 +112,21 @@ interface IFilter {
     */
    getId() generates (Result result, uint32_t filterId);

    /**
     * Release the handle reported by the HAL for AV memory.
     *
     * It is used by the client to notify the HAL that the AV handle won't be
     * used any more in client side, so that the HAL can mark the memory
     * presented by file descripor in the handle as released.
     *
     * @param avMemory A handle associated to the memory for audio or video.
     * @return result Result status of the operation.
     *         SUCCESS if successful,
     *         INVALID_ARGUMENT if failed for wrong parameter.
     *         UNKNOWN_ERROR if failed for other reasons.
     */
    releaseAvHandle(handle avMemory) generates (Result result);

    /**
     * Set the filter's data source.
     *
+14 −0
Original line number Diff line number Diff line
@@ -147,6 +147,20 @@ Return<void> Demux::openDvr(DvrType type, uint32_t bufferSize, const sp<IDvrCall
    return Void();
}

Return<Result> Demux::connectCiCam(uint32_t ciCamId) {
    ALOGV("%s", __FUNCTION__);

    mCiCamId = ciCamId;

    return Result::SUCCESS;
}

Return<Result> Demux::disconnectCiCam() {
    ALOGV("%s", __FUNCTION__);

    return Result::SUCCESS;
}

Result Demux::removeFilter(uint32_t filterId) {
    ALOGV("%s", __FUNCTION__);

+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,10 @@ class Demux : public IDemux {
    virtual Return<void> openDvr(DvrType type, uint32_t bufferSize, const sp<IDvrCallback>& cb,
                                 openDvr_cb _hidl_cb) override;

    virtual Return<Result> connectCiCam(uint32_t ciCamId) override;

    virtual Return<Result> disconnectCiCam() override;

    // Functions interacts with Tuner Service
    void stopBroadcastInput();
    Result removeFilter(uint32_t filterId);
@@ -118,6 +122,7 @@ class Demux : public IDemux {
    void startTsFilter(vector<uint8_t> data);

    uint32_t mDemuxId;
    uint32_t mCiCamId;
    /**
     * Record the last used filter id. Initial value is -1.
     * Filter Id starts with 0.
+15 −1
Original line number Diff line number Diff line
@@ -120,6 +120,12 @@ Return<Result> Filter::flush() {
    return Result::SUCCESS;
}

Return<Result> Filter::releaseAvHandle(const hidl_handle& /*avMemory*/) {
    ALOGV("%s", __FUNCTION__);

    return Result::SUCCESS;
}

Return<Result> Filter::close() {
    ALOGV("%s", __FUNCTION__);

@@ -289,6 +295,9 @@ Result Filter::startFilterHandler() {
                case DemuxTsFilterType::RECORD:
                    startRecordFilterHandler();
                    break;
                case DemuxTsFilterType::TEMI:
                    startTemiFilterHandler();
                    break;
            }
            break;
        case DemuxFilterMainType::MMTP:
@@ -419,6 +428,11 @@ Result Filter::startPcrFilterHandler() {
    return Result::SUCCESS;
}

Result Filter::startTemiFilterHandler() {
    // TODO handle starting TEMI filter
    return Result::SUCCESS;
}

bool Filter::writeSectionsAndCreateEvent(vector<uint8_t> data) {
    // TODO check how many sections has been read
    ALOGD("[Filter] section hander");
Loading