summaryrefslogtreecommitdiff
path: root/libavcodec/dirac.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-07-05 09:09:15 +0000
committerAnton Khirnov <anton@khirnov.net>2015-12-06 10:28:04 +0100
commite02de9df4b218bd6e1e927b67fd4075741545688 (patch)
treea618485fed655d22df0ef80f5f28d0f50e5841ff /libavcodec/dirac.h
parent8bcadaacc2b8dc3c5d6569835a5ca20e62d3efca (diff)
lavc: export Dirac parsing API used by the ogg demuxer as public
Also, stop using AVCodecContext for storing the stream parameters.
Diffstat (limited to 'libavcodec/dirac.h')
-rw-r--r--libavcodec/dirac.h33
1 files changed, 28 insertions, 5 deletions
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 */