Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e4f3d1d authored by Dharmaray Kundargi's avatar Dharmaray Kundargi Committed by Android (Google) Code Review
Browse files

Merge "videoeditor JNI files on honeycomb" into honeycomb

parents 72b83b59 cd196d37
Loading
Loading
Loading
Loading
+92 −0
Original line number Diff line number Diff line
#
# Copyright (C) 2011 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.
#

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
    VideoEditorMain.cpp \
    VideoEditorClasses.cpp \
    VideoEditorOsal.cpp \
    VideoEditorJava.cpp \
    VideoEditorPropertiesMain.cpp \
    VideoEditorThumbnailMain.cpp  \
    VideoBrowserMain.c

LOCAL_C_INCLUDES += \
    $(TOP)/frameworks/base/core/jni \
    $(TOP)/frameworks/base/include \
    $(TOP)/frameworks/base/include/media \
    $(TOP)/frameworks/base/media/libmediaplayerservice \
    $(TOP)/frameworks/base/media/libstagefright \
    $(TOP)/frameworks/base/media/libstagefright/include \
    $(TOP)/frameworks/base/media/libstagefright/rtsp \
    $(JNI_H_INCLUDE) \
    $(call include-path-for, corecg graphics) \
    $(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include \
    $(TOP)/external/opencore/android \
    $(TOP)/vendor/qcom/proprietary/qdsp6/mm-core/omxcore/inc \
    $(TOP)/frameworks/base/core/jni/mediaeditor \
    $(TOP)/frameworks/media/libvideoeditor/vss/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/common/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/mcs/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/stagefrightshells/inc \
    $(TOP)/frameworks/media/libvideoeditor/lvpp \
    $(TOP)/frameworks/media/libvideoeditor/osal/inc

LOCAL_SHARED_LIBRARIES := \
    libcutils \
    libutils \
    libandroid_runtime \
    libnativehelper \
    libmedia \
    libbinder \
    libstagefright \
    libstagefright_omx \
    libsurfaceflinger_client \
    libvideoeditorplayer


LOCAL_CFLAGS += \
    -DUSE_STAGEFRIGHT_CODECS \
    -DUSE_STAGEFRIGHT_AUDIODEC \
    -DUSE_STAGEFRIGHT_VIDEODEC \
    -DUSE_STAGEFRIGHT_AUDIOENC \
    -DUSE_STAGEFRIGHT_VIDEOENC \
    -DUSE_STAGEFRIGHT_READERS \
    -DUSE_STAGEFRIGHT_3GPP_READER


LOCAL_LDFLAGS += -fuse-ld=bfd

LOCAL_STATIC_LIBRARIES := \
    libvideoeditor_core \
    libstagefright_color_conversion \
    libvideoeditor_3gpwriter \
    libvideoeditor_mcs \
    libvideoeditor_videofilters \
    libvideoeditor_stagefrightshells \
    libvideoeditor_osal

LOCAL_MODULE:= libvideoeditor_jni

# Don't prelink this library.  For more efficient code, you may want
# to add this library to the prelink map and set this to true.
LOCAL_PRELINK_MODULE := false

LOCAL_MODULE_TAGS := eng development

include $(BUILD_SHARED_LIBRARY)
+131 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 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.
 */


#ifndef VIDEO_BROWSER_INTERNAL_H
#define VIDEO_BROWSER_INTERNAL_H

#include "VideoBrowserMain.h"

#include "M4READER_Common.h"
#include "M4DECODER_Common.h"


#define VIDEO_BROWSER_BGR565


#define VIDEO_BROWSER_PREDECODE_TIME 2000    /* In miliseconds */

/*---------------------------- MACROS ----------------------------*/
#define CHECK_PTR(fct, p, err, errValue) \
{ \
    if (M4OSA_NULL == p) \
    { \
        err = errValue ; \
        M4OSA_TRACE1_1("" #fct "(L%d): " #p " is NULL, returning " #errValue "", __LINE__) ; \
        goto fct##_cleanUp; \
    } \
}

#define CHECK_ERR(fct, err) \
{ \
    if (M4OSA_ERR_IS_ERROR(err)) \
    { \
        M4OSA_TRACE1_2("" #fct "(L%d): ERROR 0x%.8x returned", __LINE__,err) ; \
        goto fct##_cleanUp; \
    } \
    else if (M4OSA_ERR_IS_WARNING(err)) \
    { \
        M4OSA_TRACE2_2("" #fct "(L%d): WARNING 0x%.8x returned", __LINE__,err) ; \
    } \
}

#define CHECK_STATE(fct, state, pC) \
{ \
    if (state != pC->m_state) \
    { \
        M4OSA_TRACE1_1("" #fct " called in bad state %d", pC->m_state) ; \
        err = M4ERR_STATE ; \
        goto fct##_cleanUp; \
    } \
}

#define SAFE_FREE(p) \
{ \
    if (M4OSA_NULL != p) \
    { \
        M4OSA_free((M4OSA_MemAddr32)p) ; \
        p = M4OSA_NULL ; \
    } \
}

/*--- Video Browser state ---*/
typedef enum
{
    VideoBrowser_kVBCreating,
    VideoBrowser_kVBOpened,
    VideoBrowser_kVBBrowsing
} VideoBrowser_videoBrowerState;


/*--- Video Browser execution context. ---*/
typedef struct
{
    VideoBrowser_videoBrowerState       m_state ;
    VideoBrowser_videoBrowerDrawMode    m_drawmode;

    M4OSA_Context                       g_hbmp2;
    M4OSA_Context                       dc;
    M4OSA_Int16*                        g_bmPixels2;

    /*--- Reader parameters ---*/
    M4OSA_FileReadPointer               m_fileReadPtr;
    M4READER_GlobalInterface*           m_3gpReader ;
    M4READER_DataInterface*             m_3gpData ;
    M4READER_MediaType                  m_mediaType ;
    M4OSA_Context                       m_pReaderCtx ;

    M4_StreamHandler*                   m_pStreamHandler ;
    M4_AccessUnit                       m_accessUnit ;

    /*--- Decoder parameters ---*/
    M4DECODER_VideoInterface*           m_pDecoder ;
    M4OSA_Context                       m_pDecoderCtx ;

    /*--- Common display parameters ---*/
    M4OSA_UInt32                        m_x ;
    M4OSA_UInt32                        m_y ;
    M4VIFI_ImagePlane                   m_outputPlane[3] ;

    /*--- Current browsing time ---*/
    M4OSA_UInt32                        m_currentCTS ;

    /*--- Platform dependent display parameters ---*/
    M4OSA_Context                       m_pCoreContext ;

    /*--- Callback function settings ---*/
    videoBrowser_Callback               m_pfCallback;
    M4OSA_Void*                         m_pCallbackUserData;

    /*--- Codec Loader core context ---*/
    M4OSA_Context                       m_pCodecLoaderContext;

    /*--- Required color type ---*/
    VideoBrowser_VideoColorType         m_frameColorType;

} VideoBrowserContext;

#endif /* VIDEO_BROWSER_INTERNAL_H */
+593 −0

File added.

Preview size limit exceeded, changes collapsed.

+163 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 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.
 */


#ifndef VIDEO_BROWSER_MAIN_H
#define VIDEO_BROWSER_MAIN_H

/**
 ************************************************************************
 * @file    VideoBrowserMain.h
 * @brief   Video browser Interface functions
 ************************************************************************
*/

#define VIDEOBROWSER    0x423

#include "M4OSA_Memory.h"
#include "M4OSA_CharStar.h"
#include "M4OSA_OptionID.h"
#include "M4OSA_Debug.h"
#include "M4VIFI_FiltersAPI.h"
#include "M4OSA_FileReader.h"


/**
 ************************************************************************
 * @brief    Error codes definition.
 * @note    These value are the Browser engine specific error codes.
 ************************************************************************
*/
#define M4ERR_VB_MEDIATYPE_NOT_SUPPORTED    M4OSA_ERR_CREATE(M4_ERR, VIDEOBROWSER, 0x01)
#define M4ERR_VB_NO_VIDEO                   M4OSA_ERR_CREATE(M4_ERR, VIDEOBROWSER, 0x02)

#ifdef __cplusplus
extern "C" {
#endif

/*
 *  Video Browser draw mode, extension for angle based bliting can be done
 */
typedef enum
{
    VideoBrowser_kVBNormalBliting
} VideoBrowser_videoBrowerDrawMode;


/*--- Video Browser output frame color type ---*/
typedef enum
{
    VideoBrowser_kYUV420,
    VideoBrowser_kGB565
} VideoBrowser_VideoColorType;

/**
 ************************************************************************
 * enumeration  VideoBrowser_Notification
 * @brief       Video Browser notification type.
 * @note        This callback mechanism must be used to wait the completion of an asynchronous
 * operation, before calling another API function.
 ************************************************************************
*/
typedef enum
{
    /**
     * A frame is ready to be displayed, it should be displayed in the callback function
     * pCbData type = M4VIFI_ImagePlane*
     */
    VIDEOBROWSER_DISPLAY_FRAME            = 0x00000001,
    VIDEOBROWSER_NOTIFICATION_NONE        = 0xffffffff
}VideoBrowser_Notification;


/**
 ************************************************************************
 * @brief    videoBrowser_Callback type definition
 * @param    pInstance          (IN) Video Browser context.
 * @param    notificationID     (IN) Id of the callback which generated the error
 * @param    errCode            (IN) Error code from the core
 * @param    pCbData            (IN) pointer to data associated wit the callback.
 * @param    pCbUserData        (IN) pointer to application user data passed in init.
 * @note    This callback mechanism is used to request display of an image
 ************************************************************************
*/
typedef M4OSA_Void (*videoBrowser_Callback) (M4OSA_Context pInstance,
                                        VideoBrowser_Notification notificationID,
                                        M4OSA_ERR errCode,
                                        M4OSA_Void* pCbData,
                                        M4OSA_Void* pCallbackUserData);


/******************************************************************************
* @brief   This function allocates the resources needed for browsing a video file.
* @param   ppContext     (OUT): Pointer on a context filled by this function.
* @param   pURL          (IN) : Path of File to browse
* @param   DrawMode      (IN) : Indicate which method is used to draw (Direct draw etc...)
* @param   pfCallback    (IN) : Callback function to be called when a frame must be displayed
* @param   pCallbackData (IN)  : User defined data that will be passed as parameter of the callback
* @param   clrType       (IN) : Required color type.
* @return  M4NO_ERROR / M4ERR_PARAMETER / M4ERR_STATE / M4ERR_ALLOC
******************************************************************************/
M4OSA_ERR videoBrowserCreate(M4OSA_Context* ppContext, M4OSA_Char* pURL,
                                        M4OSA_UInt32 DrawMode,
                                        M4OSA_FileReadPointer* ptrF,
                                        videoBrowser_Callback pfCallback,
                                        M4OSA_Void* pCallbackData,
                                        VideoBrowser_VideoColorType clrType);

/******************************************************************************
* @brief        This function frees the resources needed for browsing a video file.
* @param        pContext     (IN) : Video browser context
* @return       M4NO_ERROR / M4ERR_PARAMETER / M4ERR_STATE
******************************************************************************/
M4OSA_ERR videoBrowserCleanUp(M4OSA_Context pContext) ;


/******************************************************************************
* @brief        This function allocates the resources needed for browsing a video file.
* @param        pContext  (IN)      : Video browser context
* @param        pTime     (IN/OUT)  : Pointer on the time to reach. Updated by
*                                     this function with the reached time
* @return       M4NO_ERROR / M4ERR_PARAMETER / M4ERR_STATE / M4ERR_ALLOC
******************************************************************************/
M4OSA_ERR videoBrowserPrepareFrame(M4OSA_Context pContext, M4OSA_UInt32* pTime);

/******************************************************************************
* @brief        This function sets the size and the position of the display.
* @param        pContext     (IN) : Video Browser context
* @param        pixelArray   (IN) : Array to hold the video frame.
* @param        x            (IN) : Horizontal position of the top left corner
* @param        y            (IN) : Vertical position of the top left corner
* @param        dx           (IN) : Width of the display window
* @param        dy           (IN) : Height of the video window
* @return       M4NO_ERROR / M4ERR_PARAMETER / M4ERR_STATE / M4ERR_ALLOC
******************************************************************************/
M4OSA_ERR videoBrowserSetWindow(M4OSA_Context pContext, M4OSA_Int32* pixelArray,
                                M4OSA_UInt32 x, M4OSA_UInt32 y,
                                M4OSA_UInt32 dx, M4OSA_UInt32 dy);

/******************************************************************************
* @brief        This function displays the current frame.
* @param        pContext     (IN) : Video browser context
* @return       M4NO_ERROR / M4ERR_PARAMETER / M4ERR_STATE / M4ERR_ALLOC
******************************************************************************/
M4OSA_ERR videoBrowserDisplayCurrentFrame(M4OSA_Context pContext);

#ifdef __cplusplus
}
#endif

#endif /* VIDEO_BROWSER_MAIN_H */
+3174 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading