MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / dec_standalone_open

Function dec_standalone_open

fftools/ffmpeg_dec.c:839–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837 const DecoderOpts *o, AVFrame *param_out);
838
839static int dec_standalone_open(DecoderPriv *dp, const AVPacket *pkt)
840{
841 DecoderOpts o;
842 const FrameData *fd;
843 char name[16];
844
845 if (!pkt->opaque_ref)
846 return AVERROR_BUG;
847 fd = (FrameData *)pkt->opaque_ref->data;
848
849 if (!fd->par_enc)
850 return AVERROR_BUG;
851
852 memset(&o, 0, sizeof(o));
853
854 o.par = fd->par_enc;
855 o.time_base = pkt->time_base;
856
857 o.codec = dp->standalone_init.codec;
858 if (!o.codec)
859 o.codec = avcodec_find_decoder(o.par->codec_id);
860 if (!o.codec) {
861 const AVCodecDescriptor *desc = avcodec_descriptor_get(o.par->codec_id);
862
863 av_log(dp, AV_LOG_ERROR, "Cannot find a decoder for codec ID '%s'\n",
864 desc ? desc->name : "?");
865 return AVERROR_DECODER_NOT_FOUND;
866 }
867
868 snprintf(name, sizeof(name), "dec%d", dp->index);
869 o.name = name;
870
871 return dec_open(dp, &dp->standalone_init.opts, &o, NULL);
872}
873
874static void dec_thread_set_name(const DecoderPriv *dp)
875{

Callers 1

decoder_threadFunction · 0.85

Calls 4

avcodec_find_decoderFunction · 0.85
avcodec_descriptor_getFunction · 0.85
av_logFunction · 0.85
dec_openFunction · 0.85

Tested by

no test coverage detected