OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / internal / media_dev.h
diff --git a/tstools/DtsEdit/src/gpac/internal/media_dev.h b/tstools/DtsEdit/src/gpac/internal/media_dev.h
new file mode 100644 (file)
index 0000000..c7cc5bc
--- /dev/null
@@ -0,0 +1,148 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Media Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MEDIA_DEV_H_\r
+#define _GF_MEDIA_DEV_H_\r
+\r
+#include <gpac/media_tools.h>\r
+\r
+GF_Err gf_import_message(GF_MediaImporter *import, GF_Err e, char *format, ...);\r
+\r
+/*returns 0 if not a start code, or size of start code (3 or 4 bytes). If start code, bitstream\r
+is positionned AFTER start code*/\r
+u32 AVC_IsStartCode(GF_BitStream *bs);\r
+/*returns size of chunk between current and next startcode (excluding startcode sizes), 0 if no more startcodes (eos)*/\r
+u32 AVC_NextStartCode(GF_BitStream *bs);\r
+/*returns NAL unit type - bitstream must be sync'ed!!*/\r
+u8 AVC_NALUType(GF_BitStream *bs);\r
+/*slice NALU*/\r
+Bool AVC_NALUIsSlice(u8 type);\r
+\r
+\r
+typedef struct\r
+{\r
+    s32 profile_idc;\r
+    s32 level_idc;\r
+    s32 prof_compat;\r
+    s32 log2_max_frame_num;\r
+    u32 poc_type, poc_cycle_length;\r
+    s32 log2_max_poc_lsb;\r
+    s32 delta_pic_order_always_zero_flag;\r
+       s32 offset_for_non_ref_pic, offset_for_top_to_bottom_field;\r
+       Bool frame_mbs_only_flag;\r
+\r
+    s16 offset_for_ref_frame[256];\r
+\r
+    s32 timing_info_present_flag;\r
+    u32 num_units_in_tick;\r
+    u32 time_scale;\r
+    s32 fixed_frame_rate_flag;\r
+\r
+       u32 width, height;\r
+       u32 par_num, par_den;\r
+       /*used to discard repeated SPSs - 0: not parsed, 1 parsed, 2 sent*/\r
+       u32 status;\r
+} AVC_SPS;\r
+\r
+typedef struct \r
+{\r
+    s32 sps_id;\r
+    s32 pic_order_present;      /* pic_order_present_flag*/\r
+    s32 redundant_pic_cnt_present; /* redundant_pic_cnt_present_flag */\r
+    int slice_group_count;      /* num_slice_groups_minus1 + 1*/\r
+       /*used to discard repeated SPSs - 0: not parsed, 1 parsed, 2 sent*/\r
+       u32 status;\r
+} AVC_PPS;\r
+\r
+typedef struct\r
+{\r
+       u8 nal_ref_idc, nal_unit_type, field_pic_flag, bottom_field_flag;\r
+       u32 frame_num, idr_pic_id, poc_lsb, slice_type;\r
+       s32 delta_poc_bottom;\r
+       s32 delta_poc[2];\r
+       s32 redundant_pic_cnt;\r
+\r
+       s32 poc;\r
+       u32 poc_msb, poc_msb_prev, poc_lsb_prev, frame_num_prev;\r
+       s32 frame_num_offset, frame_num_offset_prev;\r
+\r
+       AVC_SPS *sps;\r
+       AVC_PPS *pps;\r
+} AVCSliceInfo;\r
+\r
+\r
+typedef struct \r
+{\r
+       u32 frame_cnt;\r
+       u8 exact_match_flag;\r
+       u8 broken_link_flag;\r
+       u8 changing_slice_group_idc;\r
+       u8 valid;\r
+} AVCSeiRecoveryPoint;\r
+\r
+\r
+typedef struct \r
+{\r
+       AVCSeiRecoveryPoint recovery_point;\r
+       /*to be eventually completed by other sei*/\r
+\r
+} AVCSei;\r
+\r
+typedef struct\r
+{\r
+       AVC_SPS sps[32];\r
+       AVC_PPS pps[255];\r
+\r
+       AVCSliceInfo s_info;\r
+       AVCSei sei;\r
+} AVCState;\r
+\r
+/*return sps ID or -1 if error*/\r
+s32 AVC_ReadSeqInfo(GF_BitStream *bs, AVCState *avc, u32 *vui_flag_pos);\r
+/*return pps ID or -1 if error*/\r
+s32 AVC_ReadPictParamSet(GF_BitStream *bs, AVCState *avc);\r
+/*is slice a RAP*/\r
+Bool AVC_SliceIsIDR(AVCState *avc);\r
+/*parses NALU, updates avc state and returns:\r
+       1 if NALU part of new frame\r
+       0 if NALU part of prev frame\r
+       -1 if bitstream error\r
+*/\r
+s32 AVC_ParseNALU(GF_BitStream *bs, u32 nal_hdr, AVCState *avc);\r
+/*remove SEI messages not allowed in MP4*/\r
+u32 AVC_ReformatSEI_NALU(char *buffer, u32 nal_size, AVCState *avc);\r
+\r
+GF_Err AVC_ChangePAR(GF_AVCConfig *avcc, s32 ar_n, s32 ar_d);\r
+\r
+\r
+typedef struct\r
+{\r
+       u8 rate_idx;\r
+       u8 pck_size;\r
+} QCPRateTable;\r
+\r
+\r
+#endif         /*_GF_MEDIA_DEV_H_*/\r
+\r