*****************************************************************************/
void vout_DisplaySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
{
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
char psz_begin_date[MSTRTIME_MAX_SIZE]; /* buffer for date string */
char psz_end_date[MSTRTIME_MAX_SIZE]; /* buffer for date string */
#endif
/* Remove reservation flag */
p_subpic->i_status = READY_SUBPICTURE;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
/* Send subpicture information */
intf_DbgMsg("subpicture %p: type=%d, begin date=%s, end date=%s\n",
p_subpic, p_subpic->i_type,
* the best possible case, since no memory allocation needs
* to be done */
p_vout->p_subpicture[i_subpic].i_status = RESERVED_SUBPICTURE;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("subpicture %p (in destroyed subpicture slot)\n",
&p_vout->p_subpicture[i_subpic] );
#endif
intf_ErrMsg("spu warning: %s\n", strerror( ENOMEM ) );
}
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("subpicture %p (in free subpicture slot)\n", p_free_subpic );
#endif
vlc_mutex_unlock( &p_vout->subpicture_lock );
p_subpic->i_status = DESTROYED_SUBPICTURE;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("subpicture %p\n", p_subpic);
#endif
}
#endif
}
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("picture %p\n", p_pic);
#endif
vlc_mutex_unlock( &p_vout->picture_lock );
*****************************************************************************/
void vout_DatePicture( vout_thread_t *p_vout, picture_t *p_pic, mtime_t date )
{
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
char psz_date[MSTRTIME_MAX_SIZE]; /* date */
#endif
#endif
}
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("picture %p, display date: %s\n", p_pic, mstrtime( psz_date, p_pic->date) );
#endif
vlc_mutex_unlock( &p_vout->picture_lock );
* memory allocation needs to be done */
p_vout->p_picture[i_picture].i_status = RESERVED_PICTURE;
p_vout->i_pictures++;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("picture %p (in destroyed picture slot)\n",
&p_vout->p_picture[i_picture] );
#endif
intf_ErrMsg( "vout warning: %s\n", strerror( ENOMEM ) );
}
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("picture %p (in free picture slot)\n", p_free_picture );
#endif
vlc_mutex_unlock( &p_vout->picture_lock );
p_pic->i_status = DESTROYED_PICTURE;
p_vout->i_pictures--;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("picture %p\n", p_pic);
#endif
vlc_mutex_unlock( &p_vout->picture_lock );
vlc_mutex_lock( &p_vout->picture_lock );
p_pic->i_refcount++;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("picture %p refcount=%d\n", p_pic, p_pic->i_refcount );
#endif
vlc_mutex_lock( &p_vout->picture_lock );
p_pic->i_refcount--;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
if( p_pic->i_refcount < 0 )
{
intf_DbgMsg("error: refcount < 0\n");
p_vout->i_pictures--;
}
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("picture %p refcount=%d\n", p_pic, p_pic->i_refcount );
#endif
/* Computes FPS rate */
p_vout->p_fps_sample[ p_vout->c_fps_samples++ % VOUT_FPS_SAMPLES ] = display_date;
- if( display_date < current_date )
+ if( display_date < current_date - p_vout->render_time )
{
/* Picture is late: it will be destroyed and the thread
* will sleep and go to next picture */
/* On awakening, take back lock and send immediately picture to display,
* then swap buffers */
vlc_mutex_lock( &p_vout->change_lock );
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg( "picture %p, subpicture %p in buffer %d, display=%d\n", p_pic, p_subpic,
p_vout->i_buffer_index, b_display /* && !(p_vout->i_changes & VOUT_NODISPLAY_CHANGE) */ );
#endif
}
else
{
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("area overflow\n");
#endif
p_buffer->pi_area_end[VOUT_MAX_AREAS - 1] = i_h;
* move all old areas down */
if( p_buffer->i_areas == VOUT_MAX_AREAS )
{
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("areas overflow\n");
#endif
p_buffer->pi_area_end[VOUT_MAX_AREAS - 2] = p_buffer->pi_area_end[VOUT_MAX_AREAS - 1];
*/
for( i_area = 0; i_area < p_buffer->i_areas; i_area++ )
{
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
intf_DbgMsg("clearing picture %p area in buffer %d: %d-%d\n", p_pic,
p_vout->i_buffer_index, p_buffer->pi_area_begin[i_area], p_buffer->pi_area_end[i_area] );
#endif
*****************************************************************************/
static void RenderPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
char psz_date[MSTRTIME_MAX_SIZE]; /* picture date */
mtime_t render_time; /* picture rendering time */
#endif
p_pic_data = p_buffer->p_data +
p_buffer->i_pic_x * p_vout->i_bytes_per_pixel +
p_buffer->i_pic_y * p_vout->i_bytes_per_line;
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
render_time = mdate();
#endif
#endif
}
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
/* Print picture date and rendering time */
intf_DbgMsg("picture %p rendered in buffer %d (%ld us), display date: %s\n", p_pic,
p_vout->i_buffer_index, (long) (mdate() - render_time),
*****************************************************************************/
static int Manage( vout_thread_t *p_vout )
{
-#ifdef DEBUG_VIDEO
+#ifdef DEBUG_VOUT
if( p_vout->i_changes )
{
intf_DbgMsg("changes: 0x%x (no display: 0x%x)\n", p_vout->i_changes,
/* VPAR_SYNCHRO_DEFAULT */
mtime_t now, pts, period, tau_yuv;
boolean_t b_decode = 0;
+#ifdef DEBUG_VPAR
+ char p_date[MSTRTIME_MAX_SIZE];
+#endif
now = mdate();
period = 1000000 / (p_vpar->sequence.i_frame_rate) * 1001;
}
else
{
- pts = S.current_pts + period * S.i_n_b;
+ /* displaying order : B B P B B I
+ * ^ ^
+ * | +- current picture
+ * +- current PTS
+ */
+ pts = S.current_pts + period * (S.i_n_b + 2);
}
if( (1 + S.i_n_p * (S.i_n_b + 1)) * period >
}
else
{
- pts = S.current_pts + period * S.i_n_b;
+ pts = S.current_pts + period * (S.i_n_b + 2);
}
if( (1 + S.i_n_p * (S.i_n_b + 1)) * period >
if( S.i_eta_b + 1 > S.i_n_b )
S.i_n_b++;
- pts = S.current_pts;
+ pts = S.current_pts + period;
if( (S.i_n_b + 1) * period > S.p_tau[P_CODING_TYPE] )
{
}
vlc_mutex_unlock( &p_vpar->synchro.fifo_lock );
+#ifdef DEBUG_VPAR
+ intf_DbgMsg("vpar synchro debug: %s picture scheduled for %s, %s (%lld)\n",
+ i_coding_type == B_CODING_TYPE ? "B" :
+ (i_coding_type == P_CODING_TYPE ? "P" : "I"),
+ mstrtime(p_date, pts), b_decode ? "decoding" : "trashed",
+ S.p_tau[i_coding_type]);
+#endif
return( b_decode );
#undef S
#undef TAU_PRIME
{
p_vpar->synchro.pi_meaningful[i_coding_type]++;
}
+#ifdef DEBUG_VPAR
+ intf_DbgMsg("vpar synchro debug: finished decoding %s (%lld)\n",
+ i_coding_type == B_CODING_TYPE ? "B" :
+ (i_coding_type == P_CODING_TYPE ? "P" : "I"), tau);
+#endif
}
FIFO_INCREMENT( i_start );