int get_image_chunk_tivo(gop_index_t * gop_index,module_t * module) { /* Iteration */ int i; /* The chunk we read */ chunk_t * chunk = NULL; /* The chunk linked list */ chunk_t * chunks = NULL; /* vstream */ vstream_t * vstream; int chunks_to_read; int result; chunks_to_read = 2; /* Find out how many chunks we need to read if pes and i frame is in the same chunk then two chunks if not three chunks */ vstream = new_vstream(); /* Lets fake it and do a read buffer */ vstream->start_stream = (uint8_t *)malloc(sizeof(uint8_t) * CHUNK_SIZE); vstream->size = sizeof(uint8_t) * CHUNK_SIZE ; vstream->current_pos = vstream->start_stream; vstream->end_stream = vstream->start_stream + vstream->size; tystream->vstream = vstream; for(i=0; i < chunks_to_read; i++) { vstream->current_pos = vstream->start_stream; vstream->eof=0; read_a_chunk(infile, gop_index->chunk_number_i_frame + i + tystream->start_chunk, vstream->start_stream); chunk = read_chunk(tystream, gop_index->chunk_number_i_frame_pes + i, 1); if(chunk) { chunks = add_chunk(tystream, chunk, chunks); } else { chunks_to_read++; } } free_vstream(vstream); tystream->vstream=NULL; result = get_video(gop_index->i_frame_rec_nr, module, chunks, MPEG_I, tystream); if(!result) { LOG_ERROR2("parse_chunk_video: ERROR - i-frame - chunk %lld , record %i\n", \ chunks->chunk_number,gop_index->i_frame_rec_nr ); free_junk_chunks(chunks); return(0); } //write(2,data_collector_module.data_buffer,data_collector_module.buffer_size); free_junk_chunks(chunks); return(1); }
void file_dialog::action(gui::dialog_process_info &dp_info) { if(result() == gui::CLOSE_DIALOG) return; //handle "delete item" requests if(result() == gui::DELETE_ITEM) { if(!chosen_file_.empty()) { if(files_list_->delete_chosen_file() == -1) { gui2::show_transient_error_message(get_video() , _("Deletion of the file failed.")); dp_info.clear_buttons(); } else { dp_info.first_time = true; } } set_result(gui::CONTINUE_DIALOG); } //handle "create item" requests else if(result() == gui::CREATE_ITEM) { std::string new_dir_name = ""; if(gui2::tfolder_create::execute(new_dir_name, get_video())) { if( !files_list_->make_directory(new_dir_name) ) { gui2::show_transient_error_message(get_video() , _("Creation of the directory failed.")); } else { dp_info.first_time = true; } } dp_info.clear_buttons(); set_result(gui::CONTINUE_DIALOG); } //update the chosen file if((dp_info.selection != last_selection_ || dp_info.first_time || dp_info.double_clicked) && (!files_list_->type_a_head() || dp_info.new_left_button)) { files_list_->reset_type_a_head(); chosen_file_ = files_list_->get_choice(); set_save_text(chosen_file_); last_selection_ = (dp_info.double_clicked) ? -1 : dp_info.selection; last_textbox_text_ = textbox_text(); } else if(textbox_text() != last_textbox_text_) { chosen_file_ = unformat_filename(textbox_text()); last_textbox_text_ = textbox_text(); // Do type-a-head search in listbox if (autocomplete_) { files_list_->select_file(textbox_text()); } } if(result() >=0) { //if a directory has been chosen, enter it if(files_list_->is_directory(chosen_file_)) { files_list_->change_directory(chosen_file_); get_message().set_text(format_dirname(files_list_->get_directory())); //reset the chosen file chosen_file_ = ".."; get_textbox().set_text(format_filename(chosen_file_)); set_result(gui::CONTINUE_DIALOG); } //if a file has been chosen, return button index "Ok" else { set_result(0); } } }
void command_executor::lua_console() { gui2::tlua_interpreter::display(get_video(), gui2::tlua_interpreter::APP); }
void video_delete(int id) { get_video(videoStruct, id); delete enigma::videoStructs[id]; }