struct list_head list;
u32 offset;
u32 val;
+ u32 size;
u64 pts_uS64;
} /*pts_rec_t */;
}
EXPORT_SYMBOL(get_last_checkout_pts);
-int pts_lookup(u8 type, u32 *val, u32 pts_margin)
+int pts_lookup(u8 type, u32 *val, u32 *frame_size, u32 pts_margin)
{
u32 page, offset;
if (type == PTS_TYPE_VIDEO) {
offset = page * pts_table[PTS_TYPE_VIDEO].buf_size + offset;
- pts_lookup_offset(PTS_TYPE_VIDEO, offset, val, pts_margin);
+ pts_lookup_offset(
+ PTS_TYPE_VIDEO, offset, val, frame_size, pts_margin);
return 0;
} else if (type == PTS_TYPE_AUDIO) {
offset = page * pts_table[PTS_TYPE_AUDIO].buf_size + offset;
- pts_lookup_offset(PTS_TYPE_AUDIO, offset, val, pts_margin);
+ pts_lookup_offset(
+ PTS_TYPE_AUDIO, offset, val, frame_size, pts_margin);
return 0;
} else
return -EINVAL;
}
EXPORT_SYMBOL(pts_lookup);
static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val,
- u32 pts_margin, u64 *uS64)
+ u32 *frame_size, u32 pts_margin, u64 *uS64)
{
struct pts_table_s *pTable;
int lookup_threshold;
} else
p2 = p;
+ if (type == PTS_TYPE_VIDEO)
+ *frame_size = p->size;
+
if ((p2) &&
(OFFSET_DIFF(offset, p2->offset) < lookup_threshold)) {
if (p2->val == 0) /* FFT: set valid vpts */
("vpts look up offset<0x%x> -->",
offset);
pr_info
- ("<0x%x:0x%x>, look_cnt = %d\n",
- p2->offset, p2->val, look_cnt);
+ ("<0x%x:0x%x>, fsize %x, look_cnt = %d\n",
+ p2->offset, p2->val,
+ p2->size, look_cnt);
}
if (tsync_get_debug_apts()
}
*val = p2->val;
*uS64 = p2->pts_uS64;
+ *frame_size = p2->size;
#ifdef CALC_CACHED_TIME
pTable->last_checkout_pts = p2->val;
static int pts_lookup_offset_inline(u8 type, u32 offset, u32 *val,
- u32 pts_margin, u64 *uS64)
+ u32 *frame_size, u32 pts_margin, u64 *uS64)
{
unsigned long flags;
int res;
spin_lock_irqsave(&lock, flags);
res = pts_lookup_offset_inline_locked(
- type, offset, val, pts_margin, uS64);
+ type, offset, val,
+ frame_size, pts_margin, uS64);
#if 0
if (timestamp_firstvpts_get() == 0 && res == 0 && (*val) != 0
}
-int pts_lookup_offset(u8 type, u32 offset, u32 *val, u32 pts_margin)
+int pts_lookup_offset(u8 type, u32 offset, u32 *val,
+ u32 *frame_size, u32 pts_margin)
{
u64 pts_us;
- return pts_lookup_offset_inline(type, offset, val, pts_margin, &pts_us);
+ return pts_lookup_offset_inline(type, offset, val,
+ frame_size, pts_margin, &pts_us);
}
EXPORT_SYMBOL(pts_lookup_offset);
-int pts_lookup_offset_us64(u8 type, u32 offset, u32 *val, u32 pts_margin,
- u64 *uS64)
+int pts_lookup_offset_us64(u8 type, u32 offset, u32 *val,
+ u32 *frame_size, u32 pts_margin, u64 *uS64)
{
- return pts_lookup_offset_inline(type, offset, val, pts_margin, uS64);
+ return pts_lookup_offset_inline(type, offset, val,
+ frame_size, pts_margin, uS64);
}
EXPORT_SYMBOL(pts_lookup_offset_us64);
extern int get_last_checkout_pts(u8 type);
-extern int pts_lookup(u8 type, u32 *val, u32 pts_margin);
+extern int pts_lookup(u8 type, u32 *val, u32 *frame_size, u32 pts_margin);
-extern int pts_lookup_offset(u8 type, u32 offset, u32 *val, u32 pts_margin);
+extern int pts_lookup_offset(u8 type, u32 offset, u32 *val,
+ u32 *frame_size, u32 pts_margin);
extern int pts_lookup_offset_us64(u8 type, u32 offset, u32 *val,
- u32 pts_margin, u64 *uS64);
+ u32 *frame_size, u32 pts_margin, u64 *uS64);
extern int pts_pickout_offset_us64(u8 type, u32 offset,
u32 *val, u32 pts_margin,
#define AMSTREAM_IOC_SET_EX _IOW((_A_M), 0xc4, struct am_ioctl_parm_ex)
#define AMSTREAM_IOC_GET_PTR _IOWR((_A_M), 0xc5, struct am_ioctl_parm_ptr)
#define AMSTREAM_IOC_SET_PTR _IOW((_A_M), 0xc6, struct am_ioctl_parm_ptr)
+#define AMSTREAM_IOC_GET_AVINFO _IOR((_A_M), 0xc7, struct av_param_info_t)
+#define AMSTREAM_IOC_GET_QOSINFO _IOR((_A_M), 0xc8, struct av_param_qosinfo_t)
+
#define TRICKMODE_NONE 0x00
#define TRICKMODE_I 0x01
u32 len; /*char reserved[4]; */
};
+struct vframe_qos_s {
+ int num;
+ int type;
+ int size;
+ int pts;
+ int max_qp;
+ int avg_qp;
+ int min_qp;
+ int max_skip;
+ int avg_skip;
+ int min_skip;
+ int max_mv;
+ int min_mv;
+ int avg_mv;
+ int decode_buffer;
+} /*vframe_qos */;
+
+enum FRAME_FORMAT {
+ FRAME_FORMAT_UNKNOWN,
+ FRAME_FORMAT_PROGRESS,
+ FRAME_FORMAT_INTERLACE,
+};
+
+#define QOS_FRAME_NUM 60
+struct av_info_t {
+ /*auido info*/
+ int sample_rate;
+ int channels;
+ int aformat_type;
+ unsigned int apts;
+ unsigned int apts_err;
+ /*video info*/
+ unsigned int width;
+ unsigned int height;
+ unsigned int dec_error_count;
+ unsigned int first_pic_coming;
+ unsigned int fps;
+ unsigned int current_fps;
+ unsigned int vpts;
+ unsigned int vpts_err;
+ unsigned int ts_error;
+ unsigned int first_vpts;
+ int vformat_type;
+ enum FRAME_FORMAT frame_format;
+ unsigned int toggle_frame_count;/*toggle frame count*/
+ unsigned int dec_err_frame_count;/*vdec error frame count*/
+ unsigned int dec_frame_count;/*vdec frame count*/
+ unsigned int dec_drop_frame_count;/*drop frame num*/
+ int tsync_mode;
+};
+
+struct av_param_info_t {
+ struct av_info_t av_info;
+};
+struct av_param_qosinfo_t {
+ struct vframe_qos_s vframe_qos[QOS_FRAME_NUM];
+};
+
+
#define SUPPORT_VDEC_NUM (20)
int vcodec_profile_register(const struct codec_profile_t *vdec_profile);
ssize_t vcodec_profile_read(char *buf);