Closed aegroto closed 4 months ago
You can try UnsafeDerefMut.
Thanks, that's exactly what I was looking for! I have another doubt, are such data transmitted from the encoder to the decoder? I am facing a weird issue, it seems like any modification I make in the AVFrame I send to the encoding context is then missing in the received AVFrame from the decoding context. Is there any specific rule I have to follow to transmit arbitrary data or am I be doing something wrong maybe?
EDIT: I have realized that libavcodec does not handle the transmission of frame/packet information apart from the packet's data buffer, which does not include information such as pts, dts and the similar. The transmission of such data should be managed by the application and added to the AVPacket to be decoded in an explicit manner in the decoder end. I am closing this issue as the original question has been answered already.
Is there a way to modify arbitrary fields of the AVFrame struct? For instance, I would like to assign a value to the opaque pointer:
But the compiler consider this as a dereference and therefore would require DerefMut to be implemented.
What's the most idiomatic way to modify data not considered in the wrapper struct rsmpeg::avutil::AVFrame but that are part of the underlying C struct?