Miscellaneous utility functions related to both encoding and decoding (or neither). More...
Miscellaneous utility functions related to both encoding and decoding (or neither).
Lock operation used by lockmgr.
| Enumerator | |
|---|---|
| AV_LOCK_CREATE |
Create a mutex. |
| AV_LOCK_OBTAIN |
Lock the mutex. |
| AV_LOCK_RELEASE |
Unlock the mutex. |
| AV_LOCK_DESTROY |
Free mutex resources. |
Put a string representing the codec tag codec_tag in buf.
Definition at line 1167 of file utils.c.
Referenced by avformat_find_stream_info(), and dump_stream_format().
Return a name for the specified profile, if available.
Definition at line 1375 of file utils.c.
Referenced by avcodec_string(), and show_stream().
Definition at line 431 of file utils.c.
Referenced by init_context_defaults(), and thread_execute().
Referenced by init_context_defaults().
Fill AVFrame audio data and linesize pointers.
The buffer buf must be a preallocated buffer with a size big enough to contain the specified samples amount. The filled AVFrame data pointers will point to this buffer.
AVFrame extended_data channel pointers are allocated if necessary for planar audio.
Reset the internal decoder state / flush internal buffers.
Should be called e.g. when seeking or when switching to a different stream.
Definition at line 1946 of file decode.c.
Referenced by compat_decode(), compute_crc_of_packets(), decoder_decode_frame(), process_command(), process_input(), and rewind_file().
Return codec bits per sample.
Definition at line 1495 of file utils.c.
Referenced by adpcm_encode_init(), aiff_write_header(), avformat_find_stream_info(), caf_write_header(), epaf_read_header(), ff_alsa_open(), ff_audio_interleave_init(), ff_pcm_read_seek(), ff_put_wav_header(), ff_voc_get_packet(), g722_read_header(), get_aiff_header(), get_bit_rate(), gxf_packet(), iff_read_header(), init_muxer(), ircam_read_header(), mkv_write_track(), mov_get_codec_tag(), mov_init(), mov_parse_stsd_audio(), mov_write_audio_tag(), mxf_handle_missing_index_segment(), mxf_set_audio_pts(), mxf_write_generic_sound_common(), mxf_write_header(), oma_read_header(), pcm_decode_frame(), pcm_decode_init(), pcm_encode_frame(), pcm_encode_init(), pcm_read_header(), pulse_read_packet(), read_header(), rso_read_header(), show_stream(), and wve_read_header().
Return the PCM codec associated with a sample format.
Definition at line 1473 of file utils.c.
Referenced by lavfi_read_header(), and main().
Return codec bits per sample.
Only return non-zero if the bits per sample is exactly correct, not an approximation.
Definition at line 1413 of file utils.c.
Referenced by av_get_bits_per_sample(), get_audio_frame_duration(), and new_output_stream().
Return audio frame duration.
Definition at line 1700 of file utils.c.
Referenced by do_streamcopy().
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters instead of an AVCodecContext.
Definition at line 1709 of file utils.c.
Referenced by adp_read_header(), build_frame_code(), ff_parse_specific_params(), ff_put_wav_header(), ff_voc_get_packet(), get_aiff_header(), mpegts_init(), msf_read_header(), rm_write_header(), rsd_read_header(), rtp_send_ilbc(), and swf_write_audio().
Definition at line 42 of file bitstream_filter.c.
Definition at line 51 of file bitstream_filter.c.
Definition at line 97 of file bitstream_filter.c.
Definition at line 83 of file bitstream_filter.c.
Definition at line 31 of file bitstream_filter.c.
Definition at line 75 of file bitstream_filters.c.
Referenced by av_bitstream_filter_init(), av_bsf_list_append2(), bsfs_init(), cuvid_decode_init(), detect_stream_specific(), extract_extradata_check(), extract_extradata_init(), ff_stream_add_bitstream_filter(), new_output_stream(), and show_help_bsf().
Iterate over all registered bitstream filters.
Definition at line 58 of file bitstream_filters.c.
Referenced by av_bitstream_filter_next(), av_bsf_get_by_name(), av_bsf_next(), ff_bsf_child_class_next(), and show_bsfs().
Definition at line 70 of file bitstream_filters.c.
Allocate a context for a given bitstream filter.
The caller must fill in the context parameters as described in the documentation and then call av_bsf_init() before sending any data to the filter.
Definition at line 81 of file bsf.c.
Referenced by av_bitstream_filter_filter(), av_bsf_get_null_filter(), av_bsf_list_append2(), av_bsf_list_finalize(), bsfs_init(), cuvid_decode_init(), detect_stream_specific(), extract_extradata_init(), ff_stream_add_bitstream_filter(), and new_output_stream().
Prepare the filter for use, after all the parameters and options have been set.
Definition at line 134 of file bsf.c.
Referenced by av_bitstream_filter_filter(), bsf_list_init(), bsfs_init(), cuvid_decode_init(), detect_stream_specific(), extract_extradata_init(), ff_stream_add_bitstream_filter(), init_output_bsfs(), and open_slave().
Submit a packet for filtering.
After sending each packet, the filter must be completely drained by calling av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or AVERROR_EOF.
Definition at line 175 of file bsf.c.
Referenced by av_bitstream_filter_filter(), avcodec_send_packet(), bsf_list_filter(), bsfs_poll(), do_packet_auto_bsf(), extract_extradata(), filter_packet(), output_packet(), and tee_write_packet().
Retrieve a filtered packet.
Definition at line 201 of file bsf.c.
Referenced by av_bitstream_filter_filter(), bsf_list_filter(), bsfs_poll(), do_packet_auto_bsf(), extract_extradata(), filter_packet(), output_packet(), and tee_write_packet().
Free a bitstream filter context and everything associated with it; write NULL into the supplied pointer.
Definition at line 35 of file bsf.c.
Referenced by av_bitstream_filter_close(), av_bitstream_filter_init(), av_bsf_alloc(), av_bsf_list_append2(), av_bsf_list_free(), avformat_find_stream_info(), bsf_list_close(), close_slave(), concat_read_close(), cuvid_decode_end(), cuvid_decode_init(), extract_extradata_init(), ff_decode_bsfs_uninit(), ff_stream_add_bitstream_filter(), ffmpeg_cleanup(), and free_stream().
Get the AVClass for AVBSFContext.
It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.
Definition at line 76 of file bsf.c.
Referenced by show_help_default().
Allocate empty list of bitstream filters.
The list must be later freed by av_bsf_list_free() or finalized by av_bsf_list_finalize().
Definition at line 399 of file bsf.c.
Referenced by av_bsf_list_parse_str().
Free list of bitstream filters.
Definition at line 404 of file bsf.c.
Referenced by av_bsf_list_parse_str().
Append bitstream filter to the list of bitstream filters.
Definition at line 417 of file bsf.c.
Referenced by av_bsf_list_append2().
Construct new bitstream filter context given it's name and options and append it to the list of bitstream filters.
Definition at line 422 of file bsf.c.
Referenced by bsf_parse_single().
Finalize list of bitstream filters.
This function will transform AVBSFList to single AVBSFContext, so the whole chain of bitstream filters can be treated as single filter freshly allocated by av_bsf_alloc(). If the call is successful, AVBSFList structure is freed and lst will be set to NULL. In case of failure, caller is responsible for freeing the structure by av_bsf_list_free()
Definition at line 451 of file bsf.c.
Referenced by av_bsf_list_parse_str().
Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters.
Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc().
bsf1[=opt1=val1:opt2=val2][,bsf2] Definition at line 506 of file bsf.c.
Referenced by open_slave().
Get null/pass-through bitstream filter.
Definition at line 544 of file bsf.c.
Referenced by av_bsf_list_parse_str(), and open_slave().
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0.
In addition the whole buffer will initially and after resizes be 0-initialized so that no uninitialized data will ever appear.
Definition at line 70 of file utils.c.
Referenced by allocate_buffers(), allocate_buffers2(), ape_decode_frame(), cdxl_decode_frame(), cllc_decode_frame(), dcadec_decode_frame(), decode(), decode_block(), decode_frame(), decode_i_frame(), decode_idat_chunk(), decode_p_frame(), deinvert_buffer(), encode_frame(), ff_alloc_packet2(), ff_h2645_packet_split(), ff_mjpeg_find_marker(), ff_mpeg4_frame_end(), ff_mpv_reallocate_putbitbuffer(), generate_fake_vps(), mimic_decode_frame(), mp_decode_frame(), mpc7_decode_frame(), parse_nal_units(), parse_object_segment(), raw_decode(), svq1_decode_frame(), svq3_decode_frame(), tiff_unpack_fax(), tiff_unpack_strip(), tqi_decode_frame(), utvideo_encode_frame(), wavpack_encode_block(), wavpack_encode_frame(), wv_stereo(), and xpm_decode_frame().
Same behaviour av_fast_padded_malloc except that buffer will always be 0-initialized after call.
Definition at line 82 of file utils.c.
Referenced by decode_idat_chunk(), encode_frame(), and init_buffers().
Encode extradata length to a buffer.
Used by xiph codecs.
Definition at line 1726 of file utils.c.
Referenced by fixup_vorbis_headers(), libvorbis_encode_init(), parse_packed_headers(), and put_main_header().
Register the hardware accelerator hwaccel.
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL, returns the next registered hardware accelerator after hwaccel, or NULL if hwaccel is the last one.
Register a user provided lock manager supporting the operations specified by AVLockOp.
The "mutex" argument to the function points to a (void *) where the lockmgr should store/get a pointer to a user allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the value left by the last call for all other ops. If the lock manager is unable to perform the op then it should leave the mutex in the same state as when it was called and return a non-zero value. However, when called with AV_LOCK_DESTROY the mutex will always be assumed to have been successfully destroyed. If av_lockmgr_register succeeds it will return a non-negative value, if it fails it will return a negative value and destroy all mutex and unregister all callbacks. av_lockmgr_register is not thread-safe, it must be called from a single thread before any calls which make use of locking are used.
Get the type of the given codec.
Definition at line 3160 of file codec_desc.c.
Referenced by m4sl_cb(), and mkv_query_codec().
Get the name of a codec.
Definition at line 1127 of file utils.c.
Referenced by add_stream(), avcodec_string(), avformat_find_stream_info(), choose_encoder(), configure_filtergraph(), device_try_init(), ff_framehash_write_header(), flv_write_header(), get_audio_flags(), init_input_stream(), log_slave(), lrc_write_header(), mkv_init(), mkv_write_codecprivate(), mov_init(), mpeg_mux_init(), mxf_parse_structural_metadata(), read_frame_internal(), rtp_write_header(), scc_write_header(), and srt_write_header().
Definition at line 1861 of file utils.c.
Referenced by avcodec_close(), avcodec_copy_context(), avcodec_open2(), avcodec_receive_frame(), avcodec_receive_packet(), avcodec_send_frame(), avcodec_send_packet(), mpegts_set_stream_info(), read_frame_internal(), try_decode_frame(), and try_decode_video_frame().
Definition at line 94 of file utils.c.
Referenced by alloc_frame_buffer(), avcodec_close(), avcodec_find_encoder(), avcodec_find_encoder_by_name(), avcodec_open2(), avcodec_receive_packet(), avcodec_send_frame(), ff_slice_thread_init(), ff_snow_get_buffer(), init_band_stepsize(), main(), next_codec_for_id(), and print_codec().
Definition at line 99 of file utils.c.
Referenced by avcodec_find_decoder(), avcodec_find_decoder_by_name(), avcodec_open2(), avcodec_receive_frame(), avcodec_send_packet(), ff_v4l2_m2m_codec_full_reinit(), find_probe_decoder(), next_codec_for_id(), v4l2_configure_contexts(), and v4l2_get_framesize_compressed().
Definition at line 3135 of file codec_desc.c.
Referenced by asf_write_header1(), av_bsf_init(), avcodec_get_name(), avcodec_get_type(), avcodec_open2(), avcodec_profile_name(), ico_check_attributes(), init_muxer(), is_intra_only(), list_formats(), main(), open_output_file(), show_help_muxer(), show_stream(), transcode_init(), unsupported_codec(), and vaapi_decode_make_config().
Iterate over all codec descriptors known to libavcodec.
Definition at line 3141 of file codec_desc.c.
Referenced by avcodec_descriptor_get_by_name(), get_codecs_sorted(), and main().
Definition at line 3150 of file codec_desc.c.
Referenced by find_codec_or_die(), main(), show_help_codec(), and v4l2_read_header().
Allocate a CPB properties structure and initialize its fields to default values.
Definition at line 1922 of file utils.c.
Referenced by ff_add_cpb_side_data(), and ff_mpv_encode_picture().