std::shared_ptr<AVFrame> poll() { if(packets_.empty()) return nullptr; auto packet = packets_.front(); if(packet->data == nullptr) { if(codec_context_->codec->capabilities & CODEC_CAP_DELAY) { auto video = decode(packet); if(video) return video; } packets_.pop(); file_frame_number_ = static_cast<size_t>(packet->pos); avcodec_flush_buffers(codec_context_.get()); return flush_video(); } packets_.pop(); return decode(packet); }
static void finalize (GObject *object) { GeglProperties *o = GEGL_PROPERTIES (object); if (o->user_data) { Priv *p = (Priv*)o->user_data; flush_audio (o); flush_video (o); av_write_trailer (p->oc); if (p->video_st) close_video (p, p->oc, p->video_st); if (p->audio_st) close_audio (p, p->oc, p->audio_st); avio_closep (&p->oc->pb); avformat_free_context (p->oc); g_free (o->user_data); o->user_data = NULL; } G_OBJECT_CLASS (g_type_class_peek_parent (G_OBJECT_GET_CLASS (object)))->finalize (object); }
void kmain( void* mbd, unsigned int magic ) { if ( magic != 0x2BADB002 ) { /* Something went not according to specs. Print an error */ /* message and halt, but do *not* rely on the multiboot */ /* data structure. */ unsigned char *videoram = (unsigned char *) 0xb8000; videoram[0] = 66; /* character 'B' */ videoram[1] = 0x07; /* forground, background color. */ } /* You could either use multiboot.h */ /* (http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#multiboot_002eh) */ /* or do your offsets yourself. The following is merely an example. */ char * boot_loader_name =(char*) ((long*)mbd)[16]; /* Write your kernel here. */ flush_video(' '); push_line(boot_loader_name); push_line("Hello World"); push_line("This is a test"); push_line("This is a test"); push_line("Hello World"); printk("iKern> ", (80 * 24) * 2); printk("iKern> ", (80 * 24) * 2); /* while (1) { change_term_color(0x07); 2 * 4 *2 +4 +2; change_term_color(0x1f); 2 * 4 *2 +4 +2; change_term_color(0x2a); 2 * 4 *2 +4 +2; } while (1) { int j = 0; unsigned char * videoram = (unsigned char *) 0xb8000; unsigned char * ram = (unsigned char *) 0x00000; for (int i = 0; i < (1920 * 2); i += 2) { videoram[i] = ram[j]; videoram[i + 1] = 0x07; j++; } } */ //unsigned char *videoram = (unsigned char *) 0xb8000; //videoram[1920 * 2] = 'A'; }
void panic(char *msg, int line, char *file) { cli(); printk("[KERNEL PANIC]"); printk("%s. Error at line %d in file %s.", msg, line, file); flush_video(); keep_running(); }