Recherche avancée

Médias (91)

Autres articles (97)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • 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

Sur d’autres sites (7380)

  • EAGLContexts sharing EAGLSharegroup giving error when subclassing GLKView

    27 août 2015, par Pawan Yadav

    i am trying to create a player using FFMPEG which can display frame using OpenGl. The player class has three threads : one for rendering (Runs a runloop and handles a render event triggered every N ms.) - it fetches GLKTextureInfo stored in pictureQueue and renders.
    one for reading packets from VideoStream and putting them in a videoQueue, the third one fetches the packets from the videoQueue and decodes them and creates a GLKTextureInfo and stores it in pictureQueue.

    Case 1 :
    The player class subclasses GLKView and creates a EAGLContext sets it as its context and also as currentContext in rendering thread (it’s the first thread that starts).

    EAGLContext *mycontext = [self createBestEaglContext];
    if (!self.mycontext || ![EAGLContext setCurrentContext:mycontext]) {
       NSLog(@"Could not create Base EAGLContext");
       return;
    }
    [self setContext:mycontext];

    and then starts the stream decoding thread which in turn starts the Video Packet Decoding Thread if it finds a video stream.then

    // set's the params for the GLKBaseEffect
    // set's up VBO's
    // run's runloop

    The Video Packet Decoding Thread also creates EAGLContext which shares the earlier created contexts EAGLSharegroup.

    self.videoPacketDecodeThreadContext = [self createEaglContextForOtherThread];
    if (!self.videoPacketDecodeThreadContext || ![EAGLContext setCurrentContext:self.videoPacketDecodeThreadContext])
    {
       NSLog(@"Could not create video packet decode thread context");
    }

    texture part

    UIImage* image = [self ImageFromAVPicture:*(AVPicture*)pFrameRGB width:self.is.video_stream->codec->width height:self.is.video_stream->codec->height];

    NSError *error = nil;
    GLKTextureInfo *textureInfo = [GLKTextureLoader textureWithCGImage:image.CGImage
                                                                  options:nil
                                                                    error:&error];
    if (error)
    {
      NSLog(@"Texture loading Error: %@\n", error.description);
      //return -1;
    }
    else
    {
      [self.is.pictQueue_lock lock];
      [self.is.pictQueue enqueue:textureInfo];
      [self.is.pictQueue_lock unlock];
    }

    i get a error saying : Failed to bind EAGLDrawable:  to GL_RENDERBUFFER 1 and Failed to make complete framebuffer object 8cd6 and glerror 1280.

    Case 2 : The Player doesn’t subclass GLKView instead it is set as a delegate to the GLKView created in storyboard.

    -(void)initPlayerWithView:(GLKView*)v
    {
      self.view = v;
    }

    and set everyThing as above (sets self.view context to mycontext) everything runs fine.

    -(void)drawRect:(CGRect)rect And -(void)glkView:(GLKView *)view drawInRect:(CGRect)rect are both called on Rendering Thread. Rendering code :

       {
         [self.is.pictQueue_lock lock];
         GLKTextureInfo *textureInfo = (GLKTextureInfo*)[self.is.pictQueue dequeue];
         [self.is.pictQueue_lock unlock];

         // delete the previous texture
         GLuint index = self.baseEffect.texture2d0.name;
         glDeleteTextures(1, &index);

         self.baseEffect.texture2d0.name = textureInfo.name;
         self.baseEffect.texture2d0.target = textureInfo.target;

         [self.baseEffect prepareToDraw];
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

         // Enable vertex buffer
         glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), 0);
         glEnableVertexAttribArray(GLKVertexAttribPosition);

         //Enable texture buffer
         glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*)offsetof(Vertex, textureCoords));
         glEnableVertexAttribArray(GLKVertexAttribTexCoord0);

         glDrawElements(GL_TRIANGLES, sizeof(Indices)/sizeof(Indices[0]), GL_UNSIGNED_BYTE, 0);
       }

    How do i resolve the error in Case 1 ?. Also if their are other things i can do in a different way please suggest like :

    1. Am i using to many threads ?
    2. I am converting the decoded frame to a UIImage and then creating a texture from it. can it be done differently ?
  • Anomalie #3655 (Nouveau) : Empêcher le scroll au chargement ajax avec la class "noscroll" pour les...

    19 janvier 2016, par Jean-Emmanuel []

    En complément de la révision #18894, on pourrait vérifier la présence de la classe "noscroll" sur les boutons ajax pour déclencher de défilement ou non.

    dans spip/prive/javascript/ajaxCallback.js @ 729 on remplacerait

    jQuery(’form.bouton_action_post.ajax’, this).not(’.noajax,.bind-ajax’).each(function()
        var leform = this ;
        var url = jQuery(this).attr(’action’).split(’#’) ;
        jQuery(this)
        .prepend(""+(url[1] ?"" :""))
        .ajaxForm(
            beforeSubmit : function()
                jQuery(blocfrag).animateLoading().positionner(false) ;
            ,
            onAjaxLoad:false,
            success : function(c)
                jQuery.spip.on_ajax_loaded(blocfrag,c) ;
                jQuery.spip.preloaded_urls = {} ; // on vide le cache des urls car on a fait une action en bdd
            /*,
            iframe : jQuery.browser.msie*/
        )
        .addClass(’bind-ajax’) ; // previent qu’on n’ajaxera pas deux fois le meme formulaire en cas de ajaxload
    ) ;
    

    par

    jQuery(’form.bouton_action_post.ajax’, this).not(’.noajax,.bind-ajax’).each(function()
        var leform = this ;
        var url = jQuery(this).attr(’action’).split(’#’) ;
        var scrollwhensubmit = !jQuery(this).is(’.noscroll’) ;
        jQuery(this)
        .prepend(""+(url[1] ?"" :""))
        .ajaxForm(
            beforeSubmit : function()
                jQuery(blocfrag).animateLoading()
                if (scrollwhensubmit)
                    jQuery(blocfrag).positionner(false) ;
            ,
            onAjaxLoad:false,
            success : function(c)
                jQuery.spip.on_ajax_loaded(blocfrag,c) ;
                jQuery.spip.preloaded_urls = {} ; // on vide le cache des urls car on a fait une action en bdd
            /*,
            iframe : jQuery.browser.msie*/
        )
        .addClass(’bind-ajax’) ; // previent qu’on n’ajaxera pas deux fois le meme formulaire en cas de ajaxload
    ) ;
    
  • Fragment shader does not show any colour when compiled with vs2013

    11 juin 2015, par 5mayfive

    When compiled with vs2010, the fragment shader works, but when I compiled and run in vs 2013, it’s grey.

    My fragment shader converts the yuv texture into rgb

    Below is my fragment code

       const char *FProgram =
       "uniform sampler2D Ytex;\n"
       "uniform sampler2D Utex;\n"
       "uniform sampler2D Vtex;\n"
       "void main(void) {\n"
       "  vec4 c = vec4((texture2D(Ytex, gl_TexCoord[0]).r - 16./255.) * 1.164);\n"
       "  vec4 U = vec4(texture2D(Utex, gl_TexCoord[0]).r - 128./255.);\n"
       "  vec4 V = vec4(texture2D(Vtex, gl_TexCoord[0]).r - 128./255.);\n"
       "  c += V * vec4(1.596, -0.813, 0, 0);\n"
       "  c += U * vec4(0, -0.392, 2.017, 0);\n"
       "  c.a = 1.0;\n"
       "  gl_FragColor = c;\n"
       "}\n";





    glClearColor(0, 0, 0, 0);

    PHandle = glCreateProgram();
    FSHandle = glCreateShader(GL_FRAGMENT_SHADER);



    glShaderSource(FSHandle, 1, &FProgram, NULL);
    glCompileShader(FSHandle);

    glAttachShader(PHandle, FSHandle);
    glLinkProgram(PHandle);


    glUseProgram(PHandle);
    glDeleteProgram(PHandle);
    glDeleteProgram(FSHandle);

    This is my texture code, I receive linesize and yuv frame data from ffmpeg and make into texture. Everything works fine in VS 2010 computer, but when compiled and run in vs2013 computer, it is grey (black n white), no colour

       /* Select texture unit 1 as the active unit and bind the U texture. */
    glPixelStorei(GL_UNPACK_ROW_LENGTH, linesize1);
    glActiveTexture(GL_TEXTURE1);
    i = glGetUniformLocation(PHandle, "Utex");
    glUniform1i(i, 1);  /* Bind Utex to texture unit 1 */
    glBindTexture(GL_TEXTURE_2D, 1);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, frame1);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);


    /* Select texture unit 2 as the active unit and bind the V texture. */
    glPixelStorei(GL_UNPACK_ROW_LENGTH, linesize2);
    glActiveTexture(GL_TEXTURE2);
    i = glGetUniformLocation(PHandle, "Vtex");
    glUniform1i(i, 2);  /* Bind Vtext to texture unit 2 */
    glBindTexture(GL_TEXTURE_2D, 2);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, frame2);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);


    /* Select texture unit 0 as the active unit and bind the Y texture. */



    glPixelStorei(GL_UNPACK_ROW_LENGTH, linesize0);
    glActiveTexture(GL_TEXTURE0);
    i = glGetUniformLocation(PHandle, "Ytex");
    glUniform1i(i, 0);
    glBindTexture(GL_TEXTURE_2D, 0);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, frame0);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);



    glClear(GL_COLOR_BUFFER_BIT);

    /* Draw image (again and again). */

    glBegin(GL_QUADS);
    glTexCoord2i(0, 0);
    glVertex2i(-w / 2, h / 2);
    glTexCoord2i(1, 0);
    glVertex2i(w / 2, h / 2);
    glTexCoord2i(1, 1);
    glVertex2i(w / 2, -h / 2);
    glTexCoord2i(0, 1);
    glVertex2i(-w / 2, -h / 2);
    glEnd();

    Need guidance here, thanks in advance !