context->cache_file,
handle->channels,
handle->samplerate,
- SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL)) != SWITCH_STATUS_SUCCESS) {
+ handle->flags, NULL)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid cache file %s opening url %s Discarding file.\n", context->cache_file, path);
unlink(context->cache_file);
unlink(context->meta_file);
return status;
}
+
+ if (switch_test_flag(&context->fh, SWITCH_FILE_FLAG_VIDEO)) {
+ switch_set_flag(handle, SWITCH_FILE_FLAG_VIDEO);
+ } else {
+ switch_set_flag(handle, SWITCH_FILE_FLAG_VIDEO);
+ }
}
handle->private_info = context;
}
+static switch_status_t http_file_read_video(switch_file_handle_t *handle, switch_frame_t *frame, switch_video_read_flag_t flags)
+{
+ http_file_context_t *context = handle->private_info;
+
+ return switch_core_file_read_video(&context->fh, frame, flags);
+}
+
+static switch_status_t http_file_write_video(switch_file_handle_t *handle, switch_frame_t *frame)
+{
+ http_file_context_t *context = handle->private_info;
+
+ return switch_core_file_write_video(&context->fh, frame);
+}
+
static switch_status_t http_file_write(switch_file_handle_t *handle, void *data, size_t *len)
{
http_file_context_t *context = handle->private_info;
http_file_interface->file_read = http_file_file_read;
http_file_interface->file_write = http_file_write;
http_file_interface->file_seek = http_file_file_seek;
+ http_file_interface->file_read_video = http_file_read_video;
+ http_file_interface->file_write_video = http_file_write_video;
https_file_supported_formats[0] = "https";
https_file_interface->file_read = http_file_file_read;
https_file_interface->file_write = http_file_write;
https_file_interface->file_seek = http_file_file_seek;
+ https_file_interface->file_read_video = http_file_read_video;
+ https_file_interface->file_write_video = http_file_write_video;
switch_snprintf(globals.cache_path, sizeof(globals.cache_path), "%s%shttp_file_cache", SWITCH_GLOBAL_dirs.storage_dir, SWITCH_PATH_SEPARATOR);
switch_dir_make_recursive(globals.cache_path, SWITCH_DEFAULT_DIR_PERMS, pool);