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

Commit 3b39f0e3 authored by Amy Zhang's avatar Amy Zhang Committed by android-build-merger
Browse files

Merge changes I1f2c9bfe,I38a92abb am: aedfe936 am: a843f717

am: 42eaeb48

Change-Id: I141aa6a7e23e076c59d37ee4362ead6551723842
parents 0f8c18d6 42eaeb48
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,8 @@ cc_defaults {
    relative_install_path: "hw",
    relative_install_path: "hw",
    srcs: [
    srcs: [
        "Frontend.cpp",
        "Frontend.cpp",
        "Descrambler.cpp",
        "Demux.cpp",
        "Tuner.cpp",
        "Tuner.cpp",
        "service.cpp",
        "service.cpp",
    ],
    ],
+55 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define LOG_TAG "android.hardware.tv.tuner@1.0-Demux"

#include "Demux.h"
#include <utils/Log.h>

namespace android {
namespace hardware {
namespace tv {
namespace tuner {
namespace V1_0 {
namespace implementation {

Demux::Demux(uint32_t demuxId) {
    mDemuxId = demuxId;
}

Demux::~Demux() {}

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

    mSourceFrontendId = frontendId;

    return Result::SUCCESS;
}

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

    return Result::SUCCESS;
    ;
}

}  // namespace implementation
}  // namespace V1_0
}  // namespace tuner
}  // namespace tv
}  // namespace hardware
}  // namespace android
+55 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_HARDWARE_TV_TUNER_V1_0_DEMUX_H_
#define ANDROID_HARDWARE_TV_TUNER_V1_0_DEMUX_H_

#include <android/hardware/tv/tuner/1.0/IDemux.h>

using namespace std;

namespace android {
namespace hardware {
namespace tv {
namespace tuner {
namespace V1_0 {
namespace implementation {

using ::android::hardware::tv::tuner::V1_0::IDemux;
using ::android::hardware::tv::tuner::V1_0::Result;

class Demux : public IDemux {
  public:
    Demux(uint32_t demuxId);

    virtual Return<Result> setFrontendDataSource(uint32_t frontendId) override;

    virtual Return<Result> close() override;

  private:
    virtual ~Demux();
    uint32_t mDemuxId;
    uint32_t mSourceFrontendId;
};

}  // namespace implementation
}  // namespace V1_0
}  // namespace tuner
}  // namespace tv
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_TV_TUNER_V1_0_DEMUX_H_
+59 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define LOG_TAG "android.hardware.tv.tuner@1.0-Descrambler"

#include <android/hardware/tv/tuner/1.0/IFrontendCallback.h>
#include <utils/Log.h>

#include "Descrambler.h"

namespace android {
namespace hardware {
namespace tv {
namespace tuner {
namespace V1_0 {
namespace implementation {

Descrambler::Descrambler() {}

Descrambler::~Descrambler() {}

Return<Result> Descrambler::setDemuxSource(uint32_t demuxId) {
    ALOGV("%s", __FUNCTION__);
    if (mDemuxSet) {
        ALOGW("[   WARN   ] Descrambler has already been set with a demux id %d", mSourceDemuxId);
        return Result::INVALID_STATE;
    }
    mDemuxSet = true;
    mSourceDemuxId = demuxId;

    return Result::SUCCESS;
}

Return<Result> Descrambler::close() {
    ALOGV("%s", __FUNCTION__);
    mDemuxSet = false;

    return Result::SUCCESS;
}

}  // namespace implementation
}  // namespace V1_0
}  // namespace tuner
}  // namespace tv
}  // namespace hardware
}  // namespace android
+56 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_HARDWARE_TV_TUNER_V1_0_DESCRAMBLER_H_
#define ANDROID_HARDWARE_TV_TUNER_V1_0_DESCRAMBLER_H_

#include <android/hardware/tv/tuner/1.0/IDescrambler.h>
#include <android/hardware/tv/tuner/1.0/ITuner.h>

using namespace std;

namespace android {
namespace hardware {
namespace tv {
namespace tuner {
namespace V1_0 {
namespace implementation {

using ::android::hardware::tv::tuner::V1_0::IDescrambler;
using ::android::hardware::tv::tuner::V1_0::Result;

class Descrambler : public IDescrambler {
  public:
    Descrambler();

    virtual Return<Result> setDemuxSource(uint32_t demuxId) override;

    virtual Return<Result> close() override;

  private:
    virtual ~Descrambler();
    uint32_t mSourceDemuxId;
    bool mDemuxSet = false;
};

}  // namespace implementation
}  // namespace V1_0
}  // namespace tuner
}  // namespace tv
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_TV_TUNER_V1_DESCRAMBLER_H_
Loading