Dharmaray Kundargi | 643290d | 2011-01-16 16:02:42 -0800 | [diff] [blame] | 1 | /*
|
| 2 | * Copyright (C) 2011 NXP Software
|
| 3 | * Copyright (C) 2011 The Android Open Source Project
|
| 4 | *
|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 | * you may not use this file except in compliance with the License.
|
| 7 | * You may obtain a copy of the License at
|
| 8 | *
|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 10 | *
|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 | * See the License for the specific language governing permissions and
|
| 15 | * limitations under the License.
|
| 16 | */
|
| 17 |
|
| 18 | #ifndef ANDROID_VE_TOOLS_H
|
| 19 | #define ANDROID_VE_TOOLS_H
|
| 20 |
|
| 21 | #include "M4OSA_Types.h"
|
| 22 | #include "M4OSA_Memory.h"
|
| 23 | #include "M4OSA_Debug.h"
|
| 24 | #include "M4VIFI_FiltersAPI.h"
|
| 25 | /* Macro definitions */
|
| 26 | #include "M4VIFI_Defines.h"
|
| 27 | /* Clip table declaration */
|
| 28 | #include "M4VIFI_Clip.h"
|
| 29 | #include "M4VFL_transition.h"
|
| 30 | #include "M4VSS3GPP_API.h"
|
| 31 | #include "M4xVSS_API.h"
|
| 32 | #include "M4xVSS_Internal.h"
|
| 33 |
|
| 34 | #include "M4AIR_API.h"
|
| 35 | #include "PreviewRenderer.h"
|
| 36 | #define MEDIA_RENDERING_INVALID 255
|
| 37 |
|
| 38 | #define TRANSPARENT_COLOR 0x7E0
|
| 39 | #define LUM_FACTOR_MAX 10
|
| 40 | enum {
|
| 41 | VIDEO_EFFECT_NONE = 0,
|
| 42 | VIDEO_EFFECT_BLACKANDWHITE = 1,
|
| 43 | VIDEO_EFFECT_PINK = 2,
|
| 44 | VIDEO_EFFECT_GREEN = 4,
|
| 45 | VIDEO_EFFECT_SEPIA = 8,
|
| 46 | VIDEO_EFFECT_NEGATIVE = 16,
|
| 47 | VIDEO_EFFECT_FRAMING = 32,
|
| 48 | VIDEO_EFFECT_FIFTIES = 64,
|
| 49 | VIDEO_EFFECT_COLOR_RGB16 = 128,
|
| 50 | VIDEO_EFFECT_GRADIENT = 256,
|
| 51 | VIDEO_EFFECT_FADEFROMBLACK = 512,
|
| 52 | VIDEO_EFFECT_CURTAINOPEN = 1024,
|
| 53 | VIDEO_EFFECT_FADETOBLACK = 2048,
|
| 54 | VIDEO_EFFECT_CURTAINCLOSE = 4096,
|
| 55 | };
|
| 56 |
|
| 57 | typedef struct {
|
| 58 | M4VIFI_UInt8 *vidBuffer;
|
| 59 | M4OSA_UInt32 videoWidth;
|
| 60 | M4OSA_UInt32 videoHeight;
|
| 61 | M4OSA_UInt32 timeMs;
|
| 62 | M4OSA_UInt32 timeOffset; //has the duration of clips played.
|
| 63 | //The flag shall be used for Framing.
|
| 64 | M4VSS3GPP_EffectSettings* effectsSettings;
|
| 65 | M4OSA_UInt32 numberEffects;
|
| 66 | M4OSA_UInt32 outVideoWidth;
|
| 67 | M4OSA_UInt32 outVideoHeight;
|
| 68 | M4OSA_UInt32 currentVideoEffect;
|
| 69 | M4OSA_Bool isFiftiesEffectStarted;
|
| 70 | M4xVSS_MediaRendering renderingMode;
|
| 71 | uint8_t *pOutBuffer;
|
| 72 | size_t outBufferStride;
|
| 73 | M4VIFI_UInt8* overlayFrameRGBBuffer;
|
| 74 | M4VIFI_UInt8* overlayFrameYUVBuffer;
|
| 75 | } vePostProcessParams;
|
| 76 |
|
| 77 | M4VIFI_UInt8 M4VIFI_YUV420PlanarToYUV420Semiplanar(void *user_data, M4VIFI_ImagePlane *PlaneIn, M4VIFI_ImagePlane *PlaneOut );
|
| 78 | M4VIFI_UInt8 M4VIFI_SemiplanarYUV420toYUV420(void *user_data, M4VIFI_ImagePlane *PlaneIn, M4VIFI_ImagePlane *PlaneOut );
|
| 79 |
|
| 80 | M4OSA_ERR M4VSS3GPP_externalVideoEffectColor(M4OSA_Void *pFunctionContext, M4VIFI_ImagePlane *PlaneIn,
|
| 81 | M4VIFI_ImagePlane *PlaneOut,M4VSS3GPP_ExternalProgress *pProgress, M4OSA_UInt32 uiEffectKind);
|
| 82 |
|
| 83 | M4OSA_ERR M4VSS3GPP_externalVideoEffectFraming( M4OSA_Void *userData, M4VIFI_ImagePlane PlaneIn[3], M4VIFI_ImagePlane *PlaneOut, M4VSS3GPP_ExternalProgress *pProgress, M4OSA_UInt32 uiEffectKind );
|
| 84 |
|
| 85 | M4OSA_ERR M4VSS3GPP_externalVideoEffectFifties( M4OSA_Void *pUserData, M4VIFI_ImagePlane *pPlaneIn, M4VIFI_ImagePlane *pPlaneOut, M4VSS3GPP_ExternalProgress *pProgress, M4OSA_UInt32 uiEffectKind );
|
| 86 |
|
| 87 | unsigned char M4VFL_modifyLumaWithScale(M4ViComImagePlane *plane_in, M4ViComImagePlane *plane_out, unsigned long lum_factor, void *user_data);
|
| 88 | unsigned char M4VFL_applyCurtain(M4ViComImagePlane *plane_in, M4ViComImagePlane *plane_out, M4VFL_CurtainParam *curtain_factor, void *user_data);
|
| 89 |
|
| 90 | M4OSA_ERR M4xVSS_internalConvertRGBtoYUV(M4xVSS_FramingStruct* framingCtx);
|
| 91 | M4VIFI_UInt8 M4VIFI_xVSS_RGB565toYUV420(void *pUserData, M4VIFI_ImagePlane *pPlaneIn,
|
| 92 | M4VIFI_ImagePlane *pPlaneOut);
|
| 93 |
|
| 94 | M4OSA_ERR M4xVSS_internalConvertRGB888toYUV(M4xVSS_FramingStruct* framingCtx);
|
| 95 | M4VIFI_UInt8 M4VIFI_RGB888toYUV420(void *pUserData, M4VIFI_ImagePlane *PlaneIn, M4VIFI_ImagePlane PlaneOut[3]);
|
| 96 |
|
| 97 | /*+ Handle the image files here */
|
| 98 | M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_UInt32 width, M4OSA_Void **pBuffer);
|
| 99 | /*- Handle the image files here */
|
| 100 |
|
| 101 | M4OSA_ERR applyRenderingMode(M4VIFI_ImagePlane* pPlaneIn, M4VIFI_ImagePlane* pPlaneOut, M4xVSS_MediaRendering mediaRendering);
|
| 102 |
|
| 103 |
|
| 104 | M4VIFI_UInt8 M4VIFI_YUV420toYUV420(void *user_data, M4VIFI_ImagePlane PlaneIn[3], M4VIFI_ImagePlane *PlaneOut );
|
| 105 | M4VIFI_UInt8 M4VIFI_ResizeBilinearYUV420toYUV420(void *pUserData,
|
| 106 | M4VIFI_ImagePlane *pPlaneIn,
|
| 107 | M4VIFI_ImagePlane *pPlaneOut);
|
| 108 |
|
| 109 | M4OSA_Void prepareYUV420ImagePlane(M4VIFI_ImagePlane *plane,
|
Dharmaray Kundargi | 35cb2de | 2011-01-19 19:09:27 -0800 | [diff] [blame^] | 110 | M4OSA_UInt32 width, M4OSA_UInt32 height, M4VIFI_UInt8 *buffer,
|
| 111 | M4OSA_UInt32 reportedWidth, M4OSA_UInt32 reportedHeight);
|
Dharmaray Kundargi | 643290d | 2011-01-16 16:02:42 -0800 | [diff] [blame] | 112 |
|
| 113 | M4OSA_Void prepareYV12ImagePlane(M4VIFI_ImagePlane *plane,
|
| 114 | M4OSA_UInt32 width, M4OSA_UInt32 height, M4OSA_UInt32 stride, M4VIFI_UInt8 *buffer);
|
| 115 |
|
| 116 | M4OSA_Void swapImagePlanes(
|
| 117 | M4VIFI_ImagePlane *planeIn, M4VIFI_ImagePlane *planeOut,
|
| 118 | M4VIFI_UInt8 *buffer1, M4VIFI_UInt8 *buffer2);
|
| 119 |
|
| 120 | M4OSA_Void computePercentageDone(
|
| 121 | M4OSA_UInt32 ctsMs, M4OSA_UInt32 effectStartTimeMs,
|
| 122 | M4OSA_UInt32 effectDuration, M4OSA_Double *percentageDone);
|
| 123 |
|
| 124 | M4OSA_Void computeProgressForVideoEffect(
|
| 125 | M4OSA_UInt32 ctsMs, M4OSA_UInt32 effectStartTimeMs,
|
| 126 | M4OSA_UInt32 effectDuration, M4VSS3GPP_ExternalProgress* extProgress);
|
| 127 |
|
| 128 | M4OSA_ERR prepareFramingStructure(
|
| 129 | M4xVSS_FramingStruct* framingCtx,
|
| 130 | M4VSS3GPP_EffectSettings* effectsSettings, M4OSA_UInt32 index,
|
| 131 | M4VIFI_UInt8* overlayRGB, M4VIFI_UInt8* overlayYUV);
|
| 132 |
|
| 133 | M4OSA_ERR applyColorEffect(M4xVSS_VideoEffectType colorEffect,
|
| 134 | M4VIFI_ImagePlane *planeIn, M4VIFI_ImagePlane *planeOut,
|
| 135 | M4VIFI_UInt8 *buffer1, M4VIFI_UInt8 *buffer2, M4OSA_UInt16 rgbColorData);
|
| 136 |
|
| 137 | M4OSA_ERR applyLumaEffect(M4VSS3GPP_VideoEffectType videoEffect,
|
| 138 | M4VIFI_ImagePlane *planeIn, M4VIFI_ImagePlane *planeOut,
|
| 139 | M4VIFI_UInt8 *buffer1, M4VIFI_UInt8 *buffer2, M4OSA_Int32 lum_factor);
|
| 140 |
|
| 141 | M4OSA_ERR applyCurtainEffect(M4VSS3GPP_VideoEffectType videoEffect,
|
| 142 | M4VIFI_ImagePlane *planeIn, M4VIFI_ImagePlane *planeOut,
|
| 143 | M4VIFI_UInt8 *buffer1, M4VIFI_UInt8 *buffer2, M4VFL_CurtainParam* curtainParams);
|
| 144 |
|
Dharmaray Kundargi | 35cb2de | 2011-01-19 19:09:27 -0800 | [diff] [blame^] | 145 | M4OSA_ERR applyEffectsAndRenderingMode(vePostProcessParams *params,
|
| 146 | M4OSA_UInt32 reportedWidth, M4OSA_UInt32 reportedHeight);
|
| 147 |
|
Dharmaray Kundargi | 643290d | 2011-01-16 16:02:42 -0800 | [diff] [blame] | 148 | #endif // ANDROID_VE_TOOLS_H
|