Changeset e2da42f9737f1197cd7e8d768266b5e0c6ec87e7
- Timestamp:
- 28/11/02 18:35:01 (6 years ago)
- git-parent:
- Files:
-
- include/video_output.h (modified) (2 diffs)
- modules/codec/cinepak/cinepak.c (modified) (5 diffs)
- modules/codec/dv.c (modified) (10 diffs)
- modules/codec/ffmpeg/video.c (modified) (7 diffs)
- modules/codec/mpeg_video/headers.c (modified) (4 diffs)
- modules/codec/mpeg_video/parser.c (modified) (2 diffs)
- modules/codec/tarkin.c (modified) (6 diffs)
- modules/codec/theora.c (modified) (5 diffs)
- modules/codec/xvid.c (modified) (4 diffs)
- modules/gui/macosx/intf.m (modified) (2 diffs)
- modules/video_filter/adjust.c (modified) (3 diffs)
- modules/video_filter/clone.c (modified) (3 diffs)
- modules/video_filter/crop.c (modified) (4 diffs)
- modules/video_filter/deinterlace/deinterlace.c (modified) (5 diffs)
- modules/video_filter/distort.c (modified) (4 diffs)
- modules/video_filter/invert.c (modified) (3 diffs)
- modules/video_filter/motionblur.c (modified) (3 diffs)
- modules/video_filter/transform.c (modified) (4 diffs)
- modules/video_filter/wall.c (modified) (3 diffs)
- src/libvlc.c (modified) (2 diffs)
- src/video_output/video_output.c (modified) (6 diffs)
- src/video_output/vout_pictures.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/video_output.h
r22f2fa6 re2da42f 6 6 ***************************************************************************** 7 7 * Copyright (C) 1999, 2000 VideoLAN 8 * $Id: video_output.h,v 1.8 7 2002/11/20 13:37:35sam Exp $8 * $Id: video_output.h,v 1.88 2002/11/28 17:34:59 sam Exp $ 9 9 * 10 10 * Authors: Vincent Seguin <seguin@via.ecp.fr> … … 142 142 * Prototypes 143 143 *****************************************************************************/ 144 #define vout_CreateThread(a,b,c,d,e) __vout_CreateThread(VLC_OBJECT(a),b,c,d,e) 145 VLC_EXPORT( vout_thread_t *, __vout_CreateThread, ( vlc_object_t *, unsigned int, unsigned int, uint32_t, unsigned int ) ); 146 VLC_EXPORT( void, vout_DestroyThread, ( vout_thread_t * ) ); 144 #define vout_Request(a,b,c,d,e,f) __vout_Request(VLC_OBJECT(a),b,c,d,e,f) 145 VLC_EXPORT( vout_thread_t *, __vout_Request, ( vlc_object_t *, vout_thread_t *, unsigned int, unsigned int, uint32_t, unsigned int ) ); 146 #define vout_Create(a,b,c,d,e) __vout_Create(VLC_OBJECT(a),b,c,d,e) 147 VLC_EXPORT( vout_thread_t *, __vout_Create, ( vlc_object_t *, unsigned int, unsigned int, uint32_t, unsigned int ) ); 148 VLC_EXPORT( void, vout_Destroy, ( vout_thread_t * ) ); 147 149 148 150 VLC_EXPORT( int, vout_ChromaCmp, ( uint32_t, uint32_t ) ); modules/codec/cinepak/cinepak.c
r4c9f239 re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: cinepak.c,v 1. 8 2002/11/27 15:18:24sam Exp $5 * $Id: cinepak.c,v 1.9 2002/11/28 17:34:59 sam Exp $ 6 6 * 7 7 * Authors: Laurent Aimar <fenrir@via.ecp.fr> … … 190 190 } 191 191 192 static int cinepak_CheckVout( vout_thread_t *p_vout,193 int i_width,194 int i_height )195 {196 if( !p_vout )197 {198 return( 0 );199 }200 201 if( ( p_vout->render.i_width != i_width )||202 ( p_vout->render.i_height != i_height )||203 ( p_vout->render.i_chroma != VLC_FOURCC('I','4','2','0') )||204 ( p_vout->render.i_aspect != VOUT_ASPECT_FACTOR * i_width / i_height) )205 {206 return( 0 );207 }208 else209 {210 return( 1 );211 }212 }213 214 /* Return a Vout */215 216 static vout_thread_t *cinepak_CreateVout( videodec_thread_t *p_vdec,217 int i_width,218 int i_height )219 {220 vout_thread_t *p_vout;221 222 if( (!i_width)||(!i_height) )223 {224 return( NULL ); /* Can't create a new vout without display size */225 }226 227 /* Spawn a video output if there is none. First we look for our children,228 * then we look for any other vout that might be available. */229 p_vout = vlc_object_find( p_vdec->p_fifo, VLC_OBJECT_VOUT,230 FIND_CHILD );231 if( !p_vout )232 {233 p_vout = vlc_object_find( p_vdec->p_fifo, VLC_OBJECT_VOUT,234 FIND_ANYWHERE );235 }236 237 if( p_vout )238 {239 if( !cinepak_CheckVout( p_vout, i_width, i_height ) )240 {241 /* We are not interested in this format, close this vout */242 vlc_object_detach( p_vout );243 vlc_object_release( p_vout );244 vout_DestroyThread( p_vout );245 p_vout = NULL;246 }247 else248 {249 /* This video output is cool! Hijack it. */250 vlc_object_detach( p_vout );251 vlc_object_attach( p_vout, p_vdec->p_fifo );252 vlc_object_release( p_vout );253 }254 }255 256 if( p_vout == NULL )257 {258 msg_Dbg( p_vdec->p_fifo, "no vout present, spawning one" );259 260 p_vout = vout_CreateThread( p_vdec->p_fifo,261 i_width,262 i_height,263 VLC_FOURCC('I','4','2','0'),264 VOUT_ASPECT_FACTOR * i_width / i_height );265 }266 267 return( p_vout );268 }269 192 270 193 void cinepak_LoadCodebook( cinepak_codebook_t *p_codebook, … … 841 764 return; 842 765 } 843 766 844 767 /* Check our vout */ 845 if( !cinepak_CheckVout( p_vdec->p_vout, 846 p_vdec->p_context->i_width, 847 p_vdec->p_context->i_height ) ) 848 { 849 p_vdec->p_vout = 850 cinepak_CreateVout( p_vdec, 851 p_vdec->p_context->i_width, 852 p_vdec->p_context->i_height ); 853 854 if( !p_vdec->p_vout ) 855 { 856 msg_Err( p_vdec->p_fifo, "cannot create vout" ); 857 p_vdec->p_fifo->b_error = 1; /* abort */ 858 return; 859 } 768 p_vdec->p_vout = vout_Request( p_vdec->p_fifo, p_vdec->p_vout, 769 p_vdec->p_context->i_width, 770 p_vdec->p_context->i_height, 771 VLC_FOURCC('I','4','2','0'), 772 p_vdec->p_context->i_width 773 * VOUT_ASPECT_FACTOR 774 / p_vdec->p_context->i_height ); 775 776 if( !p_vdec->p_vout ) 777 { 778 msg_Err( p_vdec->p_fifo, "cannot create vout" ); 779 p_vdec->p_fifo->b_error = VLC_TRUE; /* abort */ 780 return; 860 781 } 861 782 … … 906 827 { 907 828 int i; 908 829 909 830 if( !p_vdec ) 910 831 { … … 917 838 FREE( p_vdec->p_context->p_pix[i] ); 918 839 } 919 840 920 841 free( p_vdec->p_context ); 921 922 if( p_vdec->p_vout != NULL ) 923 { 924 /* We are about to die. Reattach video output to p_vlc. */ 925 vlc_object_detach( p_vdec->p_vout ); 926 vlc_object_attach( p_vdec->p_vout, p_vdec->p_fifo->p_vlc ); 927 } 928 842 843 /* Get rid of our video output if we have one. */ 844 vout_Request( p_vdec->p_fifo, p_vdec->p_vout, 0, 0, 0, 0 ); 845 929 846 free( p_vdec ); 930 847 } modules/codec/dv.c
r4910755 re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002 VideoLAN 5 * $Id: dv.c,v 1. 2 2002/11/06 09:26:25sam Exp $5 * $Id: dv.c,v 1.3 2002/11/28 17:34:59 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> 8 * 8 * 9 9 * This program is free software; you can redistribute it and/or modify 10 10 * it under the terms of the GNU General Public License as published by 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 40 40 static int OpenDecoder ( vlc_object_t * ); 41 41 42 static u32GetFourCC ( dv_sample_t );42 static vlc_fourcc_t GetFourCC ( dv_sample_t ); 43 43 44 44 /***************************************************************************** … … 74 74 static int RunDecoder ( decoder_fifo_t *p_fifo ) 75 75 { 76 u 8*p_buffer;76 uint8_t *p_buffer; 77 77 pes_packet_t *p_pes = NULL; 78 78 int i_data = 120000; … … 82 82 dv_decoder_t * p_decoder; 83 83 vout_thread_t * p_vout; 84 84 85 85 p_buffer = malloc( i_data ); 86 86 if( !p_buffer ) … … 150 150 p_buffer = realloc( p_buffer, p_decoder->frame_size ); 151 151 } 152 152 153 153 /* Don't trust the sucker */ 154 154 //p_decoder->quality = p_decoder->video->quality; … … 158 158 /* Spawn a video output if there is none. First we look amongst our 159 159 * children, then we look for any other vout that might be available */ 160 p_vout = vlc_object_find( p_fifo, VLC_OBJECT_VOUT, FIND_CHILD ); 161 if( !p_vout ) 162 { 163 p_vout = vlc_object_find( p_fifo, VLC_OBJECT_VOUT, FIND_ANYWHERE ); 164 } 165 166 if( p_vout ) 167 { 168 if( p_vout->render.i_width != p_decoder->width 169 || p_vout->render.i_height != p_decoder->height 170 || p_vout->render.i_chroma != GetFourCC( p_decoder->sampling ) 171 || p_vout->render.i_aspect != i_aspect ) 172 { 173 /* We are not interested in this format, close this vout */ 174 vlc_object_detach( p_vout ); 175 vlc_object_release( p_vout ); 176 vout_DestroyThread( p_vout ); 177 p_vout = NULL; 178 } 179 else 180 { 181 /* This video output is cool! Hijack it. */ 182 vlc_object_detach( p_vout ); 183 vlc_object_attach( p_vout, p_fifo ); 184 vlc_object_release( p_vout ); 185 } 186 } 187 188 if( !p_vout ) 189 { 190 msg_Dbg( p_fifo, "no vout present, spawning one" ); 191 192 p_vout = vout_CreateThread( p_fifo, 193 p_decoder->width, p_decoder->height, 194 GetFourCC( p_decoder->sampling ), 195 i_aspect ); 196 } 160 p_vout = vout_Request( p_fifo, NULL, 161 p_decoder->width, p_decoder->height, 162 GetFourCC( p_decoder->sampling ), i_aspect ); 197 163 198 164 /* Main loop */ … … 232 198 { 233 199 picture_t *p_pic; 234 u 8*pixels[3];200 uint8_t *pixels[3]; 235 201 int pitches[3], i; 236 202 … … 240 206 { 241 207 break; 242 } 208 } 243 209 msleep( VOUT_OUTMEM_SLEEP ); 244 210 } … … 266 232 } 267 233 268 if( p_vout ) 269 { 270 vlc_object_detach( p_vout ); 271 vout_DestroyThread( p_vout ); 272 } 234 vout_Request( p_fifo, p_vout, 0, 0, 0, 0 ); 273 235 } 274 236 … … 290 252 } 291 253 292 static u32GetFourCC( dv_sample_t x )254 static vlc_fourcc_t GetFourCC( dv_sample_t x ) 293 255 { 294 256 switch( x ) modules/codec/ffmpeg/video.c
r798e979 re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: video.c,v 1. 7 2002/11/28 16:44:05 fenrirExp $5 * $Id: video.c,v 1.8 2002/11/28 17:35:00 sam Exp $ 6 6 * 7 7 * Authors: Laurent Aimar <fenrir@via.ecp.fr> … … 100 100 } 101 101 102 /* Check if we have a Vout with good parameters */103 static int ffmpeg_CheckVout( vout_thread_t *p_vout,104 int i_width,105 int i_height,106 int i_chroma )107 {108 if( !p_vout )109 {110 return( 0 );111 }112 if( !i_chroma )113 {114 /* we will try to make conversion */115 i_chroma = VLC_FOURCC('I','4','2','0');116 }117 118 if( ( p_vout->render.i_width != i_width )||119 ( p_vout->render.i_height != i_height )||120 ( p_vout->render.i_chroma != i_chroma ) )121 {122 return( 0 );123 }124 else125 {126 return( 1 );127 }128 }129 130 102 /* Return a Vout */ 131 103 static vout_thread_t *ffmpeg_CreateVout( vdec_thread_t *p_vdec, … … 150 122 /* It's mainly for I410 -> I420 conversion that I've made, 151 123 it's buggy and very slow */ 152 } 124 } 153 125 154 126 #if LIBAVCODEC_BUILD >= 4640 … … 179 151 /* Spawn a video output if there is none. First we look for our children, 180 152 * then we look for any other vout that might be available. */ 181 p_vout = vlc_object_find( p_vdec->p_fifo, VLC_OBJECT_VOUT, 182 FIND_CHILD ); 183 if( !p_vout ) 184 { 185 p_vout = vlc_object_find( p_vdec->p_fifo, VLC_OBJECT_VOUT, 186 FIND_ANYWHERE ); 187 } 188 189 if( p_vout ) 190 { 191 if( !ffmpeg_CheckVout( p_vout, i_width, i_height, i_chroma ) ) 192 { 193 /* We are not interested in this format, close this vout */ 194 vlc_object_detach( p_vout ); 195 vlc_object_release( p_vout ); 196 vout_DestroyThread( p_vout ); 197 p_vout = NULL; 198 } 199 else 200 { 201 /* This video output is cool! Hijack it. */ 202 vlc_object_detach( p_vout ); 203 vlc_object_attach( p_vout, p_vdec->p_fifo ); 204 vlc_object_release( p_vout ); 205 } 206 } 207 208 if( p_vout == NULL ) 209 { 210 msg_Dbg( p_vdec->p_fifo, "no vout present, spawning one" ); 211 212 p_vout = vout_CreateThread( p_vdec->p_fifo, 213 i_width, i_height, 214 i_chroma, i_aspect ); 215 } 216 217 return( p_vout ); 153 p_vout = vout_Request( p_vdec->p_fifo, NULL, 154 i_width, i_height, i_chroma, i_aspect ); 155 156 return p_vout; 218 157 } 219 158 … … 723 662 if( !p_vdec->b_direct_rendering ) 724 663 { 725 /* Check our vout */ 726 if( !ffmpeg_CheckVout( p_vdec->p_vout, 727 p_vdec->p_context->width, 728 p_vdec->p_context->height, 729 ffmpeg_PixFmtToChroma(p_vdec->p_context->pix_fmt)) ) 730 { 731 p_vdec->p_vout = ffmpeg_CreateVout( p_vdec, p_vdec->p_context ); 732 if( !p_vdec->p_vout ) 733 { 734 msg_Err( p_vdec->p_fifo, "cannot create vout" ); 735 p_vdec->p_fifo->b_error = 1; /* abort */ 736 return; 737 } 664 p_vdec->p_vout = ffmpeg_CreateVout( p_vdec, p_vdec->p_context ); 665 if( !p_vdec->p_vout ) 666 { 667 msg_Err( p_vdec->p_fifo, "cannot create vout" ); 668 p_vdec->p_fifo->b_error = 1; /* abort */ 669 return; 738 670 } 739 671 … … 812 744 } 813 745 814 if( p_vdec->p_vout != NULL ) 815 { 816 /* We are about to die. Reattach video output to p_vlc. */ 817 vlc_object_detach( p_vdec->p_vout ); 818 vlc_object_attach( p_vdec->p_vout, p_vdec->p_fifo->p_vlc ); 819 } 746 /* We are about to die. Reattach video output to p_vlc. */ 747 vout_Request( p_vdec->p_fifo, p_vdec->p_vout, 0, 0, 0, 0 ); 820 748 } 821 749 … … 905 833 906 834 /* Check our vout */ 907 if( !ffmpeg_CheckVout( p_vdec->p_vout, 908 p_vdec->p_context->width, 909 p_vdec->p_context->height, 910 ffmpeg_PixFmtToChroma(p_vdec->p_context->pix_fmt)) ) 911 { 912 p_vdec->p_vout = ffmpeg_CreateVout( p_vdec, p_vdec->p_context ); 913 if( !p_vdec->p_vout ) 914 { 915 msg_Err( p_vdec->p_fifo, "cannot create vout" ); 916 p_vdec->p_fifo->b_error = 1; /* abort */ 917 return -1; 918 } 835 p_vdec->p_vout = ffmpeg_CreateVout( p_vdec, p_vdec->p_context ); 836 if( !p_vdec->p_vout ) 837 { 838 msg_Err( p_vdec->p_fifo, "cannot create vout" ); 839 p_vdec->p_fifo->b_error = 1; /* abort */ 840 return -1; 919 841 } 920 842 modules/codec/mpeg_video/headers.c
r22f2fa6 re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: headers.c,v 1. 5 2002/11/20 13:37:35sam Exp $5 * $Id: headers.c,v 1.6 2002/11/28 17:35:00 sam Exp $ 6 6 * 7 7 * Authors: Christophe Massiot <massiot@via.ecp.fr> … … 312 312 int i_aspect; 313 313 314 vout_thread_t *p_vout;315 316 314 p_vpar->sequence.i_width = GetBits( &p_vpar->bit_stream, 12 ); 317 315 p_vpar->sequence.i_height = GetBits( &p_vpar->bit_stream, 12 ); … … 480 478 /* Spawn a video output if there is none. First we look for our children, 481 479 * then we look for any other vout that might be available. */ 482 p_vout = vlc_object_find( p_vpar->p_fifo, VLC_OBJECT_VOUT, FIND_CHILD ); 483 if( p_vout == NULL ) 484 { 485 p_vout = vlc_object_find( p_vpar->p_fifo, VLC_OBJECT_VOUT, 486 FIND_ANYWHERE ); 487 } 488 489 if( p_vout ) 490 { 491 if( p_vout->render.i_width != p_vpar->sequence.i_width 492 || p_vout->render.i_height != p_vpar->sequence.i_height 493 || p_vout->render.i_chroma != ChromaToFourCC( p_vpar->sequence.i_chroma_format ) 494 || p_vout->render.i_aspect != p_vpar->sequence.i_aspect ) 495 { 496 /* We are not interested in this format, close this vout */ 497 vlc_object_detach( p_vout ); 498 vlc_object_release( p_vout ); 499 vout_DestroyThread( p_vout ); 500 p_vout = NULL; 501 } 502 else 503 { 504 /* This video output is cool! Hijack it. */ 505 if( p_vout != p_vpar->p_vout ) 506 { 507 vlc_object_detach( p_vout ); 508 vlc_object_attach( p_vout, p_vpar->p_fifo ); 509 } 510 vlc_object_release( p_vout ); 511 } 512 } 513 514 p_vpar->p_vout = p_vout; 480 p_vpar->p_vout = 481 vout_Request( p_vpar->p_fifo, p_vpar->p_vout, 482 p_vpar->sequence.i_width, p_vpar->sequence.i_height, 483 ChromaToFourCC( p_vpar->sequence.i_chroma_format ), 484 p_vpar->sequence.i_aspect ); 515 485 516 486 if( p_vpar->p_fifo->b_die || p_vpar->p_fifo->b_error ) … … 521 491 if( p_vpar->p_vout == NULL ) 522 492 { 523 msg_Dbg( p_vpar->p_fifo, "no vout present, spawning one" ); 524 525 p_vpar->p_vout = vout_CreateThread( p_vpar->p_fifo, 526 p_vpar->sequence.i_width, 527 p_vpar->sequence.i_height, 528 ChromaToFourCC( p_vpar->sequence.i_chroma_format ), 529 p_vpar->sequence.i_aspect ); 530 531 /* Everything failed */ 532 if( p_vpar->p_vout == NULL ) 533 { 534 msg_Err( p_vpar->p_fifo, "cannot open vout, aborting" ); 535 p_vpar->p_fifo->b_error = 1; 536 return; 537 } 493 msg_Err( p_vpar->p_fifo, "cannot open vout, aborting" ); 494 p_vpar->p_fifo->b_error = 1; 495 return; 538 496 } 539 497 } modules/codec/mpeg_video/parser.c
r22f2fa6 re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: parser.c,v 1. 7 2002/11/20 13:37:35sam Exp $5 * $Id: parser.c,v 1.8 2002/11/28 17:35:00 sam Exp $ 6 6 * 7 7 * Authors: Christophe Massiot <massiot@via.ecp.fr> … … 300 300 #endif 301 301 302 if( p_vpar->p_vout != NULL ) 303 { 304 /* Release used video buffers. */ 305 if( p_vpar->sequence.p_forward != NULL ) 306 { 307 vout_UnlinkPicture( p_vpar->p_vout, p_vpar->sequence.p_forward ); 308 } 309 if( p_vpar->sequence.p_backward != NULL ) 310 { 311 vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward, 312 vpar_SynchroDate( p_vpar ) ); 313 vout_UnlinkPicture( p_vpar->p_vout, p_vpar->sequence.p_backward ); 314 } 315 if( p_vpar->picture.p_picture != NULL ) 316 { 317 vout_DestroyPicture( p_vpar->p_vout, p_vpar->picture.p_picture ); 318 } 319 320 /* We are about to die. Reattach video output to p_vlc. */ 321 vlc_object_detach( p_vpar->p_vout ); 322 vlc_object_attach( p_vpar->p_vout, p_vpar->p_fifo->p_vlc ); 323 } 302 /* Release used video buffers. */ 303 if( p_vpar->sequence.p_forward != NULL ) 304 { 305 vout_UnlinkPicture( p_vpar->p_vout, p_vpar->sequence.p_forward ); 306 } 307 if( p_vpar->sequence.p_backward != NULL ) 308 { 309 vout_DatePicture( p_vpar->p_vout, p_vpar->sequence.p_backward, 310 vpar_SynchroDate( p_vpar ) ); 311 vout_UnlinkPicture( p_vpar->p_vout, p_vpar->sequence.p_backward ); 312 } 313 if( p_vpar->picture.p_picture != NULL ) 314 { 315 vout_DestroyPicture( p_vpar->p_vout, p_vpar->picture.p_picture ); 316 } 317 318 vout_Request( p_vpar->p_fifo, p_vpar->p_vout, 0, 0, 0, 0 ); 324 319 325 320 msg_Dbg( p_vpar->p_fifo, "%d loops among %d sequence(s)", modules/codec/tarkin.c
r36b7d8e re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: tarkin.c,v 1. 2 2002/11/20 14:09:57 gbazinExp $5 * $Id: tarkin.c,v 1.3 2002/11/28 17:34:59 sam Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 88 88 89 89 static void tarkin_CopyPicture( dec_thread_t *, picture_t *, uint8_t * ); 90 static vout_thread_t *tarkin_SpawnVout( dec_thread_t *, int, int, int, int ); 90 91 91 /***************************************************************************** 92 92 * Module descriptor … … 136 136 p_dec->p_fifo = p_fifo; 137 137 p_dec->p_pes = NULL; 138 p_dec->p_vout = NULL; 138 139 139 140 /* Take care of the initial Tarkin header */ … … 250 251 } 251 252 i_aspect = VOUT_ASPECT_FACTOR * i_width / i_height; 252 p_dec->p_vout = tarkin_SpawnVout( p_dec, i_width, i_height,253 i_aspect, i_chroma );253 p_dec->p_vout = vout_Request( p_dec->p_fifo, p_dec->p_vout, 254 i_width, i_height, i_aspect, i_chroma ); 254 255 255 256 /* Get a new picture */ … … 313 314 input_DeletePES( p_dec->p_fifo->p_packets_mgt, p_dec->p_pes ); 314 315 315 if( p_dec->p_vout ) 316 { 317 vlc_object_detach( p_dec->p_vout ); 318 vout_DestroyThread( p_dec->p_vout ); 319 } 316 vout_Request( p_dec, p_dec->p_vout, 0, 0, 0, 0 ); 320 317 321 318 if( p_dec->tarkin_stream ) … … 324 321 free( p_dec ); 325 322 } 326 }327 328 /*****************************************************************************329 * tarkin_SpawnVout: creates a new video output330 *****************************************************************************/331 static vout_thread_t *tarkin_SpawnVout( dec_thread_t *p_dec,332 int i_width,333 int i_height,334 int i_aspect,335 int i_chroma )336 {337 vout_thread_t *p_vout;338 339 if( !i_width || !i_height )340 return NULL;341 342 if( !i_chroma )343 return NULL;344 345 /* Spawn a video output if there is none. First we look for our children,346 * then we look for any other vout that might be available. */347 p_vout = vlc_object_find( p_dec->p_fifo, VLC_OBJECT_VOUT,348 FIND_CHILD );349 if( !p_vout )350 {351 p_vout = vlc_object_find( p_dec->p_fifo, VLC_OBJECT_VOUT,352 FIND_ANYWHERE );353 }354 355 if( p_vout )356 {357 if( p_vout->render.i_width != i_width358 || p_vout->render.i_height != i_height359 || p_vout->render.i_chroma != i_chroma360 || p_vout->render.i_aspect != i_aspect )361 {362 /* We are not interested in this format, close this vout */363 vlc_object_detach( p_vout );364 vlc_object_release( p_vout );365 vout_DestroyThread( p_vout );366 p_vout = NULL;367 }368 else369 {370 /* This video output is cool! Hijack it. */371 vlc_object_detach( p_vout );372 vlc_object_attach( p_vout, p_dec->p_fifo );373 vlc_object_release( p_vout );374 }375 }376 377 if( p_vout == NULL )378 {379 msg_Dbg( p_dec->p_fifo, "no vout present, spawning one" );380 381 p_vout = vout_CreateThread( p_dec->p_fifo,382 i_width, i_height,383 i_chroma, i_aspect );384 }385 386 return( p_vout );387 323 } 388 324 modules/codec/theora.c
r36b7d8e re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: theora.c,v 1. 1 2002/11/20 14:09:57 gbazinExp $5 * $Id: theora.c,v 1.2 2002/11/28 17:34:59 sam Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 77 77 78 78 static void theora_CopyPicture( dec_thread_t *, picture_t *, yuv_buffer * ); 79 static vout_thread_t *theora_SpawnVout( dec_thread_t *, int, int, int, int ); 79 80 80 /***************************************************************************** 81 81 * Module descriptor … … 125 125 p_dec->p_fifo = p_fifo; 126 126 p_dec->p_pes = NULL; 127 p_dec->p_vout = NULL; 127 128 128 129 /* Take care of the initial Theora header */ … … 153 154 i_chroma = VLC_FOURCC('Y','V','1','2'); 154 155 155 p_dec->p_vout = theora_SpawnVout( p_dec, p_dec->ti.width, p_dec->ti.height, 156 i_aspect, i_chroma ); 156 p_dec->p_vout = vout_Request( p_dec->p_fifo, p_dec->p_vout, 157 p_dec->ti.width, p_dec->ti.height, 158 i_aspect, i_chroma ); 157 159 158 160 /* theora decoder thread's main loop */ … … 264 266 input_DeletePES( p_dec->p_fifo->p_packets_mgt, p_dec->p_pes ); 265 267 266 if( p_dec->p_vout ) 267 { 268 vlc_object_detach( p_dec->p_vout ); 269 vout_DestroyThread( p_dec->p_vout ); 270 } 268 vout_Request( p_dec->p_fifo, p_dec->p_vout, 0, 0, 0, 0 ); 271 269 272 270 free( p_dec ); 273 271 } 274 }275 276 /*****************************************************************************277 * theora_SpawnVout: creates a new video output278 *****************************************************************************/279 static vout_thread_t *theora_SpawnVout( dec_thread_t *p_dec,280 int i_width,281 int i_height,282 int i_aspect,283 int i_chroma )284 {285 vout_thread_t *p_vout;286 287 if( !i_width || !i_height )288 return NULL;289 290 if( !i_chroma )291 return NULL;292 293 /* Spawn a video output if there is none. First we look for our children,294 * then we look for any other vout that might be available. */295 p_vout = vlc_object_find( p_dec->p_fifo, VLC_OBJECT_VOUT,296 FIND_CHILD );297 if( !p_vout )298 {299 p_vout = vlc_object_find( p_dec->p_fifo, VLC_OBJECT_VOUT,300 FIND_ANYWHERE );301 }302 303 if( p_vout )304 {305 if( p_vout->render.i_width != i_width306 || p_vout->render.i_height != i_height307 || p_vout->render.i_chroma != i_chroma308 || p_vout->render.i_aspect != i_aspect )309 {310 /* We are not interested in this format, close this vout */311 vlc_object_detach( p_vout );312 vlc_object_release( p_vout );313 vout_DestroyThread( p_vout );314 p_vout = NULL;315 }316 else317 {318 /* This video output is cool! Hijack it. */319 vlc_object_detach( p_vout );320 vlc_object_attach( p_vout, p_dec->p_fifo );321 vlc_object_release( p_vout );322 }323 }324 325 if( p_vout == NULL )326 {327 msg_Dbg( p_dec->p_fifo, "no vout present, spawning one" );328 329 p_vout = vout_CreateThread( p_dec->p_fifo,330 i_width, i_height,331 i_chroma, i_aspect );332 }333 334 return( p_vout );335 272 } 336 273 modules/codec/xvid.c
r4910755 re2da42f 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002 VideoLAN 5 * $Id: xvid.c,v 1. 2 2002/11/06 09:26:25sam Exp $5 * $Id: xvid.c,v 1.3 2002/11/28 17:34:59 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> 8 * 8 * 9 9 * This program is free software; you can redistribute it and/or modify 10 10 * it under the terms of the GNU General Public License as published by 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 49 49 set_capability( "decoder", 50 ); 50 50 set_callbacks( OpenDecoder, NULL ); 51 add_bool( "xvid-direct-render", 0, NULL, "direct rendering", 51 add_bool( "xvid-direct-render", 0, NULL, "direct rendering", 52 52 "Use libxvidcore's direct rendering feature." ); 53 53 vlc_module_end(); … … 148 148 /* Spawn a video output if there is none. First we look amongst our 149 149 * children, then we look for any other vout that might be available */ 150 p_vout = vlc_object_find( p_fifo, VLC_OBJECT_VOUT, FIND_CHILD ); 151 if( !p_vout ) 152 { 153 p_vout = vlc_object_find( p_fifo, VLC_OBJECT_VOUT, FIND_ANYWHERE ); 154 } 155 156 if( p_vout ) 157 { 158 if( p_vout->render.i_width != i_width 159 || p_vout->render.i_height != i_height 160 || p_vout->render.i_chroma != i_chroma 161 || p_vout->render.i_aspect != i_aspect ) 162 { 163 /* We are not interested in this format, close this vout */ 164 vlc_object_detach( p_vout ); 165 vlc_object_release( p_vout ); 166 vout_DestroyThread( p_vout ); 167 p_vout = NULL; 168 } 169 else 170 { 171 /* This video output is cool! Hijack it. */ 172 vlc_object_detach( p_vout ); 173 vlc_object_attach( p_vout, p_fifo ); 174 vlc_object_release( p_vout ); 175 } 176 } 150 p_vout = vout_Request( p_fifo, NULL, 151 i_width, i_height, i_chroma, i_aspect ); 177 152 178 153 if( !p_vout ) 179 154 { 180 msg_Dbg( p_fifo, "no vout present, spawning one" ); 181 182 p_vout = vout_CreateThread( p_fifo, 183 i_width, i_height, 184 i_chroma, i_aspect ); 185 &nb
