blob: 09f47b1154f4e488e6b91fed9fa3ca4f10b2b3a9 [file] [log] [blame]
/**
* Copyright (C) 2020 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.
*/
#include <stdlib.h>
#include "media/NdkMediaCodec.h"
#include "../includes/common.h"
#define NUM_SUB_SAMPLES ((SIZE_MAX / (sizeof(size_t)*2) - 34) + 32)
int main() {
uint8_t key[16] = { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 };
uint8_t iv[16] = { 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1 };
size_t clearBytes[4] = { 5, 6, 7, 8 };
size_t encryptedBytes[4] = { 8, 7, 6, 5 };
AMediaCodecCryptoInfo_new((int) NUM_SUB_SAMPLES, key, iv,
AMEDIACODECRYPTOINFO_MODE_CLEAR, clearBytes,
encryptedBytes);
return EXIT_SUCCESS;
}