Skip to content

Confusing constructor. #8

@ayikahmet

Description

@ayikahmet

Frame class has a constructor :

Frame::Frame(int _width,
int _height,
Fourcc _fourcc,
int _size,
uint8_t* _data)

that can take a pointer to data. Normally such constructor looks like it can be used as a wrapper object (as cheap creating of Frame object for a a buffer) if _data is not nullptr. However this constructor actually makes the deep copy of _data pointer. More logical way if data is not null, then it will not allocate any buffer and just use where _data points as wrapper instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions