1 /*****************************************************************************
2 * input_dec.c: Functions for the management of decoders
3 *****************************************************************************
4 * Copyright (C) 1999-2001 VideoLAN
5 * $Id: input_dec.c,v 1.83 2003/12/24 09:46:08 gbazin Exp $
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
8 * Gildas Bazin <gbazin@netcourrier.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
29 #include <string.h> /* memcpy(), memset() */
32 #include <vlc/decoder.h>
35 #include "stream_output.h"
37 #include "input_ext-intf.h"
38 #include "input_ext-plugins.h"
42 static void input_NullPacket( input_thread_t *, es_descriptor_t * );
44 static decoder_t * CreateDecoder( input_thread_t *, es_descriptor_t *, int );
45 static int DecoderThread( decoder_t * );
46 static int DecoderDecode( decoder_t * p_dec, block_t *p_block );
47 static void DeleteDecoder( decoder_t * );
49 /* Buffers allocation callbacks for the decoders */
50 static aout_buffer_t *aout_new_buffer( decoder_t *, int );
51 static void aout_del_buffer( decoder_t *, aout_buffer_t * );
53 static picture_t *vout_new_buffer( decoder_t * );
54 static void vout_del_buffer( decoder_t *, picture_t * );
55 static void vout_link_picture( decoder_t *, picture_t * );
56 static void vout_unlink_picture( decoder_t *, picture_t * );
58 static es_format_t null_es_format = {0};
60 struct decoder_owner_sys_t
62 vlc_bool_t b_own_thread;
64 aout_instance_t *p_aout;
65 aout_input_t *p_aout_input;
67 vout_thread_t *p_vout;
69 sout_packetizer_input_t *p_sout;
71 /* Current format in use by the output */
80 input_buffers_t *p_method_data;
84 /*****************************************************************************
85 * input_RunDecoder: spawns a new decoder thread
86 *****************************************************************************/
87 decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
89 decoder_t *p_dec = NULL;
92 /* If we are in sout mode, search for packetizer module */
93 var_Get( p_input, "sout", &val );
94 if( !p_es->b_force_decoder && val.psz_string && *val.psz_string )
96 free( val.psz_string );
97 val.b_bool = VLC_TRUE;
99 if( p_es->i_cat == AUDIO_ES )
101 var_Get( p_input, "sout-audio", &val );
103 else if( p_es->i_cat == VIDEO_ES )
105 var_Get( p_input, "sout-video", &val );
110 /* Create the decoder configuration structure */
111 p_dec = CreateDecoder( p_input, p_es, VLC_OBJECT_PACKETIZER );
114 msg_Err( p_input, "could not create packetizer" );
119 module_Need( p_dec, "packetizer", "$packetizer" );
124 /* Create the decoder configuration structure */
125 p_dec = CreateDecoder( p_input, p_es, VLC_OBJECT_DECODER );
128 msg_Err( p_input, "could not create decoder" );
132 /* default Get a suitable decoder module */
133 p_dec->p_module = module_Need( p_dec, "decoder", "$codec" );
135 if( val.psz_string ) free( val.psz_string );
138 if( !p_dec || !p_dec->p_module )
140 msg_Err( p_dec, "no suitable decoder module for fourcc `%4.4s'.\n"
141 "VLC probably does not support this sound or video format.",
142 (char*)&p_dec->fmt_in.i_codec );
144 DeleteDecoder( p_dec );
145 vlc_object_destroy( p_dec );
149 var_Get( p_input, "minimize-threads", &val );
150 p_dec->p_owner->b_own_thread = val.b_bool ? VLC_FALSE : VLC_TRUE;
152 if( p_dec->p_owner->b_own_thread )
155 if ( p_es->i_cat == AUDIO_ES )
157 i_priority = VLC_THREAD_PRIORITY_AUDIO;
161 i_priority = VLC_THREAD_PRIORITY_VIDEO;
164 /* Spawn the decoder thread */
165 if( vlc_thread_create( p_dec, "decoder", DecoderThread,
166 i_priority, VLC_FALSE ) )
168 msg_Err( p_dec, "cannot spawn decoder thread \"%s\"",
169 p_dec->p_module->psz_object_name );
170 module_Unneed( p_dec, p_dec->p_module );
171 DeleteDecoder( p_dec );
172 vlc_object_destroy( p_dec );
177 p_input->stream.b_changed = 1;
182 /*****************************************************************************
183 * input_EndDecoder: kills a decoder thread and waits until it's finished
184 *****************************************************************************/
185 void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
187 decoder_t *p_dec = p_es->p_dec;
190 p_dec->b_die = VLC_TRUE;
192 if( p_dec->p_owner->b_own_thread )
194 /* Make sure the thread leaves the NextDataPacket() function by
195 * sending it a few null packets. */
196 for( i_dummy = 0; i_dummy < PADDING_PACKET_NUMBER; i_dummy++ )
198 input_NullPacket( p_input, p_es );
201 if( p_es->p_pes != NULL )
203 input_DecodePES( p_es->p_dec, p_es->p_pes );
206 /* Waiting for the thread to exit */
207 /* I thought that unlocking was better since thread join can be long
208 * but it actually creates late pictures and freezes --stef */
209 /* vlc_mutex_unlock( &p_input->stream.stream_lock ); */
210 vlc_thread_join( p_dec );
211 /* vlc_mutex_lock( &p_input->stream.stream_lock ); */
213 /* XXX We don't do it here because of dll loader that want close in the
214 * same thread than open/decode */
216 module_Unneed( p_dec, p_dec->p_module );
221 module_Unneed( p_dec, p_dec->p_module );
224 /* Delete decoder configuration */
225 DeleteDecoder( p_dec );
227 /* Delete the decoder */
228 vlc_object_destroy( p_dec );
230 /* Tell the input there is no more decoder */
233 p_input->stream.b_changed = 1;
236 /*****************************************************************************
238 *****************************************************************************
239 * Put a PES in the decoder's fifo.
240 *****************************************************************************/
241 void input_DecodePES( decoder_t * p_dec, pes_packet_t * p_pes )
243 data_packet_t *p_data;
246 for( p_data = p_pes->p_first; p_data != NULL; p_data = p_data->p_next )
248 i_size += p_data->p_payload_end - p_data->p_payload_start;
252 block_t *p_block = block_New( p_dec, i_size );
255 uint8_t *p_buffer = p_block->p_buffer;
257 for( p_data = p_pes->p_first; p_data != NULL; p_data = p_data->p_next )
259 int i_copy = p_data->p_payload_end - p_data->p_payload_start;
261 memcpy( p_buffer, p_data->p_payload_start, i_copy );
265 p_block->i_pts = p_pes->i_pts;
266 p_block->i_dts = p_pes->i_dts;
267 p_block->b_discontinuity = p_pes->b_discontinuity;
268 p_block->i_rate = p_pes->i_rate;
270 input_DecodeBlock( p_dec, p_block );
274 input_DeletePES( p_dec->p_owner->p_method_data, p_pes );
276 /*****************************************************************************
278 *****************************************************************************
279 * Put a block_t in the decoder's fifo.
280 *****************************************************************************/
281 void input_DecodeBlock( decoder_t * p_dec, block_t *p_block )
283 if( p_dec->p_owner->b_own_thread )
285 block_FifoPut( p_dec->p_owner->p_fifo, p_block );
289 if( p_dec->b_error || p_block->i_buffer <= 0 )
291 block_Release( p_block );
295 DecoderDecode( p_dec, p_block );
300 /*****************************************************************************
301 * Create a NULL packet for padding in case of a data loss
302 *****************************************************************************/
303 static void input_NullPacket( input_thread_t * p_input,
304 es_descriptor_t * p_es )
306 block_t *p_block = block_New( p_input, PADDING_PACKET_SIZE );
310 memset( p_block->p_buffer, 0, PADDING_PACKET_SIZE );
311 p_block->b_discontinuity = 1;
313 block_FifoPut( p_es->p_dec->p_owner->p_fifo, p_block );
317 /*****************************************************************************
318 * input_EscapeDiscontinuity: send a NULL packet to the decoders
319 *****************************************************************************/
320 void input_EscapeDiscontinuity( input_thread_t * p_input )
322 unsigned int i_es, i;
324 for( i_es = 0; i_es < p_input->stream.i_selected_es_number; i_es++ )
326 es_descriptor_t * p_es = p_input->stream.pp_selected_es[i_es];
328 if( p_es->p_dec != NULL )
330 for( i = 0; i < PADDING_PACKET_NUMBER; i++ )
332 input_NullPacket( p_input, p_es );
338 /*****************************************************************************
339 * input_EscapeAudioDiscontinuity: send a NULL packet to the audio decoders
340 *****************************************************************************/
341 void input_EscapeAudioDiscontinuity( input_thread_t * p_input )
343 unsigned int i_es, i;
345 for( i_es = 0; i_es < p_input->stream.i_selected_es_number; i_es++ )
347 es_descriptor_t * p_es = p_input->stream.pp_selected_es[i_es];
349 if( p_es->p_dec != NULL && p_es->i_cat == AUDIO_ES )
351 for( i = 0; i < PADDING_PACKET_NUMBER; i++ )
353 input_NullPacket( p_input, p_es );
359 /*****************************************************************************
360 * CreateDecoder: create a decoder object
361 *****************************************************************************/
362 static decoder_t * CreateDecoder( input_thread_t * p_input,
363 es_descriptor_t * p_es, int i_object_type )
367 p_dec = vlc_object_create( p_input, i_object_type );
370 msg_Err( p_input, "out of memory" );
374 p_dec->pf_decode_audio = 0;
375 p_dec->pf_decode_video = 0;
376 p_dec->pf_decode_sub = 0;
377 p_dec->pf_packetize = 0;
379 /* Select a new ES */
380 INSERT_ELEM( p_input->stream.pp_selected_es,
381 p_input->stream.i_selected_es_number,
382 p_input->stream.i_selected_es_number,
385 /* Initialize the decoder fifo */
386 p_dec->p_module = NULL;
388 p_dec->fmt_in = p_es->fmt;
390 if( p_es->p_waveformatex )
392 #define p_wf ((WAVEFORMATEX *)p_es->p_waveformatex)
393 p_dec->fmt_in.audio.i_channels = p_wf->nChannels;
394 p_dec->fmt_in.audio.i_rate = p_wf->nSamplesPerSec;
395 p_dec->fmt_in.i_bitrate = p_wf->nAvgBytesPerSec * 8;
396 p_dec->fmt_in.audio.i_blockalign = p_wf->nBlockAlign;
397 p_dec->fmt_in.audio.i_bitspersample = p_wf->wBitsPerSample;
398 p_dec->fmt_in.i_extra = p_wf->cbSize;
399 p_dec->fmt_in.p_extra = NULL;
402 p_dec->fmt_in.p_extra = malloc( p_wf->cbSize );
403 memcpy( p_dec->fmt_in.p_extra, &p_wf[1], p_wf->cbSize );
407 if( p_es->p_bitmapinfoheader )
409 #define p_bih ((BITMAPINFOHEADER *) p_es->p_bitmapinfoheader)
410 p_dec->fmt_in.i_extra = p_bih->biSize - sizeof(BITMAPINFOHEADER);
411 p_dec->fmt_in.p_extra = NULL;
412 if( p_dec->fmt_in.i_extra )
414 p_dec->fmt_in.p_extra = malloc( p_dec->fmt_in.i_extra );
415 memcpy( p_dec->fmt_in.p_extra, &p_bih[1], p_dec->fmt_in.i_extra );
418 p_dec->fmt_in.video.i_width = p_bih->biWidth;
419 p_dec->fmt_in.video.i_height = p_bih->biHeight;
424 * - 2: I'm not sure there isn't any endian problem here (spu)... */
425 if( p_es->i_cat == SPU_ES && p_es->p_demux_data )
427 if( ( p_es->i_fourcc == VLC_FOURCC( 's', 'p', 'u', ' ' ) ||
428 p_es->i_fourcc == VLC_FOURCC( 's', 'p', 'u', 'b' ) ) &&
429 *((uint32_t*)p_es->p_demux_data) == 0xBeef )
431 memcpy( p_dec->fmt_in.subs.spu.palette,
432 p_es->p_demux_data, 17 * 4 );
434 else if( p_es->i_fourcc == VLC_FOURCC( 'd', 'v', 'b', 's' ) )
436 dvb_spuinfo_t *p_dvbs = (dvb_spuinfo_t*)p_es->p_demux_data;
438 p_dec->fmt_in.subs.dvb.i_id = p_dvbs->i_id;
442 p_dec->fmt_in.i_cat = p_es->i_cat;
443 p_dec->fmt_in.i_codec = p_es->i_fourcc;
445 p_dec->fmt_out = null_es_format;
447 /* Allocate our private structure for the decoder */
448 p_dec->p_owner = (decoder_owner_sys_t*)malloc(sizeof(decoder_owner_sys_t));
449 if( p_dec->p_owner == NULL )
451 msg_Err( p_dec, "out of memory" );
454 p_dec->p_owner->b_own_thread = VLC_TRUE;
455 p_dec->p_owner->p_aout = NULL;
456 p_dec->p_owner->p_aout_input = NULL;
457 p_dec->p_owner->p_vout = NULL;
458 p_dec->p_owner->p_sout = NULL;
460 if( ( p_dec->p_owner->p_fifo = block_FifoNew( p_dec ) ) == NULL )
462 msg_Err( p_dec, "out of memory" );
465 p_dec->p_owner->p_method_data = p_input->p_method_data;
467 /* Set buffers allocation callbacks for the decoders */
468 p_dec->pf_aout_buffer_new = aout_new_buffer;
469 p_dec->pf_aout_buffer_del = aout_del_buffer;
470 p_dec->pf_vout_buffer_new = vout_new_buffer;
471 p_dec->pf_vout_buffer_del = vout_del_buffer;
472 p_dec->pf_picture_link = vout_link_picture;
473 p_dec->pf_picture_unlink = vout_unlink_picture;
475 vlc_object_attach( p_dec, p_input );
480 /*****************************************************************************
481 * DecoderThread: the decoding main loop
482 *****************************************************************************/
483 static int DecoderThread( decoder_t * p_dec )
487 /* The decoder's main loop */
488 while( !p_dec->b_die && !p_dec->b_error )
490 if( ( p_block = block_FifoGet( p_dec->p_owner->p_fifo ) ) == NULL )
495 if( p_block->i_buffer <= 0 )
497 block_Release( p_block );
500 if( DecoderDecode( p_dec, p_block ) )
506 while( !p_dec->b_die )
508 /* Trash all received PES packets */
509 p_block = block_FifoGet( p_dec->p_owner->p_fifo );
512 block_Release( p_block );
516 /* XXX We do it here because of dll loader that want close in the
517 * same thread than open/decode */
519 module_Unneed( p_dec, p_dec->p_module );
524 /*****************************************************************************
525 * DecoderDecode: decode a block
526 *****************************************************************************/
527 static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
529 if( p_block->i_buffer <= 0 )
531 block_Release( p_block );
535 if( p_dec->i_object_type == VLC_OBJECT_PACKETIZER )
537 block_t *p_sout_block;
539 while( (p_sout_block = p_dec->pf_packetize( p_dec, &p_block )) )
541 if( !p_dec->p_owner->p_sout )
543 es_format_Copy( &p_dec->p_owner->sout, &p_dec->fmt_out );
545 p_dec->p_owner->p_sout =
546 sout_InputNew( p_dec, &p_dec->p_owner->sout );
548 if( p_dec->p_owner->p_sout == NULL )
550 msg_Err( p_dec, "cannot create packetizer output" );
551 p_dec->b_error = VLC_TRUE;
553 while( p_sout_block )
555 block_t *p_next = p_sout_block->p_next;
556 block_Release( p_sout_block );
557 p_sout_block = p_next;
563 while( p_sout_block )
565 block_t *p_next = p_sout_block->p_next;
566 sout_buffer_t *p_sout_buffer;
569 sout_BufferNew( p_dec->p_owner->p_sout->p_sout,
570 p_sout_block->i_buffer );
571 if( p_sout_buffer == NULL )
573 msg_Err( p_dec, "cannot get sout buffer" );
577 memcpy( p_sout_buffer->p_buffer, p_sout_block->p_buffer,
578 p_sout_block->i_buffer );
580 p_sout_buffer->i_pts = p_sout_block->i_pts;
581 p_sout_buffer->i_dts = p_sout_block->i_dts;
582 p_sout_buffer->i_length = p_sout_block->i_length;
584 block_Release( p_sout_block );
586 sout_InputSendBuffer( p_dec->p_owner->p_sout, p_sout_buffer );
588 p_sout_block = p_next;
592 else if( p_dec->fmt_in.i_cat == AUDIO_ES )
594 aout_buffer_t *p_aout_buf;
596 while( (p_aout_buf = p_dec->pf_decode_audio( p_dec, &p_block )) )
598 aout_DecPlay( p_dec->p_owner->p_aout,
599 p_dec->p_owner->p_aout_input, p_aout_buf );
602 else if( p_dec->fmt_in.i_cat == VIDEO_ES )
606 while( (p_pic = p_dec->pf_decode_video( p_dec, &p_block )) )
608 vout_DatePicture( p_dec->p_owner->p_vout, p_pic, p_pic->date );
609 vout_DisplayPicture( p_dec->p_owner->p_vout, p_pic );
612 else if( p_dec->fmt_in.i_cat == SPU_ES )
614 p_dec->pf_decode_sub( p_dec, &p_block );
618 msg_Err( p_dec, "unknown ES format !!" );
622 return p_dec->b_error ? VLC_EGENERIC : VLC_SUCCESS;
625 /*****************************************************************************
626 * DeleteDecoder: destroys a decoder object
627 *****************************************************************************/
628 static void DeleteDecoder( decoder_t * p_dec )
630 vlc_object_detach( p_dec );
633 "killing decoder fourcc `%4.4s', %d PES in FIFO",
634 (char*)&p_dec->fmt_in.i_codec,
635 p_dec->p_owner->p_fifo->i_depth );
637 /* Free all packets still in the decoder fifo. */
638 block_FifoEmpty( p_dec->p_owner->p_fifo );
639 block_FifoRelease( p_dec->p_owner->p_fifo );
642 if( p_dec->p_owner->p_aout_input )
643 aout_DecDelete( p_dec->p_owner->p_aout, p_dec->p_owner->p_aout_input );
645 if( p_dec->p_owner->p_vout )
649 #define p_pic p_dec->p_owner->p_vout->render.pp_picture[i_pic]
650 /* Hack to make sure all the the pictures are freed by the decoder */
651 for( i_pic = 0; i_pic < p_dec->p_owner->p_vout->render.i_pictures;
654 if( p_pic->i_status == RESERVED_PICTURE )
655 vout_DestroyPicture( p_dec->p_owner->p_vout, p_pic );
656 if( p_pic->i_refcount > 0 )
657 vout_UnlinkPicture( p_dec->p_owner->p_vout, p_pic );
661 /* We are about to die. Reattach video output to p_vlc. */
662 vout_Request( p_dec, p_dec->p_owner->p_vout, 0, 0, 0, 0 );
665 if( p_dec->p_owner->p_sout )
667 sout_InputDelete( p_dec->p_owner->p_sout );
668 if( p_dec->p_owner->sout.i_extra ) free(p_dec->p_owner->sout.p_extra);
671 if( p_dec->fmt_in.i_extra ) free( p_dec->fmt_in.p_extra );
672 if( p_dec->fmt_out.i_extra ) free( p_dec->fmt_out.p_extra );
674 free( p_dec->p_owner );
677 /*****************************************************************************
678 * Buffers allocation callbacks for the decoders
679 *****************************************************************************/
680 static aout_buffer_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
682 decoder_owner_sys_t *p_sys = (decoder_owner_sys_t *)p_dec->p_owner;
683 aout_buffer_t *p_buffer;
685 if( p_sys->p_aout_input != NULL &&
686 ( p_dec->fmt_out.audio.i_rate != p_sys->audio.i_rate ||
687 p_dec->fmt_out.audio.i_original_channels !=
688 p_sys->audio.i_original_channels ||
689 p_dec->fmt_out.audio.i_bytes_per_frame !=
690 p_sys->audio.i_bytes_per_frame ) )
692 /* Parameters changed, restart the aout */
693 aout_DecDelete( p_sys->p_aout, p_sys->p_aout_input );
694 p_sys->p_aout_input = NULL;
697 if( p_sys->p_aout_input == NULL )
699 p_dec->fmt_out.audio.i_format = p_dec->fmt_out.i_codec;
700 p_sys->audio = p_dec->fmt_out.audio;
701 p_sys->p_aout_input =
702 aout_DecNew( p_dec, &p_sys->p_aout, &p_sys->audio );
703 if( p_sys->p_aout_input == NULL )
705 msg_Err( p_dec, "failed to create audio output" );
706 p_dec->b_error = VLC_TRUE;
709 p_dec->fmt_out.audio.i_bytes_per_frame =
710 p_sys->audio.i_bytes_per_frame;
713 p_buffer = aout_DecNewBuffer( p_sys->p_aout, p_sys->p_aout_input,
719 static void aout_del_buffer( decoder_t *p_dec, aout_buffer_t *p_buffer )
721 aout_DecDeleteBuffer( p_dec->p_owner->p_aout,
722 p_dec->p_owner->p_aout_input, p_buffer );
725 static picture_t *vout_new_buffer( decoder_t *p_dec )
727 decoder_owner_sys_t *p_sys = (decoder_owner_sys_t *)p_dec->p_owner;
730 if( p_sys->p_vout == NULL ||
731 p_dec->fmt_out.video.i_width != p_sys->video.i_width ||
732 p_dec->fmt_out.video.i_height != p_sys->video.i_height ||
733 p_dec->fmt_out.video.i_chroma != p_sys->video.i_chroma ||
734 p_dec->fmt_out.video.i_aspect != p_sys->video.i_aspect )
736 if( !p_dec->fmt_out.video.i_width ||
737 !p_dec->fmt_out.video.i_height )
739 /* Can't create a new vout without display size */
743 p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
744 p_sys->video = p_dec->fmt_out.video;
746 p_sys->p_vout = vout_Request( p_dec, p_sys->p_vout,
747 p_sys->video.i_width,
748 p_sys->video.i_height,
749 p_sys->video.i_chroma,
750 p_sys->video.i_aspect );
752 if( p_sys->p_vout == NULL )
754 msg_Err( p_dec, "failed to create video output" );
755 p_dec->b_error = VLC_TRUE;
760 /* Get a new picture */
761 while( !(p_pic = vout_CreatePicture( p_sys->p_vout, 0, 0, 0 ) ) )
765 if( p_dec->b_die || p_dec->b_error )
770 #define p_pic p_dec->p_owner->p_vout->render.pp_picture[i_pic]
771 /* Check the decoder doesn't leak pictures */
772 for( i_pic = 0; i_pic < p_dec->p_owner->p_vout->render.i_pictures;
775 if( p_pic->i_status != DISPLAYED_PICTURE &&
776 p_pic->i_status != RESERVED_PICTURE ) break;
778 if( !p_pic->i_refcount ) break;
780 if( i_pic == p_dec->p_owner->p_vout->render.i_pictures )
782 msg_Err( p_dec, "decoder is leaking pictures, reseting the heap" );
784 /* Just free all the pictures */
785 for( i_pic = 0; i_pic < p_dec->p_owner->p_vout->render.i_pictures;
788 if( p_pic->i_status == RESERVED_PICTURE )
789 vout_DestroyPicture( p_dec->p_owner->p_vout, p_pic );
790 if( p_pic->i_refcount > 0 )
791 vout_UnlinkPicture( p_dec->p_owner->p_vout, p_pic );
796 msleep( VOUT_OUTMEM_SLEEP );
802 static void vout_del_buffer( decoder_t *p_dec, picture_t *p_pic )
804 vout_DestroyPicture( p_dec->p_owner->p_vout, p_pic );
807 static void vout_link_picture( decoder_t *p_dec, picture_t *p_pic )
809 vout_LinkPicture( p_dec->p_owner->p_vout, p_pic );
812 static void vout_unlink_picture( decoder_t *p_dec, picture_t *p_pic )
814 vout_UnlinkPicture( p_dec->p_owner->p_vout, p_pic );