2016-02-09 16:12:39 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2016 - Higor Euripedes
|
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef TASKS_HANDLER_INTERNAL_H
|
|
|
|
#define TASKS_HANDLER_INTERNAL_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <boolean.h>
|
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
#include <queues/message_queue.h>
|
2016-02-09 17:13:47 +00:00
|
|
|
#include <queues/task_queue.h>
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2016-03-22 01:56:06 +00:00
|
|
|
#include "../core_type.h"
|
2016-02-09 16:12:39 +00:00
|
|
|
#include "../runloop.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
#define CB_MENU_WALLPAPER 0xb476e505U
|
|
|
|
#define CB_MENU_THUMBNAIL 0x82f93a21U
|
|
|
|
|
|
|
|
enum nbio_status_enum
|
|
|
|
{
|
|
|
|
NBIO_STATUS_POLL = 0,
|
|
|
|
NBIO_STATUS_TRANSFER,
|
|
|
|
NBIO_STATUS_TRANSFER_PARSE,
|
|
|
|
NBIO_STATUS_TRANSFER_PARSE_FREE
|
|
|
|
};
|
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
typedef struct {
|
|
|
|
char *data;
|
|
|
|
size_t len;
|
|
|
|
} http_transfer_data_t;
|
|
|
|
|
2016-05-05 04:11:28 +00:00
|
|
|
typedef struct http_transfer_info
|
|
|
|
{
|
|
|
|
char url[PATH_MAX_LENGTH];
|
|
|
|
int progress;
|
|
|
|
} http_transfer_info_t;
|
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
typedef struct nbio_image_handle
|
|
|
|
{
|
|
|
|
struct texture_image ti;
|
|
|
|
bool is_blocking;
|
|
|
|
bool is_blocking_on_processing;
|
|
|
|
bool is_finished;
|
|
|
|
transfer_cb_t cb;
|
|
|
|
void *handle;
|
|
|
|
unsigned processing_pos_increment;
|
|
|
|
unsigned pos_increment;
|
|
|
|
uint64_t frame_count;
|
|
|
|
int processing_final_state;
|
|
|
|
unsigned status;
|
|
|
|
} nbio_image_handle_t;
|
|
|
|
|
|
|
|
typedef struct nbio_handle
|
|
|
|
{
|
|
|
|
nbio_image_handle_t image;
|
|
|
|
bool is_finished;
|
|
|
|
transfer_cb_t cb;
|
|
|
|
struct nbio_t *handle;
|
|
|
|
unsigned pos_increment;
|
|
|
|
uint64_t frame_count;
|
|
|
|
msg_queue_t *msg_queue;
|
|
|
|
unsigned status;
|
|
|
|
} nbio_handle_t;
|
|
|
|
|
2016-05-05 18:32:36 +00:00
|
|
|
void *rarch_task_push_http_transfer(const char *url, const char *type,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb, void *userdata);
|
2016-05-05 04:11:28 +00:00
|
|
|
|
2016-05-06 04:31:25 +00:00
|
|
|
task_retriever_info_t *http_task_get_transfer_list(void);
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
bool rarch_task_push_image_load(const char *fullpath, const char *type,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb, void *userdata);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBRETRODB
|
|
|
|
bool rarch_task_push_dbscan(const char *fullpath,
|
2016-02-09 16:47:04 +00:00
|
|
|
bool directory, retro_task_callback_t cb);
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_OVERLAY
|
|
|
|
bool rarch_task_push_overlay_load_default(
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb, void *user_data);
|
2016-02-09 16:12:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
int find_first_data_track(const char* cue_path,
|
|
|
|
int32_t* offset, char* track_path, size_t max_len);
|
|
|
|
|
|
|
|
int detect_system(const char* track_path, int32_t offset,
|
|
|
|
const char** system_name);
|
|
|
|
|
|
|
|
int detect_ps1_game(const char *track_path, char *game_id);
|
|
|
|
|
|
|
|
int detect_psp_game(const char *track_path, char *game_id);
|
|
|
|
|
2016-05-04 23:42:56 +00:00
|
|
|
bool rarch_task_check_decompress(const char *source_file);
|
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
bool rarch_task_image_load_handler(retro_task_t *task);
|
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
bool rarch_task_push_decompress(
|
|
|
|
const char *source_file,
|
|
|
|
const char *target_dir,
|
|
|
|
const char *target_file,
|
|
|
|
const char *subdir,
|
|
|
|
const char *valid_ext,
|
2016-02-09 16:47:04 +00:00
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
|
|
|
bool rarch_task_push_content_load_default(
|
2016-02-09 16:47:04 +00:00
|
|
|
const char *core_path,
|
|
|
|
const char *fullpath,
|
|
|
|
bool persist,
|
|
|
|
enum rarch_core_type type,
|
|
|
|
retro_task_callback_t cb,
|
|
|
|
void *user_data);
|
2016-02-09 16:12:39 +00:00
|
|
|
|
2016-05-10 05:54:47 +00:00
|
|
|
void rarch_task_image_load_free(retro_task_t *task);
|
|
|
|
|
|
|
|
void rarch_task_file_load_handler(retro_task_t *task);;
|
|
|
|
|
2016-02-09 16:12:39 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|