151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong/*
251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * Copyright (C) 2011 The Android Open Source Project
351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong *
451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * Licensed under the Apache License, Version 2.0 (the "License");
551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * you may not use this file except in compliance with the License.
651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * You may obtain a copy of the License at
751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong *
851f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong *      http://www.apache.org/licenses/LICENSE-2.0
951f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong *
1051f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * Unless required by applicable law or agreed to in writing, software
1151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * distributed under the License is distributed on an "AS IS" BASIS,
1251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * See the License for the specific language governing permissions and
1451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong * limitations under the License.
1551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong */
1651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong
1751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong#ifndef __VIDEO_EDITOR_API_H__
1851f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong#define __VIDEO_EDITOR_API_H__
1951f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong
2051f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong#include "M4OSA_Types.h"
2151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong
2251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dongtypedef enum
2351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong{
2451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    MSG_TYPE_PROGRESS_INDICATION,     // Playback progress indication event
2551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    MSG_TYPE_PLAYER_ERROR,            // Playback error
2651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    MSG_TYPE_PREVIEW_END,             // Preview of clips is complete
2751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    MSG_TYPE_OVERLAY_UPDATE,          // update overlay during preview
2851f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    MSG_TYPE_OVERLAY_CLEAR,           // clear the overlay
2951f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong} progress_callback_msg_type;
3051f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong
3151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dongtypedef struct {
3251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    int overlaySettingsIndex;
3351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    int clipIndex;
3451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong} VideoEditorCurretEditInfo;
3551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong
3651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dongtypedef struct
3751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong{
3851f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Void     *pFile;                   /** PCM file path */
3951f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Bool     bRemoveOriginal;          /** If true, the original audio track
4051f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong                                                 is not taken into account */
4151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiNbChannels;            /** Number of channels (1=mono, 2=stereo) of BGM clip*/
4251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiSamplingFrequency;     /** Sampling audio frequency (8000 for amr, 16000 or
4351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong                                                more for aac) of BGM clip*/
4451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiExtendedSamplingFrequency; /** Extended frequency for AAC+,
4551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong                                                eAAC+ streams of BGM clip*/
4651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiAddCts;                /** Time, in milliseconds, at which the added
4751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong                                                audio track is inserted */
4851f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiAddVolume;             /** Volume, in percentage, of the added audio track */
4951f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   beginCutMs;
5051f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   endCutMs;
5151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Int32    fileType;
5251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Bool     bLoop;                   /** Looping on/off **/
5351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    /* Audio ducking */
5451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiInDucking_threshold;   /** Threshold value at which
5551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong                                                background music shall duck */
5651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiInDucking_lowVolume;   /** lower the background track to
5751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong                                                this factor of current level */
5851f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Bool     bInDucking_enable;       /** enable ducking */
5951f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32   uiBTChannelCount;        /** channel count for BT */
6051f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Void     *pPCMFilePath;
6151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong} M4xVSS_AudioMixingSettings;
6251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong
6351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dongtypedef struct
6451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong{
6551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Void      *pBuffer;            /* YUV420 buffer of frame to be rendered*/
6651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    timeMs;            /* time stamp of the frame to be rendered*/
6751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    uiSurfaceWidth;    /* Surface display width*/
6851f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    uiSurfaceHeight;    /* Surface display height*/
6951f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    uiFrameWidth;        /* Frame width*/
7051f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    uiFrameHeight;        /* Frame height*/
7151f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_Bool      bApplyEffect;        /* Apply video effects before render*/
7251f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    clipBeginCutTime;  /* Clip begin cut time relative to storyboard */
7351f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    clipEndCutTime;    /* Clip end cut time relative to storyboard */
7451f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong    M4OSA_UInt32    videoRotationDegree; /* Video rotation degree */
7551f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong
7651f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong} VideoEditor_renderPreviewFrameStr;
7751f8eec23a2bcc2cc190373cdd1195972d9b8804James Dong#endif /*__VIDEO_EDITOR_API_H__*/
78