MCPcopy Create free account
hub / github.com/codestation/qcma / getThumbnail

Method getThumbnail

common/avdecoder.cpp:209–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209QByteArray AVDecoder::getThumbnail(int &width, int &height)
210{
211 QByteArray data;
212
213 if(!loadCodec(CODEC_VIDEO)) {
214 return data;
215 }
216
217 AVFrame *pFrame = getDecodedFrame(pCodecCtx, stream_index);
218
219 if(pFrame != NULL) {
220
221 calculate_thumbnail_dimensions(pCodecCtx->width, pCodecCtx->height,
222 pCodecCtx->sample_aspect_ratio.num,
223 pCodecCtx->sample_aspect_ratio.den,
224 width, height);
225
226 data = WriteJPEG(pCodecCtx, pFrame, width, height);
227 av_frame_free(&pFrame);
228 }
229
230 return data;
231}
232
233QByteArray AVDecoder::WriteJPEG(AVCodecContext *pCodecCtx, AVFrame *pFrame, int width, int height)
234{

Callers 2

foreachFunction · 0.80
ifFunction · 0.80

Calls 1

Tested by

no test coverage detected