Miscellaneous utility functions related to both encoding and decoding (or neither). More...
Miscellaneous utility functions related to both encoding and decoding (or neither).
Put a string representing the codec tag codec_tag in buf.
Definition at line 2668 of file utils.c.
Referenced by apng_read_packet(), avcodec_string(), avi_read_header(), control_port_cb(), ffmmal_init_decoder(), ffmmal_read_frame(), get_aiff_header(), init_muxer(), main(), matroska_parse_tracks(), mjpeg_decode_app(), mov_write_hdlr_tag(), parse_pixel_format(), print_pix_fmt_fourccs(), rsd_read_header(), show_stream(), and videotoolbox_retrieve_data().
Definition at line 2688 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 2864 of file utils.c.
Referenced by show_stream().
Return a name for the specified profile, if available.
Definition at line 2877 of file utils.c.
Referenced by avcodec_string().
Definition at line 951 of file utils.c.
Referenced by avcodec_get_context_defaults3(), and thread_execute().
Referenced by avcodec_get_context_defaults3().
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.
Definition at line 467 of file utils.c.
Referenced by audio_encode_example().
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 2915 of file utils.c.
Referenced by compute_crc_of_packets(), decoder_decode_frame(), rewind_file(), and seek_to_start().
Return codec bits per sample.
Definition at line 3006 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_parse_stsd_audio(), mov_write_audio_tag(), mov_write_header(), 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 2985 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 2929 of file utils.c.
Referenced by av_get_audio_frame_duration(), av_get_bits_per_sample(), and new_output_stream().
Return audio frame duration.
Definition at line 3024 of file utils.c.
Referenced by adp_read_header(), build_frame_code(), do_streamcopy(), ff_parse_specific_params(), ff_put_wav_header(), ff_voc_get_packet(), get_aiff_header(), msf_read_header(), rm_write_header(), rsd_read_header(), and rtp_send_ilbc().
Register a bitstream filter.
The filter will be accessible to the application code through av_bitstream_filter_next() or can be directly initialized with av_bitstream_filter_init().
Definition at line 37 of file bitstream_filter.c.
Create and initialize a bitstream filter context given a bitstream filter name.
The returned context must be freed with av_bitstream_filter_close().
Definition at line 44 of file bitstream_filter.c.
Referenced by detect_stream_specific(), ff_stream_add_bitstream_filter(), init(), new_output_stream(), parse_bsfs(), and qsv_decode_init().
Filter bitstream.
This function filters the buffer buf with size buf_size, and places the filtered buffer in the buffer pointed to by poutbuf.
The output buffer must be freed by the caller.
If the return value is positive, an output buffer is allocated and is available in *poutbuf, and is distinct from the input buffer.
If the return value is 0, the output buffer is not allocated and should be considered identical to the input buffer, or in case *poutbuf was set it points to the input buffer (not necessarily to its starting address).
Definition at line 81 of file bitstream_filter.c.
Referenced by av_apply_bitstream_filters(), decode(), filter_packet(), init(), and qsv_decode_frame().
Release bitstream filter context.
Definition at line 69 of file bitstream_filter.c.
Referenced by close_slaves(), ff_stream_add_bitstream_filter(), ffmpeg_cleanup(), qsv_decode_close(), and uninit().
If f is NULL, return the first registered bitstream filter, if f is non-NULL, return the next registered bitstream filter after f, or NULL if f is the last one.
This function can be used to iterate over all registered bitstream filters.
Definition at line 29 of file bitstream_filter.c.
Referenced by av_bitstream_filter_init(), and show_bsfs().
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 119 of file utils.c.
Referenced by allocate_buffers(), allocate_buffers2(), ape_decode_frame(), cdxl_decode_frame(), cllc_decode_frame(), decode_block(), decode_frame(), decode_i_frame(), decode_idat_chunk(), decode_p_frame(), deinvert_buffer(), ebml_read_binary(), encode_frame(), ff_alloc_packet2(), ff_h264_decode_nal(), ff_mjpeg_find_marker(), ff_mpeg4_frame_end(), ff_mpv_reallocate_putbitbuffer(), init_buffers(), mimic_decode_frame(), mp_decode_frame(), mpc7_decode_frame(), parse_object_segment(), raw_decode(), svq1_decode_frame(), svq3_decode_frame(), tiff_unpack_strip(), tqi_decode_frame(), utvideo_encode_frame(), wavpack_encode_block(), wavpack_encode_frame(), and wv_stereo().
Same behaviour av_fast_padded_malloc except that buffer will always be 0-initialized after call.
Definition at line 131 of file utils.c.
Referenced by decode_idat_chunk(), and encode_frame().
Encode extradata length to a buffer.
Used by xiph codecs.
Definition at line 3215 of file utils.c.
Referenced by fixup_vorbis_headers(), libvorbis_encode_init(), parse_packed_headers(), and put_main_header().
Log a generic warning message about a missing feature.
This function is intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) only, and would normally not be used by applications.
Log a generic warning message asking for a sample.
This function is intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) only, and would normally not be used by applications.
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.
Definition at line 3277 of file utils.c.
Referenced by find_hwaccel().
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 2929 of file codec_desc.c.
Referenced by m4sl_cb(), and mkv_query_codec().
Get the name of a codec.
Definition at line 2648 of file utils.c.
Referenced by add_stream(), avcodec_string(), avformat_find_stream_info(), configure_filtergraph(), device_try_init(), ffserver_save_avoption(), ffserver_set_codec(), flv_write_header(), get_audio_flags(), init_input_stream(), log_slave(), lrc_write_header(), mkv_write_codecprivate(), mkv_write_header(), mov_write_header(), mpeg_mux_init(), mxf_parse_structural_metadata(), read_frame_internal(), rtp_write_header(), srt_write_header(), and transcode_init().
Definition at line 3458 of file utils.c.
Referenced by avcodec_close(), avcodec_copy_context(), avcodec_open2(), ff_mp4_read_dec_config_descr(), mpegts_find_stream_type(), mpegts_set_stream_info(), try_decode_frame(), and try_decode_video_frame().
Definition at line 167 of file utils.c.
Referenced by alloc_frame_buffer(), avcodec_close(), avcodec_find_encoder_by_name(), avcodec_open2(), ff_slice_thread_init(), ff_snow_get_buffer(), find_encdec(), init_band_stepsize(), next_codec_for_id(), and print_codec().
Definition at line 172 of file utils.c.
Referenced by avcodec_find_decoder_by_name(), avcodec_open2(), find_encdec(), and next_codec_for_id().
Definition at line 2900 of file codec_desc.c.
Referenced by asf_write_header1(), avcodec_get_name(), avcodec_get_type(), avcodec_open2(), avcodec_profile_name(), ffm2_read_header(), ffm_read_header(), ico_check_attributes(), init_muxer(), is_intra_only(), list_formats(), open_output_file(), show_help_muxer(), show_stream(), and unsupported_codec().
Iterate over all codec descriptors known to libavcodec.
Definition at line 2910 of file codec_desc.c.
Referenced by avcodec_descriptor_get_by_name(), and get_codecs_sorted().
Definition at line 2919 of file codec_desc.c.
Referenced by find_codec_or_die(), and show_help_codec().
Allocate a CPB properties structure and initialize its fields to default values.
Definition at line 3519 of file utils.c.
Referenced by ff_add_cpb_side_data(), and ff_mpv_encode_picture().