
Recherche avancée
Autres articles (72)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.
Sur d’autres sites (5226)
-
libvpxdec : remove pre-1.4.0 checks
18 novembre 2017, par James Zern -
libvpx : remove pre-1.4.0 checks
18 novembre 2017, par James Zern -
Display FFMPEG decoded frame in a GLFW window
17 juin 2020, par InfectoI am implementing the client program of a game where the server sends encoded frames of the game to the client (via UDP), while the client decodes them (via FFMPEG) and displays them in a GLFW window. 
My program has two threads :



- 

- Thread 1 : renders the content of the uint8_t* variable
dataToRender
- Thread 2 : keeps obtaining frames from the server, decodes them and updates
dataToRender
accordingly







Thread 1 does the typical rendering of a GLFW window in a while-loop. I have already tried to display some dummy frame data (a completely red frame) and it worked :



while (!glfwWindowShouldClose(window)) {
 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 ...

 glBindTexture(GL_TEXTURE_2D, tex_handle);
 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, window_width, window_height, 0, GL_RGB, GL_UNSIGNED_BYTE, dataToRender);
 ...
 glfwSwapBuffers(window);
}




Thread 2 is where I am having trouble. I am unable to properly store the decoded frame into my
dataToRender
variable. On top if it, the frame data is originally in YUV format and needs to be converted to RGB. I use FFMPEG'ssws_scale
for that, which also gives me abad dst image pointers
error output in the console. Here's the code snippet responsible for that part :


size_t data_size = frameBuffer.size(); // frameBuffer is a std::vector where I accumulate the frame data chunks
 uint8_t* data = frameBuffer.data(); // convert the vector to a pointer
 picture->format = AV_PIX_FMT_RGB24;
 av_frame_get_buffer(picture, 1);
 while (data_size > 0) {
 int ret = av_parser_parse2(parser, c, &pkt->data, &pkt->size,
 data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
 if (ret < 0) {
 fprintf(stderr, "Error while parsing\n");
 exit(1);
 }
 data += ret;
 data_size -= ret;

 if (pkt->size) {
 swsContext = sws_getContext(
 c->width, c->height,
 AV_PIX_FMT_YUV420P, c->width, c->height,
 AV_PIX_FMT_RGB24, SWS_BILINEAR, NULL, NULL, NULL
 );
 uint8_t* rgb24[1] = { data };
 int rgb24_stride[1] = { 3 * c->width };
 sws_scale(swsContext, rgb24, rgb24_stride, 0, c->height, picture->data, picture->linesize);

 decode(c, picture, pkt, outname);
 // TODO: copy content of picture->data[0] to "dataToRender" maybe?
 }
 }




I have already tried doing another sws_scale to copy the content to
dataToRender
and I cannot get rid of thebad dst image pointers
error. Any advice or solution to the problem would be greatly appreciated as I have been stuck for days on this.

- Thread 1 : renders the content of the uint8_t* variable