diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-07-30 15:24:30 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-07-31 13:21:10 +0200 |
commit | 23fc4dd6e7e150ea163a867dfaee2062ade90b74 (patch) | |
tree | c7dde701e6c36d2f22454d69e2756ce35acccf12 /libavcodec/avcodec.h | |
parent | b4c3359828d232d8e81c1bff2dcbbca773dee2d7 (diff) | |
download | ffmpeg-23fc4dd6e7e150ea163a867dfaee2062ade90b74.tar.gz |
lavc: add channels field to AVFrame
This is required otherwise it is not always possible to guess the number
of channels from the layout, for example if the channel layout is
unknown.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index edbc59bcca..fb16c8380d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1337,6 +1337,15 @@ typedef struct AVFrame { int decode_error_flags; #define FF_DECODE_ERROR_INVALID_BITSTREAM 1 #define FF_DECODE_ERROR_MISSING_REFERENCE 2 + + /** + * number of audio channels, only used for audio. + * Code outside libavcodec should access this field using: + * av_frame_get_channels(frame) + * - encoding: unused + * - decoding: Read by user. + */ + int64_t channels; } AVFrame; /** @@ -1352,6 +1361,8 @@ int64_t av_frame_get_pkt_pos (const AVFrame *frame); void av_frame_set_pkt_pos (AVFrame *frame, int64_t val); int64_t av_frame_get_channel_layout (const AVFrame *frame); void av_frame_set_channel_layout (AVFrame *frame, int64_t val); +int av_frame_get_channels (const AVFrame *frame); +void av_frame_set_channels (AVFrame *frame, int val); int av_frame_get_sample_rate (const AVFrame *frame); void av_frame_set_sample_rate (AVFrame *frame, int val); AVDictionary *av_frame_get_metadata (const AVFrame *frame); |