提交 0772d57c 编写于 作者: Z Zhang Rui

ios/VideoToolbox: simplify context init

上级 2ca8b42a
......@@ -33,6 +33,7 @@
#define MAX_PKT_QUEUE_DEEP 350
#define MAX_DECODING_SAMPLES 16
typedef struct VTBPicture {
double pts;
......@@ -44,6 +45,13 @@ typedef struct VTBPicture {
} VTBPicture;
typedef struct sample_info {
double dts;
double pts;
int serial;
} sample_info;
typedef struct sort_queue {
double dts;
double pts;
......@@ -82,6 +90,9 @@ typedef struct VideoToolBoxContext {
bool dealloced;
int m_buffer_deep;
AVPacket m_buffer_packet[MAX_PKT_QUEUE_DEEP];
sample_info sample_info_array[MAX_DECODING_SAMPLES];
int sample_info_index;
} VideoToolBoxContext ;
......
......@@ -733,26 +733,13 @@ VideoToolBoxContext* init_videotoolbox(FFPlayer* ffp, AVCodecContext* ic)
int codec = ic->codec_id;
uint8_t* extradata = ic->extradata;
VideoToolBoxContext* context_vtb = malloc(sizeof(VideoToolBoxContext));
VideoToolBoxContext *context_vtb = (VideoToolBoxContext *)mallocz(sizeof(VideoToolBoxContext));
if (!context_vtb) {
goto failed;
}
context_vtb->m_convert_bytestream = false;
context_vtb->m_convert_3byteTo4byteNALSize = false;
context_vtb->refresh_request = false;
context_vtb->new_seg_flag = false;
context_vtb->recovery_drop_packet = false;
context_vtb->refresh_session = false;
context_vtb->idr_based_identified = true;
context_vtb->dealloced = false;
context_vtb->last_keyframe_pts = 0;
context_vtb->m_max_ref_frames = 0;
context_vtb->ffp = ffp;
context_vtb->serial = 0;
context_vtb->last_sort = 0;
context_vtb->m_buffer_deep = 0;
memset(context_vtb->m_buffer_packet, 0, sizeof(context_vtb->m_buffer_packet));
switch (profile) {
case FF_PROFILE_H264_HIGH_10:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册