Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (72)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (11840)

  • Rendering Bitmap using ANativeWindow

    19 février 2016, par William Seemann

    I’m decoding a video frame and trying to render is using Android’s ANativeWindow API in conjunction with a SurfaceView. I know I’m decoding the frame successfully because my demo application returns the decoded (and re-encoded) frame as a bitmap and displays it in an ImageView (bottom image). However, when trying to draw the decoded frame to a SurfaceView I’m getting garbage output (top image). Can someone explain why ?

    const int TARGET_IMAGE_FORMAT = AV_PIX_FMT_RGBA;
    const int TARGET_IMAGE_CODEC = AV_CODEC_ID_PNG;

    void convert_image(State *state, AVCodecContext *pCodecCtx, AVFrame *pFrame, AVPacket *avpkt, int *got_packet_ptr, int width, int height) {
           AVCodecContext *codecCtx;
           AVCodec *codec;
           AVFrame *frame;

           *got_packet_ptr = 0;

           if (width == -1) {
               width = pCodecCtx->width;
           }

           if (height == -1) {
               height = pCodecCtx->height;
           }

           codec = avcodec_find_encoder(TARGET_IMAGE_CODEC);
           if (!codec) {
               printf("avcodec_find_decoder() failed to find decoder\n");
               goto fail;
           }

           codecCtx = avcodec_alloc_context3(codec);
           if (!codecCtx) {
               printf("avcodec_alloc_context3 failed\n");
               goto fail;
           }

           codecCtx->bit_rate = pCodecCtx->bit_rate;
           //codecCtx->width = pCodecCtx->width;
           //codecCtx->height = pCodecCtx->height;
           codecCtx->width = width;
           codecCtx->height = height;
           codecCtx->pix_fmt = TARGET_IMAGE_FORMAT;
           codecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
           codecCtx->time_base.num = pCodecCtx->time_base.num;
           codecCtx->time_base.den = pCodecCtx->time_base.den;

           if (!codec || avcodec_open2(codecCtx, codec, NULL) < 0) {
               printf("avcodec_open2() failed\n");
               goto fail;
           }

           frame = av_frame_alloc();

           if (!frame) {
               goto fail;
           }

           // Determine required buffer size and allocate buffer
           int numBytes = avpicture_get_size(TARGET_IMAGE_FORMAT, codecCtx->width, codecCtx->height);
           void * buffer = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t));

           printf("wqwq %d\n", numBytes);

           avpicture_fill(((AVPicture *)frame),
                   buffer,
                   TARGET_IMAGE_FORMAT,
                   codecCtx->width,
                   codecCtx->height);

           avpicture_alloc(((AVPicture *)frame),
                   TARGET_IMAGE_FORMAT,
                   codecCtx->width,
                   codecCtx->height);

           struct SwsContext *scalerCtx = sws_getContext(pCodecCtx->width,
                   pCodecCtx->height,
                   pCodecCtx->pix_fmt,
                   //pCodecCtx->width,
                   //pCodecCtx->height,
                   width,
                   height,
                   TARGET_IMAGE_FORMAT,
                   SWS_FAST_BILINEAR, 0, 0, 0);

           if (!scalerCtx) {
               printf("sws_getContext() failed\n");
               goto fail;
           }

           sws_scale(scalerCtx,
                   (const uint8_t * const *) pFrame->data,
                   pFrame->linesize,
                   0,
                   pFrame->height,
                   frame->data,
                   frame->linesize);

           int ret = avcodec_encode_video2(codecCtx, avpkt, frame, got_packet_ptr);

           // code to draw the re-encoded frame on the surface view
           if (state->native_window) {    
               ANativeWindow_Buffer windowBuffer;

               if (ANativeWindow_lock(state->native_window, &windowBuffer, NULL) == 0) {
                   memcpy(windowBuffer.bits, avpkt->data, windowBuffer.width * windowBuffer.height * 4);
                   ANativeWindow_unlockAndPost(state->native_window);
               }
           }

           if (ret < 0) {
               *got_packet_ptr = 0;
           }

           fail:
           av_free(frame);

           free(buffer);

           if (codecCtx) {
               avcodec_close(codecCtx);
               av_free(codecCtx);
           }

           if (scalerCtx) {
               sws_freeContext(scalerCtx);
           }

           if (ret < 0 || !*got_packet_ptr) {
               av_free_packet(avpkt);
           }
       }

    enter image description here

  • x86inc : Add debug symbols indicating sizes of compiled functions

    18 janvier 2016, par Geza Lore
    x86inc : Add debug symbols indicating sizes of compiled functions
    

    Some debuggers/profilers use this metadata to determine which function a
    given instruction is in ; without it they get can confused by local labels
    (if you haven’t stripped those). On the other hand, some tools are still
    confused even with this metadata. e.g. this fixes `gdb`, but not `perf`.

    Currently only implemented for ELF.

    Signed-off-by : Anton Khirnov <anton@khirnov.net>

    • [DBH] libavcodec/x86/proresdsp.asm
    • [DBH] libavutil/x86/x86inc.asm
    • [DBH] tests/checkasm/x86/checkasm.asm
  • x86inc : Add debug symbols indicating sizes of compiled functions

    12 octobre 2015, par Geza Lore
    x86inc : Add debug symbols indicating sizes of compiled functions
    

    Some debuggers/profilers use this metadata to determine which function a
    given instruction is in ; without it they get can confused by local labels
    (if you haven’t stripped those). On the other hand, some tools are still
    confused even with this metadata. e.g. this fixes `gdb`, but not `perf`.

    Currently only implemented for ELF.

    • [DH] libavcodec/x86/proresdsp.asm
    • [DH] libavcodec/x86/simple_idct10.asm
    • [DH] libavutil/x86/x86inc.asm
    • [DH] tests/checkasm/x86/checkasm.asm