/*
- * HAL(Hardware Abstract Layer) API for DRM(Digital Rights Management) including HDCP(High-bandwidth Digital Content Protection)
+ * HAL(Hardware Abstract Layer) API for DRM(Digital Rights Management)
*
* Copyright (c) 2025 Samsung Electronics Co., Ltd.
*
*/
int hal_drm_set_batch_command(void *drm_handle, hal_drm_batch_command_control_s *batch_command, hal_drm_command_e *error_command);
-/**
- * @brief Opens HDCP.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] type The type of HDCP
- * @param[in] version The version of HDCP
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_INITIALIZED.
- * @post If it succeeds, the DRM state will be #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_close()
- */
-int hal_drm_hdcp_open(void *drm_handle, hal_drm_hdcp_device_type_e type, hal_drm_hdcp_protocol_version_e version);
-
-/**
- * @brief Closes HDCP.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @post If it succeeds, the DRM state will be #HAL_DRM_STATE_INITIALIZED.
- * @see hal_drm_hdcp_open()
- */
-int hal_drm_hdcp_close(void *drm_handle);
-
-/**
- * @brief Starts HDCP receiver.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] socket_port The socket port number
- * @param[out] hdcp_id The hdcp id
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_stop_receiver()
- */
-int hal_drm_hdcp_start_receiver(void *drm_handle, uint32_t socket_port, uint32_t *hdcp_id);
-
-/**
- * @brief Stops HDCP receiver.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] hdcp_id The hdcp id
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_start_receiver()
- */
-int hal_drm_hdcp_stop_receiver(void *drm_handle, uint32_t hdcp_id);
-
-/**
- * @brief Starts HDCP transmitter.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] socket_ip The socket ip address
- * @param[in] socket_port The socket port number
- * @param[out] hdcp_id The hdcp id
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_stop_transmitter()
- */
-int hal_drm_hdcp_start_transmitter(void *drm_handle, const char *socket_ip, uint32_t socket_port, uint32_t *hdcp_id);
-
-/**
- * @brief Stops HDCP transmitter.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] hdcp_id The hdcp id
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_start_transmitter()
- */
-int hal_drm_hdcp_stop_transmitter(void *drm_handle, uint32_t hdcp_id);
-
-/**
- * @brief Allocates HDCP output buffer.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] size The size of output buffer
- * @param[in] is_secure The flag which indicates the real data is managed in secure world or not
- * @param[out] output The HDCP output buffer
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_INTERNAL Internal error
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_release_output_buffer()
- * @see hal_drm_hdcp_decrypt()
- */
-int hal_drm_hdcp_allocate_output_buffer(void *drm_handle, uint32_t size, bool is_secure, hal_drm_buffer_s *buffer);
-
-/**
- * @brief Releases HDCP output buffer.
- * @since HAL_MODULE_DRM 1.0
- * @remarks The output buffer should be released with this function after use it.
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] output The HDCP output buffer to release
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_allocate_output_buffer()
- * @see hal_drm_hdcp_decrypt()
- */
-int hal_drm_hdcp_release_output_buffer(void *drm_handle, hal_drm_buffer_s *buffer);
-
-/**
- * @brief Decrypts HDCP data.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] input The input buffer to decrypt
- * @param[in] decrypt_info The decryption information
- * @param[out] output The decrypted output buffer
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_INTERNAL Internal error
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_allocate_output_buffer()
- * @see hal_drm_hdcp_release_output_buffer()
- */
-int hal_drm_hdcp_decrypt(void *drm_handle, hal_drm_buffer_s *input, void *decrypt_info, hal_drm_buffer_s *output);
-
-/**
- * @brief Encrypts HDCP data to send.
- * @since HAL_MODULE_DRM 1.0
- * @param[in] drm_handle The handle to the DRM HAL
- * @param[in] input The input buffer to encrypt
- * @param[in] hdcp_id The hdcp id
- * @param[in] encrypt_info The encryption information
- * @param[out] output The encrypted output buffer
- * @return @c 0 on success, otherwise a negative error value
- * @retval #HAL_DRM_ERROR_NONE Successful
- * @retval #HAL_DRM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #HAL_DRM_ERROR_INTERNAL Internal error
- * @retval #HAL_DRM_ERROR_NOT_IMPLEMENTED The feature is not implemented
- * @pre The DRM state must be set to #HAL_DRM_STATE_HDCP_OPENED.
- * @see hal_drm_hdcp_allocate_output_buffer()
- * @see hal_drm_hdcp_release_output_buffer()
- */
-int hal_drm_hdcp_encrypt(void *drm_handle, hal_drm_buffer_s *input, uint32_t hdcp_id, void *encrypt_info, hal_drm_buffer_s *output);
-
/**
* @}
*/
return handle->funcs->set_batch_command(handle->backend, batch_command, error_command);
}
-
-int hal_drm_hdcp_open(void *drm_handle, hal_drm_hdcp_device_type_e type, hal_drm_hdcp_protocol_version_e version)
-{
- int ret = 0;
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_open, HAL_DRM_ERROR_NOT_IMPLEMENTED);
-
- if (type < HAL_DRM_HDCP_DEVICE_RECEIVER || type > HAL_DRM_HDCP_DEVICE_TRANSMIT_MULTISINK)
- return HAL_DRM_ERROR_INVALID_PARAMETER;
-
- if (version < HAL_DRM_HDCP_VERSION_2_0 || version > HAL_DRM_HDCP_VERSION_2_2)
- return HAL_DRM_ERROR_INVALID_PARAMETER;
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_INITIALIZED);
-
- ret = handle->funcs->hdcp_open(handle->backend, type, version);
- if (ret == HAL_DRM_ERROR_NONE)
- __hal_drm_set_state(handle, HAL_DRM_STATE_HDCP_OPENED);
-
- return ret;
-}
-
-int hal_drm_hdcp_close(void *drm_handle)
-{
- int ret = 0;
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_close, HAL_DRM_ERROR_NOT_IMPLEMENTED);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- ret = handle->funcs->hdcp_close(handle->backend);
- if (ret == HAL_DRM_ERROR_NONE)
- __hal_drm_set_state(handle, HAL_DRM_STATE_INITIALIZED);
-
- return ret;
-}
-
-int hal_drm_hdcp_start_receiver(void *drm_handle, uint32_t socket_port, uint32_t *hdcp_id)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_start_receiver, HAL_DRM_ERROR_NOT_IMPLEMENTED);
- HAL_DRM_RETURN_IF_NULL(hdcp_id, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_start_receiver(handle->backend, socket_port, hdcp_id);
-}
-
-int hal_drm_hdcp_stop_receiver(void *drm_handle, uint32_t hdcp_id)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_stop_receiver, HAL_DRM_ERROR_NOT_IMPLEMENTED);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_stop_receiver(handle->backend, hdcp_id);
-}
-
-int hal_drm_hdcp_start_transmitter(void *drm_handle, const char *socket_ip, uint32_t socket_port, uint32_t *hdcp_id)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_start_transmitter, HAL_DRM_ERROR_NOT_IMPLEMENTED);
- HAL_DRM_RETURN_IF_NULL(socket_ip, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(hdcp_id, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_start_transmitter(handle->backend, socket_ip, socket_port, hdcp_id);
-}
-
-int hal_drm_hdcp_stop_transmitter(void *drm_handle, uint32_t hdcp_id)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_stop_transmitter, HAL_DRM_ERROR_NOT_IMPLEMENTED);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_stop_transmitter(handle->backend, hdcp_id);
-}
-
-int hal_drm_hdcp_allocate_output_buffer(void *drm_handle, uint32_t size, bool is_secure, hal_drm_buffer_s *buffer)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_stop_transmitter, HAL_DRM_ERROR_NOT_IMPLEMENTED);
- HAL_DRM_RETURN_IF_NULL(buffer, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_allocate_output_buffer(handle->backend, size, is_secure, buffer);
-}
-
-int hal_drm_hdcp_release_output_buffer(void *drm_handle, hal_drm_buffer_s *buffer)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_stop_transmitter, HAL_DRM_ERROR_NOT_IMPLEMENTED);
- HAL_DRM_RETURN_IF_NULL(buffer, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_release_output_buffer(handle->backend, buffer);
-}
-
-int hal_drm_hdcp_decrypt(void *drm_handle, hal_drm_buffer_s *input, void *decrypt_info, hal_drm_buffer_s *output)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_decrypt, HAL_DRM_ERROR_NOT_IMPLEMENTED);
- HAL_DRM_RETURN_IF_NULL(input, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(output, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_decrypt(handle->backend, input, decrypt_info, output);
-}
-
-int hal_drm_hdcp_encrypt(void *drm_handle, hal_drm_buffer_s *input, uint32_t hdcp_id, void *encrypt_info, hal_drm_buffer_s *output)
-{
- hal_drm_s *handle = (hal_drm_s *)drm_handle;
-
- HAL_DRM_RETURN_IF_NULL(handle, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(handle->funcs->hdcp_encrypt, HAL_DRM_ERROR_NOT_IMPLEMENTED);
- HAL_DRM_RETURN_IF_NULL(input, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(encrypt_info, HAL_DRM_ERROR_INVALID_PARAMETER);
- HAL_DRM_RETURN_IF_NULL(output, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- AUTOCLEAN_LOCKER(&handle->lock);
-
- HAL_DRM_CHECK_STATE(handle->state, HAL_DRM_STATE_HDCP_OPENED);
-
- return handle->funcs->hdcp_encrypt(handle->backend, input, hdcp_id, encrypt_info, output);
-}
static int gRet;
static void *gHalHandle;
-static const char *gSocketIp = "192.168.0.1";
-static int gPortIp = 100;
/*
* main class
batch_command.custom.name = "custom_command_name";
batch_command.custom.value = (void*)10;
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
gRet = hal_drm_set_batch_command(gHalHandle, &batch_command, nullptr);
ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
}
/**
batch_command.custom.name = "custom_command_name";
batch_command.custom.value = (void*)10;
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
gRet = hal_drm_set_batch_command(nullptr, &batch_command, nullptr);
ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
gRet = hal_drm_set_batch_command(gHalHandle, nullptr, nullptr);
ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpOpenP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Open HDCP
- * @apicovered hal_drm_hdcp_open
- * @passcase when hal_drm_hdcp_open returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_open does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpOpenP)
-{
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpCloseP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Close HDCP
- * @apicovered hal_drm_hdcp_close
- * @passcase when hal_drm_hdcp_close returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_close does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpCloseP)
-{
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpCloseN
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Close HDCP
- * @apicovered hal_drm_hdcp_close
- * @passcase when hal_drm_hdcp_open is not called and hal_drm_hdcp_close returns HAL_DRM_ERROR_INVALID_STATE
- * @failcase when hal_drm_hdcp_close does not return HAL_DRM_ERROR_INVALID_STATE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpCloseN1)
-{
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_STATE);
-}
-
-/**
- * @testcase HdcpCloseN
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Close HDCP
- * @apicovered hal_drm_hdcp_close
- * @passcase when hal_drm_hdcp_close returns HAL_DRM_ERROR_INVALID_PARAMETER
- * @failcase when hal_drm_hdcp_close does not return HAL_DRM_ERROR_INVALID_PARAMETER
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpCloseN2)
-{
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(nullptr);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-}
-
-/**
- * @testcase HdcpStartReceiverP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Start HDCP receiver
- * @apicovered hal_drm_hdcp_start_receiver
- * @passcase when hal_drm_hdcp_start_receiver returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_start_receiver does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStartReceiverP)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_receiver(gHalHandle, 100, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpStartReceiverN
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Start HDCP receiver
- * @apicovered hal_drm_hdcp_start_receiver
- * @passcase when hal_drm_hdcp_start_receiver returns HAL_DRM_ERROR_INVALID_STATE
- * @failcase when hal_drm_hdcp_start_receiver does not return HAL_DRM_ERROR_INVALID_STATE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStartReceiverN1)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_start_receiver(gHalHandle, 100, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_STATE);
-}
-
-/**
- * @testcase HdcpStartReceiverN2
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Start HDCP receiver
- * @apicovered hal_drm_hdcp_start_receiver
- * @passcase when hal_drm_hdcp_start_receiver returns HAL_DRM_ERROR_INVALID_PARAMETER
- * @failcase when hal_drm_hdcp_start_receiver does not return HAL_DRM_ERROR_INVALID_PARAMETER
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStartReceiverN2)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_receiver(nullptr, 100, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_start_receiver(gHalHandle, 100, nullptr);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpStopReceiverP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Stop HDCP receiver
- * @apicovered hal_drm_hdcp_stop_receiver
- * @passcase when hal_drm_hdcp_stop_receiver returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_stop_receiver does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStopReceiverP)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_receiver(gHalHandle, 100, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_receiver(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpStopReceiverN1
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Stop HDCP receiver
- * @apicovered hal_drm_hdcp_stop_receiver
- * @passcase when hal_drm_hdcp_stop_receiver returns HAL_DRM_ERROR_INVALID_STATE
- * @failcase when hal_drm_hdcp_stop_receiver does not return HAL_DRM_ERROR_INVALID_STATE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStopReceiverN1)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_stop_receiver(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_STATE);
-}
-
-/**
- * @testcase HdcpStopReceiverN2
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Stop HDCP receiver
- * @apicovered hal_drm_hdcp_stop_receiver
- * @passcase when hal_drm_hdcp_stop_receiver returns HAL_DRM_ERROR_INVALID_PARAMETER
- * @failcase when hal_drm_hdcp_stop_receiver does not return HAL_DRM_ERROR_INVALID_PARAMETER
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStopReceiverN2)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_receiver(gHalHandle, 100, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_receiver(nullptr, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpStartTransmitterP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Start HDCP transmitter
- * @apicovered hal_drm_hdcp_start_transmitter
- * @passcase when hal_drm_hdcp_start_transmitter returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_start_transmitter does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStartTransmitterP)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpStartTransmitterN1
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Start HDCP transmitter
- * @apicovered hal_drm_hdcp_start_transmitter
- * @passcase when hal_drm_hdcp_start_transmitter returns HAL_DRM_ERROR_INVALID_STATE
- * @failcase when hal_drm_hdcp_start_transmitter does not return HAL_DRM_ERROR_INVALID_STATE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStartTransmitterN1)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_STATE);
-}
-
-/**
- * @testcase HdcpStartTransmitterN2
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Start HDCP transmitter
- * @apicovered hal_drm_hdcp_start_transmitter
- * @passcase when hal_drm_hdcp_start_transmitter returns HAL_DRM_ERROR_INVALID_PARAMETER
- * @failcase when hal_drm_hdcp_start_transmitter does not return HAL_DRM_ERROR_INVALID_PARAMETER
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStartTransmitterN2)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(nullptr, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpStopTransmitterP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Stop HDCP transmitter
- * @apicovered hal_drm_hdcp_stop_transmitter
- * @passcase when hal_drm_hdcp_stop_transmitter returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_stop_transmitter does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStopTransmitterP)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpStopTransmitterN1
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Stop HDCP transmitter
- * @apicovered hal_drm_hdcp_stop_transmitter
- * @passcase when hal_drm_hdcp_stop_transmitter returns HAL_DRM_ERROR_INVALID_STATE
- * @failcase when hal_drm_hdcp_stop_transmitter does not return HAL_DRM_ERROR_INVALID_STATE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStopTransmitterN1)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_STATE);
-}
-
-/**
- * @testcase HdcpStopTransmitterN2
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Stop HDCP transmitter
- * @apicovered hal_drm_hdcp_stop_transmitter
- * @passcase when hal_drm_hdcp_stop_transmitter returns HAL_DRM_ERROR_INVALID_PARAMETER
- * @failcase when hal_drm_hdcp_stop_transmitter does not return HAL_DRM_ERROR_INVALID_PARAMETER
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpStopTransmitterN2)
-{
- uint32_t hdcp_id = 0;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_transmitter(nullptr, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpAllocateBufferP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Allocate output buffer
- * @apicovered hal_drm_hdcp_allocate_output_buffer
- * @passcase when hal_drm_hdcp_allocate_output_buffer returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_allocate_output_buffer does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpAllocateBufferP)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s output;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_allocate_output_buffer(gHalHandle, 1000, false, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpAllocateBufferN
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Allocate output buffer
- * @apicovered hal_drm_hdcp_allocate_output_buffer
- * @passcase when hal_drm_hdcp_allocate_output_buffer returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_allocate_output_buffer does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpAllocateBufferN)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s output;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_allocate_output_buffer(nullptr, 1000, false, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_allocate_output_buffer(gHalHandle, 1000, false, nullptr);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpReleaseBufferP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Release output buffer
- * @apicovered hal_drm_hdcp_release_output_buffer
- * @passcase when hal_drm_hdcp_release_output_buffer returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_release_output_buffer does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpReleaseBufferP)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s output;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_allocate_output_buffer(gHalHandle, 1000, false, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_release_output_buffer(gHalHandle, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpReleaseBufferN
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Release output buffer
- * @apicovered hal_drm_hdcp_release_output_buffer
- * @passcase when hal_drm_hdcp_release_output_buffer returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_release_output_buffer does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpReleaseBufferN)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s output;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_allocate_output_buffer(gHalHandle, 1000, false, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_release_output_buffer(nullptr, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_release_output_buffer(gHalHandle, nullptr);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpDecryptP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Decrypt HDCP data
- * @apicovered hal_drm_hdcp_decrypt
- * @passcase when hal_drm_hdcp_decrypt returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_decrypt does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpDecryptP)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s input, output;
- uint32_t decrypt_info;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_allocate_output_buffer(gHalHandle, 1000, false, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- input.size = 100;
- gRet = hal_drm_hdcp_decrypt(gHalHandle, &input, (void *)&decrypt_info, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpDecryptN1
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Decrypt HDCP data
- * @apicovered hal_drm_hdcp_decrypt
- * @passcase when hal_drm_hdcp_decrypt returns HAL_DRM_ERROR_INVALID_PARAMETER
- * @failcase when hal_drm_hdcp_decrypt does not return HAL_DRM_ERROR_INVALID_PARAMETER
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpDecryptN1)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s output;
- int decrypt_info;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_decrypt(gHalHandle, nullptr, (void *)&decrypt_info, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpEncryptP
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Positive, Encrypt HDCP data
- * @apicovered hal_drm_hdcp_encrypt
- * @passcase when hal_drm_hdcp_encrypt returns HAL_DRM_ERROR_NONE
- * @failcase when hal_drm_hdcp_encrypt does not return HAL_DRM_ERROR_NONE
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpEncryptP)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s input, output;
- uint32_t encrypt_info;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_allocate_output_buffer(gHalHandle, 1000, false, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- input.size = 100;
- gRet = hal_drm_hdcp_encrypt(gHalHandle, &input, hdcp_id, (void *)&encrypt_info, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-}
-
-/**
- * @testcase HdcpEncryptN1
- * @since HAL_MODULE_DRM 1.0
- * @author SR(haesu.gwon)
- * @reviewer SR(gilbok)
- * @type auto
- * @description Negative, Encrypt HDCP data
- * @apicovered hal_drm_hdcp_encrypt
- * @passcase when hal_drm_hdcp_encrypt returns HAL_DRM_ERROR_INVALID_PARAMETER
- * @failcase when hal_drm_hdcp_encrypt does not return HAL_DRM_ERROR_INVALID_PARAMETER
- * @precondition None
- * @postcondition None
- */
-TEST_F(DrmHalTest, HdcpEncryptN1)
-{
- uint32_t hdcp_id = 0;
- hal_drm_buffer_s input, output;
- uint32_t encrypt_info;
- input.size = 100;
-
- gRet = hal_drm_hdcp_open(gHalHandle, HAL_DRM_HDCP_DEVICE_RECEIVER, HAL_DRM_HDCP_VERSION_2_0);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_start_transmitter(gHalHandle, gSocketIp, gPortIp, &hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_encrypt(gHalHandle, nullptr, hdcp_id, (void *)&encrypt_info, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_encrypt(gHalHandle, &input, hdcp_id, nullptr, &output);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_encrypt(gHalHandle, &input, hdcp_id, (void *)&encrypt_info, nullptr);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_INVALID_PARAMETER);
-
- gRet = hal_drm_hdcp_stop_transmitter(gHalHandle, hdcp_id);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
-
- gRet = hal_drm_hdcp_close(gHalHandle);
- ASSERT_EQ(gRet, HAL_DRM_ERROR_NONE);
}
int main(int argc, char **argv)