[FFmpeg-devel,v1,05/12] avutil/frame: add helper for adding side data to set
Checks
Context |
Check |
Description |
andriy/make_x86 |
success
|
Make finished
|
andriy/make_fate_x86 |
success
|
Make fate finished
|
Commit Message
---
libavutil/frame.c | 12 ++++++++++++
libavutil/frame.h | 13 +++++++++++++
2 files changed, 25 insertions(+)
@@ -708,6 +708,18 @@ AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
return ret;
}
+
+AVFrameSideData *av_new_side_data_to_set(AVFrameSideDataSet *set,
+ enum AVFrameSideDataType type,
+ size_t size)
+{
+ AVBufferRef *buf = av_buffer_alloc(size);
+ AVFrameSideData *ret = add_side_data_to_set_from_buf(set, type, buf);
+ if (!ret)
+ av_buffer_unref(&buf);
+ return ret;
+}
+
AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
enum AVFrameSideDataType type)
{
@@ -998,6 +998,19 @@ const char *av_frame_side_data_name(enum AVFrameSideDataType type);
*/
void av_side_data_set_wipe(AVFrameSideDataSet *set);
+/**
+ * Add a new side data entry to a set.
+ *
+ * @param set a set to which the side data should be added
+ * @param type type of the added side data
+ * @param size size of the side data
+ *
+ * @return newly added side data on success, NULL on error
+ */
+AVFrameSideData *av_new_side_data_to_set(AVFrameSideDataSet *set,
+ enum AVFrameSideDataType type,
+ size_t size);
+
/**
* @}
*/