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

Function ff_cbs_sei_alloc_message_payload

libavcodec/cbs_sei.c:240–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message,
241 const SEIMessageTypeDescriptor *desc)
242{
243 void (*free_func)(AVRefStructOpaque, void*);
244
245 av_assert0(message->payload == NULL &&
246 message->payload_ref == NULL);
247 message->payload_type = desc->type;
248
249 if (desc->type == SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35)
250 free_func = &cbs_free_user_data_registered;
251 else if (desc->type == SEI_TYPE_USER_DATA_UNREGISTERED)
252 free_func = &cbs_free_user_data_unregistered;
253 else {
254 free_func = NULL;
255 }
256
257 message->payload_ref = av_refstruct_alloc_ext(desc->size, 0,
258 NULL, free_func);
259 if (!message->payload_ref)
260 return AVERROR(ENOMEM);
261 message->payload = message->payload_ref;
262
263 return 0;
264}
265
266int ff_cbs_sei_list_add(SEIRawMessageList *list)
267{

Callers 1

FUNC(message)Function · 0.85

Calls 1

av_refstruct_alloc_extFunction · 0.85

Tested by

no test coverage detected