📄 pthread_dec.h
字号:
/* set tabstop=4 */
/********************************************************************************
* *
* Copyright(C) 2004 Penta-Micro *
* *
* ALL RIGHT RESERVED *
* *
* This software is the property of Penta-Micro and is furnished under *
* license by Penta-Micro. This software may be used only in accordance *
* with the terms of said license. This copyright notice may not be *
* removed, modified or obliterated without the prior written permission *
* of Penta-Micro. *
* *
* This software may not be copyed, transmitted, provided to or otherwise *
* made available to any other person, company, corporation or other entity *
* except as specified in the terms of said license. *
* *
* No right, title, ownership or other interest in the software is hereby *
* granted or transferred. *
* *
* The information contained herein is subject to change without notice and *
* should not be construed as a commitment by Penta-Micro. *
* *
********************************************************************************
MODULE NAME: PTHREAD_DEC.H
REVISION HISTORY:
Date Ver Name Description
---------- --- --------------------- -----------------------------------------
06/30/2004 2.0 CheulBeck(whitefe) Created
...............................................................................
DESCRIPTION:
This Module contains definition for MPEG Decoding function.
...............................................................................
*/
#ifndef __PTHREAD_DEC_H
#define __PTHREAD_DEC_H
/** ************************************************************************* **
** includes
** ************************************************************************* **/
#include "typedef.h"
/** ************************************************************************* **
** defines
** ************************************************************************* **/
#define DEC_MAX_BUF_SIZE 64*1024
#define RX_BUF_SIZE 2
/* definition for header size */
#define PACK_HEADER_SIZE 16
#define PROGRAM_STREAM_MAP_SIZE 276
#define PES_PACKET_SIZE 32
/** ************************************************************************* **
** typedefs
** ************************************************************************* **/
/* type definition for picture info */
typedef struct {
S32 size;
} SIZE_T;
/* type definition for picture info */
typedef enum {
F_START,
F_CONTI,
F_END
} FILE_INFO;
/* type definition for picture info */
typedef struct __DEC_INFO_PICTURE__ {
UNS32 cur_size;
UNS32 prev_size;
UNS32 time;
UNS16 data_type;
UNS16 type;
UNS16 conti;
UNS16 motion_start;
UNS16 motion;
UNS16 sensor_start;
UNS16 sensor;
} DEC_INFO_PICTURE;
typedef struct __PACK_HEADER__ {
UNS32 start_code;
UNS32 system_clock_reference_base;
UNS32 program_mux_rate;
UNS32 stuffing_byte;
} PACK_HEADER;
typedef struct __ELEMENTARY_STREAM_MAP__ {
UNS8 type;
UNS8 id;
UNS16 info_length;
UNS8 mb_width;
UNS8 mb_height;
UNS16 reserved;
} ELEMENTARY_STREAM_MAP;
typedef struct __PROGRAM_STREAM_MAP__ {
UNS32 start_code;
UNS16 length;
UNS8 version;
UNS8 reserved_0;
UNS16 info_length;
UNS8 reserved_1[8];
UNS16 elementary_stream_map_length;
ELEMENTARY_STREAM_MAP esm[32];
} PROGRAM_STREAM_MAP;
typedef struct __PES_PACKET__ {
UNS32 start_code;
UNS32 packet_length;
UNS32 data_length;
UNS32 pts;
UNS32 dts;
UNS32 prev_pes_packet_length;
UNS32 cur_pes_packet_length;
UNS32 time_code;
} PES_PACKET;
typedef struct __DEC_OBJECT__ {
S8 fname_ps[32]; // file name for saving video stream
FILE *p_fd_ps; // file descriptor for video stream
UNS32 end_fp; // file end pointer for video stream
UNS16 play_mode;
UNS16 flag_first; // for real time play at event playback
UNS16 global_count;
UNS16 flag_global; // global flag
UNS16 *p_demux_buf; // buffer pointer to demux video stream
DEC_INFO_PICTURE dip; // picture information for decoding
DB_RECORD db_rec; // pointer to record db structure
DECODER_PARAM *pdp;
STATE_DEC *psd;
PACK_HEADER tph;
PROGRAM_STREAM_MAP tpsm;
PES_PACKET tpp;
} DEC_OBJECT;
/** ************************************************************************* **
** function prototypes
** ************************************************************************* **/
void *pthread_dec(void *args);
RETURN open_play_file(DEC_OBJECT *pdo);
RETURN dec_set_param(DEC_OBJECT *pdo);
RETURN dec_play(DEC_OBJECT *pdo);
void dec_stop(DEC_OBJECT *pdo);
RETURN dec_ff(DEC_OBJECT *pdo);
RETURN dec_slow(DEC_OBJECT *pdo);
RETURN dec_rew(DEC_OBJECT *pdo);
RETURN dec_step_forward(DEC_OBJECT *pdo);
RETURN dec_step_backward(DEC_OBJECT *pdo);
RETURN dec_pause(DEC_OBJECT *pdo);
FILE_INFO arrange_picture_inform(DEC_OBJECT *pdo);
FILE_INFO arrange_backward_picture_inform(DEC_OBJECT *pdo);
RETURN get_picture_inform(DEC_OBJECT *pdo);
BOOL decoding_stream_filter(DEC_OBJECT *pdo);
RETURN read_data_from_hdd(DEC_OBJECT *pdo);
RETURN feed_data_to_decoder(DEC_OBJECT *pdo);
BOOL fast_forward_stream_filter(DEC_OBJECT *pdo);
BOOL fast_backward_stream_filter(DEC_OBJECT *pdo);
RETURN select_next_file(DEC_OBJECT *pdo);
RETURN select_previous_file(DEC_OBJECT *pdo);
#endif /* __PTHREAD_DEC_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -