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

Function lcevc_send_frame

libavcodec/lcevcdec.c:113–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame *in)
114{
115 FFLCEVCContext *lcevc = frame_ctx->lcevc;
116 const AVFrameSideData *sd = av_frame_get_side_data(in, AV_FRAME_DATA_LCEVC);
117 AVFrame *opaque;
118 LCEVC_PictureHandle picture;
119 LCEVC_ReturnCode res;
120 int ret = 0;
121
122 if (!sd)
123 return 1;
124
125 res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, sd->data, sd->size);
126 if (res != LCEVC_Success)
127 return AVERROR_EXTERNAL;
128
129 ret = alloc_base_frame(logctx, lcevc, in, &picture);
130 if (ret < 0)
131 return ret;
132
133 opaque = av_frame_clone(in);
134 if (!opaque) {
135 LCEVC_FreePicture(lcevc->decoder, picture);
136 return AVERROR(ENOMEM);
137 }
138
139 res = LCEVC_SetPictureUserData(lcevc->decoder, picture, opaque);
140 if (res != LCEVC_Success) {
141 LCEVC_FreePicture(lcevc->decoder, picture);
142 av_frame_free(&opaque);
143 return AVERROR_EXTERNAL;
144 }
145
146 res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, opaque);
147 if (res != LCEVC_Success) {
148 LCEVC_FreePicture(lcevc->decoder, picture);
149 av_frame_free(&opaque);
150 return AVERROR_EXTERNAL;
151 }
152
153 memset(&picture, 0, sizeof(picture));
154 ret = alloc_enhanced_frame(logctx, frame_ctx, &picture);
155 if (ret < 0)
156 return ret;
157
158 res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
159 if (res != LCEVC_Success) {
160 LCEVC_FreePicture(lcevc->decoder, picture);
161 return AVERROR_EXTERNAL;
162 }
163
164 return 0;
165}
166
167static int generate_output(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
168{

Callers 1

ff_lcevc_processFunction · 0.85

Calls 5

av_frame_get_side_dataFunction · 0.85
av_frame_cloneFunction · 0.85
av_frame_freeFunction · 0.85
alloc_base_frameFunction · 0.70
alloc_enhanced_frameFunction · 0.70

Tested by

no test coverage detected