* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: video_output.c,v 1.120 2001/04/25 20:54:07 massiot Exp $
+ * $Id: video_output.c,v 1.122 2001/05/01 04:18:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
}
/* Choose the best module */
- p_vout->p_module = module_Need( p_main->p_bank,
- MODULE_CAPABILITY_VOUT, NULL );
+ p_vout->p_module = module_Need( MODULE_CAPABILITY_VOUT, NULL );
if( p_vout->p_module == NULL )
{
* own error messages */
if( p_vout->pf_create( p_vout ) )
{
- module_Unneed( p_main->p_bank, p_vout->p_module );
+ module_Unneed( p_vout->p_module );
free( p_vout );
return( NULL );
}
*****************************************************************************/
void vout_DisplaySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
{
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
char psz_begin_date[MSTRTIME_MAX_SIZE]; /* buffer for date string */
char psz_end_date[MSTRTIME_MAX_SIZE]; /* buffer for date string */
#endif
/* Check if status is valid */
if( p_subpic->i_status != RESERVED_SUBPICTURE )
{
- intf_DbgMsg("error: subpicture %p has invalid status %d", p_subpic,
+ intf_ErrMsg("error: subpicture %p has invalid status %d", p_subpic,
p_subpic->i_status );
}
#endif
/* Remove reservation flag */
p_subpic->i_status = READY_SUBPICTURE;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
/* Send subpicture information */
intf_DbgMsg("subpicture %p: type=%d, begin date=%s, end date=%s",
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_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("subpicture %p (in destroyed subpicture slot)",
&p_vout->p_subpicture[i_subpic] );
#endif
break;
#ifdef DEBUG
default:
- intf_DbgMsg("error: unknown subpicture type %d", i_type );
+ intf_ErrMsg("error: unknown subpicture type %d", i_type );
p_free_subpic->p_data = NULL;
break;
#endif
strerror( ENOMEM ) );
}
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("subpicture %p (in free subpicture slot)", p_free_subpic );
#endif
vlc_mutex_unlock( &p_vout->subpicture_lock );
/* Check if status is valid */
if( p_subpic->i_status != RESERVED_SUBPICTURE )
{
- intf_DbgMsg("error: subpicture %p has invalid status %d",
+ intf_ErrMsg("error: subpicture %p has invalid status %d",
p_subpic, p_subpic->i_status );
}
#endif
p_subpic->i_status = DESTROYED_SUBPICTURE;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("subpicture %p", p_subpic);
#endif
}
break;
#ifdef DEBUG
default:
- intf_DbgMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
+ intf_ErrMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
break;
#endif
}
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("picture %p", 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_VOUT
+#ifdef TRACE_VOUT
char psz_date[MSTRTIME_MAX_SIZE]; /* date */
#endif
break;
#ifdef DEBUG
default:
- intf_DbgMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
+ intf_ErrMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
break;
#endif
}
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("picture %p, display date: %s", 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_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("picture %p (in destroyed picture slot)",
&p_vout->p_picture[i_picture] );
#endif
break;
#ifdef DEBUG
default:
- intf_DbgMsg("error: unknown picture type %d", i_type );
+ intf_ErrMsg("error: unknown picture type %d", i_type );
p_free_picture->p_data = NULL;
break;
#endif
strerror( ENOMEM ) );
}
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("picture %p (in free picture slot)", p_free_picture );
#endif
vlc_mutex_unlock( &p_vout->picture_lock );
(p_pic->i_status != RESERVED_DATED_PICTURE) &&
(p_pic->i_status != RESERVED_DISP_PICTURE) )
{
- intf_DbgMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
+ intf_ErrMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
}
#endif
p_pic->i_status = DESTROYED_PICTURE;
p_vout->i_pictures--;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("picture %p", p_pic);
#endif
vlc_mutex_lock( &p_vout->picture_lock );
p_pic->i_refcount++;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("picture %p refcount=%d", p_pic, p_pic->i_refcount );
#endif
vlc_mutex_lock( &p_vout->picture_lock );
p_pic->i_refcount--;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
if( p_pic->i_refcount < 0 )
{
intf_DbgMsg("error: refcount < 0");
p_vout->i_pictures--;
}
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("picture %p refcount=%d", p_pic, p_pic->i_refcount );
#endif
/* On awakening, take back lock and send immediately picture to display,
* then swap buffers */
vlc_mutex_lock( &p_vout->change_lock );
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg( "picture %p, subpicture %p in buffer %d, display=%d", p_pic, p_subpic,
p_vout->i_buffer_index, b_display /* && !(p_vout->i_changes & VOUT_NODISPLAY_CHANGE) */ );
#endif
vlc_mutex_destroy( &p_vout->change_lock );
/* Release the module */
- module_Unneed( p_main->p_bank, p_vout->p_module );
+ module_Unneed( p_vout->p_module );
/* Free structure */
free( p_vout );
}
else
{
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("area overflow");
#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_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("areas overflow");
#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_VOUT
+#ifdef TRACE_VOUT
intf_DbgMsg("clearing picture %p area in buffer %d: %d-%d", 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_VOUT
+#ifdef TRACE_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_VOUT
+#ifdef TRACE_VOUT
render_time = mdate();
#endif
break;
#ifdef DEBUG
default:
- intf_DbgMsg("error: unknown picture type %d", p_pic->i_type );
+ intf_ErrMsg("error: unknown picture type %d", p_pic->i_type );
break;
#endif
}
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
/* Print picture date and rendering time */
intf_DbgMsg("picture %p rendered in buffer %d (%ld us), display date: %s", p_pic,
p_vout->i_buffer_index, (long) (mdate() - render_time),
#ifdef DEBUG
default:
- intf_DbgMsg( "error: unknown subpicture %p type %d",
+ intf_ErrMsg( "error: unknown subpicture %p type %d",
p_subpic, p_subpic->i_type );
#endif
}
*****************************************************************************/
static int Manage( vout_thread_t *p_vout )
{
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
if( p_vout->i_changes )
{
intf_DbgMsg("changes: 0x%x (no display: 0x%x)", p_vout->i_changes,