| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2012, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bdsp_video_encode_task.c $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/3 $ |
|---|
| 12 | * $brcm_Date: 1/12/12 8:07p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: Host DSP Interface |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/basemodules/dsp/common/bdsp_video_encode_task.c $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/3 1/12/12 8:07p ashoky |
|---|
| 21 | * FWRAA-390: Adding userconfig for datasync module for dsp video encoder. |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/2 10/13/11 7:20p ashoky |
|---|
| 24 | * SW7231-344: Adding changes in the interface after discussion. |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/1 10/4/11 7:48p ashoky |
|---|
| 27 | * SW7231-344: Adding changes in the interface after discussion. |
|---|
| 28 | * |
|---|
| 29 | ***************************************************************************/ |
|---|
| 30 | #include "bdsp.h" |
|---|
| 31 | #include "bdsp_priv.h" |
|---|
| 32 | |
|---|
| 33 | /* Retruns the datasync settings for video encoder */ |
|---|
| 34 | BERR_Code BDSP_VideoEncodeTask_GetDatasyncSettings( |
|---|
| 35 | BDSP_TaskHandle task, |
|---|
| 36 | unsigned branchId, |
|---|
| 37 | unsigned stageId, |
|---|
| 38 | BDSP_VideoEncodeTaskDatasyncSettings *pDatasyncSettings /* [out] */ |
|---|
| 39 | ) |
|---|
| 40 | { |
|---|
| 41 | BDBG_OBJECT_ASSERT(task, BDSP_Task); |
|---|
| 42 | BDBG_ASSERT(NULL != pDatasyncSettings); |
|---|
| 43 | |
|---|
| 44 | if ( task->getVideoEncodeDatasyncSettings ) |
|---|
| 45 | { |
|---|
| 46 | return task->getVideoEncodeDatasyncSettings(task->pTaskHandle, branchId, stageId, pDatasyncSettings); |
|---|
| 47 | } |
|---|
| 48 | else |
|---|
| 49 | { |
|---|
| 50 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 51 | } |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | /* Sets datasync settings for dsp video encoder */ |
|---|
| 55 | BERR_Code BDSP_VideoEncodeTask_SetDatasyncSettings( |
|---|
| 56 | BDSP_TaskHandle task, |
|---|
| 57 | unsigned branchId, |
|---|
| 58 | unsigned stageId, |
|---|
| 59 | const BDSP_VideoEncodeTaskDatasyncSettings *pDatasyncSettings |
|---|
| 60 | ) |
|---|
| 61 | { |
|---|
| 62 | BDBG_OBJECT_ASSERT(task, BDSP_Task); |
|---|
| 63 | BDBG_ASSERT(NULL != pDatasyncSettings); |
|---|
| 64 | |
|---|
| 65 | if ( task->setVideoEncodeDatasyncSettings ) |
|---|
| 66 | { |
|---|
| 67 | return task->setVideoEncodeDatasyncSettings(task->pTaskHandle, branchId, stageId, pDatasyncSettings); |
|---|
| 68 | } |
|---|
| 69 | else |
|---|
| 70 | { |
|---|
| 71 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 72 | } |
|---|
| 73 | } |
|---|
| 74 | |
|---|
| 75 | /* Function for getting a free picture buffer. Returns a NULL address if no picture buffer is available */ |
|---|
| 76 | BERR_Code BDSP_VideoEncode_getPictureBuffer_isr( |
|---|
| 77 | BDSP_TaskHandle task, |
|---|
| 78 | BVENC_VF_sPicParamBuff **pPictureParmBuf |
|---|
| 79 | ) |
|---|
| 80 | { |
|---|
| 81 | BDBG_OBJECT_ASSERT(task, BDSP_Task); |
|---|
| 82 | if ( task->getPictureBuffer_isr) |
|---|
| 83 | { |
|---|
| 84 | return task->getPictureBuffer_isr(task->pTaskHandle, pPictureParmBuf); |
|---|
| 85 | } |
|---|
| 86 | else |
|---|
| 87 | { |
|---|
| 88 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 89 | } |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | BERR_Code BDSP_VideoEncode_putPicture_isr( |
|---|
| 93 | BDSP_TaskHandle task, |
|---|
| 94 | uint32_t ui32PPBAddress |
|---|
| 95 | ) |
|---|
| 96 | { |
|---|
| 97 | BDBG_OBJECT_ASSERT(task, BDSP_Task); |
|---|
| 98 | if ( task->putPicture_isr) |
|---|
| 99 | { |
|---|
| 100 | return task->putPicture_isr(task->pTaskHandle, ui32PPBAddress); |
|---|
| 101 | } |
|---|
| 102 | else |
|---|
| 103 | { |
|---|
| 104 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 105 | } |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|