📄 video_editor.h
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2004
*
*******************************************************************************/
/*******************************************************************************
*
* Filename:
* ---------
* video_editor.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* video global header files. Other modules should include this header file
* to use video driver.
*
* Author:
* -------
* -------
*
*==============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
#ifndef VIDEO_EDITOR_H
#define VIDEO_EDITOR_H
#define MAX_VIDEO_EDITOR_SECTION 2000
/// if the duration < VIDEO_EDITOR_DROP_DURATION(ms), this frame will be drop
///
#define VIDEO_EDITOR_DROP_DURATION 10
/// Maximum video editor frame width
///
#define VIDEO_EDITOR_MAX_FRAME_WIDTH 176
/// Maximum video editor frame height
///
#define VIDEO_EDITOR_MAX_FRAME_HEIGHT 144
#define VIDEO_EDITOR_ENC_BUFFER_SIZE (VIDEO_EDITOR_MAX_FRAME_WIDTH*VIDEO_EDITOR_MAX_FRAME_HEIGHT+128)
/// Decode bitstream buffer size per decode buffer
///
#define VIDEO_EDITOR_DEC_BUFFER_SIZE (DEC_MAX_FRAME_WIDTH*DEC_MAX_FRAME_HEIGHT*3)
#define VIDEO_EDITOR_DEC_BUFFER_COUNT 3
typedef enum {
VIEDO_EDITOR_TYPE_SINGLE_FILE=0xa5,
VIEDO_EDITOR_TYPE_MULTI_FILE
} VIEDO_EDITOR_TYPE;
typedef enum {
VIEDO_EDITOR_STATE_IDLE = 0,
VIEDO_EDITOR_STATE_OPEN,
VIEDO_EDITOR_STATE_OPEN_NEXT,
VIEDO_EDITOR_STATE_SEEK,
VIEDO_EDITOR_STATE_START,
VIEDO_EDITOR_STATE_MAX
} VIEDO_EDITOR_STATE;
typedef enum {
/// Buffer empty event, upper layer should fill up the buffer
///
VIDEO_EDITOR_DEC_EVENT_BUFFER_EMPTY=100,
/// video seek handler.
///
VIDEO_EDITOR_DEC_DRV_SEEK_ACTION,
/// No Video track event
///
VIDEO_EDITOR_DEC_EVENT_NO_TRACK,
/// Seek ready event
///
VIDEO_EDITOR_DEC_EVENT_SEEK_DONE,
/// VIDEO bitstream buffer is available, and wait MED task move these data
/// to video bitstream file
VIDEO_EDITOR_ENC_EVENT_VIDEO_BUFFER_AVAIL,
/// VIDEO meta buffer is available, and wait MED task move these data to video meta file
///
VIDEO_EDITOR_ENC_EVENT_META_BUFFER_AVAIL,
/// Count file size for file size limit
///
VIDEO_EDITOR_ENC_EVENT_COUNT_FILE_SIZE,
/// Someting wrong in video driver, upper layer should call function
/// to obtain error casue.
VIDEO_EDITOR_EVENT_FAIL,
/// Viedo editor complete event
///
VIDEO_EDITOR_EVENT_COMPLETE,
/// Max event number
///
VIDEO_EDITOR_MAX_EVENT
} VIDEO_EDITOR_EVENT;
typedef struct
{
kal_uint32 start_frame_number; /*0~n-1*/
kal_bool start_frame_discard;
kal_uint32 delta_start_frame_duratoin;
/* if start_frame_discard =1,
first_frame_duration = first_frame_duration + delta_start_frame_duratoin;
if start_frame_discard =0,
first_frame_duration = delta_start_frame_duratoin;*/
kal_uint32 end_frame_number; /*0~n-1*/
kal_bool end_frame_discard;
kal_uint32 delta_end_frame_duratoin;
/* if end_frame_discard =1,
end_frame_duration = end_frame_duration + delta_end_frame_duratoin;
if end_frame_discard =0,
end_frame_duration = delta_end_frame_duratoin;*/
} VEDITOR_AVSYNC_VIDEO_STRUCT;
typedef struct {
kal_uint32 audio_start_frame;
kal_uint32 audio_end_frame;
kal_uint32 mute_frame_count; /*frame count*/
} VEDITOR_AVSYNC_AUDIO_STRUCT;
typedef struct
{
STMp4Parser *pstVIDParser;
STFSAL *pstVIDFSAL;
STMp4Parser *pstAUDParser;
STFSAL *pstAUDFSAL;
// VIEDO_EDITOR_TYPE editor_type;
kal_bool short_header;
kal_uint32 bit_rate;
VIEDO_EDITOR_STATE veditor_state;
/*AV sync*/
kal_uint32 glb_time_stamp;
kal_bool call_by_next;
void (*call_back)(kal_uint8 event);
kal_bool (*check_end_call_back)(void);
kal_bool video_decode_end;
VEDITOR_AVSYNC_VIDEO_STRUCT video_avsync;
VEDITOR_AVSYNC_AUDIO_STRUCT audio_avsync;
kal_bool need_avsync;
kal_uint16 decode_frame_width;
kal_uint16 decode_frame_height;
kal_uint16 encode_frame_width;
kal_uint16 encode_frame_height;
kal_uint32 video_time_scale;
kal_uint32 audio_time_scale;
kal_uint32 video_start_time;
kal_uint32 audio_start_time;
kal_uint32 av_duration;
}VIDEO_EDITOR_STRUCT;
typedef struct
{
/*video editor time base = VIDEO_COMMON_TIME_BASE*/
/*Encoder*/
kal_bool short_header;
kal_uint32 bit_rate;
kal_uint16 encode_frame_width;
kal_uint16 encode_frame_height;
VIEDO_EDITOR_TYPE editor_type;
/*Decoder*/
STMp4Parser *pstVIDParser;
STFSAL *pstVIDFSAL;
STMp4Parser *pstAUDParser;
STFSAL *pstAUDFSAL;
/*all*/
kal_bool need_avsync;
void (*call_back)(kal_uint8 event);
kal_uint32 video_start_time;
kal_uint32 audio_start_time;
kal_uint32 av_duration;
}VIDEO_EDITOR_OPEN_STRUCT;
typedef struct
{
/*Decoder*/
STMp4Parser *pstVIDParser;
STFSAL *pstVIDFSAL;
STMp4Parser *pstAUDParser;
STFSAL *pstAUDFSAL;
/*video editor time base = VIDEO_COMMON_TIME_BASE*/
kal_bool need_avsync;
void (*call_back)(kal_uint8 event);
kal_uint32 video_start_time;
kal_uint32 audio_start_time;
kal_uint32 av_duration;
}VIDEO_EDITOR_OPEN_NEXT_STRUCT;
extern void MPEG4_EDITOR_LISR(void);
extern void VIDEO_EDITOR_DEC_DONE_HISR(void);
#endif /*VIDEO_EDITOR_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -