~ubuntu-branches/ubuntu/precise/vlc/precise-proposed

« back to all changes in this revision

Viewing changes to modules/codec/avcodec/video.c

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2012-03-24 01:33:03 UTC
  • mfrom: (1.1.46) (3.5.39 sid)
  • Revision ID: package-import@ubuntu.com-20120324013303-km51kpl9kixydb8g
Really add the preinst from Didier Raboud to vlc to drop it's doc directory
before unpacking a symlink to vlc-nox's over it. (Closes: #613121, #662217)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * video.c: video decoder using the ffmpeg library
3
3
 *****************************************************************************
4
4
 * Copyright (C) 1999-2001 the VideoLAN team
5
 
 * $Id: 49f94fc85dd678f76d5a8f7038af7fdfa449e99e $
 
5
 * $Id: 60ce6b66d52f584d9e4a0484055c7cdae9c99aa3 $
6
6
 *
7
7
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8
8
 *          Gildas Bazin <gbazin@videolan.org>
29
29
# include "config.h"
30
30
#endif
31
31
 
 
32
#if defined(HAVE_LIBAVCODEC_AVCODEC_H) && defined(HAVE_AVCODEC_DXVA2)
 
33
# if _WIN32_WINNT < 0x600
 
34
/* dxva2 needs Vista support */
 
35
#  undef _WIN32_WINNT
 
36
#  define _WIN32_WINNT 0x600
 
37
# endif
 
38
#endif
 
39
 
32
40
#include <vlc_common.h>
33
41
#include <vlc_codec.h>
34
42
#include <vlc_avcodec.h>
86
94
    /* Hack to force display of still pictures */
87
95
    bool b_first_frame;
88
96
 
 
97
 
89
98
    /* */
 
99
#if LIBAVCODEC_VERSION_MAJOR < 54
90
100
    AVPaletteControl palette;
 
101
#else
 
102
# warning FIXME
 
103
#endif
91
104
 
92
105
    /* */
93
106
    bool b_flush;
106
119
#   define post_mt(s)
107
120
#endif
108
121
 
109
 
/* FIXME (dummy palette for now) */
110
 
static const AVPaletteControl palette_control;
111
 
 
112
122
/*****************************************************************************
113
123
 * Local prototypes
114
124
 *****************************************************************************/
225
235
    /*  ***** Get configuration of ffmpeg plugin ***** */
226
236
    p_sys->p_context->workaround_bugs =
227
237
        var_InheritInteger( p_dec, "ffmpeg-workaround-bugs" );
 
238
#if LIBAVCODEC_VERSION_MAJOR < 54
228
239
    p_sys->p_context->error_recognition =
 
240
#else
 
241
    p_sys->p_context->err_recognition =
 
242
#endif
229
243
        var_InheritInteger( p_dec, "ffmpeg-error-resilience" );
230
244
 
231
245
    if( var_CreateGetBool( p_dec, "grayscale" ) )
341
355
        i_thread_count = vlc_GetCPUCount();
342
356
        if( i_thread_count > 1 )
343
357
            i_thread_count++;
 
358
 
 
359
        //FIXME: take in count the decoding time
 
360
        i_thread_count = __MIN( i_thread_count, 4 );
344
361
    }
345
362
    i_thread_count = __MIN( i_thread_count, 16 );
346
363
    msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count );
393
410
    }
394
411
    p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
395
412
 
 
413
#if LIBAVCODEC_VERSION_MAJOR < 54
396
414
    /* Setup palette */
397
415
    memset( &p_sys->palette, 0, sizeof(p_sys->palette) );
398
416
    if( p_dec->fmt_in.video.p_palette )
422
440
    {
423
441
        p_sys->p_context->palctrl = &p_sys->palette;
424
442
    }
 
443
#else
 
444
# warning FIXME
 
445
#endif
425
446
 
426
447
    /* ***** init this codec with special data ***** */
427
448
    ffmpeg_InitCodec( p_dec );
643
664
        }
644
665
 
645
666
        /* Sanity check (seems to be needed for some streams) */
646
 
        if( p_sys->p_ff_pic->pict_type == FF_B_TYPE )
 
667
        if( p_sys->p_ff_pic->pict_type == AV_PICTURE_TYPE_B)
647
668
        {
648
669
            p_sys->b_has_b_frames = true;
649
670
        }
976
997
 
977
998
        /* */
978
999
        p_ff_pic->type = FF_BUFFER_TYPE_USER;
979
 
        /* FIXME what is that, should give good value */
980
 
        p_ff_pic->age = 256*256*256*64; // FIXME FIXME from ffmpeg
 
1000
 
 
1001
#if LIBAVCODEC_VERSION_MAJOR < 54
 
1002
        p_ff_pic->age = 256*256*256*64;
 
1003
#endif
981
1004
 
982
1005
        if( vlc_va_Get( p_sys->p_va, p_ff_pic ) )
983
1006
        {
1067
1090
    p_ff_pic->linesize[2] = p_pic->p[2].i_pitch;
1068
1091
    p_ff_pic->linesize[3] = 0;
1069
1092
 
1070
 
    /* FIXME what is that, should give good value */
1071
 
    p_ff_pic->age = 256*256*256*64; // FIXME FIXME from ffmpeg
 
1093
#if LIBAVCODEC_VERSION_MAJOR < 54
 
1094
    p_ff_pic->age = 256*256*256*64;
 
1095
#endif
1072
1096
 
1073
1097
    post_mt( p_sys );
1074
1098
    return 0;