Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libdash/qtsampleplayer/Decoder/LibavDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ void LibavDecoder::NotifyVideo (AVFrame * avFrame, St
props.linesize = avFrame->linesize;
props.streamIndex = decoConf->stream->index;

if(decoConf->stream->codec->pix_fmt == PIX_FMT_YUV420P)
if(decoConf->stream->codec->pix_fmt == AV_PIX_FMT_YUV420P)
props.pxlFmt = yuv420p;
if(decoConf->stream->codec->pix_fmt == PIX_FMT_YUV422P)
if(decoConf->stream->codec->pix_fmt == AV_PIX_FMT_YUV422P)
props.pxlFmt = yuv422p;

for(size_t i = 0; i < videoObservers.size(); i++)
Expand Down Expand Up @@ -254,7 +254,7 @@ bool LibavDecoder::Init ()
if (this->errorHappened)
return false;

this->frame = avcodec_alloc_frame();
this->frame = av_frame_alloc();

av_init_packet(&this->avpkt);
this->InitStreams(avFormatContextPtr);
Expand Down
8 changes: 4 additions & 4 deletions libdash/qtsampleplayer/libdashframework/Input/DASHManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ void DASHManager::OnVideoFrameDecoded (const uint8_t **data, videoFram
int w = props->width;
int h = props->height;

AVFrame *rgbframe = avcodec_alloc_frame();
int numBytes = avpicture_get_size(PIX_FMT_RGB24, w, h);
AVFrame *rgbframe = av_frame_alloc();
int numBytes = avpicture_get_size(AV_PIX_FMT_RGB24, w, h);
uint8_t *buffer = (uint8_t*)av_malloc(numBytes);

avpicture_fill((AVPicture*)rgbframe, buffer, PIX_FMT_RGB24, w, h);
avpicture_fill((AVPicture*)rgbframe, buffer, AV_PIX_FMT_RGB24, w, h);

SwsContext *imgConvertCtx = sws_getContext(props->width, props->height, (PixelFormat)props->pxlFmt, w, h, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);
SwsContext *imgConvertCtx = sws_getContext(props->width, props->height, (AVPixelFormat)props->pxlFmt, w, h, AV_PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);

sws_scale(imgConvertCtx, data, props->linesize, 0, h, rgbframe->data, rgbframe->linesize);

Expand Down