DTerr HWVideoPlayerFFPacketQueue::push_back (AVPacket *pkt) { // Duplicate if not a flush packet if (!is_flush(pkt) && !is_play(pkt) && !is_pause(pkt)) { if(av_dup_packet(pkt) < 0) return DT3_ERR_FILE_OPEN_FAILED; } AVPacketList *packet_list = (AVPacketList *) ::av_malloc(sizeof(AVPacketList)); packet_list->pkt = *pkt; packet_list->next = NULL; _lock.lock(); // Queue is empty if (!_first_pkt) { _first_pkt = _last_pkt = packet_list; } else { _last_pkt->next = packet_list; _last_pkt = packet_list; } ++_size; _lock.unlock(); return 0; }
void* play_picture(void* q) { fb_info fb_inf; fb_inf.w = ((fb_info *)q)->w; fb_inf.h = ((fb_info *)q)->h; fb_inf.bpp = ((fb_info *)q)->bpp; fb_inf.fbmem = ((fb_info *)q)->fbmem; while(1) { display_jpeg_circle("1024X768_1.jpg", fb_inf); sleep(1); while(!is_play()); display_jpeg_chessboard("GQ1.jpg", fb_inf); sleep(1); while(!is_play()); display_jpeg_shut("1024X768_1.jpg", fb_inf); sleep(1); while(!is_play()); display_jpeg_diamond("GQ.jpg", fb_inf); sleep(1); while(!is_play()); display_jpeg_move("1024X768_2.jpg", fb_inf); sleep(1); while(!is_play()); display_jpeg_block("1024X768_1.jpg", fb_inf); sleep(1); while(!is_play()); display_jpeg_slopline("1024X768_2.jpg", fb_inf); sleep(1); while(!is_play()); } }