blob: 459e5e3006527205926ffeebc6b589b6f5bc1336 [file] [log] [blame]
Chong Zhanga4f67512017-04-24 17:18:25 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package android.hardware.cas.native@1.0;
17
18import android.hardware.cas@1.0::IDescramblerBase;
19
20/**
21 * IDescrambler is the native plugin API for descrambling operations.
22 */
23
24interface IDescrambler extends IDescramblerBase {
25 /**
26 * Descramble the data in a source SharedBuffer, described by an array of
27 * SubSample structures.
28 *
29 * @param scramblingControl an enumeration indicating the key that the subsamples
30 * were scrambled with.
31 * @param subSamples an array of SubSample structures describing the number of
32 * clear and scrambled bytes within each subsample.
33 * @param srcBuffer the SharedBuffer containing the source scrambled data.
34 * @param srcOffset the position where the source scrambled data starts at.
35 * @param dstBuffer the DestinationBuffer to hold the descrambled data.
36 * @param dstOffset the position where the descrambled data should start at.
37 *
38 * @return status the status of the call.
39 * @return bytesWritten number of bytes that have been successfully descrambled.
40 * @return detailedError a detailed message describing the error (if any).
41 */
42 descramble(ScramblingControl scramblingControl, vec<SubSample> subSamples,
43 SharedBuffer srcBuffer, uint64_t srcOffset, DestinationBuffer dstBuffer, uint64_t dstOffset)
44 generates(Status status, uint32_t bytesWritten, string detailedError);
45};