Recherche avancée

Médias (1)

Mot : - Tags -/portrait

Autres articles (105)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (11294)

  • Why AVFormatContext pointer is initialized in a non-global struct object, while NULL in a global object ?

    6 mai 2013, par user1914692

    The code is almost similar to filtering _video.c, one example code in ffmpeg doc.

    In the original example file, there are many global static variables. Here is one snippet of the 1st version code (same as the original sample) :

    static AVFormatContext *fmt_ctx;
    static AVCodecContext *dec_ctx;

    int main(int argc, char **argv) {

    // ....  other code
       if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
           av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
           return ret;
       }

    // .... other code

    }

    Since all these variables serve for open a video file, I prefer to group them. So the purpose of my code is to rearrange these variables, making the source file more structed.

    The first idea came to my mind is to use struct.

    struct structForInVFile {
       AVFormatContext *inFormatContext;
       AVCodecContext *inCodecContext;
       AVCodec* inCodec;
       AVPacket inPacket;
       AVFrame *inFrame;
       int video_stream_index;
       int inFrameRate;
       int in_got_frame;
    };

    Now the 2nd version of code becomes :

    int main(int argc, char **argv) {

    // .... other code
    structForInVFile inStruct;

       if ((ret = avformat_open_input(&inStruct.inFormatContext, filename, NULL, NULL)) < 0) {
           av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
           return ret;
       }

    // .... other code

    }

    Result for the 2nd version : the code can not work at the avformat_open_input. No error information. The program silently exits.
    Through debugging, I find that : inStruct.inFormatContext : 0xffffefbd22b60000

    In the 3rd version of code, I set inStruct as a global variable.
    The code becomes :

    structForInVFile inStruct;

    int main(int argc, char **argv) {

    // .... other code
       if ((ret = avformat_open_input(&inStruct.inFormatContext, filename, NULL, NULL)) < 0) {
           av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
           return ret;
       }

    // .... other code

    }

    Result for the 3rd version : the code works.
    Through debugging, I find that : inStruct.inFormatContext : 0x0

    So I think the reason is that : the AVFormatContext should be zero-initialized for avformat_open_input to work.
    Now, the question is :

    Why AVFormatContext pointer is initialized in a non-global struct object, while zero-initialized in a global object ?

    I do not know any difference of definition of a struct object as a global variable or a non-global variable.

  • Revision e81a3ede4c : thumb : Keep whitespace between arguments as before Include the whitespace after

    29 septembre 2013, par Martin Storsjo

    Changed Paths :
     Modify /build/make/thumb.pm



    thumb : Keep whitespace between arguments as before

    Include the whitespace after the first argument's comma in the
    optional first argument group.

    This fixes a minor style regression in the converted output
    since 2a233dd31.

    Change-Id : I254f4aaff175e2d728d9b6f3c12ede03846adcf1

  • Ubuntu 12.04 upgrade php 5.4 missing php5-ffmpeg

    1er juillet 2013, par Lughino

    I updated php to version 5.4 but now I can not install the package php5-ffmpeg because it gives me this error :
    php5-ffmpeg : Depends : phpapi-20090626

    also if I try to write php-v gives me this warning :

    PHP Warning: PHP Startup: Unable to load dynamic library
    '/usr/lib/php5/20100525/ffmpeg.so' - / usr/lib/php5/20100525/ffmpeg.so:
    can not open shared object file: No such file or directory in Unknown on line 0
    5.4.17RC1 PHP (cli) (built: Jun 22 2013 19:27:26)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

    Some solution ?