From e02de9df4b218bd6e1e927b67fd4075741545688 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 5 Jul 2014 09:09:15 +0000 Subject: lavc: export Dirac parsing API used by the ogg demuxer as public Also, stop using AVCodecContext for storing the stream parameters. --- libavcodec/dirac.h | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'libavcodec/dirac.h') diff --git a/libavcodec/dirac.h b/libavcodec/dirac.h index e5b79b09d2..25cefdb626 100644 --- a/libavcodec/dirac.h +++ b/libavcodec/dirac.h @@ -29,9 +29,8 @@ */ #include "avcodec.h" -#include "get_bits.h" -typedef struct dirac_source_params { +typedef struct AVDiracSeqHeader { unsigned width; unsigned height; uint8_t chroma_format; ///< 0: 444 1: 422 2: 420 @@ -49,9 +48,33 @@ typedef struct dirac_source_params { uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[] uint8_t color_spec_index; ///< index into dirac_color_spec_presets[] -} dirac_source_params; -int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, - dirac_source_params *source); + int profile; + int level; + + AVRational framerate; + AVRational sample_aspect_ratio; + + enum AVPixelFormat pix_fmt; + enum AVColorRange color_range; + enum AVColorPrimaries color_primaries; + enum AVColorTransferCharacteristic color_trc; + enum AVColorSpace colorspace; +} AVDiracSeqHeader; + +/** + * Parse a Dirac sequence header. + * + * @param dsh this function will allocate and fill an AVDiracSeqHeader struct + * and write it into this pointer. The caller must free it with + * av_free(). + * @param buf the data buffer + * @param buf_size the size of the data buffer in bytes + * @param log_ctx if non-NULL, this function will log errors here + * @return 0 on success, a negative AVERROR code on failure + */ +int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh, + const uint8_t *buf, size_t buf_size, + void *log_ctx); #endif /* AVCODEC_DIRAC_H */ -- cgit v1.2.3