6 #include <libavcodec/avcodec.h>
7 #include <libswscale/swscale.h>
8 #include <libavutil/imgutils.h>
9 #include <libavutil/pixdesc.h>
10 #if LIBAVCODEC_VERSION_MAJOR > 54
11 #include <libavutil/frame.h>
24 : _imageConvertContext(NULL)
45 dst.
getHeight(), dstPixelFormat, SWS_POINT, NULL, NULL, NULL);
49 throw std::runtime_error(
"unable to create color convert context");
52 const char* srcPixFmt;
53 srcPixFmt = av_get_pix_fmt_name(srcPixelFormat);
54 const char* dstPixFmt;
55 dstPixFmt = av_get_pix_fmt_name(dstPixelFormat);
57 std::stringstream msg;
58 msg <<
"Video conversion from " << (srcPixFmt != NULL ? srcPixFmt :
"None") <<
" to "
59 << (dstPixFmt != NULL ? dstPixFmt :
"None") << std::endl;
60 msg <<
"Source, width = " << src.
getWidth() << std::endl;
61 msg <<
"Source, height = " << src.
getHeight() << std::endl;
62 msg <<
"Destination, width = " << dst.
getWidth() << std::endl;
63 msg <<
"Destination, height = " << dst.
getHeight() << std::endl;
83 throw std::runtime_error(
"unknown color convert context");
91 throw std::runtime_error(
"error in color converter");
This class describes decoded video data.
AVPixelFormat getPixelFormat() const
unsigned char ** getData()
Get all the data of the frame.
This class describes decoded (raw) audio or video data.
int * getLineSize() const
Returns the size in byte. For video, size in bytes of each picture line. For audio, size in bytes of each plane.