|
Blender V5.0
|
#include <algorithm>#include <cctype>#include <climits>#include <cmath>#include <cstdio>#include <cstdlib>#include <sys/types.h>#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_task.hh"#include "BLI_utildefines.h"#include "DNA_scene_types.h"#include "MEM_guardedalloc.h"#include "IMB_colormanagement.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "CLG_log.h"#include "MOV_read.hh"#include "IMB_metadata.hh"#include "movie_proxy_indexer.hh"#include "movie_read.hh"Go to the source code of this file.
|
static |
Try to initialize the #anim struct. Returns true on success.
Definition at line 1379 of file movie_read.cc.
References BLI_assert, MovieReader::Failed, MovieReader::state, MovieReader::Uninitialized, and MovieReader::Valid.
Referenced by MOV_decode_frame(), and probe_video_colorspace().
| void MOV_close | ( | MovieReader * | anim | ) |
Release memory and other resources associated with movie playback.
Definition at line 66 of file movie_read.cc.
References IMB_metadata_free(), MovieReader::metadata, and MOV_close_proxies().
Referenced by build_pict_list_from_anim(), free_buffers(), blender::seq::free_strip_proxy(), image_free_anims(), MOV_close_proxies(), openanim(), blender::ed::vse::prefetch_data_fn(), blender::seq::relations_strip_free_anim(), blender::seq::seq_free_strip(), thumb_create_ex(), and wm_main_playanim_intern().
| ImBuf * MOV_decode_frame | ( | MovieReader * | anim, |
| int | position, | ||
| IMB_Timecode_Type | tc, | ||
| IMB_Proxy_Size | preview_size ) |
Fetches a frame from a movie at given frame position.
Internally this will seek within the movie as/if needed. For most movie files, decoding frames sequentially is much more efficient than decoding random frames.
If proxy_size is not IMB_PROXY_NONE, a proxy file of given size will be attempted. If it exists, the frame will be decoded from it. If the proxy does not exist, original file will be used.
Movies that are <= 8 bits/color channel are returned as byte images; higher bit depth movies are returned as float images. Note that the color space is returned as-is, i.e. a float image might not be in linear space.
Returned image can be null if movie file does not exist, is not supported or failed decoding.
Definition at line 1437 of file movie_read.cc.
References anim_getnew(), MovieReader::cur_position, MovieReader::duration_in_frames, ImBuf::fileframe, ImBuf::filepath, MovieReader::filepath, IMB_PROXY_NONE, IMB_TC_NONE, MOV_calc_frame_index_with_timecode(), MOV_decode_frame(), movie_open_proxy(), MovieReader::state, STRNCPY(), MovieReader::Uninitialized, and MovieReader::Valid.
Referenced by build_pict_list_from_anim(), ibuf_from_picture(), load_movie_single(), MOV_decode_frame(), MOV_decode_preview_frame(), movieclip_load_movie_file(), openanim(), blender::seq::seq_proxy_fetch(), blender::seq::seq_render_movie_strip_custom_file_proxy(), blender::seq::seq_render_movie_strip_view(), thumb_create_ex(), and wm_main_playanim_intern().
| ImBuf * MOV_decode_preview_frame | ( | MovieReader * | anim | ) |
Fetches a frame from a movie used for preview/thumbnails. The frame will be halfway into the file duration. Thumbnail related metadata ("Thumb::Video::*") will be set on the returned image.
Definition at line 1399 of file movie_read.cc.
References MovieReader::duration_in_frames, IMB_freeImBuf(), IMB_metadata_ensure(), IMB_metadata_set_field(), IMB_PROXY_NONE, IMB_TC_NONE, ImBuf::metadata, MOV_decode_frame(), SNPRINTF_UTF8, MovieReader::x, and MovieReader::y.
Referenced by thumb_create_ex(), and ui_tooltip_from_clip().
| int MOV_get_duration_frames | ( | MovieReader * | anim, |
| IMB_Timecode_Type | tc ) |
Return the length (in frames) of the movie.
Definition at line 1487 of file movie_read.cc.
References MovieReader::duration_in_frames, MovieIndex::get_duration(), IMB_TC_NONE, and movie_open_index().
Referenced by blender::seq::add_movie_strip(), blender::seq::add_reload_new_file(), build_pict_list_from_anim(), image_match_len_exec(), load_movie_single(), movieclip_calc_length(), blender::nodes::node_geo_image_info_cc::node_geo_exec(), blender::ed::vse::prefetch_data_fn(), ui_tooltip_from_clip(), ui_tooltip_from_image(), and uiTemplateImageInfo().
| void MOV_get_filename | ( | const MovieReader * | anim, |
| char * | filename, | ||
| int | filename_maxncpy ) |
Gets filename (without the folder) part of the movie.
Definition at line 81 of file movie_read.cc.
References BLI_path_split_file_part(), and MovieReader::filepath.
Referenced by blender::seq::seq_proxy_index_dir_set().
| float MOV_get_fps | ( | const MovieReader * | anim | ) |
Returns the frames per second of the movie, or zero if the information is not available. Note that if you want the most accurate representation, use MOV_get_fps_num_denom.
Definition at line 1506 of file movie_read.cc.
References float, MovieReader::frs_sec, and MovieReader::frs_sec_base.
Referenced by blender::seq::add_movie_strip(), BKE_movieclip_get_fps(), blender::nodes::node_geo_image_info_cc::node_geo_exec(), blender::ed::vse::prefetch_data_fn(), blender::seq::seq_render_movie_strip(), blender::seq::time_strip_fps_get(), uiTemplateMovieclipInformation(), and wm_main_playanim_intern().
| bool MOV_get_fps_num_denom | ( | const MovieReader * | anim, |
| short & | r_fps_num, | ||
| float & | r_fps_denom ) |
Returns the frames per second of the movie as numerator and denominator. False will be returned if the information is not available.
Definition at line 1514 of file movie_read.cc.
References float, MovieReader::frs_sec, and MovieReader::frs_sec_base.
Referenced by blender::seq::add_movie_strip().
| int MOV_get_image_height | ( | const MovieReader * | anim | ) |
Get movie image height in pixels.
Definition at line 1536 of file movie_read.cc.
References ELEM, MovieReader::video_rotation, MovieReader::x, and MovieReader::y.
Referenced by blender::seq::add_movie_strip(), and ui_tooltip_from_clip().
| int MOV_get_image_width | ( | const MovieReader * | anim | ) |
Get movie image width in pixels.
Definition at line 1531 of file movie_read.cc.
References ELEM, MovieReader::video_rotation, MovieReader::x, and MovieReader::y.
Referenced by blender::seq::add_movie_strip(), and ui_tooltip_from_clip().
| double MOV_get_start_offset_seconds | ( | const MovieReader * | anim | ) |
Return the encoded start offset (in seconds) of the movie.
Definition at line 1501 of file movie_read.cc.
References MovieReader::start_offset.
Referenced by blender::seq::add_movie_strip().
| bool MOV_is_initialized_and_valid | ( | const MovieReader * | anim | ) |
Returns true if movie playback has been fully initialized and is supported. Note that immediately after MOV_open_file the playback is not initialized yet.
Definition at line 178 of file movie_read.cc.
References UNUSED_VARS.
Referenced by blender::seq::add_movie_reload_if_needed().
| IDProperty * MOV_load_metadata | ( | MovieReader * | anim | ) |
Loads metadata of the movie. Metadata is only loaded for already initialized movies.
Definition at line 86 of file movie_read.cc.
References BLI_assert, IMB_metadata_ensure(), IMB_metadata_set_field(), MovieReader::metadata, MovieReader::state, and MovieReader::Valid.
Referenced by blender::seq::add_movie_strip(), and blender::seq::add_reload_new_file().
| MovieReader * MOV_open_file | ( | const char * | filepath, |
| int | ib_flags, | ||
| int | streamindex, | ||
| bool | keep_original_colorspace, | ||
| char | colorspace[IM_MAX_SPACE] ) |
Opens a movie file for reading / playback. ib_flags are IB_ ImBuf bitmask (only IB_animdeinterlace is taken into account). streamindex is for multi-track movie files.
Returned MovieReader object can be used in other playback related functions. Note that a valid object will be returned even if file does not exist or is not a video file. The actual initialization is delayed until MOV_decode_frame is called.
When done with playback, use MOV_close to delete it.
Definition at line 141 of file movie_read.cc.
References BLI_assert, BLI_path_is_rel(), BLI_strncpy_utf8(), MovieReader::colorspace, MovieReader::filepath, MovieReader::ib_flags, IM_MAX_SPACE, MovieReader::keep_original_colorspace, probe_video_colorspace(), MovieReader::streamindex, STRNCPY(), and STRNCPY_UTF8.
Referenced by build_pict_list_from_anim(), movie_open_proxy(), openanim(), openanim_noload(), thumb_create_ex(), and wm_main_playanim_intern().
| void MOV_set_multiview_suffix | ( | MovieReader * | anim, |
| const char * | suffix ) |
Sets multi-view suffix to be used when building proxies for this movie.
Definition at line 192 of file movie_read.cc.
References STRNCPY(), and MovieReader::suffix.
Referenced by blender::seq::open_anim_file_multiview(), and blender::seq::seq_anim_add_suffix().
|
static |
Definition at line 109 of file movie_read.cc.
References anim_getnew(), BLI_strncpy_utf8(), COLOR_ROLE_DEFAULT_BYTE, MovieReader::colorspace, IM_MAX_SPACE, IMB_colormanagement_colorspace_get_name(), IMB_colormanagement_role_colorspace_name_get(), IMB_colormanagement_space_from_cicp(), MovieReader::state, MovieReader::Uninitialized, and Video.
Referenced by MOV_open_file().